23 #include <vlutil/vlHashlist.h>
24 #include <vlutil/vlString.h>
25 #include <vlutil/vlList.h>
57 #define CACHED_NEXT_FRAME_STATE_PROPERTY(property) \
58 DtPropertyInterface* myNextFrame##property = 0;
59 #define SET_CACHED_STATE_PROPERTY(property, value) \
60 setCachedNextFrameStatePropertyValue(&myNextFrame##property, #property, value);
62 #define CACHED_CURRENT_FRAME_STATE_PROPERTY(property) \
63 const DtPropertyInterface* myCurrFrame##property = 0;
64 #define GET_CACHED_STATE_PROPERTY_VALUE(property, value) \
65 getCachedCurrentFrameStatePropertyValue(&myCurrFrame##property, #property, value);
90 #ifdef DtObjectDebugger_Enable
137 virtual void enable();
138 virtual void disable();
139 virtual bool isEnabled();
140 virtual void setIsEnabled(
bool yesNo);
146 virtual void preFirstTickInit();
156 virtual void postTick();
165 virtual void timedTick();
172 virtual void setMinTickPeriod(
double minTickPeriod,
double minTickPeriodVariance);
176 virtual void setupFirstTickTime();
184 virtual const char* type()
const = 0;
201 virtual void setListItem(DtListItem* item);
203 virtual DtListItem* listItem();
207 virtual void putData(std::string& fp,
int indentLevel = 0)
override;
229 virtual DtList inputPortList()
const;
246 virtual DtList outputPortList()
const;
260 virtual DtList inputPortGroupList()
const;
274 virtual DtList outputPortGroupList()
const;
282 virtual int priority()
const;
288 virtual void setPriority(
int priority);
298 virtual void setDT(
double deltaT);
310 virtual bool tickWhileDestroyed()
const;
317 virtual DtOutputStream& objectConsoleDebug(
const DtString& channel =
"")
const;
319 virtual DtOutputStream& objectConsoleVerbose(
const DtString& channel =
"")
const;
321 virtual DtOutputStream& objectConsoleInfo(
const DtString& channel =
"")
const;
323 virtual DtOutputStream& objectConsoleWarn(
const DtString& channel =
"")
const;
325 virtual DtOutputStream& objectConsoleError(
const DtString& channel =
"")
const;
327 virtual int notifyLevel()
const;
333 DtString toString(
const DtEntityType& entityType)
const;
371 static void addSimComponentCreatorFcn(
const DtString& type,
396 virtual void isClutterChanged();
401 virtual bool taskVisualizationsActive()
const;
408 virtual bool taskVisualizationsEnabled()
const;
411 virtual void onRestore();
416 return myTaskVisualizations;
423 virtual void updateImgui();
428 virtual bool debugActive()
const;
436 virtual void setupTimedTickLogic(
double minTickPeriod,
double minTickPeriodVariance);
440 virtual double computeCurrentTime();
446 bool testInvariant()
const;
451 virtual bool createPortGroups();
456 virtual bool createPorts();
467 const DtString& defaultPsrName,
bool useDescriptorParams =
true);
474 virtual void destroyTaskVisualizations();
477 virtual void destroyTaskVisualization(
const DtString& name);
492 double calculateNextTaskVisTickTime()
const;
513 template<
typename ValType>
530 template<
typename ValType>
554 void removeSimObjectPredicateCallback(
const DtSimObject* simObject,
563 void invokeSimObjectPredicateCallbacks();
567 virtual void clearPredicateCallbacks();
679 template<
typename ValType>
699 template<
typename ValType>
714 objectConsoleWarn() <<
"Could not find state property: " << propName << std::endl;
const DtComponentDescriptor * myComponentDescriptor
The descriptor used to configure this component, typically read from an OPD file. ...
Definition: simComponent.h:626
virtual bool postAddComponentsInit()
Called after all components have been created, initialized and added to the component manager...
Definition: simComponent.h:127
This class is used to interface with the terrain a particular entity is "attached" to...
Definition: attachedTerrain.h:57
This class allows one to collect and compare strings using an index number instead of having to do st...
Definition: symbolString.h:27
void setCachedNextFrameStatePropertyValue(DtPropertyInterface **prop, const DtString &propName, ValType value)
Sets the value of a next-frame state property via a cached property interface. The cache pointer is p...
Definition: simComponent.h:680
const DtPropertyInterface * cachedCurrentFrameStateProperty(const DtPropertyInterface **prop, const DtString &propName) const
Returns the cached read-only property interface for a current-frame state property, looking it up and caching the result on first access.
Definition: simComponent.h:689
virtual const DtRwProperties & stateProperties() const
Gets current frame external state properties, unless there are none, in which case it returns the nex...
bool myLocalDebug
Local debug flag for this component instance. If true, debugActive() will return true.
Definition: simComponent.h:650
A DtComponentSystem is a collection of DtSimComponents that are associated with each other...
Definition: componentSystem.h:35
Abstract base class for a small class that tracks the tick period for DtSimComponent.
Definition: timedTickLogic.h:9
DtOutputPortGroupMap myOutputPortGroupList
Map of output port groups registered on this component, keyed by group name.
Definition: simComponent.h:602
virtual DtlObjPtr getData(DtlObjPtr args, const SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
Deriving class overrides these to get/put class specific data.
Definition: readerWriter.h:85
The DtSimResourceManager is responsible for managing all of the resources for a given entity...
Definition: simResourceManager.h:18
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
#define DT_DEFINE_OBJECT_DEBUGGER_NAME(type)
Definition: objectCounter.h:31
Default on in debug, off in release.
Definition: objectCounter.h:27
std::map< DtString, DtInputPort * > DtInputPortMap
Definition: simComponent.h:590
int myPriority
The connection priority of this component; lower values take precedence.
Definition: simComponent.h:608
Definition: readerWriterRegistry.h:39
double myDT
The time delta since the last tick, in seconds.
Definition: simComponent.h:615
class DtSimComponentFactory:
Definition: simComponentFactory.h:36
class DtVrfProcessStateRepositoryManager:
Definition: vrfProcessStateRepositoryManager.h:48
const DtLocalObject * entity() const
Definition: simComponent.h:383
DtOutputPortGroup is a data port group of a data provider. It may contain any number of DtOutputPorts...
Definition: outputPortGroup.h:34
DtLocalObject * myEntity
The local object (entity) that owns this component.
Definition: simComponent.h:583
Description: This repository is an internal repository accessible only by local objects. It holds all information that is common to all the forms of all entity/aggregate/control objects within VR-Forces.
Definition: vrfObjectStateRepository.h:92
DtPredicateCallbackManager * myPredicateCallbackManager
Manages the registered predicate callbacks that are invoked each tick.
Definition: simComponent.h:644
static DtSimComponentFactory * myFactory
The factory used to create DtSimComponent instances.
Definition: simComponent.h:605
virtual DtOutputStream & objectConsoleWarn(const DtString &channel="") const
Interface class used to define minimal interface for a property. The DtPropertyInterface class provid...
Definition: propertyInterface.h:53
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:471
Contains the DtVrfObjectPredicate class declaration.
Definition: vrfObjectPredicate.h:20
static DtReaderWriterFactory * factory()
makVrf::DtTaskVisualizationMap myTaskVisualizations
The visualization objects to be drawn for this component.
Definition: simComponent.h:633
DtListItem * myListItem
The list item node used for intrusive list membership in DtComponentList.
Definition: simComponent.h:588
DtComponentSystem * mySystem
Pointer to the DtComponentSystem that this component belongs.
Definition: simComponent.h:586
DtInputPortGroupMap myInputPortGroupList
Map of input port groups registered on this component, keyed by group name.
Definition: simComponent.h:600
boost::signals2::scoped_connection myIsClutterChangedConnection
Connection to the entity's isClutterChanged signal, used to re-enable when clutter state changes...
Definition: simComponent.h:647
The DtPhysicalWorld is the primary interface to and manager of all of the "physical" aspects of the s...
Definition: physicalWorld.h:114
Definition: coordSystem.h:54
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
double myLastTickSimTime
The simulation time at which this component was last ticked.
Definition: simComponent.h:611
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
File: simMsg.h.
Definition: simMessage.h:35
std::vector< DtFilename > SearchPaths
Definition: readerWriter.h:92
The predicate callback manager allows for registration of callbacks by sim object for predicates...
Definition: predicateCallbackManager.h:20
double dT() const
This is the delta-t for this component, which may or may not be the same as the exerciseClock dT...
Definition: simComponent.h:664
static VRF4API_METHOD DtSimComponent * MarkThreadSafe(DtSimComponent *comp)
This is the deprecated API that can be used as a reference to migrate 4.X code to 5...
Definition: simComponent.h:660
std::map< DtString, DtOutputPortGroup * > DtOutputPortGroupMap
Definition: simComponent.h:593
DtSimComponent *(* DtSimComponentCreatorFcn)(const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *compDescriptor, DtReaderWriterRegistry *registry)
Definition: simComponentFactory.h:25
DtInputPortMap myInputPortList
Map of input ports registered on this component, keyed by port name.
Definition: simComponent.h:596
std::list< DtVrfProcessStateRepository * > myComponentPsrs
List of PSRs created via createComponentPsr() that will be automatically unregistered and deleted whe...
Definition: simComponent.h:630
double myNextTaskVisTickTime
The next tick time for updating the task visualizations.
Definition: simComponent.h:636
bool myFirstTick
Initialized to true in the constructor, set to false by the first call to postTick.
Definition: simComponent.h:623
bool myIsEnabled
Indicates whether this component should be enabled for ticking or not.
Definition: simComponent.h:619
DtOutputPortMap myOutputPortList
Map of output ports registered on this component, keyed by port name.
Definition: simComponent.h:598
DtOutputPorts are data ports owned by data producers. They are connected to DtPortConnections and sen...
Definition: outputPort.h:42
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:97
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
Definition: vrfObjectPredicateEvaluator.h:17
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:80
virtual void putData(std::string &fp, int indentLevel=0)
Deriving class overrides these to get/put class specific data.
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
VRF4API_METHOD const DtSimulationServices * simManager() const
This is the deprecated API that can be used as a reference to migrate 4.X code to 5...
Definition: simComponent.h:659
virtual DtRwProperties & nextFrameStateProperties()
Returns the full list of the next frame external state properties. To get the internal state properti...
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
DtLocalObject * entity()
Gets the entity.
Definition: simComponent.h:382
virtual void registerAttributeFunctions()
Called to register functions that provide system attribute values. Called by init(). Empty in this class. Overridden in different components to add attribute provider functions.
Definition: simComponent.h:132
bool getCachedCurrentFrameStatePropertyValue(const DtPropertyInterface **prop, const DtString &propName, ValType &value) const
Gets the value of a current-frame state property via a cached property interface. The cache pointer i...
Definition: simComponent.h:700
const DtReaderWriter & operator=(const DtReaderWriter &orig)
assignment operator
std::map< DtString, DtOutputPort * > DtOutputPortMap
Definition: simComponent.h:591
std::unique_ptr< DtTimedTickLogic > myTimedTickLogic
The logic object that determines when this component should be ticked.
Definition: simComponent.h:613
void(* DtVrfObjectPredicateCallbackFunction)(DtSimObjectReference obj, DtVrfObjectPredicateEvaluator *predicateEval, void *userData)
Definition: simComponent.h:51
makVrf::DtTaskVisualizationMap & taskVisualizations()
Definition: simComponent.h:414
std::map< DtString, DtInputPortGroup * > DtInputPortGroupMap
Definition: simComponent.h:592
DtSimulationServices * mySimServices
Pointer to the simulation services, providing access to the clock, terrain, and messaging.
Definition: simComponent.h:642
1) Define the interface class that will be used to represent the next and current frames...
Definition: taskVisualizationStateComponent.h:300
#define VRF4API_METHOD
Include this header file to allow for the definition/usage of the ability to mark something as deprec...
Definition: vrf4XAPI.h:23
bool setPropertyValue(ValueType val)
Sets the value of this property. If the value cannot be converted from the specified type...
DtSymbolString myFullComponentName
The fully-qualified name of this component, composed of the containing system hierarchy and component...
Definition: simComponent.h:639
std::map< DtTaskVisualizationId, DtTaskVisualizationStateComponent * > DtTaskVisualizationMap
Map from task visualization identifier to its state component pointer.
Definition: taskVisualizationForwards.h:26
DtPropertyInterface * cachedNextFrameStateProperty(DtPropertyInterface **prop, const DtString &propName)
Returns the cached property interface for a next-frame state property, looking it up and caching the ...
Definition: simComponent.h:669
virtual const DtPropertyInterface * findPropertyInterface(const DtString &propertyName) const override
boost::optional< ValueType > propertyValue() const
Returns the value of this property. You can only retrieve the value of properties which can contain s...
A locally simulated VRF object.
Definition: localObject.h:98