VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOverlayGroupManager.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
13 #include <vrvCore/DtUniqueID.h>
15 
18 
19 #include <unordered_map>
20 #include <list>
21 #include <set>
22 
23 namespace makVrv
24 {
25 
26  class DtBaseConnection;
27 
48  {
49  public:
50 
53  {
54  HiddenGroup = 0,
55  DefaultGroup = 1,
56  UnusedLowGroup = 2,
57  GroupsGroup = 500000,
58  UnusedHighGroup = 1000000,
59  };
60 
62  typedef std::list<std::string> GroupRangeList;
63 
64  public:
65 
68  static DtOverlayGroupManager& instance( DtDe& de );
69 
72  static DtOverlayGroupManager& instance( DtBaseConnection& sim );
73 
75  virtual DtOverlayGroupManager* clone();
76 
78  static void copyInstance( DtBaseConnection& sim, DtDe& de );
79 
81  virtual ~DtOverlayGroupManager();
82 
101  {
102  addOverlayGroupSet( "hoverGroupSet" );
103  addOverlayGroupSet( "overlayZoneMouseOver" );
104  setOverlayGroupSetSizeMultiplier( "overlayZoneMouseOver", 8 );
105  addOverlayGroupSet( "overlayZoneSelected" );
106  setOverlayGroupSetSizeMultiplier( "overlayZoneSelected", 8 );
107  addOverlayGroupSet( "selectedGroupSet" );
108  addOverlayGroupSet( "overlayZoneNormal" );
109  setOverlayGroupSetSizeMultiplier( "overlayZoneNormal", 8 );
110  addOverlayGroupSet( "aboveIconsGroupSet" );
111  addOverlayGroupSet( "iconsGroupSet" );
112  addOverlayGroupSet( "rangeInfoGroupSet" );
113  addOverlayGroupSet( "entityInfoPinnedGroupSet" );
114  addOverlayGroupSet( "symbolDecorationGroupSet" );
115  }
116 
119  virtual void addOverlayGroupSet( const std::string& name );
120 
124  virtual void addOverlayGroupSetUnder( const std::string& name,
125  const std::string& beforeName );
126 
130  virtual void addOverlayGroupSetAbove( const std::string& name,
131  const std::string& afterName );
132 
135  virtual const GroupRangeList& overlayGroupSets() const;
136 
140  virtual GroupRangeList& overlayGroupSets();
141 
147  virtual unsigned int nextGroupId( const std::string& groupSetName );
148 
158  virtual unsigned int acquireElementBlock( const DtElementID& elementId );
159 
165  virtual void releaseElementBlock( const DtElementID& elementId );
166 
175  virtual unsigned int elementGroupId( DtOverlayZone zone,
176  unsigned int blockIndex, DtElementOverlayLayer layer ) const;
177 
184  virtual unsigned int layersPerBlock() const;
185 
193  virtual unsigned int layerSlot( DtElementOverlayLayer layer ) const;
194 
205  virtual void setOverlayGroupSetSizeMultiplier(
206  const std::string& name, unsigned int multiplier );
207 
211  virtual unsigned int blocksPerZone() const;
212 
213  protected:
214 
215  template <typename ManagerClass>
216  friend ManagerClass& defaultManagerInstanceFunction(DtDe&,bool);
217 
218  template <typename ManagerClass>
219  friend void defaultManagerRegisterInstanceFunction(DtDe&,ManagerClass*);
220 
223 
226 
229 
233  virtual void initializeGroupIdGenerators();
234 
235  protected:
236 
242  {
243  public:
244 
249  DtOverlayGroupIdGenerator( const std::string& name,
250  unsigned int minId, unsigned int maxId );
251 
257  unsigned int nextGroupId();
258 
259  protected:
260 
261  std::string myGroupName;
262 
263  unsigned int myNextId;
264 
265  unsigned int myMinId;
266  unsigned int myMaxId;
267 
268  };
269 
270  protected:
272  using ElementBlockMap = std::unordered_map<DtElementID, unsigned int>;
273 
275  using GroupIdGeneratorList = std::unordered_map<std::string,DtOverlayGroupIdGenerator*>;
276 
278 
280 
282  std::unordered_map<std::string, unsigned int> myGroupSizeMultipliers;
283 
286 
290  std::set<unsigned int> myFreeBlockIndices;
291 
293  unsigned int myNextBlockIndex;
294 
297 
299  unsigned int myNormalZoneBase;
300 
302  unsigned int mySelectedZoneBase;
303 
305  unsigned int myMouseOverZoneBase;
306 
308  unsigned int myBlocksPerZone;
309 
311 
312  unsigned int myNextGroupId;
313 
315 
316  };
317 
318 }
std::string myGroupName
Definition: DtOverlayGroupManager.h:261
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
unsigned int myMaxId
Definition: DtOverlayGroupManager.h:266
std::list< std::string > GroupRangeList
List type for the names and order of configured overlay group sets.
Definition: DtOverlayGroupManager.h:62
DtOverlayZone
State zone for a per-element overlay block.
Definition: DtElementOverlayLayer.h:60
unsigned int myNextGroupId
Definition: DtOverlayGroupManager.h:312
unsigned int mySelectedZoneBase
Base group id of the overlayZoneSelected range.
Definition: DtOverlayGroupManager.h:302
Manages the allocation of overlay groups. Overlay groups are used to determine the draw order of spri...
Definition: DtOverlayGroupManager.h:47
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:23
Generates group ids for within the given range. The group id generator keeps track of the next availa...
Definition: DtOverlayGroupManager.h:241
unsigned int myNextBlockIndex
Next sequential block index to hand out when free list is empty.
Definition: DtOverlayGroupManager.h:293
void initializeDefaultGroupSets()
Initialization of the default group sets used by VR-Vantage. This method creates the default overlay ...
Definition: DtOverlayGroupManager.h:100
OverlayGroupId
Enumerates the various special valued overlay group ids.
Definition: DtOverlayGroupManager.h:52
unsigned int myNormalZoneBase
Base group id of the overlayZoneNormal range.
Definition: DtOverlayGroupManager.h:299
DtElementOverlayLayer
Per-element overlay layer order within a block, ordered bottom to top.
Definition: DtElementOverlayLayer.h:28
The DtBaseConnection is an abstract class.
Definition: DtBaseConnection.h:35
Contains makVrv::DtVirtualBaseClass class.
bool myBlockExhaustionWarned
True after the one-time block exhaustion warning has been emitted.
Definition: DtOverlayGroupManager.h:296
std::unordered_map< DtElementID, unsigned int > ElementBlockMap
Map type from element id to block allocation record.
Definition: DtOverlayGroupManager.h:272
std::set< unsigned int > myFreeBlockIndices
Recycled block indices awaiting reuse. std::set deduplicates double-releases and yields deterministic...
Definition: DtOverlayGroupManager.h:290
bool myModificationsLockedFlag
Definition: DtOverlayGroupManager.h:314
GroupRangeList myOverlayGroupRanges
Definition: DtOverlayGroupManager.h:279
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
Contains the DtElementOverlayLayer enumeration.
ElementBlockMap myElementBlocks
Per-entity block allocations, keyed by DtElementID.
Definition: DtOverlayGroupManager.h:285
void defaultManagerRegisterInstanceFunction(DtDe &de, ManagerClass *mgr)
Default implementation of how to register a manager, especially necessary when overriding the manager...
Definition: DtDe.h:930
unsigned int myBlocksPerZone
Number of entity blocks that fit within one zone.
Definition: DtOverlayGroupManager.h:308
DtDe * myOptionalDe
Definition: DtOverlayGroupManager.h:310
Base class to provide boost signal/slot management.
std::unordered_map< std::string, unsigned int > myGroupSizeMultipliers
Per-set ID-range size multipliers; unregistered sets default to 1.
Definition: DtOverlayGroupManager.h:282
ManagerClass & defaultManagerInstanceFunction(DtDe &de, bool allowedInSlave)
default Manager instance function. Manager requirements: 1) Static instance function 2) Protected DtS...
Definition: DtDe.h:892
unsigned int myMinId
Definition: DtOverlayGroupManager.h:265
Contains makVrv::DtUniqueID type.
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
unsigned int myMouseOverZoneBase
Base group id of the overlayZoneMouseOver range.
Definition: DtOverlayGroupManager.h:305
unsigned int myNextId
Definition: DtOverlayGroupManager.h:263
std::unordered_map< std::string, DtOverlayGroupIdGenerator * > GroupIdGeneratorList
Map type for mapping overlay group sets to their ID generators.
Definition: DtOverlayGroupManager.h:275
GroupIdGeneratorList myGroupIdGenerators
Definition: DtOverlayGroupManager.h:277
Contains DLL export macros.

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)