VR-Forces 5.0.3 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 Attributes | Private Member Functions
DtObjectSensor Class Reference

DtObjectSensor is a base level sensor component.

End User Description: Manages a filtered list of detectable targets, as specified in the descriptor, and sets up infrastructure for specific sensor types to run their algorithms on the list. Manages sending of sensor data to the GUI though messages. Manages sensor geometry. Configuring a DtObjectSensor on an entity will cause it to detect all entities of types specified in the descriptor within the geometric region specified by the sensor geometry. No tests for terrain obstruction or sensor signatures will be done. For this functionality, use a DtSignatureObjectSensor.

Uses Descriptor Type: DtObjectSensorDescriptor.

Inheritance diagram for DtObjectSensor:
Inheritance graph
[legend]

Classes

struct  DtProcessObjectsState
 

Public Types

enum  ContinueDetectingResult { DetectionLost = 0, DetectionContinued = 1, DetectionMissed = 2 }
 
- Public Types inherited from DtReaderWriter
typedef std::vector
< DtSymbolString
aliasContainer
 
typedef std::vector
< DtSymbolString >::iterator 
aliasIter
 
typedef std::vector
< DtSymbolString >
::const_iterator 
aliasConstIter
 
typedef std::vector< DtFilename > SearchPaths
 
typedef std::pair
< DtSymbolString, DtString
DtVariableNameType
 
typedef DtReaderWriterFactory *(* DtReaderWriterFactoryCreatorFcn )()
 

