NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgCompoundRigidSensorInfo Class Reference

#include <tgCompoundRigidSensorInfo.h>

Inheritance diagram for tgCompoundRigidSensorInfo:
Collaboration diagram for tgCompoundRigidSensorInfo:

Public Member Functions

 tgCompoundRigidSensorInfo ()
 
 ~tgCompoundRigidSensorInfo ()
 
virtual bool isThisMySenseable (tgSenseable *pSenseable)
 
virtual std::vector< tgSensor * > createSensorsIfAppropriate (tgSenseable *pSenseable)
 

Detailed Description

tgCompoundRigidSensorInfo is a sensor info class that creates sensors for compound rigid bodies. It creates a sensor for any tgSenseable object that: (1) is a tgModel with at least two descendants (2) at least two of the descendants, both of which can be cast to tgBaseRigids, have matching "compound_XXXXXX" tags See the implementation of these functions for more details about how many sensors are created. If used properly (e.g. this is the only tgCompoundRigidSensorInfo in the application), there should not be any redundant sensors created.

Definition at line 57 of file tgCompoundRigidSensorInfo.h.

Constructor & Destructor Documentation

tgCompoundRigidSensorInfo::tgCompoundRigidSensorInfo ( )

tgSensorInfo has an empty constructor. It does not contain any data.

Nothing to do in this constructor. A sensor info doesn't have any data.

Definition at line 54 of file tgCompoundRigidSensorInfo.cpp.

tgCompoundRigidSensorInfo::~tgCompoundRigidSensorInfo ( )

Similarly, its destructor should be empty.

Similarly, empty destructor.

Definition at line 61 of file tgCompoundRigidSensorInfo.cpp.

Member Function Documentation

std::vector< tgSensor * > tgCompoundRigidSensorInfo::createSensorsIfAppropriate ( tgSenseable pSenseable)
virtual

Similarly, create a sensor if appropriate. This class can make zero or more sensors via this method. An empty list will be returned if there are no available compounds in the passed-in model that are not in the blacklist. Otherwise, it will create an individual sensor for every compound that is not in the blacklist.

Parameters
[in]pSenseablepointer to a senseable object. Sensor will be created for this pSenseable.
Returns
zero or more new sensors.

Create a tgCompoundRigidSensor for a tgModel.

(1) Get the compound tags from within this tgModel. (2) Remove any compound tags that are in blacklist. (3) Create sensors for all remaining tags. (4) Blacklist the tags that were just now passed in to the sensor constructor.

Implements tgSensorInfo.

Definition at line 193 of file tgCompoundRigidSensorInfo.cpp.

Here is the call graph for this function:

bool tgCompoundRigidSensorInfo::isThisMySenseable ( tgSenseable pSenseable)
virtual

From tgSensorInfo, need to implement a check to see if a particular tgSenseable fits the criteria for making a compound rigid body sensor. This returns true iff the passed-in model has at least one compound, and that compound is not in the blacklist.

Parameters
[in]pSenseablea pointer to a tgSenseable object, that this sensor info may or may not be able to create a sensor for.
Returns
true if pSenseable is able to be sensed by the type of sensor that this sensor info creates.

This function returns true if pSenseable is a tgModel with: (1) at least two descendants (2) at least two of the descendants, both of which can be cast to tgBaseRigids, have matching "compound_XXXXXX" tags (3) at least one of the tags does NOT exist in the blacklist.

Implements tgSensorInfo.

Definition at line 145 of file tgCompoundRigidSensorInfo.cpp.

Here is the caller graph for this function:


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