VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
exampleSimEngine.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 
73 protected:
86  const makVrv::DtSelectionManager::IdSet& pinOrUnpinList,
87  bool pinAllLabels);
88 
91  virtual void setHoverSignalsActive(bool active);
92 
94  virtual void setEntityInfoWidgetActive(bool active);
95 
97  virtual makVrv::DtUnicode generateInfoString() const;
98 
100  virtual void updatePosition(double simTime);
101 
102 #ifdef SIM_IS_SHIP
103  // For the ship, need to pass dT so we can determine velocity
104  virtual void repositionShip(DtVector position, DtTaitBryan ori, double dT);
105 #else
106  virtual void repositionAircraft(DtVector position, DtTaitBryan ori);
108 #endif
109 
111  virtual void slot_coordinateSystemChanged();
112 
113 protected:
115 
120 
121  std::string myEntityDisplayName;
123 
124  DtTaitBryan myOrientation;
126 
127 #ifdef SIM_IS_SHIP
128  // For the ship, need our last (local) position to determine our velocity
129  DtVector myLastPosition;
130 #endif
131  double myHeading;
132 
133  double myLastCommLineTime;
134  double myLastUpdateTime;
135 
137  double myAngularVelocity;
138  double myClockAngle;
139  double myRadius;
140  double myRoll;
141 
142 
144 
148 
149  makVrv::vrvSignalsLib::connection myMouseEnterConnection;
150  makVrv::vrvSignalsLib::connection myMouseLeaveConnection;
151 };
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
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.
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
makVrv::DtSignalConnectionManager mySignalConnections
local clone of the system wide coordinate system. for thread safety.
Definition: exampleSimEngine.h:143

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)