19 #include <vlutil/vlThreadSysWrapper.h>
23 #include <boost/bind.hpp>
24 #include <tbb/mutex.h>
25 #include <tbb/recursive_mutex.h>
29 #define DT_DE_INIT_ONCE(de)\
30 if(de.isInitFunctionRegistered((void*)&init))\
36 de.registerInitFunction((void*)&init);\
44 class DtBackgroundLoader;
47 class DtDeSharedState;
49 class DtDriverManager;
51 class DtInMemoryProfilerDistributorAgent;
52 class DtMessageDispatcher;
56 class DtVirtualBaseClass;
57 class DtSchemaManager;
60 class DtDisplayConfiguration;
61 class DtWindowConfiguration;
62 class DtChannelConfiguration;
63 class DtDriverConfiguration;
64 class DtSynchronizedTimeManager;
65 class DtDrawnIntersectorManager;
77 typedef std::vector<std::pair<DtDeError,bool> >
DeErrors;
116 UnableToInitialize = 0,
117 UnableToInitializeDueToLicense = -1
132 virtual InitializationResult initialize(
bool abortOnLicenseFailure =
true,
bool useLicenseErrorDialog=
true );
135 bool initialized()
const;
140 DtThreadId threadId();
157 virtual void tick(
double simTime);
162 inline void retick() { tick(simulationTime()); }
167 virtual bool timeToStop()
const;
170 virtual void setTimeToStop(
bool flag =
true);
176 virtual void reset();
179 virtual void updateScene();
215 bool driverManagerCreated()
const;
231 virtual double simulationTime()
const;
235 virtual double syncedTime()
const;
243 virtual int displayCount()
const;
252 virtual bool isInMasterMode()
const;
255 virtual bool isInSlaveMode()
const;
271 virtual const DeErrors deErrors()
const;
274 virtual void clearDeErrors();
280 bool renderFrameThisTick()
const;
285 virtual bool licenseAvailable()
const;
312 virtual void realizeDisplayConfiguration(
const std::string& clientName,
313 const std::string& displayName);
321 virtual void destroyDisplay(
const std::string& displayName);
324 virtual void destroyAllDisplays();
327 virtual bool modifyDisplay(
const std::string& displayName,
337 virtual void setSimulationTime(
double time);
342 virtual double systemTime()
const;
345 virtual void setCurrentFrameNumber(
unsigned int frameNumber);
348 virtual unsigned int currentFrameNumber()
const;
351 virtual bool isPaused()
const;
356 virtual void pause();
359 virtual void resume();
365 double pausedTime()
const;
373 StaticInstanceFunction classInstanceFunction)
const;
378 template <
typename Class>
381 return findFastInstance(reinterpret_cast<StaticInstanceFunction>(staticInstFunc));
386 virtual void registerFastInstance(
392 template <
typename Class>
395 registerFastInstance(reinterpret_cast<StaticInstanceFunction>(staticInstFunc),inst);
401 const std::string& instanceName)
const;
412 virtual void registerInstance(
const std::string& instanceName,
416 virtual void registerProctor(
unsigned short handlerId,
DtProctor*);
420 virtual void unregisterProctor(
unsigned short handlerId);
423 DtProctor* findProctor(
unsigned short handlerId)
const;
433 void setRenderFrameThisTick(
bool update);
437 virtual bool modelSetActive(
int i)
const;
441 virtual void determineActiveModelSets();
453 virtual void startLogFrameTime();
454 virtual void stopLogFrameTime();
491 boost::signalslib::signal<void (const std::string&, const std::string&)>
507 boost::signalslib::signal<void (const std::string&, const DtDisplayConfiguration&)>
513 boost::signalslib::signal<void (const std::string&, const DtWindowConfiguration&)>
520 boost::signalslib::signal<void (const std::string&, const std::string&)>
526 boost::signalslib::signal<void (
const std::string&,
const std::string&,
532 boost::signalslib::signal<void (
const std::string&,
const std::string&,
538 boost::signalslib::signal<void (
const std::string&,
const std::string&,
544 boost::signalslib::signal<void (
const std::string&,
const std::string&,
550 boost::signalslib::signal<void (const DtDeError& error, bool critical)>
signal_deError;
571 virtual void onSlaveConnected(
const std::string& igName);
574 virtual void emitDeError(
const DtDeError&
error,
bool criticalError);
580 static const char* className();
584 void registerInitFunction(
void* address);
587 bool isInitFunctionRegistered(
void* address);
593 return isInMasterMode() && myCommunicator && !myCommunicator->masterIgOnly();
598 virtual void setTargetFrameTime(
double frameTimeInMs);
601 virtual double targetFrameTime();
605 virtual void runSwapBufferWork();
608 virtual void startProfilerNextFrame();
610 virtual void stopProfilerNextFrame();
613 virtual double lastUpdateTime()
const;
616 virtual void setShowErrorDialogs(
bool show);
619 virtual bool showErrorDialogs()
const;
632 virtual void initializeSchemaManager();
634 virtual void initializeLibXmlIfNecessary();
638 virtual bool shouldSkipThisTick(
double simulationTime );
641 virtual void postInitialize();
644 virtual void postInitializeMaster();
647 virtual void checkForData();
655 void masterTick(
double simulationTime );
659 void renderTick(
double elapsedTime);
665 virtual bool local_realizeDisplayConfiguration(
666 const std::string& clientName,
const std::string& displayName);
670 virtual void local_destroyDisplay(
const std::string& displayName);
673 virtual bool local_modifyDisplay(
const std::string& displayName,
683 void destroyDisplay();
689 virtual void intializeStatsManager(
void);
757 Master3D_License = 0,
790 template <
typename ManagerClass>
827 template <
typename ManagerClass>
830 ManagerClass* mgr =
dynamic_cast<ManagerClass*
>
838 DtTHROW_NEW(DtCorruptedState,
839 "Manager created after display engine was initialized.");
844 DtTHROW_NEW(DtCorruptedState,
"Create unsupported manager in slave.");
848 mgr =
new ManagerClass(de);
865 template <
typename ManagerClass>
871 DtTHROW_NEW(DtCorruptedState,
872 "Manager created after display engine was initialized.");
879 mgr->myConnections.manageConnection(
881 &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:379
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:539
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:737
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:546
DtDisplay * myDisplayEngine
Definition: DtDe.h:721
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:502
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:533
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:480
DtDeProctor * myIgProctor
Definition: DtDe.h:724
bool myInitializeFlag
Definition: DtDe.h:714
DtSynchronizedTimeManager manages NTP synchronized time DtSynchronizedTimeManager is used by the disp...
Definition: DtSynchronizedTimeManager.h:25
tbb::recursive_mutex myErrorMutex
Definition: DtDe.h:747
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:727
boost::signalslib::signal< void()> signal_quit
Signal emitted by the quit method. Applications should listen for this signal and respond appropriate...
Definition: DtDe.h:554
bool myInTickFlag
Definition: DtDe.h:741
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:560
double mySystemPausedTime
Definition: DtDe.h:771
DtDePathConfiguration myPathConfiguration
Definition: DtDe.h:712
DtSynchronizedTimeManager * mySynchronizedTimeManager
Definition: DtDe.h:752
DtMainEventQueue myMainEventQueue
Definition: DtDe.h:720
This is a simple class for logging information to a file. To be used, the caller must specify a loggi...
Definition: DtDebugLog.h:37
Component which owns how the application is displayed.
Definition: DtDisplay.h:27
DtAgentManager * myAgentManager
Definition: DtDe.h:726
DtRenderer * myRenderer
Definition: DtDe.h:738
void retick()
Retick is a helper function for simply ticking using the current Simulation time. This may be necessa...
Definition: DtDe.h:162
bool mySceneNeedsUpdateFlag
Definition: DtDe.h:739
Base class for Proctor classes.
Definition: DtProctor.h:21
double myLastUpdateTime
used by stats system
Definition: DtDe.h:777
boost::signalslib::signal< void()> signal_aboutToAutoStartDrivers
Signal emitted during initialization at at time when it is possible to initialize default state...
Definition: DtDe.h:562
DtInMemoryProfilerDistributorAgent * myFrameTimeLogger
Definition: DtDe.h:764
InitializationResult
Result codes for the initialize() function.
Definition: DtDe.h:113
core singleton that manages loading for all the various DtModel subclasses
Definition: DtBackgroundLoader.h:38
This owns a list of channel configurations.
Definition: DtWindowConfiguration.h:28
The DtDriverManager manages all the DtDriver's in the DtDe.
Definition: DtDriverManager.h:32
DtDeCommunicator * myCommunicator
Definition: DtDe.h:722
Configuration for the makVrv::DtIgDriver class.
Definition: DtDriverConfiguration.h:19
PrintLevel
Definition: DtDebugLog.h:41
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:487
Contains makVrv:DtDeCommunicator class.
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:514
DtDebugLog & log()
Inline access for the debug log object.
Definition: DtDe.h:221
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:497
DtSchemaManager * mySchemaManager
Definition: DtDe.h:730
bool myRenderedLastFrame
Definition: DtDe.h:765
boost::signalslib::signal< void()> signal_initializeDefaultState
Signal emitted during initialization at at time when it is possible to initialize default state...
Definition: DtDe.h:467
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:521
Contains makVrv::DtDisplayProctor class.
DtDriverManager * myDriverManager
Definition: DtDe.h:725
void * myRegInitFunction
Definition: DtDe.h:734
Contains the DtDeInitializer class definition.
std::map< StaticInstanceFunction, DtVirtualBaseClass * > FastRootedSingletonMap
Definition: DtDe.h:701
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:492
LicenseTypes
Definition: DtDe.h:754
DtThreadId myThreadId
Definition: DtDe.h:749
bool myShowErrorDialogs
Definition: DtDe.h:785
unsigned int myCurrentFrameNumber
Definition: DtDe.h:716
DtClock * mySimulationClock
Definition: DtDe.h:751
tbb::mutex myInternalDataMutex
Definition: DtDe.h:746
bool initialized() const
Get whether the application is initialized.
bool shouldSendMesssage()
Helper function used to check if a message needs to be created and sent.
Definition: DtDe.h:591
boost::signalslib::signal< void()> signal_pause
signal emitted by the pause method.
Definition: DtDe.h:557
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:729
LicenseTypes myLicenseType
Definition: DtDe.h:762
binderNoArgs< _Fn > bind(const _Fn &_Func, const _Ty &_Left)
Definition: DtSTLUtilities.h:76
The DtDeSharedState represents all the data that is shared between the master and its slaves...
Definition: DtDeSharedState.h:44
bool myStopFlag
Definition: DtDe.h:713
DtBackgroundLoader * myBackgroundLoader
Definition: DtDe.h:731
bool myStopProfilerNextFrame
Definition: DtDe.h:781
std::vector< bool > myActiveModelSets
Definition: DtDe.h:742
DtDebugLog * myDebugLog
Definition: DtDe.h:718
DtFileCache * myFileCache
Definition: DtDe.h:736
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
static const char * myClassName
Definition: DtDe.h:707
This owns a list of window configurations.
Definition: DtDisplayConfiguration.h:47
std::vector< std::pair< DtDeError, bool > > DeErrors
Typedef of a vector of error/critical.
Definition: DtDe.h:77
virtual bool isInSlaveMode() const
Returns true if the DtDe is in slave mode.
RootedSingletonMap::const_iterator myLastInstance
Definition: DtDe.h:745
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:733
DtDeConfiguration myConfiguration
Definition: DtDe.h:719
std::string myLastInstanceName
Definition: DtDe.h:744
void defaultManagerRegisterInstanceFunction(DtDe &de, ManagerClass *mgr)
Default implementation of how to register a manager, especially necessary when overriding the manager...
Definition: DtDe.h:866
std::vector< void * > InitFunctionVector
This vector stores the address of registered init functions.
Definition: DtDe.h:697
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:473
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:43
DtMessageDispatcher * myDispatcher
Definition: DtDe.h:723
FastRootedSingletonMap myFastRootedSingletonMap
Definition: DtDe.h:710
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:393
DtDataBank is the repository for common element data and simulation-specific state data...
Definition: DtDataBank.h:20
RootedSingletonMap myRootedSingletonMap
Definition: DtDe.h:709
DtDeSharedState * myDeSharedState
Definition: DtDe.h:728
bool myStartProfilerNextFrame
Definition: DtDe.h:780
The configuration of the Display Engine.
Definition: DtDeConfiguration.h:22
Configuration for a single channel Serialized and sent to remote displays as necessary to configure r...
Definition: DtChannelConfiguration.h:26
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:527
DtBoost::shared_ptr< DtDisplayProxy > DtDisplayProxySP
Definition: DtDisplayProxy.h:91
ManagerClass & defaultManagerInstanceFunction(DtDe &de, bool allowedInSlave)
default Manager instance function. Manager requirements: 1) Static instance function 2) Protected DtS...
Definition: DtDe.h:828
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:508
virtual void registerFastInstance(StaticInstanceFunction classInstanceFunction, DtVirtualBaseClass *inst)
Register a fast instance, if the inst is a null pointer the instance key is removed.
bool myResettingFlag
Definition: DtDe.h:766
IGI Manager managers both IGI clients and IGI interfaces.
Definition: DtMessageDispatcher.h:31
Contains makVrv::DtMainEventQueue class.
std::map< std::string, DtVirtualBaseClass * > RootedSingletonMap
Definition: DtDe.h:700
double myNextFixedTime
Definition: DtDe.h:717
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:550
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:70
Handles the caching of files. Includes functions for excluding files with certain extensions from bei...
Definition: DtFileCache.h:36
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:715
double myTargetFrameTime
used to budget streaming at the end of a frame
Definition: DtDe.h:774
DtDeInitializer myInitializer
Definition: DtDe.h:711
The initialization configuration for the makVrv::DtDe.
Definition: DtDeInitializer.h:36
bool myDestructionFlag
Definition: DtDe.h:740
std::map< std::string, DtDisplayProxyWP > DisplayEngineProxyMap
Definition: DtDe.h:703