Engauge Digitizer 2
Loading...
Searching...
No Matches
CentipedeSegmentAbstract.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_ABSTRACT_H
8#define CENTIPEDE_SEGMENT_ABSTRACT_H
9
11#include <QObject>
12#include <QPointF>
13#include "Transformation.h"
14
15class QGraphicsItem;
16
23
28class CentipedeSegmentAbstract : public QObject
29{
30 Q_OBJECT;
31
32public:
36 const QPointF &posClickScreen);
38
40 virtual double distanceToClosestEndpoint (const QPointF &posScreen) const = 0;
41
43 virtual void updateRadius (double radius) = 0;
44
45protected:
46
48 double closestAngleToCentralAngle (double angleCenter,
49 double angleOld) const;
50
53
55 QPointF posClickScreen () const;
56
59
60private:
62
63 DocumentModelGuideline m_modelGuideline;
64 Transformation m_transformation;
65 QPointF m_posClickScreen;
66
67};
68
69#endif // CENTIPEDE_SEGMENT_ABSTRACT_H
IntersectionType
Intersect with one of the following XT or YT coordinates for constant YR or XT respectively.
@ INTERSECTION_HIGH
Intersection of circle center with XT or YR.
@ INTERSECTION_CENTER
Intersection along circle perimeter with lowest value of XT or YR.
QPointF posClickScreen() const
Center of circle in screen coordinates.
double closestAngleToCentralAngle(double angleCenter, double angleOld) const
Loop to find closest angle to angleCenter.
virtual double distanceToClosestEndpoint(const QPointF &posScreen) const =0
Return distance to closest endpoint.
CentipedeSegmentAbstract(const DocumentModelGuideline &modelGuideline, const Transformation &transformation, const QPointF &posClickScreen)
Constructor with individual coordinates.
virtual void updateRadius(double radius)=0
Update geometry to reflect cursor movement.
const DocumentModelGuideline & modelGuideline() const
Settings.
Transformation transformation() const
Transformation which is static through the entire lifetime of the Centipede class instances.
Model for managing the coordinate values corresponding Guidelines.
Affine transformation between screen and graph coordinates, based on digitized axis points.