![]() |
VR-Forces 4.0.4 Class Documentation
|
class DtLineSymbol: More...

Public Types | |
| enum | DtLineSelectionMode { DtLineSelected_None = -2, DtLineSelected_Line = -1, DtLineSelected_Point } |
| enum | DtArrowStyle { DtStyle_NoArrow = 0, DtStyle_Simple, DtStyle_Main, DtStyle_Double, DtStyle_Capped, DtStyle_Triangle, DtStyle_2525DispTail, DtStyle_Thick, DtStyle_ThickDouble, DtStyle_Feint, DtStyle_Bridge, DtStyle_AirAxis, DtStyle_SegmentMode, DtStyle_NoArrowDrawLine, DtStyle_ArrowStyle_MAX } |
Public Member Functions | |
| DtLineSymbol (DtSymbolDrawer &drawer) | |
| Constructors / assignment operator / destructor. | |
| DtLineSymbol (DtSymbolDrawer &drawer, const QPoint &startPoint, const QPoint &endPoint) | |
| DtLineSymbol (DtNullDrawer &drawer) | |
| DtLineSymbol (const DtLineSymbol &orig) | |
| DtLineSymbol & | operator= (const DtLineSymbol &orig) |
| virtual | ~DtLineSymbol () |
| virtual DtSymbol * | clone () const |
| Returns an instance of a symbol which is a copy of this. | |
| virtual unsigned | width () const |
| Width of arrow that can be on the end of the line. | |
| virtual void | setWidth (unsigned w) |
| virtual void | setLineWidth (int i) |
| Width of line. Set to -1 to use drawer default. | |
| virtual const DtDisplayPoint | centerPoint () const |
| The real visual center of the symbol in display coordinates. | |
| virtual void | shift (QPoint p) |
| Move the center of this object by p amount. | |
| virtual void | setStartPosition (const QPoint &position) |
| Set/get the location of the start of the symbol. | |
| virtual QPoint | startPosition () const |
| virtual void | setEndPosition (const QPoint &position) |
| Set/get the location of the end of the symbol. | |
| virtual QPoint | endPosition () const |
| virtual void | setNumPoints (const int num) |
| virtual int | getNumPoints () const |
| virtual void | addPoint (const QPoint *pnt) |
| virtual void | insertPoint (int iIndex, const QPoint *pnt) |
| virtual void | removePoint (int iIndex) |
| virtual const QPoint | getPoint (int pointNum) const |
| virtual void | setPoint (int pointNum, const QPoint *pnt) |
| virtual bool | setLocationData (const QPolygon *pts) |
| This function is used so that multipoint symbols have the same interface as single point symbols In the single point case, it takes the first value and sets the origin from that. | |
| virtual const QPolygon * | getLocationData () const |
| Provided for a simpler interface to subclasses. | |
| virtual bool | select (const QPoint &aPoint) |
| ---- Mouse selecting options | |
| virtual bool | selected () const |
| virtual bool | select (const QPoint &aPoint, const QSize &rectangleSize) |
| Returns true if the rectangle intersects the symbol, if the symbol is selectable. | |
| virtual void | reverseLine () |
| Invert the direction of this line. | |
| virtual void | setKnobSize (int i) |
| Accessors for point knob size (if this line can be modified) | |
| virtual int | knobSize () const |
| virtual void | setHighlight (const bool highlight) |
| Set/get the highlight flag (whether the symbol should be drawn highlighted). | |
| virtual bool | pointHighlighted () const |
| Returns true if there is a point selected. | |
| virtual int | pointSelected () const |
| Return the selected point. | |
| virtual void | selectPoint (int iPoint) |
| virtual void | clearSelection () |
| virtual bool | pointSelected (const QPoint &pnt) |
| Checks to see if the point supplied is in our knob area. | |
| virtual void | setLineSelected (bool b, int iSegment=-1) |
| Sets whether or not the line portion has been selected. | |
| virtual int | segmentSelected () const |
| virtual int | getNumVertexPoints () const |
| In vertex drawing mode, returns the number of vertex points to draw and the vertex point at the particular index. | |
| virtual const QPoint | getVertexPoint (int pointNum) const |
| virtual void | setCanAddPoint (bool b) |
| Set to false if cannot add or delete point. | |
| virtual bool | canAddPoint () const |
| virtual bool | setAndCalculatePoint (int iIndex, const QPoint &pnt) |
| Given a screen point, return a point on the line that will draw exactly to the screen. | |
| virtual bool | setAndCalculatePoint (int iIndex, const DtPoint &pnt, QVector< DtPoint > *list) |
| No-op. | |
| virtual void | setFixedLength (int iLen) |
| Sets the fixed length of the line that will be used when calculating a point on the line. | |
| virtual DtArrowStyle | arrowStyle () const |
| virtual void | setArrowStyle (DtArrowStyle style) |
| Set the style of the lines being drawn. | |
| virtual void | setDrawVertexPoints (const QVector< int > pnts) |
| Sets which vertex points to draw. | |
| virtual int | getVertexOffset (int index) const |
| Returns the index of the point selected. | |
| virtual int | mapPointSelectedToIndex (int iPointSelected) const |
| Returns the true index of the point selected based on whether or not there is a vertex draw list. | |
| virtual void | setPenStyle (Qt::PenStyle style) |
| Accessors for pen style. By default SolidLine is the style. | |
| virtual Qt::PenStyle | penStyle () const |
| virtual bool | isSkipPoint (int pointNum) const |
| Returns true if point indicated is a skip point (0xFFFFFFFF, 0xFFFFFFFF) | |
| virtual bool | freehand () const |
| Sets whether or not this symbol should be treated in initial drawing in freehand mode. | |
| virtual void | setFreehand (bool b) |
| bool | operator== (const DtLineSymbol &orig) const |
| bool | operator!= (const DtLineSymbol &orig) const |
| virtual bool | transparentCacheChanged () const |
| virtual bool | keepAspectRatio () const |
| Returns true if all points need to be kept in line. By default, returns false. | |
| virtual bool | originIsCenterOfMass () const |
| Returns true. | |
Static Public Member Functions | |
| static double | calculateLineAngle (const QPoint &origin, const QPoint &end) |
| Returns angle of line (in radians) between 2 points. | |
Protected Member Functions | |
| virtual const DtDisplayPoint | calcCenterPoint () const |
| virtual const DtDisplayPoint | calcCenterPoint (QPoint &pnt) const |
Protected Attributes | |
| QPolygon * | myPoints |
| unsigned | myWidth |
| int | myKnobSize |
| int | mySegmentSelected |
| DtLineSelectionMode | mySelection |
| QVector< int > | myDrawVertexPoints |
| bool | myCanAddPoint |
| int | myFixedLength |
| DtArrowStyle | myArrowStyle |
| Qt::PenStyle | myPenStyle |
| bool | myFreehand |
Private Member Functions | |
| DtLineSymbol () | |
| Not implemented. Private to ensure it is only constructed with a drawer. | |
class DtLineSymbol:
Instances of DtLineSymbol are arrows
| DtLineSymbol::DtLineSymbol | ( | DtSymbolDrawer & | drawer | ) |
Constructors / assignment operator / destructor.
| DtLineSymbol::DtLineSymbol | ( | DtSymbolDrawer & | drawer, |
| const QPoint & | startPoint, | ||
| const QPoint & | endPoint | ||
| ) |
| DtLineSymbol::DtLineSymbol | ( | DtNullDrawer & | drawer | ) |
| DtLineSymbol::DtLineSymbol | ( | const DtLineSymbol & | orig | ) |
| virtual DtLineSymbol::~DtLineSymbol | ( | ) | [virtual] |
| DtLineSymbol::DtLineSymbol | ( | ) | [private] |
Not implemented. Private to ensure it is only constructed with a drawer.
| DtLineSymbol& DtLineSymbol::operator= | ( | const DtLineSymbol & | orig | ) |
| virtual DtSymbol* DtLineSymbol::clone | ( | ) | const [virtual] |
Returns an instance of a symbol which is a copy of this.
The caller is responsible for freeing the memory.
Reimplemented from DtColorizedSymbol.
Reimplemented in DtPolygonSymbol, and DtBoxSymbol.
| virtual unsigned DtLineSymbol::width | ( | ) | const [virtual] |
Width of arrow that can be on the end of the line.
| virtual void DtLineSymbol::setWidth | ( | unsigned | w | ) | [virtual] |
| virtual void DtLineSymbol::setLineWidth | ( | int | i | ) | [virtual] |
Width of line. Set to -1 to use drawer default.
Reimplemented from DtColorizedSymbol.
| virtual const DtDisplayPoint DtLineSymbol::centerPoint | ( | ) | const [virtual] |
The real visual center of the symbol in display coordinates.
Reimplemented from DtSymbol.
Reimplemented in DtPolygonSymbol.
| virtual void DtLineSymbol::shift | ( | QPoint | p | ) | [virtual] |
Move the center of this object by p amount.
Reimplemented from DtSymbol.
Reimplemented in DtPolygonSymbol.
| virtual void DtLineSymbol::setStartPosition | ( | const QPoint & | position | ) | [virtual] |
Set/get the location of the start of the symbol.
| virtual QPoint DtLineSymbol::startPosition | ( | ) | const [virtual] |
| virtual void DtLineSymbol::setEndPosition | ( | const QPoint & | position | ) | [virtual] |
Set/get the location of the end of the symbol.
| virtual QPoint DtLineSymbol::endPosition | ( | ) | const [virtual] |
| virtual void DtLineSymbol::setNumPoints | ( | const int | num | ) | [virtual] |
| virtual int DtLineSymbol::getNumPoints | ( | ) | const [virtual] |
| virtual void DtLineSymbol::addPoint | ( | const QPoint * | pnt | ) | [virtual] |
| virtual void DtLineSymbol::insertPoint | ( | int | iIndex, |
| const QPoint * | pnt | ||
| ) | [virtual] |
| virtual void DtLineSymbol::removePoint | ( | int | iIndex | ) | [virtual] |
| virtual const QPoint DtLineSymbol::getPoint | ( | int | pointNum | ) | const [virtual] |
Reimplemented in DtPolygonSymbol.
| virtual void DtLineSymbol::setPoint | ( | int | pointNum, |
| const QPoint * | pnt | ||
| ) | [virtual] |
| virtual bool DtLineSymbol::setLocationData | ( | const QPolygon * | ) | [virtual] |
This function is used so that multipoint symbols have the same interface as single point symbols In the single point case, it takes the first value and sets the origin from that.
Reimplemented from DtSymbol.
| virtual const QPolygon* DtLineSymbol::getLocationData | ( | ) | const [virtual] |
Provided for a simpler interface to subclasses.
Since there is only one point (the origin), this routine will return NULL
Reimplemented from DtSymbol.
| virtual bool DtLineSymbol::select | ( | const QPoint & | aPoint | ) | [virtual] |
---- Mouse selecting options
Returns true if the point intersects the symbol, if the symbol is selectable.
Reimplemented from DtSymbol.
Reimplemented in DtPolygonSymbol.
| virtual bool DtLineSymbol::selected | ( | ) | const [virtual] |
Reimplemented from DtSymbol.
| virtual bool DtLineSymbol::select | ( | const QPoint & | aPoint, |
| const QSize & | rectangleSize | ||
| ) | [virtual] |
Returns true if the rectangle intersects the symbol, if the symbol is selectable.
Reimplemented from DtSymbol.
| virtual void DtLineSymbol::reverseLine | ( | ) | [virtual] |
Invert the direction of this line.
| virtual void DtLineSymbol::setKnobSize | ( | int | i | ) | [virtual] |
Accessors for point knob size (if this line can be modified)
| virtual int DtLineSymbol::knobSize | ( | ) | const [virtual] |
| virtual void DtLineSymbol::setHighlight | ( | const bool | highlight | ) | [virtual] |
Set/get the highlight flag (whether the symbol should be drawn highlighted).
Reimplemented from DtSymbol.
| virtual bool DtLineSymbol::pointHighlighted | ( | ) | const [virtual] |
Returns true if there is a point selected.
| virtual int DtLineSymbol::pointSelected | ( | ) | const [virtual] |
Return the selected point.
| virtual void DtLineSymbol::selectPoint | ( | int | iPoint | ) | [virtual] |
| virtual void DtLineSymbol::clearSelection | ( | ) | [virtual] |
| virtual bool DtLineSymbol::pointSelected | ( | const QPoint & | pnt | ) | [virtual] |
Checks to see if the point supplied is in our knob area.
| virtual void DtLineSymbol::setLineSelected | ( | bool | b, |
| int | iSegment = -1 |
||
| ) | [virtual] |
Sets whether or not the line portion has been selected.
The segment is the segment of the line selected
| virtual int DtLineSymbol::segmentSelected | ( | ) | const [virtual] |
| virtual int DtLineSymbol::getNumVertexPoints | ( | ) | const [virtual] |
In vertex drawing mode, returns the number of vertex points to draw and the vertex point at the particular index.
By default simple defers to getNumPoints and getPoint
| virtual const QPoint DtLineSymbol::getVertexPoint | ( | int | pointNum | ) | const [virtual] |
| virtual void DtLineSymbol::setCanAddPoint | ( | bool | b | ) | [virtual] |
Set to false if cannot add or delete point.
| virtual bool DtLineSymbol::canAddPoint | ( | ) | const [virtual] |
| virtual bool DtLineSymbol::setAndCalculatePoint | ( | int | iIndex, |
| const QPoint & | pnt | ||
| ) | [virtual] |
Given a screen point, return a point on the line that will draw exactly to the screen.
Will modify by fixed length if set
Reimplemented in DtBoxSymbol.
| virtual bool DtLineSymbol::setAndCalculatePoint | ( | int | iIndex, |
| const DtPoint & | pnt, | ||
| QVector< DtPoint > * | list | ||
| ) | [virtual] |
No-op.
Reimplemented in DtBoxSymbol.
| virtual void DtLineSymbol::setFixedLength | ( | int | iLen | ) | [virtual] |
Sets the fixed length of the line that will be used when calculating a point on the line.
Really only useful for a line that has two points. Set to 0 to not use
| static double DtLineSymbol::calculateLineAngle | ( | const QPoint & | origin, |
| const QPoint & | end | ||
| ) | [static] |
Returns angle of line (in radians) between 2 points.
| virtual DtArrowStyle DtLineSymbol::arrowStyle | ( | ) | const [virtual] |
| virtual void DtLineSymbol::setArrowStyle | ( | DtArrowStyle | style | ) | [virtual] |
Set the style of the lines being drawn.
| virtual void DtLineSymbol::setDrawVertexPoints | ( | const QVector< int > | pnts | ) | [virtual] |
Sets which vertex points to draw.
When getNumVertexPoints() or getVertexPoint() is called, and this member has been set, it will reference the myDrawVertexPoints to figure out which vertex to draw
| virtual int DtLineSymbol::getVertexOffset | ( | int | index | ) | const [virtual] |
Returns the index of the point selected.
If there is a vertex list, returns the offset in that list
| virtual int DtLineSymbol::mapPointSelectedToIndex | ( | int | iPointSelected | ) | const [virtual] |
Returns the true index of the point selected based on whether or not there is a vertex draw list.
| virtual void DtLineSymbol::setPenStyle | ( | Qt::PenStyle | style | ) | [virtual] |
Accessors for pen style. By default SolidLine is the style.
| virtual Qt::PenStyle DtLineSymbol::penStyle | ( | ) | const [virtual] |
| virtual bool DtLineSymbol::isSkipPoint | ( | int | pointNum | ) | const [virtual] |
Returns true if point indicated is a skip point (0xFFFFFFFF, 0xFFFFFFFF)
| virtual bool DtLineSymbol::freehand | ( | ) | const [virtual] |
Sets whether or not this symbol should be treated in initial drawing in freehand mode.
Freehand mode tracks mouse movement and adds a point for every mouse position change. By default, this mode is false
| virtual void DtLineSymbol::setFreehand | ( | bool | b | ) | [virtual] |
| bool DtLineSymbol::operator== | ( | const DtLineSymbol & | orig | ) | const |
| bool DtLineSymbol::operator!= | ( | const DtLineSymbol & | orig | ) | const |
| virtual bool DtLineSymbol::transparentCacheChanged | ( | ) | const [virtual] |
Reimplemented from DtColorizedSymbol.
Reimplemented in DtPolygonSymbol.
| virtual bool DtLineSymbol::keepAspectRatio | ( | ) | const [virtual] |
Returns true if all points need to be kept in line. By default, returns false.
Reimplemented in DtBoxSymbol.
| virtual bool DtLineSymbol::originIsCenterOfMass | ( | ) | const [virtual] |
Returns true.
Reimplemented from DtSymbol.
| virtual const DtDisplayPoint DtLineSymbol::calcCenterPoint | ( | ) | const [protected, virtual] |
Reimplemented in DtPolygonSymbol.
| virtual const DtDisplayPoint DtLineSymbol::calcCenterPoint | ( | QPoint & | pnt | ) | const [protected, virtual] |
QPolygon* DtLineSymbol::myPoints [protected] |
unsigned DtLineSymbol::myWidth [protected] |
int DtLineSymbol::myKnobSize [protected] |
int DtLineSymbol::mySegmentSelected [protected] |
DtLineSelectionMode DtLineSymbol::mySelection [protected] |
QVector<int> DtLineSymbol::myDrawVertexPoints [protected] |
bool DtLineSymbol::myCanAddPoint [protected] |
int DtLineSymbol::myFixedLength [protected] |
DtArrowStyle DtLineSymbol::myArrowStyle [protected] |
Qt::PenStyle DtLineSymbol::myPenStyle [protected] |
bool DtLineSymbol::myFreehand [protected] |