VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtAutoCollapseExpandEchelonManager Class Reference

Manages automatic expansion and collapsing of aggregates based on map scale and echelon level.

This manager automatically controls the collapse/expand state of aggregate units based on the current map scale. It allows configuration of which echelon levels should be collapsed at specific map scales.

Inheritance diagram for makVrv::DtAutoCollapseExpandEchelonManager:
Inheritance graph
[legend]

Classes

struct  AutoCollapseInfo
 

Public Member Functions

 DtAutoCollapseExpandEchelonManager (DtDe &)
 
virtual ~DtAutoCollapseExpandEchelonManager () override
 
 DtAutoCollapseExpandEchelonManager ()=delete
 
 DtAutoCollapseExpandEchelonManager (DtAutoCollapseExpandEchelonManager &)=delete
 
 DtAutoCollapseExpandEchelonManager (DtAutoCollapseExpandEchelonManager &&)=delete
 
DtAutoCollapseExpandEchelonManager & operator= (DtAutoCollapseExpandEchelonManager &)=delete
 
DtAutoCollapseExpandEchelonManager & operator= (DtAutoCollapseExpandEchelonManager &&)=delete
 
Configuration Methods
virtual void setCollapseLevelsAboveMapScales (const std::map< int, double > &mapScaleCollapse)
 
const std::map< int, double > & collapseLevelsAboveMapScales () const
 
virtual void setEnabled (bool enabled)
 
virtual bool enabled () const
 
virtual void setChannelToUseForScale (std::string name)
 
Map Scale Control
virtual void mapScaleChanged (double scaleInMeters)
 
Manual Control Methods
virtual void collapseAllToLevel (int level)
 
virtual void expandAllAutomaticallyCollapsed ()
 
User Control Tracking
virtual void setNextExpandCollapseIsUser (bool b)
 
virtual void setToAutomatic (const std::set< DtElementID > &ids=std::set< DtElementID >())
 
virtual void setToUserControlled (const std::set< DtElementID > &ids, bool expanding)
 
virtual bool unitOrChildIsUserControlled (DtElementID id) const
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static
DtAutoCollapseExpandEchelonManager & 
instance (DtDe &de)
 

Protected Types

using HierarchyLevels = std::map< int, std::set< DtElementID >>
 
using AutoCollapseMap = std::map< DtElementID, AutoCollapseInfo >
 

Protected Member Functions

virtual bool setChildElementsToAutomatic (const DtElementID &id)
 
virtual void slot_postTick ()
 
virtual void hierarchyItemsModified (const DtElementAttributeManager::EntryAttributesList &l)
 
virtual void hierarchyItemsRemoved (const DtElementData::UniqueIdList &idList)
 
virtual void recalculateLevels ()
 
virtual int levelFor (DtElementID id) const
 
virtual void bottomUpHierarchy ()
 
virtual int bottomUpHierarchy (DtElementEntry *entry)
 
virtual void findDefaultChannel ()
 
virtual DtElementID findHighestLevelUserControlled (const DtElementID &startingId)
 
virtual bool userControlled (const DtElementID &id) const
 
virtual void slot_channelAboutToBeDestroyed (DtChannelManager *, DtChannel *channel)
 

Protected Attributes

DtDe & myDe
 
HierarchyLevels myHierarchyLevels
 
DtSignalConnectionManager myConnectionManager
 
int myLastCollapsedLevel = 0
 
AutoCollapseMap myAutoCollapseMap
 
AutoCollapseMap myUserSpecifiedMap
 
bool myNextExpandCollapseIsUser
 
std::map< int, double > myMapScaleCollapse
 
bool myEnabled
 
bool myRecalculateLevels
 
double myCurrentScale
 
double myPreviousViewResolution
 
DtChannel * myChannel
 
boost::signals2::connection myChannelDestroyConnection
 

Member Typedef Documentation

Type alias for hierarchy level mapping.

Type alias for auto-collapse information map.

Constructor & Destructor Documentation

makVrv::DtAutoCollapseExpandEchelonManager::DtAutoCollapseExpandEchelonManager ( DtDe &  )

CTOR.

Parameters
deReference to the DtDe (Distributed Entity) object
virtual makVrv::DtAutoCollapseExpandEchelonManager::~DtAutoCollapseExpandEchelonManager ( )
overridevirtual

DTOR.

makVrv::DtAutoCollapseExpandEchelonManager::DtAutoCollapseExpandEchelonManager ( )
delete

not allowed

makVrv::DtAutoCollapseExpandEchelonManager::DtAutoCollapseExpandEchelonManager ( DtAutoCollapseExpandEchelonManager &  )
delete

not allowed

makVrv::DtAutoCollapseExpandEchelonManager::DtAutoCollapseExpandEchelonManager ( DtAutoCollapseExpandEchelonManager &&  )
delete

