VR-Engage  2.2
Loading...
Searching...
No Matches
DtVortexStateRepository Class Reference

Detailed Description

Extends the ground vehicle state repository to provide specialized state management for entities using the Vortex physics engine. Includes support for location and heading change callbacks.

Note
Since version 5.0, this class no longer provides a copy constructor or assignment operator. Also, the constructor prototype has changed to remove the object type and parameters.

#include <vortexStateRepository.h>

Inheritance diagram for DtVortexStateRepository:
[legend]

Public Member Functions

 DtVortexStateRepository (DtLocalObject *vrfObject, const DtString &name, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVortexStateRepository () override
 
virtual DtString type () const override
 
virtual void place (const DtVector &location, const DtReal heading, bool clampToGroundFlag, bool *dataAvailable, bool requireAllData) override
 
virtual void addLocationChangedCallback (DtLocationCallbackFunction function, void *userData)
 
virtual void removeLocationChangedCallback (DtLocationCallbackFunction function, void *userData)
 
virtual void addHeadingChangedCallback (DtHeadingCallbackFunction function, void *userData)
 
virtual void removeHeadingChangedCallback (DtHeadingCallbackFunction function, void *userData)
 

Static Public Member Functions

static DtVrfObjectStateRepository * creator (const DtString &name, DtLocalObject *vrfObject, DtReaderWriterRegistry *parentRegistry)
 
static DtVortexStateRepositoryasVortexStateRepository (const DtVrfObjectStateRepository *repository)
 

Protected Attributes

DtLocationCallbackList myLocationCallbackList
 
DtHeadingCallbackList myHeadingCallbackList
 

Private Member Functions

 DtVortexStateRepository (const DtVortexStateRepository &orig)
 
const DtVortexStateRepositoryoperator= (const DtVortexStateRepository &orig)
 

Constructor & Destructor Documentation

◆ DtVortexStateRepository() [1/2]

DtVortexStateRepository::DtVortexStateRepository ( const DtVortexStateRepository & orig)
private

Copy constructor (private, not implemented)

References DtVortexStateRepository().

Referenced by asVortexStateRepository(), DtVortexStateRepository(), and operator=().

◆ DtVortexStateRepository() [2/2]

DtVortexStateRepository::DtVortexStateRepository ( DtLocalObject * vrfObject,
const DtString & name,
DtReaderWriterRegistry * parentRegistry = 0 )

Constructor.

Creates a new state repository with the specified parameters.

Parameters
vrfObjectThe VR-Forces object to associate with
nameName for the repository
parentRegistryOptional parent registry

◆ ~DtVortexStateRepository()

virtual DtVortexStateRepository::~DtVortexStateRepository ( )
overridevirtual

Destructor.

Member Function Documentation

◆ operator=()

const DtVortexStateRepository & DtVortexStateRepository::operator= ( const DtVortexStateRepository & orig)
private

Assignment operator (private, not implemented)

References DtVortexStateRepository().

◆ type()

virtual DtString DtVortexStateRepository::type ( ) const
overridevirtual

Gets the type of this repository.

Returns a unique string identifying the type of component, used as key in the state repository factory.

Returns
Type string "vortex-state-repository"

◆ creator()

static DtVrfObjectStateRepository * DtVortexStateRepository::creator ( const DtString & name,
DtLocalObject * vrfObject,
DtReaderWriterRegistry * parentRegistry )
static

Factory method to create new instances.

Returns a newly created instance of this class. To be registered with the state repository factory.

Parameters
nameName for the repository
vrfObjectThe VR-Forces object to associate with
parentRegistryOptional parent registry
Returns
Pointer to the new repository

◆ asVortexStateRepository()

static DtVortexStateRepository * DtVortexStateRepository::asVortexStateRepository ( const DtVrfObjectStateRepository * repository)
static

Safe type-checking conversion.

Returns the pointer to the repository if the repository passed in is of type DtVortexStateRepository, nullptr if not.

Parameters
repositoryRepository to cast
Returns
Typed pointer or nullptr if wrong type

References DtVortexStateRepository().

◆ place()

virtual void DtVortexStateRepository::place ( const DtVector & location,
const DtReal heading,
bool clampToGroundFlag,
bool * dataAvailable,
bool requireAllData )
overridevirtual

Places the entity at a new location and heading.

Positions the entity at the specified location and heading, then invokes all registered location and heading change callbacks.

Parameters
locationThe new position vector
headingThe new heading in radians
clampToGroundFlagWhether to clamp the entity to ground
dataAvailableOptional pointer to receive data availability status
requireAllDataWhether all data must be available

◆ addLocationChangedCallback()

virtual void DtVortexStateRepository::addLocationChangedCallback ( DtLocationCallbackFunction function,
void * userData )
virtual

Adds a location change callback.

Registers a function to be called when the entity's location changes. The callback will be invoked whenever the place() method is called.

Parameters
functionCallback function to add
userDataUser data to pass to the callback

◆ removeLocationChangedCallback()

virtual void DtVortexStateRepository::removeLocationChangedCallback ( DtLocationCallbackFunction function,
void * userData )
virtual

Removes a location change callback.

Unregisters a previously added location change callback.

Parameters
functionCallback function to remove
userDataUser data associated with the callback

◆ addHeadingChangedCallback()

virtual void DtVortexStateRepository::addHeadingChangedCallback ( DtHeadingCallbackFunction function,
void * userData )
virtual

Adds a heading change callback.

Registers a function to be called when the entity's heading changes. The callback will be invoked whenever the place() method is called.

Parameters
functionCallback function to add
userDataUser data to pass to the callback

◆ removeHeadingChangedCallback()

virtual void DtVortexStateRepository::removeHeadingChangedCallback ( DtHeadingCallbackFunction function,
void * userData )
virtual

Removes a heading change callback.

Unregisters a previously added heading change callback.

Parameters
functionCallback function to remove
userDataUser data associated with the callback

Member Data Documentation

◆ myLocationCallbackList

DtLocationCallbackList DtVortexStateRepository::myLocationCallbackList
protected

List of location change callbacks.

◆ myHeadingCallbackList

DtHeadingCallbackList DtVortexStateRepository::myHeadingCallbackList
protected

List of heading change callbacks.


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