VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtAutoCollapseExpandEchelonManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2025 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
14 #include <vrvCore/DtElementData.h>
16 
19 
20 #include <boost/signals2.hpp>
21 #include <map>
22 #include <set>
23 
24 namespace makVrv
25 {
26  class DtDe;
27  class DtRecordSettingsBackupInterface;
28  class DtSharedSettingsManager;
29  class DtEventQueueInterface;
30  class DtChannel;
31  class DtChannelManager;
32 
42  {
43  public:
47 
49  virtual ~DtAutoCollapseExpandEchelonManager() override;
50 
59 
63  static DtAutoCollapseExpandEchelonManager& instance(DtDe& de);
64 
67 
75  virtual void setCollapseLevelsAboveMapScales(const std::map<int, double>& mapScaleCollapse);
76 
79  const std::map<int, double>& collapseLevelsAboveMapScales() const;
80 
83  virtual void setEnabled(bool enabled);
84 
87  virtual bool enabled() const;
88 
91  virtual void setChannelToUseForScale(std::string name);
92 
94 
97 
105  virtual void mapScaleChanged(double scaleInMeters);
106 
108 
111 
119  virtual void collapseAllToLevel(int level);
120 
125  virtual void expandAllAutomaticallyCollapsed();
126 
128 
131 
138  virtual void setNextExpandCollapseIsUser(bool b);
139 
147  virtual void setToAutomatic(const std::set<DtElementID>& ids = std::set<DtElementID>());
148 
156  virtual void setToUserControlled(const std::set<DtElementID>& ids, bool expanding);
157 
161  virtual bool unitOrChildIsUserControlled(DtElementID id) const;
162 
164 
165  protected:
168  virtual bool setChildElementsToAutomatic(const DtElementID& id);
169 
171  virtual void slot_postTick();
172 
175  virtual void hierarchyItemsModified(const DtElementAttributeManager::EntryAttributesList& l);
176 
179  virtual void hierarchyItemsRemoved(const DtElementData::UniqueIdList& idList);
180 
182  virtual void recalculateLevels();
183 
187  virtual int levelFor(DtElementID id) const;
188 
194  virtual void bottomUpHierarchy();
195 
199  virtual int bottomUpHierarchy(DtElementEntry* entry);
200 
202  virtual void findDefaultChannel();
203 
205  virtual DtElementID findHighestLevelUserControlled(const DtElementID& startingId);
206 
209  virtual bool userControlled(const DtElementID& id) const;
210 
212  virtual void slot_channelAboutToBeDestroyed( DtChannelManager*, DtChannel* channel );
213  protected:
216 
218  using HierarchyLevels = std::map<int, std::set<DtElementID>>;
219 
222 
225 
228  {
229  int level = 0;
230  bool userExpanded = false;
231  };
232 
234  int myLastCollapsedLevel = 0;
235 
237  using AutoCollapseMap = std::map<DtElementID, AutoCollapseInfo>;
238 
243 
246 
248  std::map<int, double> myMapScaleCollapse;
249 
251  bool myEnabled;
252 
255 
258 
261 
264  boost::signals2::connection myChannelDestroyConnection;
265  };
266 }
std::map< int, std::set< DtElementID >> HierarchyLevels
Type alias for hierarchy level mapping.
Definition: DtAutoCollapseExpandEchelonManager.h:218
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
double myPreviousViewResolution
Previous view resolution for change detection.
Definition: DtAutoCollapseExpandEchelonManager.h:260
DtSignalConnectionManager myConnectionManager
Manages signal connections for this manager.
Definition: DtAutoCollapseExpandEchelonManager.h:224
Information about an aggregate&#39;s auto-collapse state.
Definition: DtAutoCollapseExpandEchelonManager.h:227
DT_DLL_VRVCORE DtTaitBryan level(const DtCoordinateSystem &cs, const DtVector &localOrigin, double topoHeading)
Returns a level orientation with the topographic heading.
AutoCollapseMap myAutoCollapseMap
Map of aggregate IDs to their auto-collapse information.
Definition: DtAutoCollapseExpandEchelonManager.h:240
Contains makVrv::DtElementData class.
HierarchyLevels myHierarchyLevels
Map of hierarchy levels to sets of unique IDs at each level.
Definition: DtAutoCollapseExpandEchelonManager.h:221
DtElementEntry holds the non-simulation-specific data about an element, including its element type an...
Definition: DtElementEntry.h:22
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:23
Manages automatic expansion and collapsing of aggregates based on map scale and echelon level...
Definition: DtAutoCollapseExpandEchelonManager.h:41
The abstract Channel Class.
Definition: DtChannel.h:35
Contains makVrv::DtVirtualBaseClass class.
DtChannel * myChannel
Pointer to the channel being monitored for scale changes.
Definition: DtAutoCollapseExpandEchelonManager.h:263
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
std::map< int, double > myMapScaleCollapse
Map of echelon level to map scale threshold (meters per screen inch)
Definition: DtAutoCollapseExpandEchelonManager.h:248
DtDe & myDe
Reference to the DtDe object.
Definition: DtAutoCollapseExpandEchelonManager.h:215
std::vector< EntryAttributes > EntryAttributesList
Define the type used to signal changes to one or more attributes for one or more elements.
Definition: DtElementAttributeManager.h:44
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
double myCurrentScale
Current map scale in meters per screen inch.
Definition: DtAutoCollapseExpandEchelonManager.h:257
bool myRecalculateLevels
Flag indicating if hierarchy levels need recalculation.
Definition: DtAutoCollapseExpandEchelonManager.h:254
boost::signals2::connection myChannelDestroyConnection
Definition: DtAutoCollapseExpandEchelonManager.h:264
bool myNextExpandCollapseIsUser
Flag indicating if the next expand/collapse is user-initiated.
Definition: DtAutoCollapseExpandEchelonManager.h:245
Base class for handling DtChannels. Derived classes should override the tick() method and advance the...
Definition: DtChannelManager.h:32
Base class to provide boost signal/slot management.
AutoCollapseMap myUserSpecifiedMap
Map of aggregates that have been explicitly controlled by the user.
Definition: DtAutoCollapseExpandEchelonManager.h:242
std::vector< DtElementID > UniqueIdList
Public Type Definitions.
Definition: DtElementData.h:49
Contains the DtElementAttributeManager class declaration.
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
std::map< DtElementID, AutoCollapseInfo > AutoCollapseMap
Type alias for auto-collapse information map.
Definition: DtAutoCollapseExpandEchelonManager.h:237
bool myEnabled
Flag indicating if auto-collapse/expand is enabled.
Definition: DtAutoCollapseExpandEchelonManager.h:251
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)