Public Member Functions

 DtObjectSensor (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtObjectSensor ()
 
virtual bool init ()
 
virtual bool postAddComponentsInit ()
 
virtual void preFirstTickInit ()
 
virtual const chartype () const
 
virtual void tick ()
 
virtual bool tickWhileDestroyed () const
 
virtual int sensorType () const
 
virtual void enable ()
 
virtual void disable ()
 
virtual void setIsEnabled (bool yesNo)
 
virtual void setTypesToDetectForTask (const DtRwObjectTypeList &objectTypes)
 
virtual void clearTypesToDetectForTask ()
 
virtual const DtRwObjectTypeListtypesToDetectForTask () const
 
- Public Member Functions inherited from DtSimComponent
 DtSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtSimComponent ()
 
virtual void setParentSystem (DtComponentSystem *system)
 
DtComponentSystemparentSystem () const
 
virtual void registerAttributeFunctions ()
 
virtual void postTick ()
 
virtual void timedTick ()
 
virtual void setMinTickPeriod (double minTickPeriod)
 
virtual double minTickPeriod () const
 
virtual void setMinTickPeriodVariance (double minTickPeriodVariance)
 
virtual double minTickPeriodVariance () const
 
virtual void setNextTickTime (double nextTickTime)
 
virtual double nextTickTime () const
 
virtual double calculateNextTickTime () const
 
virtual double calculateFirstTickTime () const
 
virtual void setEntity (DtLocalObject *entity)
 
virtual DtSimComponentnextComponent ()
 
virtual DtSimComponentprevComponent ()
 
virtual void setListItem (DtListItem *item)
 
virtual DtListItem * listItem ()
 
virtual void putData (std::string &fp, int indentLevel=0)
 
virtual DtlObjPtr getData (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
 
virtual void addInputPort (DtInputPort *port)
 
virtual void removeInputPort (DtInputPort *port)
 
virtual DtInputPortlookupInputPort (const DtString &portName)
 
virtual DtList inputPortList () const
 
virtual void addOutputPort (DtOutputPort *port)
 
virtual void removeOutputPort (DtOutputPort *port)
 
virtual DtOutputPortlookupOutputPort (const DtString &portName)
 
virtual DtList outputPortList () const
 
virtual void addInputPortGroup (DtInputPortGroup *group)
 
virtual void removeInputPortGroup (DtInputPortGroup *group)
 
virtual DtInputPortGrouplookupInputPortGroup (const DtString &groupName)
 
virtual DtList inputPortGroupList () const
 
virtual void addOutputPortGroup (DtOutputPortGroup *group)
 
virtual void removeOutputPortGroup (DtOutputPortGroup *group)
 
virtual DtOutputPortGrouplookupOutputPortGroup (const DtString &groupName)
 
virtual DtList outputPortGroupList () const
 
virtual int priority () const
 
virtual void setPriority (int priority)
 
double dT () const
 
virtual void setDT (double deltaT)
 
virtual void setComponentDescriptor (DtComponentDescriptor *componentDescriptor)
 
virtual const
DtComponentDescriptor
componentDescriptor () const
 
DtVrfProcessStateRepositoryManagerpsrManager ()
 
virtual const DtSymbolStringcomponentFullName () const
 
DtPhysicalWorldphysicalWorld ()
 
const DtPhysicalWorldphysicalWorld () const
 
const DtAttachedTerrainterrainAttachedTo () const
 
DtLocalObjectentity ()
 
const DtLocalObjectentity () const
 
DtSimulationServicessimulationServices ()
 
const DtSimulationServicessimulationServices () const
 
const Coordinate_SystemcoordinateSystem () const
 
virtual bool taskVisualizationsActive () const
 
virtual bool taskVisualizationsEnabled () const
 
virtual void onRestore ()
 
makVrf::DtTaskVisualizationMaptaskVisualizations ()
 
virtual bool isEnabled ()
 
virtual DtOutputStream & objectConsoleDebug (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleVerbose (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleInfo (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleWarn (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleError (const DtString &channel="") const
 
virtual int notifyLevel () const
 
virtual DtSimResourceManagerresourceManager ()
 
virtual const
DtSimResourceManager
resourceManager () const
 
VRF4API_METHOD const
DtSimulationServices
simManager () const
 
- Public Member Functions inherited from DtReaderWriter
 DtReaderWriter ()
 
 DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtReaderWriter &, DtReaderWriterRegistry *parentRegistry=NULL)
 
const DtReaderWriteroperator= (const DtReaderWriter &orig)
 
bool operator== (const DtReaderWriter &) const
 
bool operator!= (const DtReaderWriter &rhs)
 
virtual ~DtReaderWriter ()
 
virtual void putSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual void postPutSelf ()
 
virtual void prePutSelf ()
 
virtual void getSelf (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
virtual void postGetSelf ()
 
virtual void preGetSelf ()
 
virtual void writeSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual DtSymbolString name () const
 
virtual void addAlias (const DtSymbolString &alias)
 
virtual void addAlias (const DtString &alias)
 
virtual bool hasAlias (const DtSymbolString &alias)
 
virtual const aliasContaineraliases () const
 
virtual void setReadonly (bool flag)
 
bool isReadonly () const
 
virtual void reset ()
 
virtual int alignment () const
 
virtual bool variableIsBound () const
 
virtual void unbindVariable ()
 
virtual void setName (const DtString &)
 
virtual const charreaderWriterType () const
 
virtual const charxmlType () const
 
virtual DtString prettyPrint () const
 
std::string debugText () const
 
virtual void bindVariables (DtVariableBindingsList variableBindings)
 
virtual std::list
< DtVariableNameType
unboundVariables () const
 
bool invalid () const
 
virtual bool hasChild (const DtReaderWriter *p) const
 
virtual bool hasVariableReference () const
 
virtual void bindLocalVariables (const DtVariableBindingsList &variableBindings)
 
virtual void recordUpdateTime () const
 
virtual bool wasUpdatedSince (DtTime t) const
 
virtual bool changedSinceLastChecked ()
 
virtual bool peekChangedSinceLastChecked () const
 
virtual void setValueSpecified (bool specified, bool recurse=false)
 
virtual bool valueSpecified () const
 
virtual bool isVariableReference () const
 
virtual void setIsVariableReference (bool value)
 
virtual void clearAllVariableReferenceFlags ()
 
virtual DtSymbolString variableName () const
 
virtual void setVariableName (const DtSymbolString variableName)
 
virtual const DtReaderWriterdefaultRWValue () const
 
virtual DtReaderWriterdefaultRWValue ()
 
virtual void setDefaultRWValue (DtReaderWriter *)
 
virtual bool checkAndSetDefaultRWValue (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
const DtReaderWriterRegistryregistry () const
 
DtReaderWriterRegistryregistry ()
 
virtual DtPropertyInterfaceproperty ()
 
virtual const DtPropertyInterfaceproperty () const
 
virtual DtString toXml () const
 
virtual DtRwVariableBindingsgenerateVariableBindings () const
 
virtual bool toXml (const DtFilename &) const
 
virtual bool fromXml (const DtString &)
 
virtual bool fromXmlFile (const DtFilename &)
 
virtual void putSelf (DtEnvironmentSP, DtEnvValueSP parent) const
 
virtual void putData (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void putVariableReference (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void getSelf (const DtEnvironmentSP, const DtEnvValueSP root, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void getData (const DtEnvironmentSP, const DtEnvValueSP, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void unrecognizedItem (const DtEnvironmentSP env, const DtEnvValueSP root, const SearchPaths &searchPaths, const DtVariableBindingsList &varBindings)
 
virtual void getVariableReference (DtEnvironmentSP, DtEnvValueSP value)
 

Protected Attributes

DtManagedObjectListConstPtr myDetectableObjectList
 
const DtObjectSensorDescriptormyObjectSensorDescriptor
 
DtObjectSensorPSRmyProcessState
 
DtObjectSensorMonitormyMonitor
 
DtSpatialFilterEvaluatormySensorGeometryEvaluator
 
DtForceType myForceType
 
const DtSimObjectmyMutableObjectCached
 
bool myMutableObjectRangeCalculated
 
double myMutableObjectRangeCache
 
bool myMutableObjectRangeSquaredCalculated
 
double myMutableObjectRangeSquaredCache
 
bool myGeometrySetup
 
bool myPrep_invokeNewContactCallbacks
 
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
 
DtBoost::shared_ptr
< DtProcessObjectsState
myProcessObjectsState
 
Ports and Port Groups
DtSensorContactListOutputPortmyDetectedObjectListPort
 
DtObjectTypesListMultiInputPortmyObjectsToDetectInputPort
 
DtInputPortGroupmySensorOffsetInputPortGroup
 
DtOrientationInputPortmyOrientationInputPort
 
DtVectorInputPortmyPositionInputPort
 
DtStringInputPortmyTargetObjectInputPort
 
DtVectorInputPortmyTargetLocationInputPort
 
DtIntegerInputPortmyTrackingModeInputPort
 
DtBooleanInputPortmyTargetAcquiredInputPort
 
- Protected Attributes inherited from DtSimComponent
DtLocalObjectmyEntity
 
DtComponentSystemmySystem
 
DtListItem * myListItem
 
DtInputPortMap myInputPortList
 
DtOutputPortMap myOutputPortList
 
DtInputPortGroupMap myInputPortGroupList
 
DtOutputPortGroupMap myOutputPortGroupList
 
int myPriority
 
double myMinTickPeriod
 
double myMinTickPeriodVariance
 
double myNextTickTime
 
double myLastTickSimTime
 
double myDT
 
bool myIsEnabled
 
bool myFirstTick
 
const DtComponentDescriptormyComponentDescriptor
 
std::list
< DtVrfProcessStateRepository * > 
myComponentPsrs
 
bool myTickEveryFrame
 
makVrf::DtTaskVisualizationMap myTaskVisualizations
 
double myNextTaskVisTickTime
 
DtSymbolString myFullComponentName
 
DtSimulationServicesmySimServices
 
DtPredicateCallbackManager myPredicateCallbackManager
 
- Protected Attributes inherited from DtReaderWriter
const DtSymbolString myName
 
DtReaderWriterRegistry myRegistry
 
DtReaderWriterRegistrymyParentRegistry
 
bool myValueSpecified
 
bool myReadOnlyFlag
 
bool myIsVariableReference
 
DtSymbolString myVariableName
 
bool myVariableIsBound
 
DtReaderWritermyDefaultValue
 
aliasContainer myAliases
 
bool myInvalid
 
bool myChangedFlag
 

Private Member Functions

 DtObjectSensor ()
 
 DtObjectSensor (const DtObjectSensor &orig)
 
const DtObjectSensoroperator= (const DtObjectSensor &orig)
 
virtual bool setTypesToDetectAttribute (DtReaderWriter *val)
 
static bool setTypesToDetectAttribute (void *ctrlr, DtReaderWriter *val)
 
virtual bool clearTypesToDetect (DtReaderWriter *val)
 
static bool clearTypesToDetect (void *ctrlr, DtReaderWriter *val)
 
virtual DtReaderWritergetSensorPositionAttribute ()
 
virtual void setSensorEnabled (bool enabled)
 
virtual bool sensorEnabled () const
 
static DtReaderWritergetSensorPositionAttribute (void *ctrlr)
 
static DtSimComponentcreator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual bool createPortGroups ()
 
virtual bool createPorts ()
 
virtual DtObjectSensorPSRcreatePSR ()
 
virtual const chardefaultPSRType () const
 
virtual void initSensorRangeRing ()
 
virtual void updateDetectableObjectsList ()
 
virtual bool initSensorGeometry ()
 
virtual void setupGeometryForDetection ()
 
virtual DtVector localSensorPosition () const
 
virtual DtVector bodySensorPosition () const
 
virtual DtTaitBryan localSensorOrientation () const
 
virtual DtTaitBryan bodySensorOrientation () const
 
virtual DtUUID targetObject () const
 
virtual DtVector targetLocation () const
 
virtual DtSensorTrackingMode trackingMode () const
 
virtual void processObjects ()
 
virtual void processObjectsSlice (const DtInterruptFlag &timer)
 
virtual bool detectObject (DtSimObjectReference object, DtRwSensorContactInfo *contactInfo)
 
virtual ContinueDetectingResult continueDetectingObject (DtSimObjectReference object, DtRwSensorContactInfo *contactInfo, bool &contactInfoModified)
 
virtual bool objectWithinSensorGeometry (const DtSimObject *object) const
 
virtual bool sensorGeometryExtent (DtExtent &extent) const
 
virtual double rangeSquaredToObject (const DtSimObject *object) const
 
virtual double rangeToObject (const DtSimObject *object) const
 
virtual void clearObjectRangeCache () const
 
virtual void printTargets () const
 
virtual void updateDetectedObjectListPort ()
 
virtual bool createAndInitSensorMonitor ()
 
virtual bool objectInDetectableList (const DtSimObject *) const
 
virtual void processHostilitiesChanged (DtU8 force)
 
virtual DtTaitBryan worldOrientationOfObject (const DtSimObject *object) const
 
virtual bool canDetectForceOfObject (const DtSimObject *)
 
virtual void processSetSensorEnabledRequestMessage (DtSimMessage *msg)
 
virtual void notifyContactsChanged ()
 
static void hostilitiesChangedCallback (DtU8 force, void *usr)
 
static void setSensorEnabledRequestCallback (DtSimMessage *msg, void *usrData)
 

Additional Inherited Members

- Static Public Member Functions inherited from DtSimComponent
static DtSimComponentFactoryfactory ()
 
static void setFactory (DtSimComponentFactory *factory)
 
static DtSimComponentcreateComponent (const DtString &name, const DtString &type, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentSystem *parentSystem, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
static void addSimComponentCreatorFcn (const DtString &type, DtSimComponentCreatorFcn fcn)
 
static VRF4API_METHOD
DtSimComponent
MarkThreadSafe (DtSimComponent *comp)
 
- Static Public Member Functions inherited from DtReaderWriter
static void putIndent (std::string &fp, int indentLevel)
 
static const
DtVariableBindingsList
nullVariableReference ()
 
static void setPostGetSelfCallback (DtGetSelfCallbackFcn fcn, void *usrData)
 
static void setPrePutSelfCallback (DtPutSelfCallbackFcn fcn, void *usrData)
 
static void setPutIndent (bool)
 
static bool putIndent ()
 
static const chartheXmlType ()
 
static const DtFilename & appPath ()
 
static void setFactoryCreatorFunction (DtReaderWriterFactoryCreatorFcn fcn)
 
static void createReaderWriterFactory ()
 
static void cleanupFactory ()
 
static DtReaderWriterFactoryfactory ()
 
static void setOutputStream (DtOutputStream *stream)
 
static DtOutputStream & outputStream ()
 
static DtReaderWritercreateFromXmlFile (const DtFilename &, bool createAsProperty=false)
 
static DtReaderWritercreateFromXml (const DtString &, bool createAsProperty=false)
 
static DtReaderWritercreateFromEnvironment (DtEnvironmentSP, bool createAsProperty=false)
 
static DtString getAttribute (DtEnvironmentSP env, const DtString &name, DtEnvValueSP root)
 
- Protected Types inherited from DtSimComponent
typedef std::map< DtString,
DtInputPort * > 
DtInputPortMap
 
typedef std::map< DtString,
DtOutputPort * > 
DtOutputPortMap
 
typedef std::map< DtString,
DtInputPortGroup * > 
DtInputPortGroupMap
 
typedef std::map< DtString,
DtOutputPortGroup * > 
DtOutputPortGroupMap
 
- Protected Member Functions inherited from DtSimComponent
virtual double computeCurrentTime ()
 
bool testInvariant () const
 
DtVrfProcessStateRepositorycreateComponentPsr (const DtString &defaultPsrType, const DtString &defaultPsrName, bool useDescriptorParams=true)
 
virtual void updateTaskVisualizations ()
 
virtual void destroyTaskVisualizations ()
 
virtual void destroyTaskVisualization (const DtString &name)
 
virtual
makVrf::DtPointTaskVisualizationPtr 
pointTaskVisualization (const DtString &name)
 
virtual
makVrf::DtLineTaskVisualizationPtr 
lineTaskVisualization (const DtString &name)
 
virtual
makVrf::DtAreaTaskVisualizationPtr 
areaTaskVisualization (const DtString &name)
 
virtual
makVrf::DtTextTaskVisualizationPtr 
textTaskVisualization (const DtString &name)
 
double calculateNextTaskVisTickTime () const
 
DtVrfObjectStateRepositorylocalStateRepository ()
 
const DtVrfObjectStateRepositorylocalStateRepository () const
 
void addSimObjectPredicateCallback (DtSimObjectReference, DtVrfObjectPredicateCallbackFunction function, const DtVrfObjectPredicate &predicate, DtTime evaluationPeriod=0, void *userData=0)
 
void removeSimObjectPredicateCallback (const DtSimObject *, DtVrfObjectPredicateCallbackFunction function, const DtVrfObjectPredicate &predicate, DtTime evaluationPeriod=0, void *userData=0)
 
void invokeSimObjectPredicateCallbacks ()
 
virtual void clearPredicateCallbacks ()
 
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 
- Static Protected Attributes inherited from DtSimComponent
static DtSimComponentFactorymyFactory
 
- Static Protected Attributes inherited from DtReaderWriter
static DtString theUnspecifiedValue
 
static DtGetSelfCallbackInfo thePostGetSelfCallback
 
static DtPutSelfCallbackInfo thePrePutSelfCallback
 
static const DtVariableBindingsList theEmptyVariableBindingsList
 
static bool theCreatorFcnSet
 
static DtReaderWriterFactorytheFactory
 
static
DtReaderWriterFactoryCreatorFcn 
theFactoryCreatorFcn
 
static bool thePutIndent
 
static DtOutputStream * theOutputStream
 

Member Enumeration Documentation

Enumerator
DetectionLost 
DetectionContinued 
DetectionMissed 

Constructor & Destructor Documentation

DtObjectSensor::DtObjectSensor ( )
private

default constructor; not implemented

DtObjectSensor::DtObjectSensor ( const DtObjectSensor orig)
private

copy constructor; not implemented

DtObjectSensor::DtObjectSensor ( const DtString name,
DtLocalObject owner,
DtSimulationServices simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)

Parameters
nameReader writer name of this component.
ownerThe DtLocalObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
virtual DtObjectSensor::~DtObjectSensor ( )
virtual

destructor

Member Function Documentation

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

assignment operator; not implemented

virtual bool DtObjectSensor::init ( )
virtual

Calls createPSR(), createDetectableObjectList(), createAndInitSensorMonitor() and initSensorGeometry(). This must be called after construction and before the sensor is used on an entity.

Reimplemented from DtSimComponent.

Reimplemented in DtRadarObjectSensor, DtSignatureObjectSensor, DtPassiveSonarSensor, DtSearchRescueSensor, DtActiveSonarSensor, DtNbcSensor, and DtEngineeringObjectSensor.

virtual bool DtObjectSensor::postAddComponentsInit ( )
virtual

Called after all components have been created, initialized and added to the component manager. Ensures output ports have been activated and pre-populated before any other components looks for the data on their input ports.

Reimplemented from DtSimComponent.

virtual void DtObjectSensor::preFirstTickInit ( )
virtual

Initializes the component before it is ticked for the first time. It is called by timedTick if myFirstTick is true.

Reimplemented from DtSimComponent.

Reimplemented in DtActiveSonarSensor, DtRadarObjectSensor, and DtSearchRescueSensor.

virtual const char* DtObjectSensor::type ( ) const
virtual

Returns a string identifies the class type of component. Type values are defined in compTypes.h. DtSimComponent creation functions are registered with the DtSimComponentFactory using the type values as the key. Warning: this function should always return the same pointer and it should be valid forever. This means the data should be static.

Returns
DtObjectSensorType

Implements DtSimComponent.

Reimplemented in DtRadarObjectSensor, DtSignatureObjectSensor, DtSearchRescueSensor, DtPassiveSonarSensor, DtActiveSonarSensor, DtNbcSensor, DtEngineeringObjectSensor, and DtBeaconRadarObjectSensor.

virtual void DtObjectSensor::tick ( )
virtual

Processes only if the simulation is not paused. Calls attemptToActivate() on myDetectedObjectListPort. Calls clearObjectRangeCache(). Calls setupGeometryForDetection() Calls processObjects(). When processObjects() returns true, calls notifyTargetsChanged() on the DtObjectSensorModitor. Calls updateDetectedObjectListPort().

Reimplemented from DtSimComponent.

Reimplemented in DtRadarObjectSensor, DtSignatureObjectSensor, DtSearchRescueSensor, DtActiveSonarSensor, DtNbcSensor, and DtEngineeringObjectSensor.

virtual bool DtObjectSensor::tickWhileDestroyed ( ) const
virtual
Returns
true. This sensor ticks when the entity is destroyed so that it can notify any subscribed GUIs that it is no longer detecting objects.

Reimplemented from DtSimComponent.

virtual int DtObjectSensor::sensorType ( ) const
virtual
Returns
an enumeration indicating what type of sensor this is. (Visual, radar, etc) Types specified in ifSensorData.h

Reimplemented in DtSignatureObjectSensor, DtRadarObjectSensor, DtSearchRescueSensor, DtPassiveSonarSensor, DtActiveSonarSensor, DtNbcSensor, DtEngineeringObjectSensor, and DtBeaconRadarObjectSensor.

virtual void DtObjectSensor::enable ( )
virtual

Overridden to clear out the target list and update the monitor so that the sensor contact list will be cleared out in the front-end when the sensor is disabled.

Reimplemented from DtSimComponent.

virtual void DtObjectSensor::disable ( )
virtual

Overridden to clear out the target list and update the monitor so that the sensor contact list will be cleared out in the front-end when the sensor is disabled.

Reimplemented from DtSimComponent.

virtual void DtObjectSensor::setIsEnabled ( bool  yesNo)
virtual

Overridden to clear out the target list and update the monitor so that the sensor contact list will be cleared out in the front-end when the sensor is disabled.

Reimplemented from DtSimComponent.

virtual void DtObjectSensor::setTypesToDetectForTask ( const DtRwObjectTypeList objectTypes)
virtual

Set or clear the dynamic list of object types to detect. This is useful for a task that wants to look for a type of object; the task should clear this when it is done.Set types. The types are saved in the PSR. Calls updateDetectbaleObjectsList.

virtual void DtObjectSensor::clearTypesToDetectForTask ( )
virtual

Clear all types. Should be called when the task is done.

virtual const DtRwObjectTypeList& DtObjectSensor::typesToDetectForTask ( ) const
virtual

Gets the type list.

static bool DtObjectSensor::setTypesToDetectAttribute ( void *  ctrlr,
DtReaderWriter val 
)
static

Attribute set functions to accept types to detect or clear the list of task-specific types. The static functions are registered as callbacks, and the virtual functions perform the set.This function accepts a value that is a single string representing a list of types. Each type is a colon-separated set of 8 integers (object types), and types are separated by commas.

virtual bool DtObjectSensor::setTypesToDetectAttribute ( DtReaderWriter val)
virtual

Attribute set functions to accept types to detect or clear the list of task-specific types. The static functions are registered as callbacks, and the virtual functions perform the set.This function accepts a value that is a single string representing a list of types. Each type is a colon-separated set of 8 integers (object types), and types are separated by commas.

static bool DtObjectSensor::clearTypesToDetect ( void *  ctrlr,
DtReaderWriter val 
)
static

This function ignores the value passed in. It clears the list of types.

virtual bool DtObjectSensor::clearTypesToDetect ( DtReaderWriter val)
virtual

This function ignores the value passed in. It clears the list of types.

static DtReaderWriter* DtObjectSensor::getSensorPositionAttribute ( void *  ctrlr)
static

Attribute get function to retrieve the sensor position. The static function is registered as a callback, and the virtual function performs the get.This function retrieves the sensor offset position, as a vector, and returns it as an offset vector.

virtual DtReaderWriter* DtObjectSensor::getSensorPositionAttribute ( )
virtual

Enables or disables this sensor.

virtual void DtObjectSensor::setSensorEnabled ( bool  enabled)
virtual

Enables or disables this sensor.

Reimplemented in DtSignatureObjectSensor, DtRadarObjectSensor, and DtActiveSonarSensor.

virtual bool DtObjectSensor::sensorEnabled ( ) const
virtual

Whether this sensor is enabled or disabled.

static DtSimComponent* DtObjectSensor::creator ( const DtString name,
DtLocalObject owner,
DtSimulationServices simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)
static

Parameters
nameReader writer name of this component.
ownerThe DtLocalObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
Returns
New instance of this class.
virtual bool DtObjectSensor::createPortGroups ( )
protectedvirtual

Creates and initializes port groups.

Reimplemented from DtSimComponent.

Reimplemented in DtSignatureObjectSensor.

virtual bool DtObjectSensor::createPorts ( )
protectedvirtual

Creates the target list port.

Reimplemented from DtSimComponent.

Reimplemented in DtSignatureObjectSensor.

virtual DtObjectSensorPSR* DtObjectSensor::createPSR ( )
protectedvirtual

Creates myProcessState data member, and adds it to our process state repository manager. Passes in the name and type specified in the component descriptor (if they exist) to the DtVrfProcessStateRepository::createRepository factory method. If name and/or type is not specified, uses the appropriate default strings defined in procSRTypes.h.

virtual const char* DtObjectSensor::defaultPSRType ( ) const
protectedvirtual
Returns
DtVrfObjectSensorProcessStateRepositoryType. Derived classes may override this to return their own default PSR type, if a different PSR type is desired.

Reimplemented in DtRadarObjectSensor, DtPassiveSonarSensor, DtActiveSonarSensor, and DtSignatureObjectSensor.

virtual void DtObjectSensor::initSensorRangeRing ( )
protectedvirtual

Adds a sensor range ring to the range rings published for this object with the system-name.sensor-name as the title. If there is no range evaluator for this sensor in the sensor geometry (max range) then a ring for this sensor will not be added.

virtual void DtObjectSensor::updateDetectableObjectsList ( )
protectedvirtual

Sets up myDetectableObjectList as a list that contains all entity types/forces specified in both the descriptor and the myObjectsToDetectInputPort input port. DtTargetSelectionController and DtSpotReportGeneratorController are examples of controllers that provide lists of types of objects to detect. Uses objectTypeForcePredicate() to create the predicate for each type/force specified.

virtual bool DtObjectSensor::initSensorGeometry ( )
protectedvirtual

Creates the geometry evaluator based on the sensor-geometry entry in the descriptor, and the sensor geometry evaluator factory.

virtual void DtObjectSensor::setupGeometryForDetection ( )
protectedvirtual

Sets up the current sensor geometry evaluator with the current position and orientation of the sensor. Called once per detection cycle.

Reimplemented in DtSignatureObjectSensor.

virtual DtVector DtObjectSensor::localSensorPosition ( ) const
protectedvirtual
Returns
The position of the sensor in local coordinates. If myPositionInputPort is active, this offset it used, otherwise it returns the entity's origin position.
virtual DtVector DtObjectSensor::bodySensorPosition ( ) const
protectedvirtual
Returns
The position of the sensor in body coordinates. If myPositionInputPort is active, this offset it used, otherwise it returns the entity's origin position (i.e. 0,0,0).
virtual DtTaitBryan DtObjectSensor::localSensorOrientation ( ) const
protectedvirtual
Returns
The orientation of the sensor in local coordinates. If myOrientationInputPort is active, this orientation is used, otherwise it is just the entity's orientation.
virtual DtTaitBryan DtObjectSensor::bodySensorOrientation ( ) const
protectedvirtual
Returns
The orientation of the sensor in body coordinates. If myOrientationInputPort is active, this orientation is used, otherwise it is just the entity's orientation (i.e. 0,0,0).
virtual DtUUID DtObjectSensor::targetObject ( ) const
protectedvirtual
Returns
The name of the target object of the sensor. If myTargetObjectInputPort is not active, no target is assumed.
virtual DtVector DtObjectSensor::targetLocation ( ) const
protectedvirtual
Returns
The target location of the sensor. If myTargetLocationInputPort is not active, no target is assumed.
virtual DtSensorTrackingMode DtObjectSensor::trackingMode ( ) const
protectedvirtual
Returns
The tracking mode of the sensor. If #myTrackingModePort is not active, assume FixedAngle.
virtual void DtObjectSensor::processObjects ( )
protectedvirtual

Checks detectability of each of the detectable objects. This is done by calling continueDetectingObject() for all objects previously detected. For any that return false, they are removed from the list. For all objects that weren't previously detected, detectObject() is called. For any where the return value is true, they are added to the detected objects list in the PSR.

Reimplemented in DtRadarObjectSensor.

virtual void DtObjectSensor::processObjectsSlice ( const DtInterruptFlag timer)
protectedvirtual

Enables or disables this sensor.

virtual bool DtObjectSensor::detectObject ( DtSimObjectReference  object,
DtRwSensorContactInfo contactInfo 
)
protectedvirtual
Returns
true if the specified object should be detected by the sensor, when it has not been detected on the previous detection cycle. Deriving classes should override this to implement their own detection constraints. A blank DtRwSensorContactInfo structure is provided, and may be filled in by deriving class code. This implementation returns true if objectWithinSensorGeometry() returns true, and the entity meets the detectDestroyedObjects criteria.

Reimplemented in DtRadarObjectSensor, DtSignatureObjectSensor, DtPassiveSonarSensor, DtSearchRescueSensor, DtActiveSonarSensor, DtNbcSensor, DtEngineeringObjectSensor, and DtBeaconRadarObjectSensor.

virtual ContinueDetectingResult DtObjectSensor::continueDetectingObject ( DtSimObjectReference  object,
DtRwSensorContactInfo contactInfo,
bool contactInfoModified 
)
protectedvirtual
Returns
true if the specified object should continue to be detected by the sensor, when it was detected on the previous detection cycle. Deriving classes should override this to implement their own detection constraints. The current DtRwSensorContactInfo structure is provided for this contact, and may be modified in deriving class code. If any modifications are made, contactInfoModified should be set to true for notification of the ObjectSensorMonitor. This implementation returns true if objectWithinSensorGeometry() returns true, and the entity meets the detectDestroyedObjects criteria.

Reimplemented in DtRadarObjectSensor, DtSignatureObjectSensor, DtSearchRescueSensor, DtPassiveSonarSensor, DtActiveSonarSensor, DtNbcSensor, DtEngineeringObjectSensor, and DtBeaconRadarObjectSensor.

virtual bool DtObjectSensor::objectWithinSensorGeometry ( const DtSimObject object) const
protectedvirtual
Returns
true only if the specified object is within the defined geometry of the sensor. Uses the sensor geometry evaluator. Also checks whether or not this item is invisible. If it is it is not within the geometry
virtual bool DtObjectSensor::sensorGeometryExtent ( DtExtent extent) const
protectedvirtual

Calculates an extent encompassing the entire sensor geometry and returns it in extent. The extent will be set in local coordinates.

Returns
True if a valid extent is calculated, or false if the extent cannot be calculated.
virtual double DtObjectSensor::rangeSquaredToObject ( const DtSimObject object) const
protectedvirtual
Returns
the square of the range from the host object to the specified object. Uses the objectRangeCache to avoid recalculation when possible.
virtual double DtObjectSensor::rangeToObject ( const DtSimObject object) const
protectedvirtual
Returns
the range from the host object to the specified object. Uses the objectRangeCache to avoid recalculation when possible.
virtual void DtObjectSensor::clearObjectRangeCache ( ) const
protectedvirtual

Invalidates the current object range cache.

virtual void DtObjectSensor::printTargets ( ) const
protectedvirtual

Prints the current target list to the console.

virtual void DtObjectSensor::updateDetectedObjectListPort ( )
protectedvirtual

Clears the list port, then adds all target infos from the previous target list in the PSR, and sends the data.

virtual bool DtObjectSensor::createAndInitSensorMonitor ( )
protectedvirtual

Creates a DtObjectSensorMonitor, and calls init() on it.

virtual bool DtObjectSensor::objectInDetectableList ( const DtSimObject ) const
protectedvirtual

Returns true if the object is in the myDetectableObjectList.

static void DtObjectSensor::hostilitiesChangedCallback ( DtU8  force,
void *  usr 
)
staticprotected

If who were hostile towards has changed we will need to update our myDetectableObjectList.

virtual void DtObjectSensor::processHostilitiesChanged ( DtU8  force)
protectedvirtual

Enables or disables this sensor.

virtual DtTaitBryan DtObjectSensor::worldOrientationOfObject ( const DtSimObject object) const
protectedvirtual

Given the object, if this is a single point object return the orientation in the state data else return orientation as calculated for multi-point objects (closed figure is origin to first point, non-closed is origin to last point). The resultant orientation is a geocentric orientation.

virtual bool DtObjectSensor::canDetectForceOfObject ( const DtSimObject )
protectedvirtual

Return false if the force of the object supplied cannot be detected by this force. Currently will only return false if an intelligence object that cannot be detected by this force.

static void DtObjectSensor::setSensorEnabledRequestCallback ( DtSimMessage msg,
void *  usrData 
)
staticprotected

Static callback method for setSensorEnabled messages. Calls processSetSensorEnabledRequestMessage().

virtual void DtObjectSensor::processSetSensorEnabledRequestMessage ( DtSimMessage msg)
protectedvirtual

Calls setSensorEnabled() with the value specified in the message if the message matches our sensor name.

virtual void DtObjectSensor::notifyContactsChanged ( )
protectedvirtual

Provides various notifications (sensor monitor, output port) of changes to sensor contacts.

Member Data Documentation

DtSensorContactListOutputPort* DtObjectSensor::myDetectedObjectListPort
protected

Outputs:

Output Port Name: detected-objects
Output Port Description: The list of contacts detected by this sensor.
Output Port Range:
Output Port Default Value:
Output Group Parent:

DtObjectTypesListMultiInputPort* DtObjectSensor::myObjectsToDetectInputPort
protected

Inputs: 
 DtObjectTypesListMultiInputPort : object-types-to-detect

Input Port Name: object-types-to-detect
Input Port Description: List of contacts to be considered for target selection. As many contact lists as desired can be connected and work simultaneously.
Input Port Range:
Input Port Default Value:
Input Group Parent: object-types-to-detect

DtInputPortGroup* DtObjectSensor::mySensorOffsetInputPortGroup
protected

Input Port Group Name: sensor-offset
Input Port Group Description: Allows an external controller to provide position and orientation of the sensor relative to the entity's position.

DtOrientationInputPort* DtObjectSensor::myOrientationInputPort
protected

Input Port Name: orientation
Input Port Description: Specifies the orientation of the sensor relative to the entity on which it is mounted.
Input Port Range:
Input Port Default Value: 0,0,0
Input Group Parent: sensor-offset.

DtVectorInputPort* DtObjectSensor::myPositionInputPort
protected

Input Port Name: position
Input Port Description: Specifies the position of the sensor in body coordinates relative to the entity which it is mounted on. If this port is not connected localSensorPosition() simply returns the local position of the entity.
Input Port Range:
Input Port Default Value: 0,0,0
Input Group Parent: sensor-offset.

DtStringInputPort* DtObjectSensor::myTargetObjectInputPort
protected

Input Port Name: target-object
Input Port Description: Specifies the name of the object be targeted by this sensor. Can give context to sensor orientation.
Input Port Range:
Input Port Default Value: ""
Input Group Parent:

DtVectorInputPort* DtObjectSensor::myTargetLocationInputPort
protected

Input Port Name: target-location
Input Port Description: Specifies the location to be targeted by this sensor. Can give context to sensor orientation.
Input Port Range:
Input Port Default Value: ""
Input Group Parent:

DtIntegerInputPort* DtObjectSensor::myTrackingModeInputPort
protected

Input Port Name: tracking-mode
Input Port Description: Specifies the tracking mode of the sensor.
Input Port Range: Values specified by DtSensorTrackingMode enum
Input Port Default Value: ""
Input Group Parent:

DtBooleanInputPort* DtObjectSensor::myTargetAcquiredInputPort
protected

Input Port Name: target-acquired
Input Port Description: Specifies whether the sensor was able to acquire the target.
Input Port Range:
Input Port Default Value: ""
Input Group Parent:

DtManagedObjectListConstPtr DtObjectSensor::myDetectableObjectList
protected
const DtObjectSensorDescriptor* DtObjectSensor::myObjectSensorDescriptor
protected
DtObjectSensorPSR* DtObjectSensor::myProcessState
protected

Container for state data associated with this component. This state is saved and restored as part of a scenario (or checkpoint).

DtObjectSensorMonitor* DtObjectSensor::myMonitor
protected

Sends out sensor contact information to the GUI if the GUI or other application has requested the information.

DtSpatialFilterEvaluator* DtObjectSensor::mySensorGeometryEvaluator
protected
DtForceType DtObjectSensor::myForceType
protected

The force type the last time the detectable object list was updated.

const DtSimObject* DtObjectSensor::myMutableObjectCached
mutableprotected

The VrfObject whose range is currently cached.

bool DtObjectSensor::myMutableObjectRangeCalculated
mutableprotected

Keeps track of whether the range has been calculated for the current cached object.

double DtObjectSensor::myMutableObjectRangeCache
mutableprotected

The current range to the cached object, if calculated.

bool DtObjectSensor::myMutableObjectRangeSquaredCalculated
mutableprotected

Keeps track of whether the range squared has been calculated for the current cached object.

double DtObjectSensor::myMutableObjectRangeSquaredCache
mutableprotected

The current range squared to the cached object, if calculated.

bool DtObjectSensor::myGeometrySetup
protected

Whether setupGeometryForDetection() has been called yet.

bool DtObjectSensor::myPrep_invokeNewContactCallbacks
protected
DtPlatformLocalObjectFacade DtObjectSensor::myPlatformLocalObjectFacade
protected
DtBoost::shared_ptr<DtProcessObjectsState> DtObjectSensor::myProcessObjectsState
protected

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

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)