VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgGlStudioCockpit.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 #pragma once
10 
12 #include <vrvCore/DtUniqueID.h>
13 #include <vrvCore/DtTickable.h>
15 #include <vlpi/exponentialSmoother.h>
16 
17 #include <osg/ref_ptr>
18 #include <osg/MatrixTransform>
19 
20 #include <string>
21 #include <map>
22 
23 
24 namespace osg
25 {
26  class Switch;
27  class Group;
28 }
29 
30 namespace makVrv
31 {
32  class DtDe;
33  class DtGlStudioDrawable;
34  class DtChannelSpecificGroup;
35  class DtGlStudioEventProcessor;
36  class DtMouseEvent;
37  class DtChannelManager;
38  class DtChannel;
39  class DtChannelConfiguration;
40  class DtWindowConfiguration;
41  class DtGlStudioAttributeUpdater;
42  class DtObserverObject;
43  class DtSceneObject;
44 
50  {
51  public:
52  enum DtPerspective {Dt2D, Dt3D};
53  typedef std::map<std::string, DtGlStudioAttributeUpdater*> DtAttributeUpdateMap;
54 
56  virtual ~DtOsgGlStudioCockpit();
57 
58  //@name Distributed Interface
60 
65  virtual void createCockpit(const std::string& filename,
66  const std::string& rsoName, DtPerspective p,
67  DtUniqueID attachedEntityElementId = 0);
68 
69  virtual void removeCockpit();
70 
72  virtual void setProperty(const std::string& prop, const std::string& val);
73 
75  virtual void setChannelKeyword(const std::string& channelKeyword);
76 
78  virtual void setPerspective(const double& width, const double& height);
79 
81  virtual void setOffset(const double& x, const double& y, const double& z);
82 
84  virtual void setDynamicScale(const double& x, const double& y,
85  const double& z);
86 
88  virtual void setDynamicRotate(const double& x, const double& y,
89  const double& z);
90 
92  virtual void setVisible(bool vis);
93 
95  virtual void addUpdater(const std::string& name, const std::string& type);
96 
99  virtual void updateTSPI(const DtVector& loc, const DtVector& vel,
100  const DtVector& accel, const DtTaitBryan& orient,
101  const DtVector& rotVel, int algorithm);
102 
104  virtual void setObserverName(const std::string& obsName);
105  virtual std::string observerName() const;
106 
110  virtual void setRenderCockpitOnly(bool cockpitOnly);
111  virtual bool renderCockpitOnly();
112 
116  virtual void setRenderAsOverlay(bool renderAsOverlay);
117  virtual bool renderAsOverlay();
118 
120  //
121 
122 
123 
124 
125  //@name Local Interface
127 
130  virtual std::string className() const;
131 
133  DtUniqueID uniqueID() const;
134 
137  virtual void updateMatrixTransform();
138 
140  virtual bool handleMouseInput(const DtMouseEvent& ea);
141 
143  virtual double update();
144 
146 
148  virtual bool needsUpdate( DtTime tNow );
149 
151  virtual void update( DtTime tNow );
152 
154  virtual DtPerspective perspective(void) const;
155 
156  protected:
157  //attributes of the current entity
159 
161  virtual void initGlStudio();
162 
164  virtual osg::Group* createOverlayObjects();
165 
168  virtual osg::Group* createChannelNode();
169 
171  virtual void deepRemoveChildren(osg::Group* g);
172 
174  virtual void slot_channelAdded(DtChannelManager* mgr, DtChannel* channel);
175 
177  virtual void slot_channelDestroyed(DtChannelManager* mgr, DtChannel* channel);
178 
180  virtual void slot_channelModified(const std::string& deName, const std::string& windowName,
181  const std::string& channelName, const DtChannelConfiguration& config);
182 
184  virtual void slot_smoothingEnabled(bool smooth);
186  virtual void slot_smoothingPeriod(const double& period);
187 
188  virtual void slot_projectionChanged( DtObserverObject*, bool is2D );
189 
192  std::string myRsoName;
193  std::string myFilename;
194  double myWidth;
195  double myHeight;
198  std::string myChannelKeyword;
199  double myOffsetX;
200  double myOffsetY;
201  double myOffsetZ;
208  std::string myObserverName;
212 
217 
223 
225  DtExponentialSmoother mySmoother;
226  DtClock myClock;
229 
232  };
233 }
std::string myObserverName
Definition: DtOsgGlStudioCockpit.h:208
double myWidth
Definition: DtOsgGlStudioCockpit.h:194
bool myHasSmootherValues
Definition: DtOsgGlStudioCockpit.h:224
DtSignalConnectionManager myConnections
Auto-disconnects on destruction; avoids singleton lookups in the DTOR.
Definition: DtOsgGlStudioCockpit.h:231
Processor to handle events for the osgWidget overlay on a channel.
Definition: DtGlStudioEventProcessor.h:38
double myHeight
Definition: DtOsgGlStudioCockpit.h:195
double myDynamicRotateY
Definition: DtOsgGlStudioCockpit.h:206
double myOffsetZ
Definition: DtOsgGlStudioCockpit.h:201
DtAttributeUpdateMap myAttributeUpdaters
Definition: DtOsgGlStudioCockpit.h:158
DtPerspective
Definition: DtOsgGlStudioCockpit.h:52
double myDynamicRotateZ
Definition: DtOsgGlStudioCockpit.h:207
std::string myChannelKeyword
Definition: DtOsgGlStudioCockpit.h:198
osg::ref_ptr< osg::MatrixTransform > myMatrixTransform
Definition: DtOsgGlStudioCockpit.h:218
DtPerspective myPerspective
Definition: DtOsgGlStudioCockpit.h:196
An abstract base class for objects that require updates. This object automatically adds itself to a D...
Definition: DtTickable.h:26
double myCurrentTime
Definition: DtOsgGlStudioCockpit.h:228
DtGlStudioDrawable * myGlStudioComponent
Definition: DtOsgGlStudioCockpit.h:220
double myDynamicScaleZ
Definition: DtOsgGlStudioCockpit.h:204
This class encapsulates a mouse button event.
Definition: DtMouseEvent.h:19
DtExponentialSmoother mySmoother
Definition: DtOsgGlStudioCockpit.h:225
std::string myFilename
Definition: DtOsgGlStudioCockpit.h:193
The abstract Channel Class.
Definition: DtChannel.h:35
double myOffsetY
Definition: DtOsgGlStudioCockpit.h:200
DtGlStudioEventProcessor * myEventProcessor
Definition: DtOsgGlStudioCockpit.h:221
bool myIsVisible
Definition: DtOsgGlStudioCockpit.h:209
bool myRenderCockpitOnly
Definition: DtOsgGlStudioCockpit.h:211
A group node that culls it&#39;s group members based on channels.
Definition: DtChannelSpecificGroup.h:31
The OSG Drawable that contains a GL Studio HUD.
Definition: DtGlStudioDrawable.h:49
DtOsgGlStudioCockpit is the implementation of the distributed object of the same name (and under our ...
Definition: DtOsgGlStudioCockpit.h:49
This abstract base class defines the interface for OS-specific keyboard and mouse event listeners...
Definition: DtObserverObject.h:35
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
bool myObserverIs2D
Definition: DtOsgGlStudioCockpit.h:210
double myDynamicRotateX
Definition: DtOsgGlStudioCockpit.h:205
double myOffsetX
Definition: DtOsgGlStudioCockpit.h:199
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
double myDynamicScaleY
Definition: DtOsgGlStudioCockpit.h:203
std::map< std::string, DtGlStudioAttributeUpdater * > DtAttributeUpdateMap
Definition: DtOsgGlStudioCockpit.h:53
Base class for handling DtChannels. Derived classes should override the tick() method and advance the...
Definition: DtChannelManager.h:32
DtClock myClock
Definition: DtOsgGlStudioCockpit.h:226
osg::ref_ptr< osg::Group > myGlStudioGroup
Definition: DtOsgGlStudioCockpit.h:213
#define DT_DLL_VRVGLSTUDIOSHARED
Definition: DtGlStudioShared.h:22
Base class to provide boost signal/slot management.
Contains the declaration for makVrv::DtTickable.
Configuration for a single channel Serialized and sent to remote displays as necessary to configure r...
Definition: DtChannelConfiguration.h:24
std::string myRsoName
Definition: DtOsgGlStudioCockpit.h:192
bool myRenderAsOverlay
Definition: DtOsgGlStudioCockpit.h:197
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it t...
Definition: DtSceneObject.h:44
Contains makVrv::DtUniqueID type.
DtUniqueID myId
Definition: DtOsgGlStudioCockpit.h:191
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
DtDe & myDe
Definition: DtOsgGlStudioCockpit.h:190
osg::ref_ptr< osg::Switch > myViewSwitchNode
Definition: DtOsgGlStudioCockpit.h:216
double myDynamicScaleX
Definition: DtOsgGlStudioCockpit.h:202
DtSceneObject * myHostSceneObject
Definition: DtOsgGlStudioCockpit.h:222
osg::ref_ptr< osg::Group > myGlStudio3DGroup
Definition: DtOsgGlStudioCockpit.h:215
double myPreviousTime
Definition: DtOsgGlStudioCockpit.h:227
osg::ref_ptr< osg::Group > myGlStudioPost2DGroup
Definition: DtOsgGlStudioCockpit.h:214
DtChannelSpecificGroup * myChannelNode
Definition: DtOsgGlStudioCockpit.h:219

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)