VR-Forces Developer's Guide
 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) 2026 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 <atomic>
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 
49  class CdbGroupNode : public osg::Group
50  {
51  public:
53  CdbGroupNode(const CDBTileKey& key);
55  CdbGroupNode(const osg::Group& group, const CDBTileKey& key, int dataSet);
57  virtual ~CdbGroupNode();
58 
59  private:
61  CdbGroupNode(const CdbGroupNode &other);
63  CdbGroupNode &operator=(const CdbGroupNode &other);
64 
65  public:
66 
68  virtual osg::MatrixTransform* getMTForQuadrant(Quadrant q);
69 
71  void addQuadrantChild(Quadrant quadrant, osg::Group* group);
73  void setQuadrantChild(Quadrant quadrant, CdbGroupNode* parentGroupNode);
76  bool isFromParentQuadrant(Quadrant quadrant) const;
78  osg::Group* getQuadrantAttachPoint(Quadrant quadrant);
80  osg::MatrixTransform* getQuadrantMt(Quadrant quadrant);
82  void setHasCdbChildren(bool hasChildren);
84  bool getHasCdbChildren() const;
86  const CDBTileKey& getKey(void) const;
88  void setObserver(CdbGroupNodeObserver* observer);
90  const CdbGroupNodeObserver* getObserver(void) const;
92  void plusplusNumGTPoints(Quadrant quadrant);
94  int numGTPoints(void) const;
97  osg::Group* getOrCreateQuadrantNode(Quadrant quadrant, bool& created);
98 
101  void setIsHighestLod( bool isHighestLod );
102  bool isHighestLod() const;
104 
105  protected:
110  static const std::vector<std::string> theQuadrantStrings;
112  static const std::string theEmptyString;
114  static const std::string theFromParent;
116  static const std::string theNotFromParent;
118  static const std::string theHasChild;
120  static const std::string theNoChild;
125 
126  protected:
127 #if DTCDGROUPNODE_DEBUG
128  static std::atomic<int> myNumofCdbGroupNodes;
129 #endif
130  static const std::string& getQuadrantChildPrefix(Quadrant quadrant);
133  static Quadrant getQuadrantFromName(const std::string& name);
135  std::atomic<int> myNumGTPoints[4];
140  };
141  }
142  }
143 } // 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 isHighestLod() const
Set the flag if this CDB group is the highest LOD for that tile.
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. Negative keys to zero are all 1...
Definition: DtCDBTileKey.h:47
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:107
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.
static const std::string theEmptyString
Empty String to check is a quadrant is valid.
Definition: DtCDBGroupNode.h:112
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:116
CdbGroupNodeObserver * myObserver
group observer
Definition: DtCDBGroupNode.h:122
CDB osg node class CdbGroupNode as the following structure for GT models Each quadrant does not have ...
Definition: DtCDBGroupNode.h:49
osg::Group * getOrCreateQuadrantNode(Quadrant quadrant, bool &created)
return a specific quadrant of this group (used for GT). If the quadrant does exist it will be created...
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:118
const CdbGroupNodeObserver * getObserver(void) const
return the CdbGroupNodeObserver of this group
CDBTileKey myKey
CDB tile key of this group.
Definition: DtCDBGroupNode.h:124
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:110
static const std::string theFromParent
String saved in osg cache when group is a copy of a parent quadrant.
Definition: DtCDBGroupNode.h:114
Threading::Mutex myMutex
group mutex
Definition: DtCDBGroupNode.h:137
Definition: DtCDBGroupNode.h:29
std::atomic< int > myNumGTPoints[4]
store the number of GT points in the group
Definition: DtCDBGroupNode.h:135
osg::Group * getQuadrantAttachPoint(Quadrant quadrant)
Get the quadrant attach point (under the Matrix Transform)
static const std::string theNoChild
String saved in osg cache when there is no child.
Definition: DtCDBGroupNode.h:120
Quadrant
Definition: DtCDBTileKey.h:33
void addQuadrantChild(Quadrant quadrant, osg::Group *group)
Add points to a GT quadrant.
CdbGroupNode(const CDBTileKey &key)
CTOR.
bool myHighestLod
flag to indicate if this group is the highest LOD for that tile
Definition: DtCDBGroupNode.h:139
CDB Tile key structure for the model pager.
void setIsHighestLod(bool isHighestLod)
Set the flag if this CDB group is the highest LOD for that tile.
void setObserver(CdbGroupNodeObserver *observer)
associate a CdbGroupNodeObserver

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)