Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
Checker
Checker.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 CHECKER_H
8
#define CHECKER_H
9
10
#include "
CheckerMode.h
"
11
#include "
DocumentAxesPointsRequired.h
"
12
#include "
GridLine.h
"
13
#include "
GridLines.h
"
14
#include <QColor>
15
#include <QList>
16
#include <QPainterPath>
17
#include <QPolygonF>
18
19
class
DocumentModelAxesChecker
;
20
class
DocumentModelCoords
;
21
class
Point
;
22
class
QGraphicsEllipseItem;
23
class
QGraphicsItem;
24
class
QGraphicsScene;
25
class
QPolygonF;
26
class
Transformation
;
27
33
class
Checker
34
{
35
public
:
37
Checker
(QGraphicsScene &scene);
38
virtual
~Checker
();
39
43
void
prepareForDisplay
(
const
QPolygonF &polygon,
44
int
pointRadius,
45
const
DocumentModelAxesChecker
&modelAxesChecker,
46
const
DocumentModelCoords
&modelCoords,
47
DocumentAxesPointsRequired
documentAxesPointsRequired);
48
51
void
prepareForDisplay
(
const
QList<Point> &
Points
,
52
int
pointRadius,
53
const
DocumentModelAxesChecker
&modelAxesChecker,
54
const
DocumentModelCoords
&modelCoords,
55
const
Transformation
&transformation,
56
DocumentAxesPointsRequired
documentAxesPointsRequired);
57
59
void
setVisible
(
bool
visible);
60
63
virtual
void
updateModelAxesChecker
(
const
DocumentModelAxesChecker
&modelAxesChecker);
64
65
private
:
66
Checker
();
67
68
// For polar coordinates, pick the smallest angle range. Note that xMax may be less than xMin, in which case
69
// xMax+period should be used. Ymin is also set to zero for polar coordinates
70
void
adjustPolarAngleRanges (
const
DocumentModelCoords
&modelCoords,
71
const
Transformation
&transformation,
72
const
QList<Point> &points,
73
double
&xMin,
74
double
&xMax,
75
double
&yMin)
const
;
76
77
// Low level routine to set line color
78
void
setLineColor (
GridLine
&gridLine,
79
const
QPen &pen);
80
81
QGraphicsScene &m_scene;
82
83
// These grid lines are QGraphicsLineItem line segments or QGraphicsEllipseItem arc segments. Together they
84
// make up a box (cartesian) or annular (polar) shape in cartesian coordinates.
85
//
86
// A major complication is that drawing the box with just four lines from corner to corner results in extremely
87
// thick lines through the axes points, which obscures the axis point unacceptably. So, each side is drawn with
88
// up to 3 visible lines:
89
// 1) corner1 to either point1 or corner2 (whichever comes first)
90
// 2) unused, or point1 to either point2 or corner2 (whichever comes first)
91
// 3) unused point2 to corner2
92
GridLines
m_gridLines;
93
};
94
95
#endif
// CHECKER_H
CheckerMode.h
DocumentAxesPointsRequired.h
DocumentAxesPointsRequired
DocumentAxesPointsRequired
Definition
DocumentAxesPointsRequired.h:10
GridLine.h
GridLines.h
Points
QList< Point > Points
Definition
Points.h:13
Checker::~Checker
virtual ~Checker()
Definition
Checker.cpp:39
Checker::prepareForDisplay
void prepareForDisplay(const QPolygonF &polygon, int pointRadius, const DocumentModelAxesChecker &modelAxesChecker, const DocumentModelCoords &modelCoords, DocumentAxesPointsRequired documentAxesPointsRequired)
Create the polygon from current information, including pixel coordinates, just prior to display.
Definition
Checker.cpp:135
Checker::Checker
Checker(QGraphicsScene &scene)
Single constructor for DlgSettingsAxesChecker, which does not have an explicit transformation....
Definition
Checker.cpp:34
Checker::setVisible
void setVisible(bool visible)
Show/hide this axes checker.
Definition
Checker.cpp:247
Checker::updateModelAxesChecker
virtual void updateModelAxesChecker(const DocumentModelAxesChecker &modelAxesChecker)
Apply the new DocumentModelAxesChecker, to the points already associated with this object.
Definition
Checker.cpp:252
DocumentModelAxesChecker
Model for DlgSettingsAxesChecker and CmdSettingsAxesChecker.
Definition
DocumentModelAxesChecker.h:19
DocumentModelCoords
Model for DlgSettingsCoords and CmdSettingsCoords.
Definition
DocumentModelCoords.h:21
GridLine
Single grid line drawn a straight or curved line.
Definition
GridLine.h:21
GridLines
Container class for GridLine objects.
Definition
GridLines.h:19
Point
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition
Point.h:26
Transformation
Affine transformation between screen and graph coordinates, based on digitized axis points.
Definition
Transformation.h:32
Generated on
for Engauge Digitizer by
1.17.0