![]() |
VR-Forces Developer's Guide
|
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 | |
| DtGeom3dSpheresComponent & | operator= (const DtGeom3dSpheresComponent &other)=delete |
| DtGeom3dSpheresComponent & | operator= (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 ¢er, 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 > ¢er, double &radiusSquared) const |
Protected Attributes | |
| DtGeom3dSpheresSystem & | mySystem |
| DtModelSetId | myModelSetId |
| std::vector < DtGeom3dSpheresComponent::Sphere > | mySpheres |
| std::map< SphereHandle, DtGeom3dSpheresComponent::Sphere > | myHandleSpheres |
| float | myColor [4] |
| DtVector3< double > | myBoundsMin |
| DtVector3< double > | myBoundsMax |
| bool | myBoundsValid |
| DtGeom3dSpheresComponent::CategoryFlags | myCategoryFlags |
Friends | |
| class | DtGeom3dSpheresComponentCreator |
| class | DtGeom3dSpheresSystem |
A handle type to identify individual spheres.
|
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 DtGeom3dSpheresComponentCreator.
|
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 spheres.
|
virtual |
Sets the current color applied when adding new spheres.
| r,g,b,a | color values in the range (0.0 - 1.0) |
|
virtual |
Gets the current color applied when adding new spheres.
|
virtual |
Sets the points for a line. Adds the line if the given handle does not exist.
| center | The center point of the sphere. |
| radius | The radius of the sphere. |
| handle | - a handle to uniquely identify the line for updating and removal |
|
virtual |
Removes the sphere associated with the given handle. If the handle is not associated with any sphere, then nothing happens.
| handle | a handle to uniquely identify the sphere for removal |
|
protectedvirtual |
Adds any active spheres to the given buffer.
| buffer | the buffer to add spheres to |
|
protected |
non-virtual in inner loop Computes the culling sphere for all spheres
| 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 (submitSpheres) and (computeCullingSphere).
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |