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::DtGeom3dSpheresComponent Class Reference

A class which represents a component for a set of 3d spheres.

This is part of a component/system concept. See DtGeom3dSpheresSystem for more details.

This component can be used to render arbitrary spheres (setSphere). setSphere allows a user hande to be associated with a sphere. The user handle can then be used to remove or update the specific sphere associated with the handle. The component can be used to add as many spheres as desired.

You can use one of these components by getting the system from DtRenderer, and then call createComponent() on the system (DtGeom3dSpheresSystem).

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  Sphere
 

Public Types

enum  CategoryFlags : unsigned int { CategoryFlags::CategoryFlagsTracks = 0x0001, CategoryFlags::CategoryFlagsRoutes = 0x0002, CategoryFlags::CategoryFlagsAll = 0xFFFF }
 
typedef int SphereHandle
 

Public Member Functions

virtual ~DtGeom3dSpheresComponent ()
 
 DtGeom3dSpheresComponent ()=delete
 
 DtGeom3dSpheresComponent (const DtGeom3dSpheresComponent &other)=delete
 
 DtGeom3dSpheresComponent (const DtGeom3dSpheresComponent &&other)=delete
 
DtGeom3dSpheresComponentoperator= (const DtGeom3dSpheresComponent &other)=delete
 
DtGeom3dSpheresComponentoperator= (const DtGeom3dSpheresComponent &&other)=delete
 
virtual const DtModelSetId modelSetId () const
 
virtual void setCategoryFlags (DtGeom3dSpheresComponent::CategoryFlags flags)
 
virtual const
DtGeom3dSpheresComponent::CategoryFlags 
categoryFlags () const
 
virtual void clearSpheres ()
 
virtual void setCurrentColor (float r, float g, float b, float a)
 
virtual const DtVector4< float > currentColor () const
 
virtual void setSphere (const DtVector &center, float radius, SphereHandle handle)
 
virtual void removeSphere (SphereHandle handle)
 

Protected Member Functions

 DtGeom3dSpheresComponent (DtGeom3dSpheresSystem &system, DtModelSetId modelSetId)
 
virtual void submitSpheres (Dt3dSpheresStagingBuffer *buffer) const
 
void computeCullingSphere (DtVector3< double > &center, double &radiusSquared) const
 

Protected Attributes

DtGeom3dSpheresSystemmySystem
 
DtModelSetId myModelSetId
 
std::vector
< DtGeom3dSpheresComponent::Sphere
mySpheres
 
std::map< SphereHandle,
DtGeom3dSpheresComponent::Sphere
myHandleSpheres
 
float myColor [4]
 
DtVector3< doublemyBoundsMin
 
DtVector3< doublemyBoundsMax
 
bool myBoundsValid
 
DtGeom3dSpheresComponent::CategoryFlags myCategoryFlags
 

Friends

class DtGeom3dSpheresComponentCreator
 
class DtGeom3dSpheresSystem
 

Member Typedef Documentation

A handle type to identify individual spheres.

Member Enumeration Documentation

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

Enumerator
CategoryFlagsTracks 
CategoryFlagsRoutes 
CategoryFlagsAll 

Constructor & Destructor Documentation

virtual makVrv::DtGeom3dSpheresComponent::~DtGeom3dSpheresComponent ( )
virtual

Destructor.

makVrv::DtGeom3dSpheresComponent::DtGeom3dSpheresComponent ( )
delete

Default Constructor not implemented - not allowed.

makVrv::DtGeom3dSpheresComponent::DtGeom3dSpheresComponent ( const DtGeom3dSpheresComponent other)
delete

Copy Constructor not implemented - Copy not allowed.

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

Move Constructor not implemented - Move not allowed.

makVrv::DtGeom3dSpheresComponent::DtGeom3dSpheresComponent ( DtGeom3dSpheresSystem system,
DtModelSetId  modelSetId 
)
protected

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

Member Function Documentation

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

Assignment Operator not implemented - Assignment not allowed.

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

Move assignment Operator not implemented - Move assignment not allowed.

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

Returns the model set that this component was created for.

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

Returns the category flags. (see setCategoryFlags)

virtual void makVrv::DtGeom3dSpheresComponent::clearSpheres ( )
virtual

Clears all spheres.

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

Sets the current color applied when adding new spheres.

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

Gets the current color applied when adding new spheres.

virtual void makVrv::DtGeom3dSpheresComponent::setSphere ( const DtVector center,
float  radius,
SphereHandle  handle 
)
virtual

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

Parameters
centerThe center point of the sphere.
radiusThe radius of the sphere.
handle- a handle to uniquely identify the line for updating and removal
virtual void makVrv::DtGeom3dSpheresComponent::removeSphere ( SphereHandle  handle)
virtual

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

Parameters
handlea handle to uniquely identify the sphere for removal
virtual void makVrv::DtGeom3dSpheresComponent::submitSpheres ( Dt3dSpheresStagingBuffer buffer) const
protectedvirtual

Adds any active spheres to the given buffer.

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

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

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

Friends And Related Function Documentation

friend class DtGeom3dSpheresComponentCreator
friend

The creator requires access to protected methods.

friend class DtGeom3dSpheresSystem
friend

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

Member Data Documentation

DtGeom3dSpheresSystem& makVrv::DtGeom3dSpheresComponent::mySystem
protected
DtModelSetId makVrv::DtGeom3dSpheresComponent::myModelSetId
protected
std::vector<DtGeom3dSpheresComponent::Sphere> makVrv::DtGeom3dSpheresComponent::mySpheres
protected
std::map<SphereHandle, DtGeom3dSpheresComponent::Sphere> makVrv::DtGeom3dSpheresComponent::myHandleSpheres
protected
float makVrv::DtGeom3dSpheresComponent::myColor[4]
protected
DtVector3<double> makVrv::DtGeom3dSpheresComponent::myBoundsMin
protected
DtVector3<double> makVrv::DtGeom3dSpheresComponent::myBoundsMax
protected
bool makVrv::DtGeom3dSpheresComponent::myBoundsValid
protected
DtGeom3dSpheresComponent::CategoryFlags makVrv::DtGeom3dSpheresComponent::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)