VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtSdcLine2DObject Class Reference

A 2D Line Stealth Draw Control Object. More...

Inheritance diagram for DtSdcLine2DObject:
Inheritance graph
[legend]

Public Member Functions

 DtSdcLine2DObject (DtExerciseConn *exConn, unsigned id, const DtSdcVector2D &startPosition, const DtSdcVector2D &endPosition, int numSegments=1, DtSdcColor color=DtSdcColor::DtSdcWhite, DtSdcLineSegment::DtSdcSegmentStyle lineStyle=DtSdcLineSegment::DtSdcSegmentStyleStraight, DtSdcLineSegment::DtSdcSegmentArrowStyle arrowStyle=DtSdcLineSegment::DtSdcSegmentArrowStyleNoArrow, unsigned thickness=1, unsigned pattern=0xffffff, bool flashing=false)
 Construct the 2D line Draw Control Object.
virtual ~DtSdcLine2DObject ()
virtual DtSdcVector2D startPosition () const
 startPosition accessor
virtual void setStartPosition (const DtSdcVector2D &startPosition)
 startPosition mutator
virtual DtSdcVector2D endPosition () const
 endPosition accessor
virtual void setEndPosition (const DtSdcVector2D &endPosition)
 endPosition mutator
virtual int numSegments () const
 numSegments accessor
virtual void setNumSegments (int numSegments)
 numSegments mutator
virtual const DtSdcColorcolor (int segment) const
 color accessor
virtual const DtSdcColorcolor () const
virtual void setColor (const DtSdcColor &color, int segment)
 color mutator
virtual void setColor (const DtSdcColor &color)
virtual
DtSdcLineSegment::DtSdcSegmentStyle 
lineStyle (int segment=0) const
 lineStyle accessor
virtual void setLineStyle (DtSdcLineSegment::DtSdcSegmentStyle lineStyle, int segment=0)
 lineStyle mutator
virtual
DtSdcLineSegment::DtSdcSegmentArrowStyle 
arrowStyle (int segment=0) const
 arrowStyle accessor
virtual void setArrowStyle (DtSdcLineSegment::DtSdcSegmentArrowStyle arrowStyle, int segment=0)
 arrowStyle mutator
virtual unsigned pattern (int segment=0) const
 pattern accessor
virtual void setPattern (unsigned pattern, int segment=0)
 pattern mutator
virtual unsigned thickness (int segment=0) const
 thickness accessor
virtual void setThickness (unsigned thickness, int segment=0)
 thickness mutator
virtual double percentage (int segment) const
 percentage accessor
virtual void setPercentage (double percentage, int segment)
 percentage mutator
virtual bool flashing () const
 flashing accessor
virtual void setFlashing (bool flashing)
 flashing mutator
virtual void setRemoteGraphicSet (const std::string &setName)
virtual void update ()
 Send updates to the environmental records to the publisher.
- Public Member Functions inherited from DtSdcObject
 DtSdcObject (DtExerciseConn *exConn, unsigned id, const DtString &objName)
 Parameterized constructor.
virtual ~DtSdcObject ()
 Virtual destructor.
virtual unsigned id () const
 id accessor
virtual void setId (unsigned id)
 id mutator
virtual const
DtGlobalObjectDesignator & 
globalId () const
virtual void setVisible (bool yesNo)
virtual bool visible () const

Protected Member Functions

virtual void initRecords ()

Protected Attributes

DtSdcVector2D myStartPosition
DtSdcVector2D myEndPosition
bool myFlashing
std::vector< DtSdcLineSegmentmyLineSegments
DtEnvironmentalLineRecord myLineRecord
Dt3DGraphicalObjectLineStateRecord myLineStateRecord
- Protected Attributes inherited from DtSdcObject
unsigned myId
DtEnvironmentProcessPublisher myPublisher
bool myVisible
DtSdcColor myEmptyColor

Private Member Functions

 DtSdcLine2DObject ()
 Default constructor.

Detailed Description

A 2D Line Stealth Draw Control Object.

DtSdcLine2DObject represents a line that can be positioned and displayed on the screen. The line may be divided into multiple segments of varying relative lengths. A color, line style, arrow style, pattern and thickness may be specified for each segment; and the line can flash, if desired.

Constructor & Destructor Documentation

