VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSceneGraph.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 <vrvOsg/DtOsgRenderer.h>
13 #include <cstdio>
14 namespace makVrv
15 {
16  class DtDe;
17 
23  {
24  public:
26  DtSceneGraph(DtDe& de, DtOsgRenderer* renderer);
27 
29  virtual ~DtSceneGraph();
30 
36  virtual bool isSceneRootEmpty(const DtSceneRoot& sr);
37 
39  virtual void addNodeToRoot(osg::Node* node, const DtSceneRoot& sr, bool createOnAccess);
40 
42  virtual void addSceneRootToRoot(const DtSceneRoot& childRoot, const DtSceneRoot& parentRoot, bool createOnAccess);
43 
48  virtual void addRootToNode(osg::Group* node, const DtSceneRoot& sr, bool createOnAccess);
49 
54  virtual void addActiveRootToNode(osg::Group* node, const DtSceneRoot& sr, bool createOnAccess);
55 
57  virtual void removeNodeFromRoot(osg::Node* node, const DtSceneRoot& sr);
58 
60  virtual void removeSceneRootFromRoot(const DtSceneRoot& childRoot, const DtSceneRoot& parentRoot);
61 
66  virtual void removeRootFromNode(osg::Group* node, const DtSceneRoot& sr);
67 
72  virtual void removeActiveRootFromNode(osg::Group* node, const DtSceneRoot& sr);
73 
75  virtual void traverseRoot(osg::NodeVisitor& nv, const DtSceneRoot& sr);
76 
78  virtual void setSceneRootNodeMask(const DtSceneRoot& sr, osg::Node::NodeMask nodeMask);
79 
81  virtual osg::Node::NodeMask sceneRootNodeMask(const DtSceneRoot& sr);
82 
84  virtual osg::BoundingSphere sceneRootBound(const DtSceneRoot& sr);
85 
87  virtual osg::BoundingSphere sceneRootListBound( const DtSceneRootList& srList );
88 
94  virtual osg::Group* findSceneRootChildByName(
95  const DtSceneRoot& parent, const std::string& rootName );
96 
98  virtual void setRenderRootAsSceneData( osgViewer::View& view );
99 
101  virtual osg::Group* createModelSetRoot( int modelSet );
102 
104  virtual bool matchesSceneRoot(const DtSceneRoot& sr, osg::Group* group );
105 
106  protected:
107  // Used internally by the other scene root using functions to find the
108  // correct root for adding/removing children, Getting child counts, etc.
109  virtual osg::Group* getContainerRoot(const DtSceneRoot& root, bool createOnAccess);
110 
111  // Container roots may have other roots over them for doing transforms, etc.
112  // This gets the topmost root associated with that scene root, useful for
113  // traversal, nodeMask setting/getting, etc.
114  virtual osg::Group* getActiveRoot(const DtSceneRoot& root);
115 
116  private:
119  };
120 }
virtual void addActiveRootToNode(osg::Group *node, const DtSceneRoot &sr, bool createOnAccess)
Add the specified SceneRoot to an OSG group node using its active parent.
The DtOsgRenderer is the component responsible for rendering 3D images onto the screen via OpenSceneG...
Definition: DtOsgRenderer.h:87
std::vector< DtSceneRoot > DtSceneRootList
A list of DtOsgRenderer::SceneRoots.
Definition: DtSceneRoot.h:133
virtual void removeSceneRootFromRoot(const DtSceneRoot &childRoot, const DtSceneRoot &parentRoot)
Remove a (child) sceneRoot from the specified parent SceneRoot.
DtSceneGraph(DtDe &de, DtOsgRenderer *renderer)
CTOR.
virtual void addSceneRootToRoot(const DtSceneRoot &childRoot, const DtSceneRoot &parentRoot, bool createOnAccess)
Add a (child) SceneRoot to the specified SceneRoot.
virtual osg::Group * getActiveRoot(const DtSceneRoot &root)
virtual osg::Group * getContainerRoot(const DtSceneRoot &root, bool createOnAccess)
virtual osg::BoundingSphere sceneRootListBound(const DtSceneRootList &srList)
Get the bounding sphere of list of sceneRoots.
virtual void traverseRoot(osg::NodeVisitor &nv, const DtSceneRoot &sr)
Traverse from the specified SceneRoot with the given visitor.
DtOsgRenderer * myRenderer
Definition: DtSceneGraph.h:117
virtual bool matchesSceneRoot(const DtSceneRoot &sr, osg::Group *group)
Test if this group matches the given scene root.
virtual void removeRootFromNode(osg::Group *node, const DtSceneRoot &sr)
Remove a scene root from an OSG group node.
virtual void removeNodeFromRoot(osg::Node *node, const DtSceneRoot &sr)
Remove a node from the specified SceneRoot.
virtual void addNodeToRoot(osg::Node *node, const DtSceneRoot &sr, bool createOnAccess)
Add a node to the specified SceneRoot.
virtual ~DtSceneGraph()
DTOR.
virtual void removeActiveRootFromNode(osg::Group *node, const DtSceneRoot &sr)
Remove a scene root&#39;s active parent from an OSG group node.
virtual osg::BoundingSphere sceneRootBound(const DtSceneRoot &sr)
Get the bounding sphere of sceneRoot.
Abstract index into the scene graph. This is used as an argument to functions which interact with dif...
Definition: DtSceneRoot.h:22
virtual osg::Node::NodeMask sceneRootNodeMask(const DtSceneRoot &sr)
Get the nodemask of a SceneRoot.
DtDe & myDe
Definition: DtSceneGraph.h:118
virtual osg::Group * findSceneRootChildByName(const DtSceneRoot &parent, const std::string &rootName)
Look up a root by name in the parent specified by SceneRoot.
virtual void addRootToNode(osg::Group *node, const DtSceneRoot &sr, bool createOnAccess)
Add the specified SceneRoot to an OSG group node.
virtual void setSceneRootNodeMask(const DtSceneRoot &sr, osg::Node::NodeMask nodeMask)
Set the nodemask of a SceneRoot.
virtual bool isSceneRootEmpty(const DtSceneRoot &sr)
Checks to see if the specified sceneRoot currently has any children. Note that: in some cases...
virtual osg::Group * createModelSetRoot(int modelSet)
Create a root node for the model set and return it.
virtual void setRenderRootAsSceneData(osgViewer::View &view)
Set the sceneData of a view to the top of the scene graph.
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
Contains makVrv::DtOsgRenderer class.
Abstraction over the OSG scene graph.
Definition: DtSceneGraph.h:22

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)