diff options
author | Mika Salmela <mika.salmela@digia.com> | 2014-08-15 08:55:20 +0300 |
---|---|---|
committer | Mika Salmela <mika.salmela@digia.com> | 2014-08-15 09:17:49 +0300 |
commit | be7bdaa8930caf15fcc58a480d223e0c2b8af6ed (patch) | |
tree | 65cf2369a7fabfebfb9141f29281d25cb6067fb5 /examples/datavisualization/texturesurface/custominputhandler.cpp | |
parent | 744609635867fdb673604b4128e62f7da6406632 (diff) |
Documentation for textured surface example
Change-Id: I517b02a31e342dc3ae2c1c80805f811f9d9670ff
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'examples/datavisualization/texturesurface/custominputhandler.cpp')
-rw-r--r-- | examples/datavisualization/texturesurface/custominputhandler.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/datavisualization/texturesurface/custominputhandler.cpp b/examples/datavisualization/texturesurface/custominputhandler.cpp index 9072a0b4..0f79feef 100644 --- a/examples/datavisualization/texturesurface/custominputhandler.cpp +++ b/examples/datavisualization/texturesurface/custominputhandler.cpp @@ -46,6 +46,7 @@ void CustomInputHandler::mousePressEvent(QMouseEvent *event, const QPoint &mouse Q3DInputHandler::mousePressEvent(event, mousePos); } +//! [1] void CustomInputHandler::wheelEvent(QWheelEvent *event) { float delta = float(event->delta()); @@ -62,6 +63,7 @@ void CustomInputHandler::wheelEvent(QWheelEvent *event) m_axisY->setRange(100.0f, y); m_axisZ->setRange(m_axisZMinValue, m_axisZMaxValue); } +//! [1] void CustomInputHandler::mouseMoveEvent(QMouseEvent *event, const QPoint &mousePos) { @@ -115,6 +117,7 @@ void CustomInputHandler::handleAxisDragging() // Adjust axes switch (m_state) { +//! [0] case StateDraggingX: distance = (move.x() * xMulX - move.y() * xMulY) * m_speedModifier; m_axisXMinValue -= distance; @@ -131,6 +134,7 @@ void CustomInputHandler::handleAxisDragging() } m_axisX->setRange(m_axisXMinValue, m_axisXMaxValue); break; +//! [0] case StateDraggingZ: distance = (move.x() * zMulX + move.y() * zMulY) * m_speedModifier; m_axisZMinValue += distance; @@ -154,6 +158,7 @@ void CustomInputHandler::handleAxisDragging() void CustomInputHandler::checkConstraints() { +//! [2] if (m_axisXMinValue < m_areaMinValue) m_axisXMinValue = m_areaMinValue; if (m_axisXMaxValue > m_areaMaxValue) @@ -164,6 +169,7 @@ void CustomInputHandler::checkConstraints() m_axisXMinValue -= adjust; m_axisXMaxValue += adjust; } +//! [2] if (m_axisZMinValue < m_areaMinValue) m_axisZMinValue = m_areaMinValue; |