DtSdcLine2DObject::DtSdcLine2DObject ( DtExerciseConn *  exConn,
unsigned  id,
const DtSdcVector2D startPosition,
const DtSdcVector2D endPosition,
int  numSegments = 1,
DtSdcColor  color = DtSdcColor::DtSdcWhite,
DtSdcLineSegment::DtSdcSegmentStyle  lineStyle = DtSdcLineSegment::DtSdcSegmentStyleStraight,
DtSdcLineSegment::DtSdcSegmentArrowStyle  arrowStyle = DtSdcLineSegment::DtSdcSegmentArrowStyleNoArrow,
unsigned  thickness = 1,
unsigned  pattern = 0xffffff,
bool  flashing = false 
)

Construct the 2D line Draw Control Object.

Note that the color and subsequent default parameters are applied to all segments; multi-segmented lines are constructed with all segments being equally proportioned. The segment proportions and individual stylistic elements may all be modified after construction.

Parameters
exConnPassed to DtSdcObject base (see)
idPassed to DtSdcObject base (see)
startPositionStarting position of the line on the screen - values go from [0.,0.] (left, bottom) to [1.,1.] (right, top)
endPositionEnding position of the line on the screen - values go from [0.,0.] (left, bottom) to [1.,1.] (right, top)
numSegmentsThe number of segments the line should be divided into. Note that this can be changed at any time
colorThe color to apply to all segments constructed
lineStyleA style enumeration from DtSdcLineSegment applied to all segments constructed
arrowStyleAn arrow style enumeration from DtSdcLineSegment applied to all segments constructed
thicknessThe number of pixels thick to draw all segments constructed
patternA stipple pattern used to draw all segments constructed
flashingA boolean parameter indicating whether or not the line should be flashing
virtual DtSdcLine2DObject::~DtSdcLine2DObject ( )
virtual
DtSdcLine2DObject::DtSdcLine2DObject ( )
private

Default constructor.

Private and not implemented - you must supply an id and basic geometric parameters to construct the line

Member Function Documentation

virtual DtSdcVector2D DtSdcLine2DObject::startPosition ( ) const
virtual

startPosition accessor

Get the line's start position

Returns
[0.,0.] (left, bottom) to [1.,1.] (right, top)
virtual void DtSdcLine2DObject::setStartPosition ( const DtSdcVector2D startPosition)
virtual

startPosition mutator

Set the line's start position

Parameters
startPosition[0.,0.] (left, bottom) to [1.,1.] (right, top)
virtual DtSdcVector2D DtSdcLine2DObject::endPosition ( ) const
virtual

endPosition accessor

Get the line's end position

Returns
[0.,0.] (left, bottom) to [1.,1.] (right, top)
virtual void DtSdcLine2DObject::setEndPosition ( const DtSdcVector2D endPosition)
virtual

endPosition mutator

Set the line's end position

Parameters
endPosition[0.,0.] (left, bottom) to [1.,1.] (right, top)
virtual int DtSdcLine2DObject::numSegments ( ) const
virtual

numSegments accessor

Get the number of segments in this line

Returns
0 to N

Implements DtSdcLineObjectInterface.

virtual void DtSdcLine2DObject::setNumSegments ( int  numSegments)
virtual

numSegments mutator

Set the number of individual segments that make up this line

Parameters
numSegments0 to N

Implements DtSdcLineObjectInterface.

virtual const DtSdcColor& DtSdcLine2DObject::color ( int  segment) const
virtual

color accessor

Get the color assigned to the indicated segment

Parameters
segmentThe segment to retrieve the color from
Returns
The segment's color
virtual const DtSdcColor& DtSdcLine2DObject::color ( ) const
virtual

Reimplemented from DtSdcObject.

virtual void DtSdcLine2DObject::setColor ( const DtSdcColor color,
int  segment 
)
virtual

color mutator

Set the color to use when drawing the indicated segment

Parameters
colorThe DtSdcColor to use
segmentThe segment to apply the color to
virtual void DtSdcLine2DObject::setColor ( const DtSdcColor color)
virtual

Reimplemented from DtSdcObject.

virtual DtSdcLineSegment::DtSdcSegmentStyle DtSdcLine2DObject::lineStyle ( int  segment = 0) const
virtual

lineStyle accessor

Get the lineStyle assigned to the indicated segment

Parameters
segmentThe segment to retrieve the lineStyle from
Returns
A DtSdcLineSegment::DtSdcSegmentStyle indicating the segment's style

Implements DtSdcLineObjectInterface.

virtual void DtSdcLine2DObject::setLineStyle ( DtSdcLineSegment::DtSdcSegmentStyle  lineStyle,
int  segment = 0 
)
virtual

lineStyle mutator

Set the lineStyle to use when drawing the indicated segment

