Engauge Digitizer 2
|
Show two polar Centipede graphics items that the user interacts with by moving the cursor. More...
#include <CentipedePairPolar.h>
Public Member Functions | |
CentipedePairPolar (GraphicsScene &scene, const Transformation &transformation, const DocumentModelGuideline &modelGuideline, const DocumentModelCoords &modelCoords, const QPointF &posScreen) | |
Constructor with individual coordinates. | |
virtual | ~CentipedePairPolar () |
bool | done (const QPointF &posScreen) |
True if cursor has moved far enough that the CentipedePairPolar has finished and should be removed. | |
void | move (const QPointF &posScreen) |
Follow cursor move. | |
bool | selectedXTFinal () const |
True if XT is final selection, otherwise false if YR is final selection. | |
double | valueFinal () const |
Final XT or YT (depending on selectedXTFinal) value. |
Show two polar Centipede graphics items that the user interacts with by moving the cursor.
This unique approach was chosen over conventional approaches for the following reasons:
Two Centipedes are always shown. Initially they are in the form of two orthogonal line segments (straight for polar and constant-theta polar cases, and curved for constant-radius polar case). Shown below are the notional explanation in the first column (with the Centipede objects keeping constant lengths) and the implemented solution in the second column (with the Centipede objects changing lengths). The implemented solution uses two GraphicsItem subclasses, which is less complicateed than implementing the notional explanation with four graphics items (one for each quadrant).
Notional Explanation Implemented Solution 1 1 1 1 1 1 2 2 2 1 1 1 2 2 2 2 2 2 2 1 2 1 2 1
As the cursor is moved, the Centipedes crawl the same amount correspondingly. As an example, if the cursor is moved from the center to the right (within -45 to +45 degrees so the +x axis is closest to the cursor) then the Guidelines move as
Notional Explanation Implemented Solution 1 1 1 1 2 2 2 2 1 1 1 1 2 2 2 2 2 2 2 2 2 1 2 1
When the Centipede tails disappear the user's direction preference is noted and Centipede dragging ends.
Notional Explanation Implemented Solution 2 2 2 2 2 2 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2
[At least one blank comment line is required after the final indented section so it is recognized as a code snippet like the code snippets before it]
Definition at line 64 of file CentipedePairPolar.h.
CentipedePairPolar::CentipedePairPolar | ( | GraphicsScene & | scene, |
const Transformation & | transformation, | ||
const DocumentModelGuideline & | modelGuideline, | ||
const DocumentModelCoords & | modelCoords, | ||
const QPointF & | posScreen ) |
Constructor with individual coordinates.
Definition at line 19 of file CentipedePairPolar.cpp.
|
virtual |
Definition at line 48 of file CentipedePairPolar.cpp.
bool CentipedePairPolar::done | ( | const QPointF & | posScreen | ) |
True if cursor has moved far enough that the CentipedePairPolar has finished and should be removed.
Definition at line 54 of file CentipedePairPolar.cpp.
void CentipedePairPolar::move | ( | const QPointF & | posScreen | ) |
Follow cursor move.
Definition at line 62 of file CentipedePairPolar.cpp.
bool CentipedePairPolar::selectedXTFinal | ( | ) | const |
True if XT is final selection, otherwise false if YR is final selection.
Definition at line 76 of file CentipedePairPolar.cpp.
double CentipedePairPolar::valueFinal | ( | ) | const |
Final XT or YT (depending on selectedXTFinal) value.
Definition at line 98 of file CentipedePairPolar.cpp.