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 Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Attributes
makVrv::DtDebugShapes Class Reference

This class can be used to help you visually debug lines and boxes.

You can access this class from DtRenderer (de.renderer().debugShapes()). It's expected that methods will only be called from the main thread. If other threads are needed in the future, we could extend this class with a multithread queue. Currently geometry will only be visible in stealth view. This could also be changed if needed by adding more DtGeom3dLinesComponent objects for each DtModelSetId, or by adding multiple versions of this class, accessable by the renderer, that take in the DtModelSetId.

The basic use of this class is to call one of the methods to add some geometry associated with a name. The geometry will render for the amount of time that you specify (default is 5.0 seconds). A simple case would be to add a line using the addLine method. All methods currently take in VRV "local" (not network) coordinates.

Classes

struct  BoxSet
 
struct  CaseInsensitiveUnorderedMap
 
struct  DtDebugBox
 
struct  DtDebugLine
 
struct  DtDebugMultiLine
 
struct  DtDebugSphere
 
struct  LineSet
 
struct  MultiLineSet
 
struct  SphereSet
 

Public Member Functions

virtual ~DtDebugShapes ()
 
 DtDebugShapes ()=delete
 
 DtDebugShapes (const DtDebugShapes &other)=delete
 
DtDebugShapesoperator= (const DtDebugShapes &other)=delete
 
void addLine (const char *name, const DtVector3< double > &point0, const DtVector3< double > &point1, const DtVector4< float > &color, float aliveTime=5.0f)
 
DtGeom3dLinesComponentaddMultiLine (const char *name, float aliveTime=5.0f)
 
void addBox (const char *name, const DtVector3< double > &center, const DtMatrix3< float > &rotation, const DtVector3< float > &size, const DtVector4< float > &color, float aliveTime=5.0f)
 
void addSphere (const char *name, const DtVector3< double > &center, float radius, const DtVector4< float > &color, float aliveTime=5.0f)
 

Protected Types

typedef std::unordered_map
< std::string, DtDebugLine,
CaseInsensitiveUnorderedMap::hash,
CaseInsensitiveUnorderedMap::comp
LineMap
 
typedef std::unordered_map
< std::string,
DtDebugMultiLine,
CaseInsensitiveUnorderedMap::hash,
CaseInsensitiveUnorderedMap::comp
MultiLineMap
 
typedef std::unordered_map
< std::string, DtDebugBox,
CaseInsensitiveUnorderedMap::hash,
CaseInsensitiveUnorderedMap::comp
BoxMap
 
typedef std::unordered_map
< std::string, DtDebugSphere,
CaseInsensitiveUnorderedMap::hash,
CaseInsensitiveUnorderedMap::comp
SphereMap
 

Protected Member Functions

 DtDebugShapes (DtDe &de)
 
virtual void updateLines (double timeStep)
 
virtual void updateMultiLines (double timeStep)
 
virtual void updateBoxes (double timeStep)
 
virtual void updateSpheres (double timeStep)
 
virtual void slot_preTick ()
 

Protected Attributes

DtDemyDe
 
DtSignalConnectionManager myConnections
 
double myLastSimulationTime
 
LineSet myLineSet
 
MultiLineSet myMultiLineSet
 
BoxSet myBoxSet
 
SphereSet mySphereSet
 

Private Attributes

friend DtDebugShapesCreator
 

Member Typedef Documentation

Constructor & Destructor Documentation

virtual makVrv::DtDebugShapes::~DtDebugShapes ( )
virtual
makVrv::DtDebugShapes::DtDebugShapes ( )
delete

Default Constructor not implemented.

makVrv::DtDebugShapes::DtDebugShapes ( const DtDebugShapes other)
delete

Copy Constructor not implemented - Copy not allowed.

makVrv::DtDebugShapes::DtDebugShapes ( DtDe de)
protected

Protected CTOR Create using DtDebugShapesCreator.

Member Function Documentation

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

Assignment Operator not implemented - Assignment not allowed.

void makVrv::DtDebugShapes::addLine ( const char name,
const DtVector3< double > &  point0,
const DtVector3< double > &  point1,
const DtVector4< float > &  color,
float  aliveTime = 5.0f 
)

Adds a line object to be rendered.

Parameters
nameThe name of the object
point0The start position of the line
point1The end position of the line
colorThe rgba (0.0 - 1.0) color of the line
aliveTimeHow long the object will be rendered
DtGeom3dLinesComponent* makVrv::DtDebugShapes::addMultiLine ( const char name,
float  aliveTime = 5.0f 
)

Adds a multiline object to be rendered. Resets the named object and returns the lines component for the user to fill in. The returned object should be considered temporary.

Parameters
nameThe name of the object
aliveTimeHow long the object will be rendered
void makVrv::DtDebugShapes::addBox ( const char name,
const DtVector3< double > &  center,
const DtMatrix3< float > &  rotation,
const DtVector3< float > &  size,
const DtVector4< float > &  color,
float  aliveTime = 5.0f 
)

Adds a box object to be rendered.

Parameters
nameThe name of the object
centerThe center position of the box
sizeThe size of the box in (x, y, z)
rotationThe rotation of the box
colorThe rgba (0.0 - 1.0) color of the box
aliveTimeHow long the object will be rendered
void makVrv::DtDebugShapes::addSphere ( const char name,
const DtVector3< double > &  center,
float  radius,
const DtVector4< float > &  color,
float  aliveTime = 5.0f 
)

Adds a sphere object to be rendered.

Parameters
nameThe name of the object
centerThe center position of the sphere
radiusThe radius of the sphere
colorThe rgba (0.0 - 1.0) color of the box
aliveTimeHow long the object will be rendered
virtual void makVrv::DtDebugShapes::updateLines ( double  timeStep)
protectedvirtual

Updates timouts for lines.

virtual void makVrv::DtDebugShapes::updateMultiLines ( double  timeStep)
protectedvirtual

Updates timouts for multilines.

virtual void makVrv::DtDebugShapes::updateBoxes ( double  timeStep)
protectedvirtual

Updates timouts for boxes.

virtual void makVrv::DtDebugShapes::updateSpheres ( double  timeStep)
protectedvirtual

Updates timouts for spheres.

virtual void makVrv::DtDebugShapes::slot_preTick ( )
protectedvirtual

Pre tick function. This is currently used to flush invalid camera's.

Member Data Documentation

friend makVrv::DtDebugShapes::DtDebugShapesCreator
private
DtDe& makVrv::DtDebugShapes::myDe
protected
DtSignalConnectionManager makVrv::DtDebugShapes::myConnections
protected
double makVrv::DtDebugShapes::myLastSimulationTime
protected
LineSet makVrv::DtDebugShapes::myLineSet
protected
MultiLineSet makVrv::DtDebugShapes::myMultiLineSet
protected
BoxSet makVrv::DtDebugShapes::myBoxSet
protected
SphereSet makVrv::DtDebugShapes::mySphereSet
protected

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

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)