VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCDBGroupNode.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright(c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
11 #include <osg/Group>
12 #include <osg/MatrixTransform>
13 
15 
17 
18 #include <tbb/atomic.h>
19 
20 namespace makVrv
21 {
22  namespace oe
23  {
24  namespace CDB
25  {
26  class CDBTileKey;
27  class CdbGroupNode;
28 
30  {
31  public:
32  virtual void CdbGroupNode_Deleted(CdbGroupNode* node) = 0;
33  };
34 
35  enum Quadrant
36  {
39  , UPPER_LEFT = 2
42  , INVALID = -1
43  };
44 
59  class CdbGroupNode : public osg::Group
60  {
61  public:
63  CdbGroupNode(const CDBTileKey& key);
65  CdbGroupNode(const osg::Group& group, const CDBTileKey& key, int dataSet);
67  virtual ~CdbGroupNode();
68 
69  private:
71  CdbGroupNode(const CdbGroupNode &other);
73  CdbGroupNode &operator=(const CdbGroupNode &other);
74 
75  public:
77  virtual osg::MatrixTransform* getMTForQuadrant(Quadrant q);
78 
80  void addQuadrantChild(Quadrant quadrant, osg::Group* group);
82  void setQuadrantChild(Quadrant quadrant, CdbGroupNode* parentGroupNode);
85  bool isFromParentQuadrant(Quadrant quadrant) const;
87  osg::Group* getQuadrantAttachPoint(Quadrant quadrant);
89  osg::MatrixTransform* getQuadrantMt(Quadrant quadrant);
91  void setHasCdbChildren(bool hasChildren);
93  bool getHasCdbChildren() const;
95  const CDBTileKey& getKey(void) const;
97  void setObserver(CdbGroupNodeObserver* observer);
99  const CdbGroupNodeObserver* getObserver(void) const;
101  void plusplusNumGTPoints(Quadrant quadrant);
103  int numGTPoints(void) const;
106  osg::Group* getOrCreateQuadrantNode(Quadrant quadrant, bool& created);
107 
108  protected:
113  static const std::vector<std::string> theQuadrantStrings;
115  static const std::string theEmptyString;
117  static const std::string theFromParent;
119  static const std::string theNotFromParent;
121  static const std::string theHasChild;
123  static const std::string theNoChild;
128 
129  private:
130 #if DTCDGROUPNODE_DEBUG
131  static tbb::atomic<int> myNumofCdbGroupNodes;
132 #endif
133  static const std::string& getQuadrantChildPrefix(Quadrant quadrant);
136  static Quadrant getQuadrantFromName(const std::string& name);
138  tbb::atomic<int> myNumGTPoints[4];
141  };
142  }
143  }
144 } // namespace makVrv::oe::CDB
bool isFromParentQuadrant(Quadrant quadrant) const
set the top transform of the cdbgroup (same for the 4 child)
CdbGroupNode & operator=(const CdbGroupNode &other)
Assignment Operator Not implemented – Assignment Not Allowed.
void setQuadrantChild(Quadrant quadrant, CdbGroupNode *parentGroupNode)
Set GT points of a group from the parent quad tree.
bool getHasCdbChildren() const
get the flag if this CDB group have children node
Hold the unique CDB tile key information CDB LOD goes from -10 to 23.
Definition: DtCDBTileKey.h:28
virtual osg::MatrixTransform * getMTForQuadrant(Quadrant q)
Return the transform from a quadrant.
osg::ref_ptr< osg::MatrixTransform > myMt[4]
Matrix transform Local to World (node not to be processed by instancing)
Definition: DtCDBGroupNode.h:110
static Quadrant getQuadrantFromName(const std::string &name)
Return the quadrant index based on node name (from the cache)
const CDBTileKey & getKey(void) const
return the CDB tile key for this group
static const std::string & getQuadrantChildPrefix(Quadrant quadrant)
Get the quadrant string prefix.
Definition: DtCDBGroupNode.h:39
static const std::string theEmptyString
Empty String to check is a quadrant is valid.
Definition: DtCDBGroupNode.h:115
virtual void CdbGroupNode_Deleted(CdbGroupNode *node)=0
static const std::string theNotFromParent
String saved in osg cache when group is not a copy of a parent quadrant.
Definition: DtCDBGroupNode.h:119
CdbGroupNodeObserver * myObserver
group observer
Definition: DtCDBGroupNode.h:125
CDB osg node class CdbGroupNode as the following structure for GT models Each quadrant does not have ...
Definition: DtCDBGroupNode.h:59
osg::Group * getOrCreateQuadrantNode(Quadrant quadrant, bool &created)
return a specific quadrant of this group (used for GT).
void setHasCdbChildren(bool hasChildren)
set the flag if this CDB group have children node
static const std::string theHasChild
String saved in osg cache when there is a child.
Definition: DtCDBGroupNode.h:121
const CdbGroupNodeObserver * getObserver(void) const
return the CdbGroupNodeObserver of this group
CDBTileKey myKey
CDB tile key of this group.
Definition: DtCDBGroupNode.h:127
osg::MatrixTransform * getQuadrantMt(Quadrant quadrant)
Get the quadrant Top matrix transform)
OpenThreads::Mutex Mutex
Definition: DtOsgThreadingUtils.h:12
void plusplusNumGTPoints(Quadrant quadrant)
increment the number of GT point this CDB group contains
int numGTPoints(void) const
return the number of GT point this CDB group contains
static const std::vector< std::string > theQuadrantStrings
hold the 4 quadrand string ( &quot;0&quot;, &quot;1&quot;, &quot;2&quot;, &quot;3&quot; this is used to save in osg cache to be able to rebui...
Definition: DtCDBGroupNode.h:113
static const std::string theFromParent
String saved in osg cache when group is a copy of a parent quadrant.
Definition: DtCDBGroupNode.h:117
Definition: DtCDBGroupNode.h:41
Threading::Mutex myMutex
group mutex
Definition: DtCDBGroupNode.h:140
Definition: DtCDBGroupNode.h:42
Definition: DtCDBGroupNode.h:29
osg::Group * getQuadrantAttachPoint(Quadrant quadrant)
Get the quadrant attach point (under the Matrix Transform)
Definition: DtCDBGroupNode.h:38
static const std::string theNoChild
String saved in osg cache when there is no child.
Definition: DtCDBGroupNode.h:123
Quadrant
Definition: DtCDBGroupNode.h:35
void addQuadrantChild(Quadrant quadrant, osg::Group *group)
Add points to a GT quadrant.
CdbGroupNode(const CDBTileKey &key)
CTOR.
Definition: DtCDBGroupNode.h:37
CDB Tile key structure for the model pager.
Definition: DtCDBGroupNode.h:40
void setObserver(CdbGroupNodeObserver *observer)
associate a CdbGroupNodeObserver
tbb::atomic< int > myNumGTPoints[4]
store the number of GT points in the group
Definition: DtCDBGroupNode.h:138

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)