VR-Vantage
Loading...
Searching...
No Matches
DtDriver.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2026 MAK Technologies, Inc.
3** All rights reserved.
4******************************************************************************/
5
9
10#pragma once
15
16namespace makVrv
17{
18 class DtAgentManager;
20 class DtDeRecord;
21
22
32 {
33 protected:
34 static const std::string theOnDriverSelectionList;
35
36 public:
37
38 friend class DtDriverManager;
39
42
44 virtual ~DtDriver();
45
47 virtual void realizeConfiguration(const DtConfiguration& configuration);
48
52 virtual DtConfiguration createConfiguration(bool saveAllParameters = false) const;
53
58
61
63 inline bool started() const
64 {
65 return myStartedFlag;
66 }
67
69 virtual const std::string& className() const = 0;
70
72 virtual const std::string& instanceName() const;
73
76 virtual bool autoStart() const;
77
80 virtual void setAutoStart(bool autoStart);
81
85 virtual bool isWindowDependent() const;
86
90 virtual void setIsWindowDependent(bool dep);
91
94 virtual void setIsUserControllable(bool);
95
98 virtual bool isUserControllable() const;
99
102 virtual void setIsPersistent(bool per);
103
106 virtual bool isPersistent() const;
107
110 virtual bool isOnDriverSelectionList() const;
111
114 virtual void setOnDriverSelectionList(bool);
115
118 bool objectFromAgentManager(const DtUniqueID& id) const;
119
120 protected:
121
126
130
134
137
140 void start();
141
144 void stop();
145
149 bool tick();
150
155 virtual bool onStart() = 0;
156
161 virtual bool onStop() = 0;
162
166 virtual bool onTick() = 0;
167
170 virtual void slot_displayEngineAdded(const DtDeRecord& igRecord);
171
176 virtual void setInstanceName(const std::string& name);
177
181 virtual void installAccessories();
182
186 virtual void uninstallAccessories();
187
188 protected:
189
192 std::string myName;
194
199
202
203 };
204
205
209 {
210 public:
211
214
217
221 virtual const std::string& extension() const = 0;
222
224 virtual DtDriver* create(DtAgentManager& agentManager,
225 const std::string& instanceName) const = 0;
226 };
227
228}
Contains makVrv::DtConfiguration class.
Contains makVrv::DtElementChanges class.
Contains makVrv::DtElementEntry class.
Base class to provide boost signal/slot management.
The DtAgentManager manages the distributed scene object framework. This includes the objects and upda...
Definition DtAgentManager.h:39
The abstract interface necessary for agents.
Definition DtAgentManagerInterface.h:34
The base implementation of a configuration.
Definition DtConfiguration.h:25
A Record of an IG instance.
Definition DtDeRecord.h:25
virtual const std::string & extension() const =0
Get the name of the sim driver file connection.
virtual ~DtDriverCreator()
DTOR.
virtual DtDriver * create(DtAgentManager &agentManager, const std::string &instanceName) const =0
Create a driver.
The DtDriver is an abstract class. Developers derive from this to create logic that "directs" things ...
Definition DtDriver.h:32
DtElementChanges myChanges
Definition DtDriver.h:198
virtual const std::string & className() const =0
Get this driver's class name.
virtual void realizeConfiguration(const DtConfiguration &configuration)
Realize the driver using the configuration.
virtual bool isPersistent() const
Get if the driver is persistent and should be saved between runs.
DtAgentManager & myAgentManager
Definition DtDriver.h:190
virtual bool autoStart() const
Get whether this driver is set to automatically start if it is persistent.
bool myStartedFlag
Definition DtDriver.h:191
friend class DtDriverManager
Definition DtDriver.h:38
void reportElementCreated(DtElementID id, DtElementID parentId, DtElementEntry::ElementType type)
Report an element created.
static const std::string theOnDriverSelectionList
Definition DtDriver.h:34
DtConfiguration myConfiguration
Definition DtDriver.h:193
virtual bool isUserControllable() const
Get whether this driver can be started and stopped by the user.
virtual void slot_displayEngineAdded(const DtDeRecord &igRecord)
Called when a display engine is added. Override if you want the driver to do something when a display...
bool tick()
Tick the host driver. Called by the Master Scene.
std::string myName
Definition DtDriver.h:192
virtual bool isOnDriverSelectionList() const
Returns whether or not this driver is to be automatically started/stopped from the driver selection l...
DtSignalConnectionManager myConnections
Auto-disconnects on destruction; avoids singleton lookups in the DTOR.
Definition DtDriver.h:201
virtual void setIsWindowDependent(bool dep)
Set whether this driver is set to automatically start when the first window is created and stop when ...
virtual void uninstallAccessories()
Removes accessories from this driver. The compatible and enabled accessories in the DtDriverManager's...
bool objectFromAgentManager(const DtUniqueID &id) const
check to see if the object was created using this driver's agent manager.
virtual const std::string & instanceName() const
Get this driver's instance name.
virtual void installAccessories()
Installs accessories on this driver. The compatible and enabled accessories in the DtDriverManager's ...
virtual void setAutoStart(bool autoStart)
Set whether this driver automatically starts if it is persistent.
void start()
Start the driver. Called by the Master Scene. Calls installAccessories().
virtual DtAgentManagerInterface & sceneInterface()
Get the scene manager interface for creating agents.
virtual DtConfiguration createConfiguration(bool saveAllParameters=false) const
Create a configuration for the driver.
void stop()
Stop the driver. Called by the Master Scene. Calls uninstallAccessories().
DtAgentManager & agentManager()
Get the master scene for this host. Do not create drivers using this agentManager,...
virtual bool isWindowDependent() const
Get whether this driver is set to automatically start when the first window is created and stop when ...
void applyChangesAndDelete(DtElementChanges *changes)
Function for apply changes from a changes object and deleting it. This function is useful for queuing...
virtual bool onStart()=0
Start the host output. Create all objects for an existing host connection.
bool started() const
Get this driver's active state.
Definition DtDriver.h:63
bool myPersistentFlag
Definition DtDriver.h:195
void reportElementDestroyed(DtElementID id)
Report an element destroyed.
virtual bool onTick()=0
Tick.
virtual void setIsUserControllable(bool)
Set whether this driver can be started and stopped by the user.
virtual ~DtDriver()
DTOR.
virtual void setIsPersistent(bool per)
Set if the driver is persistent and should be saved between runs.
DtDriver(DtAgentManager &agentManager, const std::string &instanceName)
CTOR.
virtual void setOnDriverSelectionList(bool)
Sets whether or not this item is on the driver selection list. Will be saved to record if state is di...
void reportElementAttribute(DtElementID id, DtElementAttribute *attribute)
Report an element attribute changed.
virtual void setInstanceName(const std::string &name)
set the Instance name.
virtual bool onStop()=0
Stop the host output. All scene object created by the host should be destroyed.
bool myUserControllableFlag
Definition DtDriver.h:196
bool myRequestStateDiffPendingFlag
Definition DtDriver.h:197
DtElementAttribute is a common base class used for all element attributes, such as those found in a D...
Definition DtElementAttribute.h:21
DtElementChanges is used to communicate changes in element data between drivers and the main applicat...
Definition DtElementChanges.h:26
ElementType
Definition DtElementEntry.h:27
Class to manage disconnection of boost connections on deletion.
Definition DtSignalConnectionManager.h:21
Contains DtCreateSensorFieldOfViewCommand and DtCreateSensorFieldOfViewCommandCreator class declarati...
Definition DtGridLinesSettingsRecord.h:16
DtUniqueID DtElementID
Definition DtUniqueID.h:23
unsigned long long DtUniqueID
Definition DtUniqueID.h:19
#define DT_DLL_VRVCORE
Definition vrvCore.h:20