VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
objectSensorPSR.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2005 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
9 #include <readerWriter/rwReal.h>
10 #include <readerWriter/rwBoolean.h>
11 #include <vlutil/vlTime.h>
14 
19 
20 class DtUUID;
21 
24 {
25 public:
26 
28  DtObjectSensorPSR(DtLocalObject* vrfObject,
29  const DtString& rwName = DtString::nullString(),
30  DtReaderWriterRegistry* parentRegistry = 0);
31 
34  const DtString& rwName = DtString::nullString(),
35  DtReaderWriterRegistry* parentRegistry = 0);
36 
38  virtual ~DtObjectSensorPSR();
39 
42 
45  const DtString& rwName = DtString::nullString(),
46  DtReaderWriterRegistry* parentRegistry = 0) const;
47 
49  virtual DtString type() const;
50 
53  virtual bool init();
54 
59  virtual DtSensorContactInfoList* contactInfoList();
65  virtual const DtSensorContactInfoList* contactInfoList() const;
66 
69  virtual DtRwSensorContactInfo* lookupContactById(const DtUUID& id) const;
70 
72  virtual void clearContactInfoList();
73 
79  virtual DtRwSensorContactInfo* createSensorContactInfo() const;
80 
86  virtual const DtRwObjectTypeList& typesToDetectForTask() const;
87 
89  virtual void setTypesToDetectForTask(const DtRwObjectTypeList& objectTypes);
91  virtual void clearTypesToDetectForTask();
92 
94  virtual void setNextDetectAttempt(DtTime time);
95  virtual DtTime nextDetectAttempt() const;
96 
98  virtual void setSensorEnabled(bool enabled);
99  virtual bool sensorEnabled() const;
100 
106  virtual void putSelf(std::string& fp, int indentLevel = 0,
107  bool writeUnspecified = false, const DtFilename& path = DtReaderWriter::appPath());
108 
111  virtual void getSelf(DtlObjPtr args, const DtReaderWriter::SearchPaths& searchPaths,
112  const DtVariableBindingsList& variableBindings);
113 
114 protected:
119  virtual DtSensorContactInfoList* createSensorContactInfoList(const DtString& name);
120 
121 public:
122 
124  static DtVrfProcessStateRepository* creator (const DtString& rwName,
125  DtLocalObject* vrfObject, DtReaderWriterRegistry* parentRegistry);
126 
127 protected:
128 
133  virtual void mapContactIdsToContactNames();
134 
138  virtual void mapContactNamesToContactIds();
139 
140 protected:
141 
145 
149 
156 
159 
162 };
UUID is a unique ID wrapper class.
Definition: uuid.h:59
DtSensorContactInfoList * myContactInfoList
Init() creates this item by using the createSensorContactInfoList() factory method.
Definition: objectSensorPSR.h:144
virtual void getSelf(DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings) override
Top level to read itself from an input stream. searchPath is passed down to all DtReaderWriter member...
DtRwReal myNextDetectAttempt
Simulation time of next detection attempt (seconds).
Definition: objectSensorPSR.h:158
DtRwBoolean mySensorEnabled
Whether the sensor is enabled or disabled.
Definition: objectSensorPSR.h:161
Definition: readerWriterRegistry.h:39
This class represents the data gathered by a sensor about a particular single sensor contact...
Definition: rwSensorContactInfo.h:68
A reader-writer list of DtRwSensorContactInfo elements. Use the DtRwList::add() and remove() methods ...
Definition: sensorContactInfoList.h:32
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
class DtRwObjectTypeList:
Definition: rwObjectTypeList.h:30
virtual DtVrfProcessStateRepository * clone(const DtString &rwName=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=0) const =0
std::vector< DtFilename > SearchPaths
Definition: readerWriter.h:92
DtRwObjectTypeList myTaskDetectionTypes
Parameter Name: task-detection-types Parameter Description: Types of objects to detect for a particul...
Definition: objectSensorPSR.h:155
virtual void putSelf(std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
Top level call to write itself to file. If write unspecified is true, will write entries that are uns...
bool myMutableMapContactNamesToContactIds
Flag used to indicate that we should initialize contact names to DtEntityIdentifiers.
Definition: objectSensorPSR.h:148
Description: Readable, Writable DtReal (double)
Definition: rwReal.h:27
virtual bool init()
Used for virtual construction. This base method simply returns true.
Class DtVrfProcessStateRepository: Abstract base class for all process state repositories. Process state repositories represent (potentially) shared, savable information for one or more components functioning together to achieve some process or set of processes; such as aiming and firing a weapon; moving an object; or just waiting a specified amount of time.
Definition: vrfProcessStateRepository.h:45
Description: Readable, Writable bool.
Definition: rwBoolean.h:26
virtual DtString type() const =0
Returns the string type of the repository, as defined in procSRTypes.h.
static const DtFilename & appPath()
Gets the current working directory. The first time this accessor is called, it determines the current...
Definition: objectSensorPSR.h:23
const DtVrfProcessStateRepository & operator=(const DtVrfProcessStateRepository &orig)
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)