Parameters
lineStyleThe lineStyle to use for the indicated segment
segmentThe segment to apply the lineStyle to

Implements DtSdcLineObjectInterface.

virtual DtSdcLineSegment::DtSdcSegmentArrowStyle DtSdcLine2DObject::arrowStyle ( int  segment = 0) const
virtual

arrowStyle accessor

Get the arrowStyle assigned to the indicated segment

Parameters
segmentThe segment to retrieve the arrowStyle from
Returns
A DtSdcLineSegment::DtSdcSegmentArrowStyle indicating the segment's arrow style

Implements DtSdcLineObjectInterface.

virtual void DtSdcLine2DObject::setArrowStyle ( DtSdcLineSegment::DtSdcSegmentArrowStyle  arrowStyle,
int  segment = 0 
)
virtual

arrowStyle mutator

Set the arrowStyle to use when drawing the indicated segment

Parameters
arrowStyleThe arrowStyle to use for the indicated segment
segmentThe segment to apply the arrowStyle to

Implements DtSdcLineObjectInterface.

virtual unsigned DtSdcLine2DObject::pattern ( int  segment = 0) const
virtual

pattern accessor

Get the stipple pattern used when drawing the indicated segment

Parameters
segmentThe segment to retrieve the pattern from
Returns
The stipple pattern, 0x00000000 to 0xFFFFFFFF

Implements DtSdcLineObjectInterface.

virtual void DtSdcLine2DObject::setPattern ( unsigned  pattern,
int  segment = 0 
)
virtual

pattern mutator

Set the stipple pattern to use when drawing the indicated segment

Parameters
patternThe stipple pattern, 0x00000000 to 0xFFFFFFFF.
segmentThe segment to apply the pattern to

Implements DtSdcLineObjectInterface.

virtual unsigned DtSdcLine2DObject::thickness ( int  segment = 0) const
virtual

thickness accessor

Get the thickness assigned to the indicated segment

Parameters
segmentThe segment to retrieve the thickness from
Returns
The segments's thickness, in pixels (0-255)

Implements DtSdcLineObjectInterface.

virtual void DtSdcLine2DObject::setThickness ( unsigned  thickness,
int  segment = 0 
)
virtual

thickness mutator

Set the thickness to use when drawing the indicated segment

Parameters
thicknessThe thickness in pixels, (0-255). Note that GL may not actually be willing or able to draw a line 255 pixels wide. It's implementation dependent.
segmentThe segment to apply the thickness to

Implements DtSdcLineObjectInterface.

virtual double DtSdcLine2DObject::percentage ( int  segment) const
virtual

percentage accessor

Get the percentage of the line that the indicated segment occupies

Parameters
segmentThe segment to retrieve the percentage from
Returns
The line's thickness, in pixels (0-255)

Implements DtSdcLineObjectInterface.

virtual void DtSdcLine2DObject::setPercentage ( double  percentage,
int  segment 
)
virtual

percentage mutator

Set the percentage of the line that the indicated segment should occupy. Note that it's the responsibility of the user to ensure that the sum of the individual segment's percentages is 1.

Parameters
percentageThe percentage (0. to 1.)
segmentThe segment to apply the precentage to

Implements DtSdcLineObjectInterface.

virtual bool DtSdcLine2DObject::flashing ( ) const
virtual

flashing accessor

Get the boolean that indicates whether or not the line should flash

Returns
true or false

Reimplemented from DtSdcObject.

virtual void DtSdcLine2DObject::setFlashing ( bool  flashing)
virtual

flashing mutator

Set the boolean that indicates whether or not the line should flash

Parameters
flashingtrue or false

Reimplemented from DtSdcObject.

virtual void DtSdcLine2DObject::setRemoteGraphicSet ( const std::string &  setName)
virtual

Reimplemented from DtSdcObject.

virtual void DtSdcLine2DObject::update ( )
virtual

Send updates to the environmental records to the publisher.

Implements DtSdcObject.

virtual void DtSdcLine2DObject::initRecords ( )
protectedvirtual

Member Data Documentation

DtSdcVector2D DtSdcLine2DObject::myStartPosition
protected
DtSdcVector2D DtSdcLine2DObject::myEndPosition
protected
bool DtSdcLine2DObject::myFlashing
protected
std::vector<DtSdcLineSegment> DtSdcLine2DObject::myLineSegments
protected
DtEnvironmentalLineRecord DtSdcLine2DObject::myLineRecord
protected
Dt3DGraphicalObjectLineStateRecord DtSdcLine2DObject::myLineStateRecord
protected

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

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)