VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
makVrv::DtGeom3dLinesComponent Class Reference

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
 
DtGeom3dLinesComponentoperator= (const DtGeom3dLinesComponent &other)=delete
 
DtGeom3dLinesComponentoperator= (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 DtVectororigin () 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 DtVectorlastPlacedHeightLinePoint () 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 > &center, double &radiusSquared) const
 

Protected Attributes

DtGeom3dLinesSystemmySystem
 
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< doublemyBoundsMin
 
DtVector3< doublemyBoundsMax
 
bool myBoundsValid
 
DtGeom3dLinesComponent::CategoryFlags myCategoryFlags
 

Friends

class DtGeom3dLinesComponentCreator
 
class DtGeom3dLinesSystem
 

Member Typedef Documentation

A handle type to identify individual lines.

Member Enumeration Documentation

Optional enumeration used to classify components for usage type. (see setCategoryFlags)

Enumerator
CategoryFlagsTracks 
CategoryFlagsRoutes 
CategoryFlagsAll 

Constructor & Destructor Documentation

virtual makVrv::DtGeom3dLinesComponent::~DtGeom3dLinesComponent ( )
virtual

Destructor.

makVrv::DtGeom3dLinesComponent::DtGeom3dLinesComponent ( )
delete

Default Constructor not implemented - not allowed.

makVrv::DtGeom3dLinesComponent::DtGeom3dLinesComponent ( const DtGeom3dLinesComponent other)
delete

Copy Constructor not implemented - Copy not allowed.

makVrv::DtGeom3dLinesComponent::DtGeom3dLinesComponent ( const DtGeom3dLinesComponent &&  other)
delete

Move Constructor not implemented - Move not allowed.

makVrv::DtGeom3dLinesComponent::DtGeom3dLinesComponent ( DtGeom3dLinesSystem system,
DtModelSetId  modelSetId 
)
protected

CTOR Protected so that instances of this class can only be created using a DtGeom3dLinesComponentCreator.

Member Function Documentation

DtGeom3dLinesComponent& makVrv::DtGeom3dLinesComponent::operator= ( const DtGeom3dLinesComponent other)
delete

Assignment Operator not implemented - Assignment not allowed.

DtGeom3dLinesComponent& makVrv::DtGeom3dLinesComponent::operator= ( const DtGeom3dLinesComponent &&  other)
delete

Move assignment Operator not implemented - Move assignment not allowed.

virtual const DtModelSetId makVrv::DtGeom3dLinesComponent::modelSetId ( ) const
virtual

Returns the model set that this component was created for.

virtual void makVrv::DtGeom3dLinesComponent::setCategoryFlags ( DtGeom3dLinesComponent::CategoryFlags  flags)
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 const DtGeom3dLinesComponent::CategoryFlags makVrv::DtGeom3dLinesComponent::categoryFlags ( ) const
virtual

Returns the category flags. (see setCategoryFlags)

virtual void makVrv::DtGeom3dLinesComponent::clearLines ( )
virtual

Clears all lines.

virtual void makVrv::DtGeom3dLinesComponent::setOrigin ( const DtVector origin)
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.

Parameters
originThe point to compute the topo at.
virtual const DtVector& makVrv::DtGeom3dLinesComponent::origin ( ) const
virtual

Gets the current origin used to compute down verctors for height lines. (see setOrigin for details)

virtual void makVrv::DtGeom3dLinesComponent::setCurrentColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

Sets the current start and end point color applied when adding new lines.

Parameters
r,g,b,acolor values in the range (0.0 - 1.0)
virtual void makVrv::DtGeom3dLinesComponent::setCurrentStartColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

Sets the current start point color applied when adding new lines.

Parameters
r,g,b,acolor values in the range (0.0 - 1.0)
virtual const DtVector4<float> makVrv::DtGeom3dLinesComponent::currentStartColor ( ) const
virtual

Gets the current start point color applied when adding new lines.

virtual void makVrv::DtGeom3dLinesComponent::setCurrentEndColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

