VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgSceneConnector.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 
12 #include <osg/Switch>
13 #include <vrvOsg/DtFastGroup.h>
14 #include <matrix/vlVector.h>
15 #include <vrvCore/DtUniqueID.h>
16 
17 #include <vrvOsg/DtSceneRoot.h>
18 
19 class DtTaitBryan;
20 
21 namespace makVrv
22 {
23 
24  class DtChannel;
25  class DtDe;
26  class DtOsgModelInstance;
27  class DtOsgRenderer;
28  enum class DtModelSetId;
29 
34  {
35  public:
37 
40  virtual void setRendered(bool isRendered);
41  virtual bool rendered();
42 
44  virtual void traverse(osg::NodeVisitor& nv);
45  virtual void setSceneObject(DtSceneObject* sceneObject);
46 
47  double lastTraversal() {
48  return myLastTraversal;
49  }
50  protected:
51  bool myRendered;
53  };
54 
59  {
60  public:
62  virtual ~DtRenderToggleGroup() {}
63 
65  virtual void setRendered(bool isRendered);
67  virtual void traverse(osg::NodeVisitor& nv);
68 
69  protected:
70  bool myRendered;
71  };
72 
78  {
79  public:
80 
84 
86  virtual ~DtOsgSceneConnector();
87 
94  void addToScene( DtOsgModelInstance* osgModelInstance,
95  const DtUniqueID& sceneObjectId, DtModelSetId modelSet, int visualizerType, bool intersectOnly = false);
96 
105  void addToScene( DtOsgModelInstance* osgModelInstance,
106  const DtUniqueID& sceneObjectId, DtModelSetId modelSet, DtChannel* channelRoot);
107 
112  void addToSceneAsProp( DtOsgModelInstance* osgModelInstance,
113  const DtUniqueID& sceneObjectId, bool intersectOnly = false);
114 
117  void removeFromScene( DtOsgModelInstance* osgModelInstance );
118 
121  void setPosition( const DtVector& position );
122 
125  void setOrientation( const DtTaitBryan& orientation );
126 
130  void setPositionAndOrientation(const DtVector& position, const DtTaitBryan& orientation,
131  const DtVector& positionOffset, const DtTaitBryan& orientationOffset );
132 
133 
140  void setVisible( bool visible );
141 
146  bool isVisible() const;
147 
155  void setConnectedWhileHidden( bool stayConnected );
156 
161  bool connectedWhileHidden() const;
162 
168  void setModelScalingEnabled( bool enabled );
169 
174  bool modelScalingEnabled() const;
175 
184  void setLocalModelScalingEnabled( bool enabled );
185 
190  bool localModelScalingEnabled() const;
191 
195  void setLocalModelScalingAmount( float amount );
196 
200  double localModelScalingAmount() const;
201 
206  DtSceneRoot findSceneParent();
207 
211  DtRenderToggleTransform* getOrCreateTransformRoot();
212 
216  osg::Group* groupRoot();
217 
223  void setSupportFlags( bool support );
224 
229  virtual void setRendered(bool rendered);
230 
231  private:
232 
237  void setTransformModelScalingState();
238 
246  void setToVisibleParent( bool visible = true, bool create = true );
247 
251  DtOsgRenderer* getRendererAndSceneParent(
252  DtSceneRoot& sceneParent );
253 
254  private:
258 
262 
265  DtOsgSceneConnector& operator=( const DtOsgSceneConnector& );
266 
267  private:
268 
272 
275 
276  bool myVisible;
278  bool myIsProp;
281 
284 
286 
288 
290  };
291 
292 }
The DtOsgRenderer is the component responsible for rendering 3D images onto the screen via OpenSceneG...
Definition: DtOsgRenderer.h:91
bool myIntersectOnly
Definition: DtOsgSceneConnector.h:289
osg::ref_ptr< DtFastGroup > myGroup
Definition: DtOsgSceneConnector.h:270
bool myRendered
Definition: DtOsgSceneConnector.h:70
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Definition: featureContext.h:36
bool myModelScalingEnabled
Definition: DtOsgSceneConnector.h:279
bool myLocalModelScalingEnabled
Definition: DtOsgSceneConnector.h:280
Contains makVrv::DtFastGroup class.
osg::ref_ptr< osg::Switch > mySwitch
Definition: DtOsgSceneConnector.h:271
osg::MatrixTransform with optimized removeChildren function
Definition: DtFastGroup.h:50
virtual ~DtRenderToggleGroup()
Definition: DtOsgSceneConnector.h:62
osg::ref_ptr< DtRenderToggleTransform > myTransform
Definition: DtOsgSceneConnector.h:269
DtOsgSceneConnector is used by models to create an OSG position/orientation transform so that it can ...
Definition: DtOsgSceneConnector.h:77
The abstract Channel Class.
Definition: DtChannel.h:35
double lastTraversal()
Definition: DtOsgSceneConnector.h:47
Abstract index into the scene graph. This is used as an argument to functions which interact with dif...
Definition: DtSceneRoot.h:24
The base class for simple OSG based model instances. This call can&#39;t be instantiated itself...
Definition: DtOsgModelInstance.h:77
DtModelSetId myModelSet
Definition: DtOsgSceneConnector.h:273
double myLastTraversal
Definition: DtOsgSceneConnector.h:52
float myLocalModelScalingAmount
Definition: DtOsgSceneConnector.h:282
DtDe & myDe
Definition: DtOsgSceneConnector.h:285
float myCurrentLocalModelScaling
Definition: DtOsgSceneConnector.h:283
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
osg::Group with optimized removeChildren function
Definition: DtFastGroup.h:22
bool myRendered
Definition: DtOsgSceneConnector.h:51
group that can be turned off, used for the different modelsets to quickly early out 3D stuff in planv...
Definition: DtOsgSceneConnector.h:58
Contains makVrv::DtSceneRoot class.
bool myConnectWhileHidden
Definition: DtOsgSceneConnector.h:277
bool myVisible
Definition: DtOsgSceneConnector.h:276
virtual ~DtRenderToggleTransform()
Definition: DtOsgSceneConnector.h:38
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it t...
Definition: DtSceneObject.h:44
bool myIsProp
Definition: DtOsgSceneConnector.h:278
Contains makVrv::DtUniqueID type.
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
int myVisualizerType
Definition: DtOsgSceneConnector.h:274
DtModelSetId
Definition: DtModelSetEnums.h:19
DtChannel * myChannel
Definition: DtOsgSceneConnector.h:287
transform that can be turned off, used for the different modelsets to quickly early out 3D stuff in p...
Definition: DtOsgSceneConnector.h:33

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)