not allowed

Member Function Documentation

DtAutoCollapseExpandEchelonManager& makVrv::DtAutoCollapseExpandEchelonManager::operator= ( DtAutoCollapseExpandEchelonManager &  )
delete

not allowed

DtAutoCollapseExpandEchelonManager& makVrv::DtAutoCollapseExpandEchelonManager::operator= ( DtAutoCollapseExpandEchelonManager &&  )
delete

not allowed

static DtAutoCollapseExpandEchelonManager& makVrv::DtAutoCollapseExpandEchelonManager::instance ( DtDe &  de)
static

Returns the singleton instance of the manager for the given DtDe.

Parameters
deReference to the DtDe object
Returns
Reference to the DtAutoCollapseExpandEchelonManager instance
virtual void makVrv::DtAutoCollapseExpandEchelonManager::setCollapseLevelsAboveMapScales ( const std::map< int, double > &  mapScaleCollapse)
virtual

Set the map scale thresholds for automatic collapse.

Configures at which map scales aggregates should automatically collapse to specific echelon levels. The map uses the echelon level as the key and the map scale (in meters per screen inch) as the value.

Parameters
mapScaleCollapseMap of echelon level to map scale threshold
const std::map<int, double>& makVrv::DtAutoCollapseExpandEchelonManager::collapseLevelsAboveMapScales ( ) const

Get the current map scale collapse configuration.

Returns
Const reference to the map scale collapse settings
virtual void makVrv::DtAutoCollapseExpandEchelonManager::setEnabled ( bool  enabled)
virtual

Enable or disable the auto collapse/expand system.

Parameters
enabledTrue to enable automatic collapse/expand, false to disable
virtual bool makVrv::DtAutoCollapseExpandEchelonManager::enabled ( ) const
virtual

Check if the auto collapse/expand system is enabled.

Returns
True if enabled, false otherwise
virtual void makVrv::DtAutoCollapseExpandEchelonManager::setChannelToUseForScale ( std::string  name)
virtual

Set which channel to use for scale calculations.

Parameters
nameName of the channel to monitor for scale changes
virtual void makVrv::DtAutoCollapseExpandEchelonManager::mapScaleChanged ( double  scaleInMeters)
virtual

Notify the manager that the map scale has changed.

Called when the display's map scale changes (e.g., user zooms in/out). The manager will automatically adjust which aggregates are expanded or collapsed based on the configured thresholds.

Parameters
scaleInMetersThe new map scale in meters per screen inch
virtual void makVrv::DtAutoCollapseExpandEchelonManager::collapseAllToLevel ( int  level)
virtual

Collapse all aggregates to a specific echelon level.

Manually collapses all aggregates to the specified level depth, unless they have been manually expanded/collapsed by the user. If level is 0, expands all aggregates that are not user-controlled.

Parameters
levelThe echelon level to collapse to (0 = expand all)
virtual void makVrv::DtAutoCollapseExpandEchelonManager::expandAllAutomaticallyCollapsed ( )
virtual

Expand all items that have been automatically collapsed.

Expands all aggregates that were collapsed by the auto-collapse system, but preserves user-controlled collapse states.

virtual void makVrv::DtAutoCollapseExpandEchelonManager::setNextExpandCollapseIsUser ( bool  b)
virtual

Mark the next expand/collapse operation as user-initiated.

When true, the next expand/collapse operation will be recorded as a user action, preventing the auto-collapse system from overriding it.

Parameters
bTrue if next operation is user-initiated
virtual void makVrv::DtAutoCollapseExpandEchelonManager::setToAutomatic ( const std::set< DtElementID > &  ids = std::set< DtElementID >())
virtual

Reset aggregates to automatic control.

Removes user-control flags from the specified aggregates, allowing the auto-collapse system to manage their state again. If no IDs are specified, resets all aggregates to automatic control.

Parameters
idsSet of unique IDs to reset (empty = reset all)
virtual void makVrv::DtAutoCollapseExpandEchelonManager::setToUserControlled ( const std::set< DtElementID > &  ids,
bool  expanding 
)
virtual

Mark aggregates as user-controlled.

Flags the specified aggregates as being under user control, preventing the auto-collapse system from automatically changing their state.

Parameters
idsSet of unique IDs to mark as user-controlled
expandingTrue if the user action was to expand, false if collapsing
virtual bool makVrv::DtAutoCollapseExpandEchelonManager::unitOrChildIsUserControlled ( DtElementID  id) const
virtual

Check if an aggregate is under user control.

Parameters
idUnique ID of the aggregate to check
Returns
True if the aggregate is user-controlled, false otherwise
virtual bool makVrv::DtAutoCollapseExpandEchelonManager::setChildElementsToAutomatic ( const DtElementID &  id)
protectedvirtual

Recursive to remove all child element IDs from myUserSpecified.

