Engauge Digitizer 2
Loading...
Searching...
No Matches
GuidelineProjectorConstantY Class Reference

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

#include <GuidelineProjectorConstantY.h>

Inheritance diagram for GuidelineProjectorConstantY:
Inheritance graph
Collaboration diagram for GuidelineProjectorConstantY:
Collaboration graph

Public Member Functions

 GuidelineProjectorConstantY ()
 Single constructor.
 ~GuidelineProjectorConstantY ()
QLineF fromCoordinateY (const Transformation &transformation, const QRectF &sceneRect, double yGraph)
 Return line through y 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 horizontal direction in graph coordinates to produce a line segment along the constant-y direction, passing through a specified point.

Definition at line 20 of file GuidelineProjectorConstantY.h.

Constructor & Destructor Documentation

◆ GuidelineProjectorConstantY()

GuidelineProjectorConstantY::GuidelineProjectorConstantY ( )

Single constructor.

Definition at line 13 of file GuidelineProjectorConstantY.cpp.

14{
15}

◆ ~GuidelineProjectorConstantY()

GuidelineProjectorConstantY::~GuidelineProjectorConstantY ( )

Definition at line 17 of file GuidelineProjectorConstantY.cpp.

18{
19}

Member Function Documentation

◆ fromCoordinateY()

QLineF GuidelineProjectorConstantY::fromCoordinateY ( const Transformation & transformation,
const QRectF & sceneRect,
double yGraph )

Return line through y in graph coordinates.

Definition at line 54 of file GuidelineProjectorConstantY.cpp.

57{
58 QLineF line (0, 0, 0, 0);
59 QPointF posGraphBL, posGraphTL, posGraphTR, posGraphBR;
60 calculateCorners (transformation,
61 sceneRect,
62 posGraphBL,
63 posGraphTL,
64 posGraphTR,
65 posGraphBR);
66
67 // Intersections found on all the sides
68 QList<QPointF> intersections;
69
70 addSide (transformation, yGraph, posGraphBL, posGraphTL, intersections);
71 addSide (transformation, yGraph, posGraphTL, posGraphTR, intersections);
72 addSide (transformation, yGraph, posGraphTR, posGraphBR, intersections);
73 addSide (transformation, yGraph, 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}
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 GuidelineProjectorConstantY::fromPosScreen ( const Transformation & transformation,
const QRectF & sceneRect,
const QPointF & posScreen )

Return line through point in screen coordinates.

Definition at line 83 of file GuidelineProjectorConstantY.cpp.

86{
87 QPointF posGraph;
88 transformation.transformScreenToRawGraph (posScreen, posGraph);
89
90 return fromCoordinateY (transformation,
91 sceneRect,
92 posGraph.y());
93}
QLineF fromCoordinateY(const Transformation &transformation, const QRectF &sceneRect, double yGraph)
Return line through y 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: