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

A class responsible for processing DtGeom3dSpheresComponent objects.

This class does not own any components, it only processes components that are registered with it. The concept is that components are processed in one place so that opens up opportunities to burst multi-thread operations, and do things as a "system" such as turning on/off the entire system for specific operations.

To use a component with this system, call createComponent(). The caller is responsible for freeing the component. The caller does not have to register/unresister the component with this system as it is done automatically be the component itself.

You can access this system from DtRenderer.

Classes

struct  Buffer
 
struct  CullJobData
 
struct  PerCameraStaging
 
struct  PerModelSetComponents
 

Public Member Functions

virtual ~DtGeom3dSpheresSystem ()
 
 DtGeom3dSpheresSystem ()=delete
 
 DtGeom3dSpheresSystem (const DtGeom3dSpheresSystem &other)=delete
 
DtGeom3dSpheresSystemoperator= (const DtGeom3dSpheresSystem &other)=delete
 
virtual DtGeom3dSpheresComponentcreateComponent (DtModelSetId modelSet)
 
virtual void registerComponent (DtGeom3dSpheresComponent *component)
 
virtual void unregisterComponent (DtGeom3dSpheresComponent *component)
 
virtual size_t registeredComponentCount (const DtModelSetId modelSetId) const
 
virtual bool cull (void *cameraContext, const DtModelSetId modelSetId, const DtVector &cameraPos, const Frustum_64 &frustum)
 
virtual void submit3dSpheresForDraw (void *cameraContext, std::vector< Dt3dSpheresStagingBuffer * > &buffers)
 

Protected Member Functions

 DtGeom3dSpheresSystem (DtDe &de)
 
virtual void slot_preTick ()
 

Static Protected Member Functions

static bool isSphereVisible (const std::array< DtVector4< double >, 6 > &cullingPlanes, const DtVector3< double > &center, double radiusSquared)
 
static void theCullJob (void *data)
 

Protected Attributes

DtDemyDe
 
DtSignalConnectionManager myConnections
 
unsigned int myComponentCategoryFlags
 
std::unordered_map
< DtModelSetId,
PerModelSetComponents * > 
myPerModelSetComponents
 
std::unordered_map< void
*, PerCameraStaging * > 
myPerCameraStagingMap
 
tbb::concurrent_vector< void * > myPendingCameras
 

Private Attributes

friend DtGeom3dSpheresSystemCreator
 

Constructor & Destructor Documentation

virtual makVrv::DtGeom3dSpheresSystem::~DtGeom3dSpheresSystem ( )
virtual
makVrv::DtGeom3dSpheresSystem::DtGeom3dSpheresSystem ( )
delete

Default Constructor not implemented.

makVrv::DtGeom3dSpheresSystem::DtGeom3dSpheresSystem ( const DtGeom3dSpheresSystem other)
delete

Copy Constructor not implemented - Copy not allowed.

makVrv::DtGeom3dSpheresSystem::DtGeom3dSpheresSystem ( DtDe de)
protected

Protected CTOR Create using DtGeom3dSpheresSystemCreator.

Member Function Documentation

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

Assignment Operator not implemented - Assignment not allowed.

virtual DtGeom3dSpheresComponent* makVrv::DtGeom3dSpheresSystem::createComponent ( DtModelSetId  modelSet)
virtual

Creates and returns a component that is compatible with this system. The component will register itself with this system on creation. The component will un-register itself with this system on destruction. The system does not own the component. The caller of this createComponent() method will own the component and should destroy it when done with it. modelSet the modelset to associate with the component (see DtModelSetEnums.h)

virtual void makVrv::DtGeom3dSpheresSystem::registerComponent ( DtGeom3dSpheresComponent component)
virtual

Registers the given component with this system. The system does not own the component. The system will perform operations on the component while it is registered.

virtual void makVrv::DtGeom3dSpheresSystem::unregisterComponent ( DtGeom3dSpheresComponent component)
virtual

Un-Registers the given component with this system. The system does not own the component.

virtual size_t makVrv::DtGeom3dSpheresSystem::registeredComponentCount ( const DtModelSetId  modelSetId) const
virtual

Returns the number of registered components for a specific model set.

Parameters
modelSetIdthe model set to check for (see DtModelSetEnums.h)
virtual bool makVrv::DtGeom3dSpheresSystem::cull ( void *  cameraContext,
const DtModelSetId  modelSetId,
const DtVector cameraPos,
const Frustum_64 frustum 
)
virtual

Culls the 3d spheres and prepares per camera context staging. Returns true is something is visible. This method can be called multi-threaded if the cameraContext is different for each calling thread.

Parameters
cameraContexta context that can be used to associate a specific camera with a set of culled data
modelSetIdthe model set to cull for (see DtModelSetEnums.h)
cameraPosthe camera position
frustumthe frustum to cull against
virtual void makVrv::DtGeom3dSpheresSystem::submit3dSpheresForDraw ( void *  cameraContext,
std::vector< Dt3dSpheresStagingBuffer * > &  buffers 
)
virtual

Fills the 3d spheres buffer for all non-culled components. Gathers buffers to draw that contain active spheres.

Parameters
cameraContexta context that can be used to associate a specific camera with a set of culled data
buffers(out) the resulting staging buffers to render
virtual void makVrv::DtGeom3dSpheresSystem::slot_preTick ( )
protectedvirtual

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

static bool makVrv::DtGeom3dSpheresSystem::isSphereVisible ( const std::array< DtVector4< double >, 6 > &  cullingPlanes,
const DtVector3< double > &  center,
double  radiusSquared 
)
staticprotected

non-virtual for inner loop Checks to see if the given sphere is visible in the culling planes. Returns true if visible. Calculations are in world (vantage space).

Parameters
cullingPlanesthe culling planes
centerthe center of the sphere
radiusSquaredthe sphere radius squared
static void makVrv::DtGeom3dSpheresSystem::theCullJob ( void *  data)
staticprotected

A cull job function used as a callback for job splitting. This is an internal function called from a tbb::parallel_for.

Member Data Documentation

friend makVrv::DtGeom3dSpheresSystem::DtGeom3dSpheresSystemCreator
private
DtDe& makVrv::DtGeom3dSpheresSystem::myDe
protected
DtSignalConnectionManager makVrv::DtGeom3dSpheresSystem::myConnections
protected
unsigned int makVrv::DtGeom3dSpheresSystem::myComponentCategoryFlags
protected
std::unordered_map<DtModelSetId, PerModelSetComponents*> makVrv::DtGeom3dSpheresSystem::myPerModelSetComponents
protected
std::unordered_map<void*, PerCameraStaging*> makVrv::DtGeom3dSpheresSystem::myPerCameraStagingMap
protected
tbb::concurrent_vector<void*> makVrv::DtGeom3dSpheresSystem::myPendingCameras
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)