![]() |
VR-Forces Developer's Guide
|
A class which represents a component for a set of 3d lines.
This is part of a component/system concept. See DtGeom3dLinesSystem for more details.
This component can be used to visualize a height line starting at some position (setHeightLineAtPoint), render multiple height lines between two points at some interval (populateHeightLines), and render arbitrary lines (setLine). Both (setHeightLineAtPoint) and (setLine) allow a user hande to be associated with a line. The user handle can then be used to remove or update the specific line associated with the handle. The component can be used to add as many lines as desired.
You can use one of these components by getting the system from DtRenderer, and then call createComponent() on the system (DtGeom3dLinesSystem).
The caller of createComponent() is responsible for freeing the component when no longer needed. The caller does not have to register or unregister the component as it is done automatically by the component.
Classes | |
| struct | Line |
Public Types | |
| enum | CategoryFlags : unsigned int { CategoryFlags::CategoryFlagsTracks = 0x0001, CategoryFlags::CategoryFlagsRoutes = 0x0002, CategoryFlags::CategoryFlagsAll = 0xFFFF } |
| typedef int | LineHandle |
Public Member Functions | |
| virtual | ~DtGeom3dLinesComponent () |
| DtGeom3dLinesComponent ()=delete | |
| DtGeom3dLinesComponent (const DtGeom3dLinesComponent &other)=delete | |
| DtGeom3dLinesComponent (const DtGeom3dLinesComponent &&other)=delete | |
| DtGeom3dLinesComponent & | operator= (const DtGeom3dLinesComponent &other)=delete |
| DtGeom3dLinesComponent & | operator= (const DtGeom3dLinesComponent &&other)=delete |
| virtual const DtModelSetId | modelSetId () const |
| virtual void | setCategoryFlags (DtGeom3dLinesComponent::CategoryFlags flags) |
| virtual const DtGeom3dLinesComponent::CategoryFlags | categoryFlags () const |
| virtual void | clearLines () |
| virtual void | setOrigin (const DtVector &origin) |
| virtual const DtVector & | origin () const |
| virtual void | setCurrentColor (float r, float g, float b, float a) |
| virtual void | setCurrentStartColor (float r, float g, float b, float a) |
| virtual const DtVector4< float > | currentStartColor () const |
| virtual void | setCurrentEndColor (float r, float g, float b, float a) |
| virtual const DtVector4< float > | currentEndColor () const |
| virtual void | populateHeightLines (const DtVector &pointA, const DtVector &pointB, float desiredSpacing) |
| virtual void | setLine (const DtVector &pointA, const DtVector &pointB, LineHandle handle) |
| virtual void | setHeightLineAtPoint (const DtVector &point, LineHandle handle) |
| virtual const DtVector & | lastPlacedHeightLinePoint () const |
| virtual void | removeLine (LineHandle handle) |
Protected Member Functions | |
| DtGeom3dLinesComponent (DtGeom3dLinesSystem &system, DtModelSetId modelSetId) | |
| virtual double | computeDownDistance (const DtVector &point) const |
| virtual void | submitLines (Dt3dLinesStagingBuffer *buffer) const |
| void | computeCullingSphere (DtVector3< double > ¢er, double &radiusSquared) const |
Protected Attributes | |
| DtGeom3dLinesSystem & | mySystem |
| DtModelSetId | myModelSetId |
| std::vector < DtGeom3dLinesComponent::Line > | myLines |
| std::map< LineHandle, DtGeom3dLinesComponent::Line > | myHandleLines |
| DtVector | myLastPlacedPoint |
| DtVector | myDown |
| DtVector | myOrigin |
| double | myOriginAlt |
| float | myStartColor [4] |
| float | myEndColor [4] |
| DtVector3< double > | myBoundsMin |
| DtVector3< double > | myBoundsMax |
| bool | myBoundsValid |
| DtGeom3dLinesComponent::CategoryFlags | myCategoryFlags |
Friends | |
| class | DtGeom3dLinesComponentCreator |
| class | DtGeom3dLinesSystem |
A handle type to identify individual lines.
|
strong |
|
virtual |
Destructor.
|
delete |
Default Constructor not implemented - not allowed.
|
delete |
Copy Constructor not implemented - Copy not allowed.
|
delete |
Move Constructor not implemented - Move not allowed.
|
protected |
CTOR Protected so that instances of this class can only be created using a DtGeom3dLinesComponentCreator.
|
delete |
Assignment Operator not implemented - Assignment not allowed.
|
delete |
Move assignment Operator not implemented - Move assignment not allowed.
|
virtual |
Returns the model set that this component was created for.
|
virtual |
Sets the type of usage categories this component will be used for. This allows the system to enable/disable components by categories. The default is CategoryFlagsAny (see enum CategoryFlags).
|
virtual |
Returns the category flags. (see setCategoryFlags)
|
virtual |
Clears all lines.
|
virtual |
Sets the origin. Points are not stored relative to this, it's just needed to compute a rough topo around the points. Internally computes a vector pointing down to the earth using the given origin. Height line methods will use this down vector to create lines pointing down to the earth.
| origin | The point to compute the topo at. |
|
virtual |
Gets the current origin used to compute down verctors for height lines. (see setOrigin for details)
|
virtual |
Sets the current start and end point color applied when adding new lines.
| r,g,b,a | color values in the range (0.0 - 1.0) |
|
virtual |
Sets the current start point color applied when adding new lines.
| r,g,b,a | color values in the range (0.0 - 1.0) |
|
virtual |
Gets the current start point color applied when adding new lines.
|
virtual |
Sets the current end point color applied when adding new lines.
| r,g,b,a | color values in the range (0.0 - 1.0) |
|
virtual |
Gets the current end point color applied when adding new lines.
|
virtual |
Creates lines pointing down to the earth along the give line.
| pointA | The starting point of the line. |
| pointB | The ending point of the line. |
| desiredSpacing | The desired spacing in meters to populate points inbetween the start and end points. There will always be at least 2 points (pointA and PointB). |
|
virtual |
Sets the points for a line. Adds the line if the given handle does not exist.
| pointA | The starting point of the line. |
| pointB | The ending point of the line. |
| handle | - a handle to uniquely identify the line for updating and removal |
|
virtual |
Sets a point for a height line. Adds the line if the given handle does not exist. A start of the height line will be created from the given point and the end point will be computed going down to the earth.
| point | The starting point of the line. |
| handle | - a handle to uniquely identify the line for updating and removal |
|
virtual |
Returns the point from the last call to setHeightLineAtPoint.
|
virtual |
Removes a line associated with the given handle. If the handle is not associated with any line, then nothing happens.
| handle | a handle to uniquely identify the line for removal |
|
protectedvirtual |
Computes this altitude to go down at the given point to to be below sea level.
|
protectedvirtual |
Adds any active lines to the given buffer.
| buffer | the buffer to add lines to |
|
protected |
non-virtual in inner loop Computes the culling sphere for all lines
| center | The output center of the culling sphere |
| radiusSquared | The output squared radius of the culling shpere |
|
friend |
The creator requires access to protected methods.
|
friend |
The system requires access to some protected methods. Specifically the system should be the only class that calls (submitLines) and (computeCullingSphere).
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |