7 #include "CallbackBoundingRects.h" 8 #include "EngaugeAssert.h" 12 #include "QtToString.h" 13 #include "Transformation.h" 17 m_transformation (transformation)
25 return m_boundingRectGraph;
32 return m_boundingRectScreen;
39 if (curveName == AXIS_CURVE_NAME) {
45 mergeCoordinates (posGraph,
48 m_boundingRectScreen);
52 return CALLBACK_SEARCH_RETURN_CONTINUE;
55 void CallbackBoundingRects::mergeCoordinates (
const QPointF &pos,
58 bool newGraphLeft = m_isEmpty;
59 bool newGraphTop = m_isEmpty;
60 bool newGraphRight = m_isEmpty;
61 bool newGraphBottom = m_isEmpty;
64 newGraphLeft = (pos.x() < boundingRect.left());
67 newGraphTop = (pos.y() < boundingRect.top());
70 newGraphRight = (boundingRect.right() < pos.x());
72 if (!newGraphBottom) {
73 newGraphBottom = (boundingRect.bottom() < pos.y());
77 boundingRect.setLeft (pos.x());
80 boundingRect.setTop (pos.y());
83 boundingRect.setRight (pos.x());
86 boundingRect.setBottom (pos.y());
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
QRectF boundingRectScreen(bool &isEmpty) const
Screen coordinate bounding rectangle.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
QPointF posScreen() const
Accessor for screen position.
QPointF posGraph(ApplyHasCheck applyHasCheck=KEEP_HAS_CHECK) const
Accessor for graph position. Skip check if copying one instance to another.
QRectF boundingRectGraph(bool &isEmpty) const
Graph coordinate bounding rectangle.
CallbackBoundingRects(const Transformation &transformation)
Single constructor.