VR-Forces 5.0.2 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) 2020 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 
33  {
34  public:
36 
39  virtual void setRendered(bool isRendered);
40  virtual bool rendered();
41 
43  virtual void traverse(osg::NodeVisitor& nv);
44  virtual void setSceneObject(DtSceneObject* sceneObject);
45 
46  double lastTraversal() {
47  return myLastTraversal;
48  }
49  protected:
50  bool myRendered;
52  };
53 
58  {
59  public:
61  virtual ~DtRenderToggleGroup() {}
62 
64  virtual void setRendered(bool isRendered);
66  virtual void traverse(osg::NodeVisitor& nv);
67 
68  protected:
69  bool myRendered;
70  };
71 
77  {
78  public:
79 
83 
85  virtual ~DtOsgSceneConnector();
86 
93  void addToScene( DtOsgModelInstance* osgModelInstance,
94  const DtUniqueID& sceneObjectId, int modelSet, int visualizerType, bool intersectOnly = false);
95 
104  void addToScene( DtOsgModelInstance* osgModelInstance,
105  const DtUniqueID& sceneObjectId, int modelSet, DtChannel* channelRoot);
106 
111  void addToSceneAsProp( DtOsgModelInstance* osgModelInstance,
112  const DtUniqueID& sceneObjectId, bool intersectOnly = false);
113 
116  void removeFromScene( DtOsgModelInstance* osgModelInstance );
117 
120  void setPosition( const DtVector& position );
121 
124  void setOrientation( const DtTaitBryan& orientation );
125 
129  void setPositionAndOrientation(const DtVector& position, const DtTaitBryan& orientation);
130 
131 
138  void setVisible( bool visible );
139 
144  bool isVisible() const;
145 
153  void setConnectedWhileHidden( bool stayConnected );
154 
159  bool connectedWhileHidden() const;
160 
166  void setModelScalingEnabled( bool enabled );
167 
172  bool modelScalingEnabled() const;
173 
182  void setLocalModelScalingEnabled( bool enabled );
183 
188  bool localModelScalingEnabled() const;
189 
193  void setLocalModelScalingAmount( float amount );
194 
198  double localModelScalingAmount() const;
199 
204  DtSceneRoot findSceneParent();
205 
209  DtRenderToggleTransform* getOrCreateTransformRoot();
210 
214  osg::Group* groupRoot();
215 
221  void setSupportFlags( bool support );
222 
227  virtual void setRendered(bool rendered);
228 
229  private:
230 
235  void setTransformModelScalingState();
236 
244  void setToVisibleParent( bool visible = true, bool create = true );
245 
249  DtOsgRenderer* getRendererAndSceneParent(
250  DtSceneRoot& sceneParent );
251 
252  private:
256 
260 
263  DtOsgSceneConnector& operator=( const DtOsgSceneConnector& );
264 
265  private:
266 
270 
273 
274  bool myVisible;
276  bool myIsProp;
279 
282 
284 
286 
288  };
289 
290 }
The DtOsgRenderer is the component responsible for rendering 3D images onto the screen via OpenSceneG...
Definition: DtOsgRenderer.h:87
bool myIntersectOnly
Definition: DtOsgSceneConnector.h:287
osg::ref_ptr< DtFastGroup > myGroup
Definition: DtOsgSceneConnector.h:268
int myModelSet
Definition: DtOsgSceneConnector.h:271
bool myRendered
Definition: DtOsgSceneConnector.h:69
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Definition: featureContext.h:37
bool myModelScalingEnabled
Definition: DtOsgSceneConnector.h:277
bool myLocalModelScalingEnabled
Definition: DtOsgSceneConnector.h:278
Contains makVrv::DtFastGroup class.
osg::ref_ptr< osg::Switch > mySwitch
Definition: DtOsgSceneConnector.h:269
osg::MatrixTransform with optimized removeChildren function
Definition: DtFastGroup.h:50
virtual ~DtRenderToggleGroup()
Definition: DtOsgSceneConnector.h:61
osg::ref_ptr< DtRenderToggleTransform > myTransform
Definition: DtOsgSceneConnector.h:267
DtOsgSceneConnector is used by models to create an OSG position/orientation transform so that it can ...
Definition: DtOsgSceneConnector.h:76
The abstract Channel Class.
Definition: DtChannel.h:35
double lastTraversal()
Definition: DtOsgSceneConnector.h:46
Abstract index into the scene graph. This is used as an argument to functions which interact with dif...
Definition: DtSceneRoot.h:22
The base class for simple OSG based model instances. This call can&#39;t be instantiated itself...
Definition: DtOsgModelInstance.h:77
double myLastTraversal
Definition: DtOsgSceneConnector.h:51
float myLocalModelScalingAmount
Definition: DtOsgSceneConnector.h:280
DtDe & myDe
Definition: DtOsgSceneConnector.h:283
float myCurrentLocalModelScaling
Definition: DtOsgSceneConnector.h:281
osg::Group with optimized removeChildren function
Definition: DtFastGroup.h:22
bool myRendered
Definition: DtOsgSceneConnector.h:50
group that can be turned off, used for the different modelsets to quickly early out 3D stuff in planv...
Definition: DtOsgSceneConnector.h:57
Contains makVrv::DtSceneRoot class.
bool myConnectWhileHidden
Definition: DtOsgSceneConnector.h:275
bool myVisible
Definition: DtOsgSceneConnector.h:274
virtual ~DtRenderToggleTransform()
Definition: DtOsgSceneConnector.h:37
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it t...
Definition: DtSceneObject.h:42
bool myIsProp
Definition: DtOsgSceneConnector.h:276
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:70
int myVisualizerType
Definition: DtOsgSceneConnector.h:272
DtChannel * myChannel
Definition: DtOsgSceneConnector.h:285
transform that can be turned off, used for the different modelsets to quickly early out 3D stuff in p...
Definition: DtOsgSceneConnector.h:32

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)