VR-Forces 4.8 Class Documentation
 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) 2019 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 
92  void addToScene( DtOsgModelInstance* osgModelInstance,
93  const DtUniqueID& sceneObjectId, int modelSet, int visualizerType);
94 
103  void addToScene( DtOsgModelInstance* osgModelInstance,
104  const DtUniqueID& sceneObjectId, int modelSet, DtChannel* channelRoot);
105 
109  void addToSceneAsProp( DtOsgModelInstance* osgModelInstance,
110  const DtUniqueID& sceneObjectId );
111 
114  void removeFromScene( DtOsgModelInstance* osgModelInstance );
115 
118  void setPosition( const DtVector& position );
119 
122  void setOrientation( const DtTaitBryan& orientation );
123 
130  void setVisible( bool visible );
131 
136  bool isVisible() const;
137 
145  void setConnectedWhileHidden( bool stayConnected );
146 
151  bool connectedWhileHidden() const;
152 
158  void setModelScalingEnabled( bool enabled );
159 
164  bool modelScalingEnabled() const;
165 
174  void setLocalModelScalingEnabled( bool enabled );
175 
180  bool localModelScalingEnabled() const;
181 
185  void setLocalModelScalingAmount( float amount );
186 
190  double localModelScalingAmount() const;
191 
196  DtSceneRoot findSceneParent();
197 
201  DtRenderToggleTransform* getOrCreateTransformRoot();
202 
206  osg::Group* groupRoot();
207 
213  void setSupportFlags( bool support );
214 
219  virtual void setRendered(bool rendered);
220 
221  private:
222 
227  void setTransformModelScalingState();
228 
236  void setToVisibleParent( bool visible = true, bool create = true );
237 
241  DtOsgRenderer* getRendererAndSceneParent(
242  DtSceneRoot& sceneParent );
243 
244  private:
248 
252 
255  DtOsgSceneConnector& operator=( const DtOsgSceneConnector& );
256 
257  private:
258 
262 
265 
266  bool myVisible;
268  bool myIsProp;
271 
274 
276 
278  };
279 
280 }
The DtOsgRenderer is the component responsible for rendering 3D images onto the screen via OpenSceneG...
Definition: DtOsgRenderer.h:125
osg::ref_ptr< DtFastGroup > myGroup
Definition: DtOsgSceneConnector.h:260
int myModelSet
Definition: DtOsgSceneConnector.h:263
bool myRendered
Definition: DtOsgSceneConnector.h:69
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Definition: featureContext.h:37
bool myModelScalingEnabled
Definition: DtOsgSceneConnector.h:269
bool myLocalModelScalingEnabled
Definition: DtOsgSceneConnector.h:270
Contains makVrv::DtFastGroup class.
osg::ref_ptr< osg::Switch > mySwitch
Definition: DtOsgSceneConnector.h:261
osg::MatrixTransform with optimized removeChildren function
Definition: DtFastGroup.h:38
virtual ~DtRenderToggleGroup()
Definition: DtOsgSceneConnector.h:61
osg::ref_ptr< DtRenderToggleTransform > myTransform
Definition: DtOsgSceneConnector.h:259
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:29
double lastTraversal()
Definition: DtOsgSceneConnector.h:46
Abstract index into the scene graph.
Definition: DtSceneRoot.h:19
The base class for simple OSG based model instances.
Definition: DtOsgModelInstance.h:72
double myLastTraversal
Definition: DtOsgSceneConnector.h:51
float myLocalModelScalingAmount
Definition: DtOsgSceneConnector.h:272
DtDe & myDe
Definition: DtOsgSceneConnector.h:275
float myCurrentLocalModelScaling
Definition: DtOsgSceneConnector.h:273
unsigned long long DtUniqueID
Definition: DtUniqueID.h:22
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:267
bool myVisible
Definition: DtOsgSceneConnector.h:266
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:41
bool myIsProp
Definition: DtOsgSceneConnector.h:268
Contains makVrv::DtUniqueID type.
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
int myVisualizerType
Definition: DtOsgSceneConnector.h:264
DtChannel * myChannel
Definition: DtOsgSceneConnector.h:277
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 Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)