Engauge Digitizer 2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
GuidelineProjectorConstantX Class Reference

Project a point along the vertical direction in graph coordinates to produce a line segment along the constant-x direction, passing through a specified point. More...

#include <GuidelineProjectorConstantX.h>

Inheritance diagram for GuidelineProjectorConstantX:
Inheritance graph
Collaboration diagram for GuidelineProjectorConstantX:
Collaboration graph

Public Member Functions

 GuidelineProjectorConstantX ()
 Single constructor.
 
 ~GuidelineProjectorConstantX ()
 
QLineF fromCoordinateX (const Transformation &transformation, const QRectF &sceneRect, double xGraph)
 Return line through x in graph coordinates.
 
QLineF fromPosScreen (const Transformation &transformation, const QRectF &sceneRect, const QPointF &posScreen)
 Return line through point in screen coordinates.
 
- Public Member Functions inherited from GuidelineProjectorAbstract
 GuidelineProjectorAbstract ()
 Single constructor.
 
 ~GuidelineProjectorAbstract ()
 

Additional Inherited Members

- Protected Member Functions inherited from GuidelineProjectorAbstract
void calculateCorners (const Transformation &transformation, const QRectF &sceneRect, QPointF &posGraphBL, QPointF &posGraphTL, QPointF &posGraphTR, QPointF &posGraphBR) const
 Conpute four corners of scene in graph coordinates.
 
bool isOutside (const QRectF &sceneRect, const QPointF &posScreen) const
 Return true if point is outside of the scene.
 

Detailed Description

Project a point along the vertical direction in graph coordinates to produce a line segment along the constant-x direction, passing through a specified point.

Definition at line 20 of file GuidelineProjectorConstantX.h.

Constructor & Destructor Documentation

◆ GuidelineProjectorConstantX()

GuidelineProjectorConstantX::GuidelineProjectorConstantX ( )

Single constructor.

Definition at line 13 of file GuidelineProjectorConstantX.cpp.

14{
15}

◆ ~GuidelineProjectorConstantX()

GuidelineProjectorConstantX::~GuidelineProjectorConstantX ( )

Definition at line 17 of file GuidelineProjectorConstantX.cpp.

18{
19}

Member Function Documentation

◆ fromCoordinateX()

QLineF GuidelineProjectorConstantX::fromCoordinateX ( const Transformation & transformation,
const QRectF & sceneRect,
double xGraph )

Return line through x in graph coordinates.

Definition at line 54 of file GuidelineProjectorConstantX.cpp.

57{
58 QLineF line (0, 0, 0, 0);
60 calculateCorners (transformation,
61 sceneRect,
66
67 // Intersections found on all the sides
69
70 addSide (transformation, xGraph, posGraphBL, posGraphTL, intersections);
71 addSide (transformation, xGraph, posGraphTL, posGraphTR, intersections);
72 addSide (transformation, xGraph, posGraphTR, posGraphBR, intersections);
73 addSide (transformation, xGraph, posGraphBR, posGraphBL, intersections);
74
75 if (intersections.size() == 2) {
76 line = QLineF (intersections.at (0),
77 intersections.at (1));
78 }
79
80 return line;
81}
const int INNER_RADIUS_MIN
void calculateCorners(const Transformation &transformation, const QRectF &sceneRect, QPointF &posGraphBL, QPointF &posGraphTL, QPointF &posGraphTR, QPointF &posGraphBR) const
Conpute four corners of scene in graph coordinates.

◆ fromPosScreen()

QLineF GuidelineProjectorConstantX::fromPosScreen ( const Transformation & transformation,
const QRectF & sceneRect,
const QPointF & posScreen )

Return line through point in screen coordinates.

Definition at line 83 of file GuidelineProjectorConstantX.cpp.

86{
87 QPointF posGraph;
88 transformation.transformScreenToRawGraph (posScreen, posGraph);
89
90 return fromCoordinateX (transformation,
91 sceneRect,
92 posGraph.x());
93}
QLineF fromCoordinateX(const Transformation &transformation, const QRectF &sceneRect, double xGraph)
Return line through x in graph coordinates.
void transformScreenToRawGraph(const QPointF &coordScreen, QPointF &coordGraph) const
Transform from cartesian pixel screen coordinates to cartesian/polar graph coordinates.

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