Engauge Digitizer 2
Loading...
Searching...
No Matches
CallbackBoundingRects.h
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#ifndef CALLBACK_BOUNDING_RECTS_H
8#define CALLBACK_BOUNDING_RECTS_H
9
12#include <QPointF>
13#include <QRectF>
14#include <QString>
15#include "Transformation.h"
16
17class Point;
18
21{
22public:
24 CallbackBoundingRects(DocumentAxesPointsRequired documentAxesPointsRequired,
25 const Transformation &transformation);
26
30 QPointF boundingRectGraphMin (bool &isEmpty) const;
31
35 QPointF boundingRectGraphMax (bool &isEmpty) const;
36
38 QRectF boundingRectScreen (bool &isEmpty) const;
39
41 CallbackSearchReturn callback (const QString &curveName,
42 const Point &point);
43
44private:
46
47 void mergeCoordinateX (const QPointF &pos,
48 QPointF &boundingRectMin,
49 QPointF &boundingRectMax,
50 bool &isEmpty);
51 void mergeCoordinateY (const QPointF &pos,
52 QPointF &boundingRectMin,
53 QPointF &boundingRectMax,
54 bool &isEmpty);
55
56 DocumentAxesPointsRequired m_documentAxesPointsRequired;
57 bool m_isEmptyGraphX; // Have x graph bounds been initialized
58 bool m_isEmptyGraphY; // Have y graph bounds been initialized
59 bool m_isEmptyScreenX; // Have x screen bounds been initialized
60 bool m_isEmptyScreenY; // Have y screen bounds been initialized
61 const Transformation m_transformation;
62 QPointF m_boundingRectGraphMin; // Not a QRectF for reasons explained by boundingRectGraphMin
63 QPointF m_boundingRectGraphMax; // Not a QRectF for reasons explained by boundingRectGraphMax
64 QPointF m_boundingRectScreenMin; // Consistent with m_boundingRectGraphMin
65 QPointF m_boundingRectScreenMax; // Consistent with m_boundingRectGraphMax
66};
67
68#endif // CALLBACK_BOUNDING_RECTS_H
CallbackSearchReturn
Return values for search callback methods.
Callback for computing the bounding rectangles of the screen and graph coordinates of the points in t...
QPointF boundingRectGraphMin(bool &isEmpty) const
Graph coordinate bounding rectangle's (xmin,ymin) corner.
QRectF boundingRectScreen(bool &isEmpty) const
Screen coordinate bounding rectangle.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
QPointF boundingRectGraphMax(bool &isEmpty) const
Graph coordinate bounding rectangle's (xmax,ymax) corner.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition Point.h:26
Affine transformation between screen and graph coordinates, based on digitized axis points.