Returns
True if the id is removed from myUserSpecified
virtual void makVrv::DtAutoCollapseExpandEchelonManager::slot_postTick ( )
protectedvirtual

Called after each simulation tick to process pending updates.

virtual void makVrv::DtAutoCollapseExpandEchelonManager::hierarchyItemsModified ( const DtElementAttributeManager::EntryAttributesList &  l)
protectedvirtual

Handle modifications to hierarchy items.

Parameters
lList of modified hierarchy entries
virtual void makVrv::DtAutoCollapseExpandEchelonManager::hierarchyItemsRemoved ( const DtElementData::UniqueIdList &  idList)
protectedvirtual

Handle removal of hierarchy items.

Parameters
idListList of removed unique IDs
virtual void makVrv::DtAutoCollapseExpandEchelonManager::recalculateLevels ( )
protectedvirtual

Recalculate the hierarchy levels for all aggregates.

virtual int makVrv::DtAutoCollapseExpandEchelonManager::levelFor ( DtElementID  id) const
protectedvirtual

Get the echelon level for a specific aggregate.

Parameters
idUnique ID of the aggregate
Returns
The echelon level of the aggregate
virtual void makVrv::DtAutoCollapseExpandEchelonManager::bottomUpHierarchy ( )
protectedvirtual

Calculate hierarchy using bottom-up approach.

Calculates levels where each aggregate has its own level structure. A 1-level aggregate collapses at level 1, while a 4-level aggregate collapses at level 4. Walks the chain of each element individually.

virtual int makVrv::DtAutoCollapseExpandEchelonManager::bottomUpHierarchy ( DtElementEntry *  entry)
protectedvirtual

Calculate bottom-up hierarchy for a specific element.

Parameters
entryPointer to the element entry to process
Returns
The calculated hierarchy level
virtual void makVrv::DtAutoCollapseExpandEchelonManager::findDefaultChannel ( )
protectedvirtual

Find and set the default channel for scale monitoring.

virtual DtElementID makVrv::DtAutoCollapseExpandEchelonManager::findHighestLevelUserControlled ( const DtElementID &  startingId)
protectedvirtual

Find the highest level user-controlled aggregate in the hierarchy.

virtual bool makVrv::DtAutoCollapseExpandEchelonManager::userControlled ( const DtElementID &  id) const
protectedvirtual

Check if an element id is in the myUserSpecifiedMap Doesn't check children.

virtual void makVrv::DtAutoCollapseExpandEchelonManager::slot_channelAboutToBeDestroyed ( DtChannelManager *  ,
DtChannel *  channel 
)
protectedvirtual

Slot called when the monitored channel is about to be destroyed.

Member Data Documentation

DtDe& makVrv::DtAutoCollapseExpandEchelonManager::myDe
protected

Reference to the DtDe object.

HierarchyLevels makVrv::DtAutoCollapseExpandEchelonManager::myHierarchyLevels
protected

Map of hierarchy levels to sets of unique IDs at each level.

DtSignalConnectionManager makVrv::DtAutoCollapseExpandEchelonManager::myConnectionManager
protected

Manages signal connections for this manager.

int makVrv::DtAutoCollapseExpandEchelonManager::myLastCollapsedLevel = 0
protected

The last level that was collapsed to.

AutoCollapseMap makVrv::DtAutoCollapseExpandEchelonManager::myAutoCollapseMap
protected

Map of aggregate IDs to their auto-collapse information.

AutoCollapseMap makVrv::DtAutoCollapseExpandEchelonManager::myUserSpecifiedMap
protected

Map of aggregates that have been explicitly controlled by the user.

bool makVrv::DtAutoCollapseExpandEchelonManager::myNextExpandCollapseIsUser
protected

Flag indicating if the next expand/collapse is user-initiated.

std::map<int, double> makVrv::DtAutoCollapseExpandEchelonManager::myMapScaleCollapse
protected

Map of echelon level to map scale threshold (meters per screen inch)

bool makVrv::DtAutoCollapseExpandEchelonManager::myEnabled
protected

Flag indicating if auto-collapse/expand is enabled.

bool makVrv::DtAutoCollapseExpandEchelonManager::myRecalculateLevels
protected

Flag indicating if hierarchy levels need recalculation.

double makVrv::DtAutoCollapseExpandEchelonManager::myCurrentScale
protected

Current map scale in meters per screen inch.

double makVrv::DtAutoCollapseExpandEchelonManager::myPreviousViewResolution
protected

Previous view resolution for change detection.

DtChannel* makVrv::DtAutoCollapseExpandEchelonManager::myChannel
protected

Pointer to the channel being monitored for scale changes.

boost::signals2::connection makVrv::DtAutoCollapseExpandEchelonManager::myChannelDestroyConnection
protected

The documentation for this class was generated from the following file:

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)