Engauge Digitizer 2
Loading...
Searching...
No Matches
CentipedeSegmentAbstract Class Referenceabstract

Line segment along one of the two coordinate directions (X/T or Y/R). More...

#include <CentipedeSegmentAbstract.h>

Inheritance diagram for CentipedeSegmentAbstract:
Inheritance graph
Collaboration diagram for CentipedeSegmentAbstract:
Collaboration graph

Public Member Functions

 CentipedeSegmentAbstract (const DocumentModelGuideline &modelGuideline, const Transformation &transformation, const QPointF &posClickScreen)
 Constructor with individual coordinates.
virtual ~CentipedeSegmentAbstract ()
virtual double distanceToClosestEndpoint (const QPointF &posScreen) const =0
 Return distance to closest endpoint.
virtual void updateRadius (double radius)=0
 Update geometry to reflect cursor movement.

Protected Member Functions

double closestAngleToCentralAngle (double angleCenter, double angleOld) const
 Loop to find closest angle to angleCenter.
const DocumentModelGuidelinemodelGuideline () const
 Settings.
QPointF posClickScreen () const
 Center of circle in screen coordinates.
Transformation transformation () const
 Transformation which is static through the entire lifetime of the Centipede class instances.

Detailed Description

Line segment along one of the two coordinate directions (X/T or Y/R).

Centipede instances are distinguished by coordinate direction, and implemented with either line or ellipse graphics item

This class inherits from QObject so its subclasses can send signals

Definition at line 28 of file CentipedeSegmentAbstract.h.

Constructor & Destructor Documentation

◆ CentipedeSegmentAbstract()

CentipedeSegmentAbstract::CentipedeSegmentAbstract ( const DocumentModelGuideline & modelGuideline,
const Transformation & transformation,
const QPointF & posClickScreen )

Constructor with individual coordinates.

Definition at line 14 of file CentipedeSegmentAbstract.cpp.

16 :
17 m_modelGuideline (modelGuideline),
18 m_transformation (transformation),
19 m_posClickScreen (posClickScreen)
20{
21}
QPointF posClickScreen() const
Center of circle in screen coordinates.
const DocumentModelGuideline & modelGuideline() const
Settings.
Transformation transformation() const
Transformation which is static through the entire lifetime of the Centipede class instances.

◆ ~CentipedeSegmentAbstract()

CentipedeSegmentAbstract::~CentipedeSegmentAbstract ( )
virtual

Definition at line 23 of file CentipedeSegmentAbstract.cpp.

24{
25}

Member Function Documentation

◆ closestAngleToCentralAngle()

double CentipedeSegmentAbstract::closestAngleToCentralAngle ( double angleCenter,
double angleOld ) const
protected

Loop to find closest angle to angleCenter.

Definition at line 27 of file CentipedeSegmentAbstract.cpp.

29{
30 bool isFirst = true;
31 double angleNew = angleOld;
32 for (int delta = -360; delta <= 360; delta += 360) {
33 double angleNext = angleOld + qDegreesToRadians ((double) delta);
34 if (isFirst || (qAbs (angleNext - angleCenter) < qAbs (angleNew - angleCenter))) {
35 isFirst = false;
36 angleNew = angleNext;
37 }
38 }
39
40 return angleNew;
41}

◆ distanceToClosestEndpoint()

virtual double CentipedeSegmentAbstract::distanceToClosestEndpoint ( const QPointF & posScreen) const
pure virtual

◆ modelGuideline()

const DocumentModelGuideline & CentipedeSegmentAbstract::modelGuideline ( ) const
protected

Settings.

Definition at line 43 of file CentipedeSegmentAbstract.cpp.

44{
45 return m_modelGuideline;
46}

◆ posClickScreen()

QPointF CentipedeSegmentAbstract::posClickScreen ( ) const
protected

Center of circle in screen coordinates.

Definition at line 48 of file CentipedeSegmentAbstract.cpp.

49{
50 return m_posClickScreen;
51}

◆ transformation()

Transformation CentipedeSegmentAbstract::transformation ( ) const
protected

Transformation which is static through the entire lifetime of the Centipede class instances.

Definition at line 53 of file CentipedeSegmentAbstract.cpp.

54{
55 return m_transformation;
56}

◆ updateRadius()

virtual void CentipedeSegmentAbstract::updateRadius ( double radius)
pure virtual

The documentation for this class was generated from the following files: