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

Project a point along the tangential direction in graph coordinates to produce a curve along the constant-range direction, passing through a specified point. More...

#include <GuidelineProjectorConstantR.h>

Inheritance diagram for GuidelineProjectorConstantR:
Inheritance graph
Collaboration diagram for GuidelineProjectorConstantR:
Collaboration graph

Public Member Functions

 GuidelineProjectorConstantR ()
 Single constructor.
 ~GuidelineProjectorConstantR ()
EllipseParameters fromCoordinateR (const Transformation &transformation, const QRectF &sceneRect, double rGraph)
 Return line through y in graph coordinates.
EllipseParameters 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 tangential direction in graph coordinates to produce a curve along the constant-range direction, passing through a specified point.

Definition at line 21 of file GuidelineProjectorConstantR.h.

Constructor & Destructor Documentation

◆ GuidelineProjectorConstantR()

GuidelineProjectorConstantR::GuidelineProjectorConstantR ( )

Single constructor.

Definition at line 17 of file GuidelineProjectorConstantR.cpp.

18{
19}

◆ ~GuidelineProjectorConstantR()

GuidelineProjectorConstantR::~GuidelineProjectorConstantR ( )

Definition at line 21 of file GuidelineProjectorConstantR.cpp.

22{
23}

Member Function Documentation

◆ fromCoordinateR()

EllipseParameters GuidelineProjectorConstantR::fromCoordinateR ( const Transformation & transformation,
const QRectF & sceneRect,
double rGraph )

Return line through y in graph coordinates.

Definition at line 25 of file GuidelineProjectorConstantR.cpp.

28{
29 // Points at 45, 135, 225 and 315 degrees at range rGraph
30 QPointF posScreenCenter, posScreenTL, posScreenTR, posScreenBR; // No need for BL point
31 transformation.transformLinearCartesianGraphToScreen (QPointF (0, 0),
32 posScreenCenter);
33 transformation.transformLinearCartesianGraphToScreen (QPointF (-rGraph, rGraph),
34 posScreenTL);
35 transformation.transformLinearCartesianGraphToScreen (QPointF (rGraph, rGraph),
36 posScreenTR);
37 transformation.transformLinearCartesianGraphToScreen (QPointF (rGraph, -rGraph),
38 posScreenBR);
39
40 double angleRadians = 0, aAligned = 0, bAligned = 0;
41 ellipseFromParallelogram (posScreenTL.x() - posScreenCenter.x(),
42 posScreenTL.y() - posScreenCenter.y(),
43 posScreenTR.x() - posScreenCenter.x(),
44 posScreenTR.y() - posScreenCenter.y(),
45 posScreenBR.x() - posScreenCenter.x(),
46 posScreenBR.y() - posScreenCenter.y(),
47 angleRadians,
48 aAligned,
49 bAligned);
50
51 return EllipseParameters (posScreenCenter,
52 angleRadians,
53 aAligned,
54 bAligned);
55}
void transformLinearCartesianGraphToScreen(const QPointF &coordGraph, QPointF &coordScreen) const
Transform from linear cartesian graph coordinates to cartesian pixel screen coordinates.
void ellipseFromParallelogram(double xTL, double yTL, double xTR, double yTR, double xBR, double yBR, double &angleRadians, double &aAligned, double &bAligned)
Calculate ellipse parameters that is incribed in a parallelogram centered at the origin,...
Definition mmsubs.cpp:52

◆ fromPosScreen()

EllipseParameters GuidelineProjectorConstantR::fromPosScreen ( const Transformation & transformation,
const QRectF & sceneRect,
const QPointF & posScreen )

Return line through point in screen coordinates.

Definition at line 57 of file GuidelineProjectorConstantR.cpp.

60{
61 QPointF posGraph;
62 transformation.transformScreenToRawGraph (posScreen, posGraph);
63
64 double rGraph = posGraph.y();
65
66 if (transformation.modelCoords().coordScaleYRadius() == COORD_SCALE_LOG) {
67 if (rGraph <= 0) {
68
69 // Range enforcement on the range values with log scale should have prevented this branch
70 LOG4CPP_ERROR_S ((*mainCat)) << "GuidelineProjectorConstantR::fromPosScreen out of bounds range " << rGraph;
71
72 } else {
73
74 // Adjust radius from log to linear so, after conversion to cartesian, we have linear x and y
75 rGraph = qLn (rGraph);
76
77 }
78 }
79
80 return fromCoordinateR (transformation,
81 sceneRect,
82 rGraph);
83}
@ COORD_SCALE_LOG
Definition CoordScale.h:14
log4cpp::Category * mainCat
Definition Logger.cpp:14
CoordScale coordScaleYRadius() const
Get method for linear/log scale on y/radius.
EllipseParameters fromCoordinateR(const Transformation &transformation, const QRectF &sceneRect, double rGraph)
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.
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
#define LOG4CPP_ERROR_S(logger)
Definition convenience.h:12

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