Sets the current end point color applied when adding new lines.

Parameters
r,g,b,acolor values in the range (0.0 - 1.0)
virtual const DtVector4<float> makVrv::DtGeom3dLinesComponent::currentEndColor ( ) const
virtual

Gets the current end point color applied when adding new lines.

virtual void makVrv::DtGeom3dLinesComponent::populateHeightLines ( const DtVector pointA,
const DtVector pointB,
float  desiredSpacing 
)
virtual

Creates lines pointing down to the earth along the give line.

Parameters
pointAThe starting point of the line.
pointBThe ending point of the line.
desiredSpacingThe 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 void makVrv::DtGeom3dLinesComponent::setLine ( const DtVector pointA,
const DtVector pointB,
LineHandle  handle 
)
virtual

Sets the points for a line. Adds the line if the given handle does not exist.

Parameters
pointAThe starting point of the line.
pointBThe ending point of the line.
handle- a handle to uniquely identify the line for updating and removal
virtual void makVrv::DtGeom3dLinesComponent::setHeightLineAtPoint ( const DtVector point,
LineHandle  handle 
)
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.

Parameters
pointThe starting point of the line.
handle- a handle to uniquely identify the line for updating and removal
virtual const DtVector& makVrv::DtGeom3dLinesComponent::lastPlacedHeightLinePoint ( ) const
virtual

Returns the point from the last call to setHeightLineAtPoint.

virtual void makVrv::DtGeom3dLinesComponent::removeLine ( LineHandle  handle)
virtual

Removes a line associated with the given handle. If the handle is not associated with any line, then nothing happens.

Parameters
handlea handle to uniquely identify the line for removal
virtual double makVrv::DtGeom3dLinesComponent::computeDownDistance ( const DtVector point) const
protectedvirtual

Computes this altitude to go down at the given point to to be below sea level.

virtual void makVrv::DtGeom3dLinesComponent::submitLines ( Dt3dLinesStagingBuffer buffer) const
protectedvirtual

Adds any active lines to the given buffer.

Parameters
bufferthe buffer to add lines to
void makVrv::DtGeom3dLinesComponent::computeCullingSphere ( DtVector3< double > &  center,
double radiusSquared 
) const
protected

non-virtual in inner loop Computes the culling sphere for all lines

Parameters
centerThe output center of the culling sphere
radiusSquaredThe output squared radius of the culling shpere

Friends And Related Function Documentation

friend class DtGeom3dLinesComponentCreator
friend

The creator requires access to protected methods.

friend class DtGeom3dLinesSystem
friend

The system requires access to some protected methods. Specifically the system should be the only class that calls (submitLines) and (computeCullingSphere).

Member Data Documentation

DtGeom3dLinesSystem& makVrv::DtGeom3dLinesComponent::mySystem
protected
DtModelSetId makVrv::DtGeom3dLinesComponent::myModelSetId
protected
std::vector<DtGeom3dLinesComponent::Line> makVrv::DtGeom3dLinesComponent::myLines
protected
std::map<LineHandle, DtGeom3dLinesComponent::Line> makVrv::DtGeom3dLinesComponent::myHandleLines
protected
DtVector makVrv::DtGeom3dLinesComponent::myLastPlacedPoint
protected
DtVector makVrv::DtGeom3dLinesComponent::myDown
protected
DtVector makVrv::DtGeom3dLinesComponent::myOrigin
protected
double makVrv::DtGeom3dLinesComponent::myOriginAlt
protected
float makVrv::DtGeom3dLinesComponent::myStartColor[4]
protected
float makVrv::DtGeom3dLinesComponent::myEndColor[4]
protected
DtVector3<double> makVrv::DtGeom3dLinesComponent::myBoundsMin
protected
DtVector3<double> makVrv::DtGeom3dLinesComponent::myBoundsMax
protected
bool makVrv::DtGeom3dLinesComponent::myBoundsValid
protected
DtGeom3dLinesComponent::CategoryFlags makVrv::DtGeom3dLinesComponent::myCategoryFlags
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)