18 #include <vlutil/vlThreadSysWrapper.h>
22 #include <boost/bind/bind.hpp>
26 #include <shared_mutex>
30 #define DT_DE_INIT_ONCE(de)\
31 if(de.isInitFunctionRegistered((void*)&init))\
37 de.registerInitFunction((void*)&init);\
45 class DtBackgroundLoader;
48 class DtDeSharedState;
50 class DtDriverManager;
52 class DtInMemoryProfilerDistributorAgent;
53 class DtMessageDispatcher;
57 class DtVirtualBaseClass;
58 class DtSchemaManager;
61 class DtDisplayConfiguration;
62 class DtWindowConfiguration;
63 class DtChannelConfiguration;
64 class DtDriverConfiguration;
65 class DtSynchronizedTimeManager;
66 class DtDrawnIntersectorManager;
67 class DtDeSplashScreen;
68 class DtDeCommunicator;
70 class DtEnvironmentVariables;
83 typedef std::vector<std::pair<DtDeError,bool> >
DeErrors;
129 UnableToInitialize = 0,
130 UnableToInitializeDueToLicense = -1
145 virtual InitializationResult initialize(
bool abortOnLicenseFailure =
true,
bool useLicenseErrorDialog =
true);
148 bool initialized()
const;
153 DtThreadId threadId();
170 virtual void tick(
double simTime);
175 inline void retick() { tick(simulationTime()); }
180 virtual bool timeToStop()
const;
183 virtual void setTimeToStop(
bool flag =
true);
191 virtual void reset();
194 virtual void updateScene();
230 bool driverManagerCreated()
const;
246 virtual double simulationTime()
const;
250 virtual double syncedTime()
const;
258 virtual int displayCount()
const;
267 virtual bool isInMasterMode()
const;
270 virtual bool isInSlaveMode()
const;
286 virtual const DeErrors deErrors()
const;
289 virtual void clearDeErrors();
295 bool renderFrameThisTick()
const;
300 virtual bool licenseAvailable()
const;
327 virtual void realizeDisplayConfiguration(
const std::string& clientName,
328 const std::string& displayName);
336 virtual void destroyDisplay(
const std::string& displayName);
339 virtual void destroyAllDisplays();
342 virtual bool modifyDisplay(
const std::string& displayName,
352 virtual void setSimulationTime(
double time);
357 virtual double systemTime()
const;
360 virtual void setCurrentFrameNumber(
unsigned int frameNumber);
363 virtual unsigned int currentFrameNumber()
const;
366 virtual bool isPaused()
const;
371 virtual void pause();
374 virtual void resume();
380 double pausedTime()
const;
388 StaticInstanceFunction classInstanceFunction)
const;
393 template <
typename Class>
396 return findFastInstance(reinterpret_cast<StaticInstanceFunction>(staticInstFunc));
401 virtual void registerFastInstance(
407 template <
typename Class>
410 registerFastInstance(reinterpret_cast<StaticInstanceFunction>(staticInstFunc),inst);
416 const std::string& instanceName)
const;
427 virtual void registerInstance(
const std::string& instanceName,
431 virtual void registerProctor(
unsigned short handlerId,
DtProctor*);
435 virtual void unregisterProctor(
unsigned short handlerId);
438 DtProctor* findProctor(
unsigned short handlerId)
const;
448 void setRenderFrameThisTick(
bool update);
456 virtual void determineActiveModelSets();
468 virtual void startLogFrameTime();
469 virtual void stopLogFrameTime();
506 boost::signalslib::signal<void (const std::string&, const std::string&)>
522 boost::signalslib::signal<void (const std::string&, const DtDisplayConfiguration&)>
528 boost::signalslib::signal<void (const std::string&, const DtWindowConfiguration&)>
535 boost::signalslib::signal<void (const std::string&, const std::string&)>
541 boost::signalslib::signal<void (
const std::string&,
const std::string&,
547 boost::signalslib::signal<void (
const std::string&,
const std::string&,
553 boost::signalslib::signal<void (
const std::string&,
const std::string&,
559 boost::signalslib::signal<void (
const std::string&,
const std::string&,
568 boost::signalslib::signal<void (const DtDeError& error, bool critical)>
signal_deError;
589 virtual void onSlaveConnected(
const std::string& igName);
592 virtual void emitDeError(
const DtDeError&
error,
bool criticalError);
598 static const char* className();
602 void registerInitFunction(
void* address);
605 bool isInitFunctionRegistered(
void* address);
609 bool shouldSendMesssage();
613 virtual void setTargetFrameTime(
double frameTimeInMs);
616 virtual double targetFrameTime();
619 virtual void startProfilerNextFrame();
621 virtual void stopProfilerNextFrame();
624 virtual double lastUpdateTime()
const;
627 virtual void setShowErrorDialogs(
bool show);
630 virtual bool showErrorDialogs()
const;
650 virtual void initializeSchemaManager();
652 virtual void initializeLibXmlIfNecessary();
656 virtual bool shouldSkipThisTick(
double simulationTime );
659 virtual void postInitialize();
662 virtual void postInitializeMaster();
665 virtual void checkForData();
673 void masterTick(
double simulationTime );
677 virtual void renderTick(
double elapsedTime);
683 virtual bool local_realizeDisplayConfiguration(
684 const std::string& clientName,
const std::string& displayName);
688 virtual void local_destroyDisplay(
const std::string& displayName);
691 virtual bool local_modifyDisplay(
const std::string& displayName,
701 void destroyDisplay();
707 virtual void intializeStatsManager(
void);
775 Master3D_License = 0,
811 template <
typename ManagerClass>
848 template <
typename ManagerClass>
851 ManagerClass* mgr =
dynamic_cast<ManagerClass*
>
859 DtTHROW_NEW(DtCorruptedState,
860 "Manager created after display engine was initialized.");
865 DtTHROW_NEW(DtCorruptedState,
"Create unsupported manager in slave.");
869 mgr =
new ManagerClass(de);
886 template <
typename ManagerClass>
892 DtTHROW_NEW(DtCorruptedState,
893 "Manager created after display engine was initialized.");
900 mgr->myConnections.manageConnection(
902 &ManagerClass::loadDefaults,mgr)));
DtVirtualBaseClass * findFastInstance(Class &(*staticInstFunc)(DtDe &)) const
The instance key is always return the subclass of the virtual base class, since it returns a referenc...
Definition: DtDe.h:394
boost::signalslib::signal< void(const std::string &, const std::string &, const std::string &)> signal_channelToBeDestroyed
Signal is emitted, then the channel is destroyed. Signal with a display engine name,window name and channel name arguments and a void return value.
Definition: DtDe.h:554
virtual DtVirtualBaseClass * findFastInstance(StaticInstanceFunction classInstanceFunction) const
Find an instance with the given name. If no instance is found than a null pointer is returned...
DeErrors myIgErrors
Definition: DtDe.h:755
boost::signalslib::signal< void(const std::string &, const std::string &, const std::string &, const DtChannelConfiguration &)> signal_channelConfigurationModified
Emitted when a channel is modified. Signal with a display engine name, window name ...
Definition: DtDe.h:561
DtDisplay * myDisplayEngine
Definition: DtDe.h:739
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
boost::signalslib::signal< void(const std::string &)> signal_displayToBeDestroyed
Emitted when a display is removed. The signal is emitted then the configuration is destroyed...
Definition: DtDe.h:517
boost::signalslib::signal< void(const std::string &, const std::string &, const DtChannelConfiguration &)> signal_channelConfigurationAdded
Emitted when a channel is added. Signal with a display engine name, window name and DtChannelConfigur...
Definition: DtDe.h:548
boost::signalslib::signal< void(DtDe &)> signal_preTick
Signal emitted at the beginning of the tick function. This is useful for executing code before the Di...
Definition: DtDe.h:495
DtDeProctor * myIgProctor
Definition: DtDe.h:742
bool myInitializeFlag
Definition: DtDe.h:732
DtSynchronizedTimeManager manages NTP synchronized time DtSynchronizedTimeManager is used by the disp...
Definition: DtSynchronizedTimeManager.h:25
The DtDeError instance.
Definition: DtDeError.h:20
An object that represents everything that is visible in the scene.
Definition: DtScene.h:44
DisplayEngineProxyMap myDisplayProxies
Definition: DtDe.h:745
boost::signalslib::signal< void()> signal_quit
Signal emitted by the quit method. Applications should listen for this signal and respond appropriate...
Definition: DtDe.h:572
bool myInTickFlag
Definition: DtDe.h:759
boost::signalslib::signal< void()> signal_postMainWindowInitialize
Emitted when after the main window has been set up.
Definition: DtDe.h:564
std::shared_timed_mutex myInternalDataMutex
Definition: DtDe.h:764
DT_DLL_VRVCORE DtTaitBryan level(const DtCoordinateSystem &cs, const DtVector &localOrigin, double topoHeading)
Returns a level orientation with the topographic heading.
boost::signalslib::signal< void()> signal_resume
signal emitted by the resume method.
Definition: DtDe.h:578
double mySystemPausedTime
Definition: DtDe.h:789
DtDePathConfiguration myPathConfiguration
Definition: DtDe.h:730
DtSynchronizedTimeManager * mySynchronizedTimeManager
Definition: DtDe.h:770
DtMainEventQueue myMainEventQueue
Definition: DtDe.h:738
This is a simple class for logging information to a file. To be used, the caller must specify a loggi...
Definition: DtDebugLog.h:38
Component which owns how the application is displayed.
Definition: DtDisplay.h:27
DtAgentManager * myAgentManager
Definition: DtDe.h:744
DtRenderer * myRenderer
Definition: DtDe.h:756
void retick()
Retick is a helper function for simply ticking using the current Simulation time. This may be necessa...
Definition: DtDe.h:175
bool mySceneNeedsUpdateFlag
Definition: DtDe.h:757
Base class for Proctor classes.
Definition: DtProctor.h:21
double myLastUpdateTime
used by stats system
Definition: DtDe.h:795
boost::signalslib::signal< void()> signal_aboutToAutoStartDrivers
Signal emitted during initialization at at time when it is possible to initialize default state...
Definition: DtDe.h:580
DtInMemoryProfilerDistributorAgent * myFrameTimeLogger
Definition: DtDe.h:782
InitializationResult
Result codes for the initialize() function.
Definition: DtDe.h:126
core singleton that manages loading for all the various DtModel subclasses
Definition: DtBackgroundLoader.h:37
This owns a list of channel configurations.
Definition: DtWindowConfiguration.h:26
The DtDriverManager manages all the DtDriver's in the DtDe.
Definition: DtDriverManager.h:32
DtDeCommunicator * myCommunicator
Definition: DtDe.h:740
Configuration for the makVrv::DtIgDriver class.
Definition: DtDriverConfiguration.h:19
PrintLevel
Definition: DtDebugLog.h:42
boost::signalslib::signal< void()> signal_postTick
Signal emitted at the end of the tick function. This is useful for executing code after the Display E...
Definition: DtDe.h:502
boost::signalslib::signal< void(const std::string &, const DtWindowConfiguration &)> signal_windowConfigurationAdded
Emitted when a window is added. Signal with a display engine name and DtViewConfiguration argument an...
Definition: DtDe.h:529
DtDebugLog & log()
Inline access for the debug log object.
Definition: DtDe.h:236
The DtDePathConfiguration contains paths to various files, and can resolve the path macros ...
Definition: DtDePathConfiguration.h:23
boost::signalslib::signal< void(const DtDisplayConfiguration &)> signal_displayConfigurationAdded
Emitted when a display is added. Signal with a const DtDisplayConfiguration& argument and a void retu...
Definition: DtDe.h:512
DtSchemaManager * mySchemaManager
Definition: DtDe.h:748
bool myRenderedLastFrame
Definition: DtDe.h:783
boost::signalslib::signal< void()> signal_initializeDefaultState
Signal emitted during initialization at at time when it is possible to initialize default state...
Definition: DtDe.h:482
boost::signalslib::signal< void(const std::string &, const std::string &)> signal_windowConfigurationToBeDestroyed
Emitted when a window is destroyed. The signal is emitted then the configuration is destroyed...
Definition: DtDe.h:536
Contains makVrv::DtDisplayProctor class.
DtDriverManager * myDriverManager
Definition: DtDe.h:743
void * myRegInitFunction
Definition: DtDe.h:752
Contains the DtDeInitializer class definition.
std::map< StaticInstanceFunction, DtVirtualBaseClass * > FastRootedSingletonMap
Definition: DtDe.h:719
boost::signalslib::signal< void(const std::string &, const std::string &)> signal_displayConfigurationRealized
Emitted when a Display Engine is told to realize a display configuration. Signal with the name of the...
Definition: DtDe.h:507
LicenseTypes
Definition: DtDe.h:772
DtThreadId myThreadId
Definition: DtDe.h:767
bool myShowErrorDialogs
Definition: DtDe.h:803
unsigned int myCurrentFrameNumber
Definition: DtDe.h:734
DtClock * mySimulationClock
Definition: DtDe.h:769
RenderingApiType myRenderingApi
Definition: DtDe.h:805
bool initialized() const
Get whether the application is initialized.
boost::signalslib::signal< void()> signal_pause
signal emitted by the pause method.
Definition: DtDe.h:575
The main event queue should live in the main application thread and is used to communicate events to ...
Definition: DtMainEventQueue.h:24
DtDataBank * myDataBank
Definition: DtDe.h:747
LicenseTypes myLicenseType
Definition: DtDe.h:780
The DtDeSharedState represents all the data that is shared between the master and its slaves...
Definition: DtDeSharedState.h:47
bool myStopFlag
Definition: DtDe.h:731
DtBackgroundLoader * myBackgroundLoader
Definition: DtDe.h:749
bool myStopProfilerNextFrame
Definition: DtDe.h:799
std::vector< bool > myActiveModelSets
Definition: DtDe.h:760
DtDebugLog * myDebugLog
Definition: DtDe.h:736
DtFileCache * myFileCache
Definition: DtDe.h:754
DtEnvironmentVariables * myCachedEnvironmentVariables
Definition: DtDe.h:807
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
static const char * myClassName
Definition: DtDe.h:725
This owns a list of window configurations.
Definition: DtDisplayConfiguration.h:43
std::vector< std::pair< DtDeError, bool > > DeErrors
Typedef of a vector of error/critical.
Definition: DtDe.h:83
virtual bool isInSlaveMode() const
Returns true if the DtDe is in slave mode.
RootedSingletonMap::const_iterator myLastInstance
Definition: DtDe.h:763
The de proctor is responsible for communication changes to slave DtDe instances running on separate p...
Definition: DtDeProctor.h:22
InitFunctionVector myRegisteredInitFunctions
Definition: DtDe.h:751
DtDeConfiguration myConfiguration
Definition: DtDe.h:737
std::string myLastInstanceName
Definition: DtDe.h:762
void defaultManagerRegisterInstanceFunction(DtDe &de, ManagerClass *mgr)
Default implementation of how to register a manager, especially necessary when overriding the manager...
Definition: DtDe.h:887
std::vector< void * > InitFunctionVector
This vector stores the address of registered init functions.
Definition: DtDe.h:715
Definition: DtDrawnIntersectorManager.h:35
The DtAgentManager manages the distributed scene object framework. This includes the objects and upda...
Definition: DtAgentManager.h:38
boost::signalslib::signal< void()> signal_postInitialize
Signal emitted at the end of the initialization function. This is useful for executing code after the...
Definition: DtDe.h:488
Definition: asyncJobServer.h:39
The class responsible for managing communication between multiple DtDe instances typically running in...
Definition: DtDeCommunicator.h:31
The DtRenderer is the component responsible for rendering 3D images onto the screen.
Definition: DtRenderer.h:49
DtMessageDispatcher * myDispatcher
Definition: DtDe.h:741
FastRootedSingletonMap myFastRootedSingletonMap
Definition: DtDe.h:728
void registerFastInstance(Class &(*staticInstFunc)(DtDe &), DtVirtualBaseClass *inst)
The instance key is always return the subclass of the virtual base class, since it returns a referenc...
Definition: DtDe.h:408
DtDataBank is the repository for common element data and simulation-specific state data...
Definition: DtDataBank.h:19
RootedSingletonMap myRootedSingletonMap
Definition: DtDe.h:727
DtDeSharedState * myDeSharedState
Definition: DtDe.h:746
bool myStartProfilerNextFrame
Definition: DtDe.h:798
The configuration of the Display Engine.
Definition: DtDeConfiguration.h:22
std::shared_ptr< DtDisplayProxy > DtDisplayProxySP
Definition: DtDisplayProxy.h:91
Configuration for a single channel Serialized and sent to remote displays as necessary to configure r...
Definition: DtChannelConfiguration.h:24
boost::signalslib::signal< void(const std::string &, const std::string &, const DtWindowConfiguration &)> signal_windowConfigurationModified
Emitted when an realized window is modified. Signal with a display engine name and a window name and ...
Definition: DtDe.h:542
ManagerClass & defaultManagerInstanceFunction(DtDe &de, bool allowedInSlave)
default Manager instance function. Manager requirements: 1) Static instance function 2) Protected DtS...
Definition: DtDe.h:849
boost::signalslib::signal< void(const std::string &, const DtDisplayConfiguration &)> signal_displayModified
Emitted when a display is modified. Signal with display engine name and display configuration argumen...
Definition: DtDe.h:523
virtual void registerFastInstance(StaticInstanceFunction classInstanceFunction, DtVirtualBaseClass *inst)
Register a fast instance, if the inst is a null pointer the instance key is removed.
std::shared_timed_mutex myErrorMutex
Definition: DtDe.h:765
Definition: DtEnvironmentVariables.h:58
bool myResettingFlag
Definition: DtDe.h:784
IGI Manager managers both IGI clients and IGI interfaces.
Definition: DtMessageDispatcher.h:31
Contains makVrv::DtMainEventQueue class.
RenderingApiType
The type of rendering API being used.
Definition: DtDe.h:88
std::map< std::string, DtVirtualBaseClass * > RootedSingletonMap
Definition: DtDe.h:718
double myNextFixedTime
Definition: DtDe.h:735
boost::signalslib::signal< void(const DtDeError &error, bool critical)> signal_deError
Listen to this signal for Display Engine errors. DO NOT EMIT using this signal. Emit using the emit f...
Definition: DtDe.h:568
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
DtModelSetId
Definition: DtModelSetEnums.h:19
Handles the caching of files. Includes functions for excluding files with certain extensions from bei...
Definition: DtFileCache.h:37
The schema manager is responsible to managing all of the schemas in the system. It will save and load...
Definition: DtSchemaManager.h:78
double mySimulationTime
Definition: DtDe.h:733
double myTargetFrameTime
used to budget streaming at the end of a frame
Definition: DtDe.h:792
DtDeInitializer myInitializer
Definition: DtDe.h:729
The initialization configuration for the makVrv::DtDe.
Definition: DtDeInitializer.h:39
bool myDestructionFlag
Definition: DtDe.h:758
std::map< std::string, DtDisplayProxyWP > DisplayEngineProxyMap
Definition: DtDe.h:721