VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtExampleSimEngine.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2023 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
15 
17 #include <vrvUtil/DtUnicode.h>
18 #include <vrvUtil/signalslib.h>
19 
20 #include <matrix/vlTaitBryan.h>
21 #include <matrix/vlVector.h>
22 
23 #include <string>
24 
25 // #define SIM_IS_SHIP
26 
27 namespace makVrv
28 {
29  class DtEntity3dFacade;
30  class DtEntityHATLineFacade;
31  class DtDe;
32  class DtCoordinateSystem;
33 }
34 
49 {
50 public:
51 
55 
57  virtual ~DtExampleSimEngine();
58 
62  bool init();
63 
66  bool uninit();
67 
71  bool tick( double simTime );
72 
74 
75 protected:
88  const makVrv::DtSelectionManager::IdSet& pinOrUnpinList,
89  bool pinAllLabels );
91 
92 
95  virtual void setHoverSignalsActive( bool active );
96 
98  virtual void setEntityInfoWidgetActive( bool active );
99 
101  virtual makVrv::DtUnicode generateInfoString() const;
102 
104  virtual void updatePosition( double simTime );
105 
106 #ifdef SIM_IS_SHIP
107  // For the ship, need to pass dT so we can determine velocity
108  virtual void repositionShip( DtVector position, DtTaitBryan ori, double dT );
109 #else
110  virtual void repositionAircraft( DtVector position, DtTaitBryan ori );
112 #endif
113 
115  virtual void slot_coordinateSystemChanged();
116 
117 protected:
119 
124 
125  std::string myEntityDisplayName;
127 
128  DtTaitBryan myOrientation;
130 
131 #ifdef SIM_IS_SHIP
132  // For the ship, need our last (local) position to determine our velocity
133  DtVector myLastPosition;
134 #endif
135  double myHeading;
136 
139 
142  double myClockAngle;
143  double myRadius;
144  double myRoll;
145 
147 
151 
152  makVrv::vrvSignalsLib::connection myMouseEnterConnection;
153  makVrv::vrvSignalsLib::connection myMouseLeaveConnection;
154 };
double myLastUpdateTime
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:138
DtVector myOrbitCenter
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:140
makVrv::vrvSignalsLib::connection myMouseEnterConnection
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:152
A unicode string. DtUnicode stores a UTF-16 encoded unicode string. Code Point, a Unicode character...
Definition: DtUnicode.h:33
makVrv::DtEntity3dFacade * facade()
Definition: DtExampleSimEngine.h:73
double myLastCommLineTime
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:137
Contains makVrv::DtEntityIndicatorWidget class.
virtual ~DtExampleSimEngine()
DTOR.
virtual void setEntityInfoWidgetActive(bool active)
Sets whether the entity info widget is displayed or not.
makVrv::DtSignalConnectionManager myConnections
Definition: DtExampleSimEngine.h:146
Contains makVrv:DtSelectionManager class.
DtVector myPosition
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:129
bool myEntityInfoWidgetPinnedFlag
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:126
virtual void updatePosition(double simTime)
Updates the current position / orientation of the entity.
bool uninit()
Destroy what was created in init()
bool init()
Initialize the simulation engine. In this case, the entity facade, indicators, and hat line are creat...
bool tick(double simTime)
Perform updates param[in] simTime is he current simulation time.
void slot_infoLabelsArePinned(const makVrv::DtSelectionManager::IdSet &pinOrUnpinList, bool pinAllLabels)
Boost slots.
Class for height above terrain line to show height above terrain line and label.
Definition: DtEntityHATLineFacade.h:34
makVrv::vrvSignalsLib::connection myMouseLeaveConnection
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:153
makVrv::DtCoordinateSystem * myCoordinateSystem
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:150
virtual void slot_coordinateSystemChanged()
slot for when the coordinate system changes
DtTaitBryan myOrientation
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:128
DtEntityInfoWidget is the object proxy for 2D distributed entity info (label) objects.
Definition: DtEntityInfoWidget.h:27
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
double myClockAngle
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:142
The DtEntity3dFacade is a facade around agents that make up an entity in the 3D model set...
Definition: DtEntity3dFacade.h:39
double myHeading
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:135
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
The indicator widget.
Definition: DtEntityIndicatorWidget.h:29
Contains makVrv::DtEntityInfoWidget class.
double myRadius
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:143
Base class to provide boost signal/slot management.
virtual void repositionAircraft(DtVector position, DtTaitBryan ori)
Positions the aircraft at the given position with the given orientation.
DtExampleSimEngine(makVrv::DtDe &de)
CTOR.
makVrv::DtDe & myDe
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:118
makVrv::DtEntity3dFacade * myEntityFacade
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:120
makVrv::DtEntityIndicatorWidget * myEntityIndicator
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:121
virtual void setHoverSignalsActive(bool active)
Sets whether the sim engine is listening for mouseover events or not in its entity indicator...
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:72
double myRoll
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:144
makVrv::DtEntityHATLineFacade * myEntityHATLineFacade
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:123
std::string myEntityDisplayName
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:125
std::set< DtUniqueID > IdSet
Definition: DtSelectionManager.h:32
double myAngularVelocity
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:141
makVrv::DtEntityInfoWidget * myEntityInfoWidget
local clone of the system wide coordinate system. for thread safety.
Definition: DtExampleSimEngine.h:122
virtual makVrv::DtUnicode generateInfoString() const
Generates the information string displayed in the entity info widget.
Provide a basic sim engine to use in an example showing how to embed a sim engine into a driver that ...
Definition: DtExampleSimEngine.h:48

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)