Engauge Digitizer 2
Loading...
Searching...
No Matches
CentipedeSegmentConstantYLine.h
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2020 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 CENTIPEDE_SEGMENT_CONSTANT_Y_LINE_H
8#define CENTIPEDE_SEGMENT_CONSTANT_Y_LINE_H
9
11
13class GraphicsScene;
14class QGraphicsLineItem;
15
18{
19 Q_OBJECT;
20
21public:
26 const QPointF &posClickScreen);
28
29 virtual double distanceToClosestEndpoint (const QPointF &posScreen) const;
30 virtual void updateRadius (double radius);
31
32signals:
33
35 void signalUpdateEndpoints (QPointF start,
36 QPointF end);
37
38private:
40
41 QGraphicsLineItem *m_graphicsItem;
42 GraphicsLineItemRelay *m_graphicsItemRelay;
43
44 // Two points where circle around click point intersects constant coordinate line. Due to symmetry about
45 // the click circle center (for affine transformation), we do not need the center
46 QPointF m_posLow;
47 QPointF m_posHigh;
48};
49
50#endif // CENTIPEDE_SEGMENT_CONSTANT_Y_LINE_H
QPointF posClickScreen() const
Center of circle in screen coordinates.
CentipedeSegmentAbstract(const DocumentModelGuideline &modelGuideline, const Transformation &transformation, const QPointF &posClickScreen)
Constructor with individual coordinates.
const DocumentModelGuideline & modelGuideline() const
Settings.
Transformation transformation() const
Transformation which is static through the entire lifetime of the Centipede class instances.
virtual void updateRadius(double radius)
Update geometry to reflect cursor movement.
virtual double distanceToClosestEndpoint(const QPointF &posScreen) const
Return distance to closest endpoint.
CentipedeSegmentConstantYLine(GraphicsScene &scene, const DocumentModelGuideline &modelGuideline, const Transformation &transformation, const QPointF &posClickScreen)
Constructor with individual coordinates.
void signalUpdateEndpoints(QPointF start, QPointF end)
Send new geometry for later updating.
Model for managing the coordinate values corresponding Guidelines.
Enable postponed geometry changes for QGraphicsLineItem, using a signal to trigger this class to upda...
Add point and line handling to generic QGraphicsScene.
Affine transformation between screen and graph coordinates, based on digitized axis points.