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) 2024 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 #pragma once
10 
12 #include <vrvCore/DtUniqueID.h>
13 #include <vrvCore/DtTickable.h>
14 #include <vlpi/exponentialSmoother.h>
15 
16 #include <osg/ref_ptr>
17 #include <osg/MatrixTransform>
18 
19 #include <string>
20 #include <map>
21 
22 
23 namespace osg
24 {
25  class Switch;
26  class Group;
27 }
28 
29 namespace makVrv
30 {
31  class DtDe;
32  class DtGlStudioDrawable;
33  class DtChannelSpecificGroup;
34  class DtGlStudioEventProcessor;
35  class DtMouseEvent;
36  class DtChannelManager;
37  class DtChannel;
38  class DtChannelConfiguration;
39  class DtWindowConfiguration;
40  class DtGlStudioAttributeUpdater;
41  class DtObserverObject;
42  class DtSceneObject;
43 
49  {
50  public:
51  enum DtPerspective {Dt2D, Dt3D};
52  typedef std::map<std::string, DtGlStudioAttributeUpdater*> DtAttributeUpdateMap;
53 
55  virtual ~DtOsgGlStudioCockpit();
56 
57  //@name Distributed Interface
59 
64  virtual void createCockpit(const std::string& filename,
65  const std::string& rsoName, DtPerspective p,
66  DtUniqueID attachedEntityElementId = 0);
67 
68  virtual void removeCockpit();
69 
71  virtual void setProperty(const std::string& prop, const std::string& val);
72 
74  virtual void setChannelKeyword(const std::string& channelKeyword);
75 
77  virtual void setPerspective(const double& width, const double& height);
78 
80  virtual void setOffset(const double& x, const double& y, const double& z);
81 
83  virtual void setDynamicScale(const double& x, const double& y,
84  const double& z);
85 
87  virtual void setDynamicRotate(const double& x, const double& y,
88  const double& z);
89 
91  virtual void setVisible(bool vis);
92 
94  virtual void addUpdater(const std::string& name, const std::string& type);
95 
98  virtual void updateTSPI(const DtVector& loc, const DtVector& vel,
99  const DtVector& accel, const DtTaitBryan& orient,
100  const DtVector& rotVel, int algorithm);
101 
103  virtual void setObserverName(const std::string& obsName);
104  virtual std::string observerName() const;
105 
109  virtual void setRenderCockpitOnly(bool cockpitOnly);
110  virtual bool renderCockpitOnly();
111 
115  virtual void setRenderAsOverlay(bool renderAsOverlay);
116  virtual bool renderAsOverlay();
117 
119  //
120 
121 
122 
123 
124  //@name Local Interface
126 
129  virtual std::string className() const;
130 
132  DtUniqueID uniqueID() const;
133 
136  virtual void updateMatrixTransform();
137 
139  virtual bool handleMouseInput(const DtMouseEvent& ea);
140 
142  virtual double update();
143 
145 
147  virtual bool needsUpdate( DtTime tNow );
148 
150  virtual void update( DtTime tNow );
151 
153  virtual DtPerspective perspective(void) const;
154 
155  protected:
156  //attributes of the current entity
158 
160  virtual void initGlStudio();
161 
163  virtual osg::Group* createOverlayObjects();
164 
167  virtual osg::Group* createChannelNode();
168 
170  virtual void deepRemoveChildren(osg::Group* g);
171 
173  virtual void slot_channelAdded(DtChannelManager* mgr, DtChannel* channel);
174 
176  virtual void slot_channelDestroyed(DtChannelManager* mgr, DtChannel* channel);
177 
179  virtual void slot_channelModified(const std::string& deName, const std::string& windowName,
180  const std::string& channelName, const DtChannelConfiguration& config);
181 
183  virtual void slot_smoothingEnabled(bool smooth);
185  virtual void slot_smoothingPeriod(const double& period);
186 
187  virtual void slot_projectionChanged( DtObserverObject*, bool is2D );
188 
191  std::string myRsoName;
192  std::string myFilename;
193  double myWidth;
194  double myHeight;
197  std::string myChannelKeyword;
198  double myOffsetX;
199  double myOffsetY;
200  double myOffsetZ;
207  std::string myObserverName;
211 
216 
222 
224  DtExponentialSmoother mySmoother;
228  };
229 }
std::string myObserverName
Definition: DtOsgGlStudioCockpit.h:207
double myWidth
Definition: DtOsgGlStudioCockpit.h:193
bool myHasSmootherValues
Definition: DtOsgGlStudioCockpit.h:223
Processor to handle events for the osgWidget overlay on a channel.
Definition: DtGlStudioEventProcessor.h:38
double myHeight
Definition: DtOsgGlStudioCockpit.h:194
double myDynamicRotateY
Definition: DtOsgGlStudioCockpit.h:205
double myOffsetZ
Definition: DtOsgGlStudioCockpit.h:200
DtAttributeUpdateMap myAttributeUpdaters
Definition: DtOsgGlStudioCockpit.h:157
DtPerspective
Definition: DtOsgGlStudioCockpit.h:51
double myDynamicRotateZ
Definition: DtOsgGlStudioCockpit.h:206
std::string myChannelKeyword
Definition: DtOsgGlStudioCockpit.h:197
osg::ref_ptr< osg::MatrixTransform > myMatrixTransform
Definition: DtOsgGlStudioCockpit.h:217
DtPerspective myPerspective
Definition: DtOsgGlStudioCockpit.h:195
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:227
DtGlStudioDrawable * myGlStudioComponent
Definition: DtOsgGlStudioCockpit.h:219
double myDynamicScaleZ
Definition: DtOsgGlStudioCockpit.h:203
This class encapsulates a mouse button event.
Definition: DtMouseEvent.h:19
DtExponentialSmoother mySmoother
Definition: DtOsgGlStudioCockpit.h:224
std::string myFilename
Definition: DtOsgGlStudioCockpit.h:192
The abstract Channel Class.
Definition: DtChannel.h:35
double myOffsetY
Definition: DtOsgGlStudioCockpit.h:199
DtGlStudioEventProcessor * myEventProcessor
Definition: DtOsgGlStudioCockpit.h:220
bool myIsVisible
Definition: DtOsgGlStudioCockpit.h:208
bool myRenderCockpitOnly
Definition: DtOsgGlStudioCockpit.h:210
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:48
This abstract base class defines the interface for OS-specific keyboard and mouse event listeners...
Definition: DtObserverObject.h:32
bool myObserverIs2D
Definition: DtOsgGlStudioCockpit.h:209
double myDynamicRotateX
Definition: DtOsgGlStudioCockpit.h:204
double myOffsetX
Definition: DtOsgGlStudioCockpit.h:198
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
double myDynamicScaleY
Definition: DtOsgGlStudioCockpit.h:202
std::map< std::string, DtGlStudioAttributeUpdater * > DtAttributeUpdateMap
Definition: DtOsgGlStudioCockpit.h:52
Base class for handling DtChannels. Derived classes should override the tick() method and advance the...
Definition: DtChannelManager.h:32
DtClock myClock
Definition: DtOsgGlStudioCockpit.h:225
osg::ref_ptr< osg::Group > myGlStudioGroup
Definition: DtOsgGlStudioCockpit.h:212
#define DT_DLL_VRVGLSTUDIOSHARED
Definition: DtGlStudioShared.h:22
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:191
bool myRenderAsOverlay
Definition: DtOsgGlStudioCockpit.h:196
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:190
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
DtDe & myDe
Definition: DtOsgGlStudioCockpit.h:189
osg::ref_ptr< osg::Switch > myViewSwitchNode
Definition: DtOsgGlStudioCockpit.h:215
double myDynamicScaleX
Definition: DtOsgGlStudioCockpit.h:201
DtSceneObject * myHostSceneObject
Definition: DtOsgGlStudioCockpit.h:221
osg::ref_ptr< osg::Group > myGlStudio3DGroup
Definition: DtOsgGlStudioCockpit.h:214
double myPreviousTime
Definition: DtOsgGlStudioCockpit.h:226
osg::ref_ptr< osg::Group > myGlStudioPost2DGroup
Definition: DtOsgGlStudioCockpit.h:213
DtChannelSpecificGroup * myChannelNode
Definition: DtOsgGlStudioCockpit.h:218

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)