VR-Forces 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) 2023 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 bool 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 
95  virtual osg::Group* findSceneRootChildByName(
96  const DtSceneRoot& parent, const std::string& rootName, bool subString = false );
97 
99  virtual void setRenderRootAsSceneData( osgViewer::View& view );
100 
102  virtual osg::Group* createModelSetRoot( DtModelSetId modelSet );
103 
105  virtual bool matchesSceneRoot(const DtSceneRoot& sr, osg::Group* group );
106 
107  protected:
108  // Used internally by the other scene root using functions to find the
109  // correct root for adding/removing children, Getting child counts, etc.
110  virtual osg::Group* getContainerRoot(const DtSceneRoot& root, bool createOnAccess);
111 
112  // Container roots may have other roots over them for doing transforms, etc.
113  // This gets the topmost root associated with that scene root, useful for
114  // traversal, nodeMask setting/getting, etc.
115  virtual osg::Group* getActiveRoot(const DtSceneRoot& root);
116 
117  private:
120  };
121 }
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:91
std::vector< DtSceneRoot > DtSceneRootList
A list of DtOsgRenderer::SceneRoots.
Definition: DtSceneRoot.h:135
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:118
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 bool 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:24
virtual osg::Node::NodeMask sceneRootNodeMask(const DtSceneRoot &sr)
Get the nodemask of a SceneRoot.
virtual osg::Group * findSceneRootChildByName(const DtSceneRoot &parent, const std::string &rootName, bool subString=false)
Look up a root by name in the parent specified by SceneRoot.
DtDe & myDe
Definition: DtSceneGraph.h:119
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 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:76
DtModelSetId
Definition: DtModelSetEnums.h:19
Contains makVrv::DtOsgRenderer class.
virtual osg::Group * createModelSetRoot(DtModelSetId modelSet)
Create a root node for the model set and return it.
Abstraction over the OSG scene graph.
Definition: DtSceneGraph.h:22

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)