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 | Friends
makVrv::DtOsgEarthPaperMapManager Class Reference

Manager that adds, clears, activates/deactives groups (if any) read in by the DtPaperMapCallback The idea is to have annotations in the .earth file which allows osgEarth layers derived from osgEarth::VisibleLayer to be associated with a group so that layers can be turned on and off at the same time A layer can be part of more than one group Use the mapgroup osgEarth layer attribute like this: <mapgroup>air,naval,default</mapgroup> This means that this osgEarth layer is part of an air map group, a naval map group and a default group visible in both 2d (ex. plan view) and 3d (ex. stealth) There is a Paper Map Toolbar which selects which group to view in the UI.

There is also another way to make layers visible in only 2D or 3D You can use a mask attribute directly in a layer without specifying a mapgroup Elements that should not be visible in 3D views have mask set like: <GDALImage ... mask="4294950911">...</GDALImage> Elements that should not be be visible in 2D have mask set like: <FeatureModel ... mask="4294959103">...</FeatureModel>

The mask settings works on any osgEarth class derived from VisibleLayer The numbers have to be 4294959103 for not being visible in 2D but visible in 3D 4294950911 for not being visible in 3D but visible in 2D 4294959103 = 11111111111111111101111111111111 = FlagPaperMap2DViewOff 4294950911 = 11111111111111111011111111111111 = FlagPaperMap3DViewOff

You can also flag a VisibleLayer to participate in intersections even when a group turns off other layers by using the annotation: <mapgroup_isect>true</mapgroup_isect>

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

Classes

struct  LayerState
 

Public Member Functions

 DtOsgEarthPaperMapManager ()=delete
 
virtual ~DtOsgEarthPaperMapManager ()
 
 DtOsgEarthPaperMapManager (DtOsgEarthPaperMapManager &in)=delete
 
DtOsgEarthPaperMapManager & operator= (const DtOsgEarthPaperMapManager &)=delete
 
virtual void addToGroups (std::string groupStr, osgEarth::VisibleLayer *layer, bool isect)
 
virtual void addToGroup (std::string groupName, osgEarth::VisibleLayer *layer, bool isect)
 
virtual void activateGroup (std::string groupName)
 
std::string activeGroup ()
 
virtual void reset ()
 
virtual bool hasGroup (const std::string &groupName)
 
virtual void updateAnyObserver3D ()
 
virtual void addLayer (osgEarth::Layer *layer)
 
virtual void removeLayer (osgEarth::Layer *layer)
 
virtual void printState ()
 
virtual std::vector< std::string > groupNames ()
 
virtual void update (DtTime tNow) override
 
virtual DtTime lastUpdateTime () const
 
virtual std::vector< std::string > getGroupsForLayer (osgEarth::VisibleLayer *layer)
 
virtual bool layerInActiveGroup (osgEarth::VisibleLayer *layer)
 
virtual void removeGroup (std::string groupName)
 
- Public Member Functions inherited from makVrv::DtTickable
virtual bool needsUpdate (DtTime tNow)
 
virtual bool updateIfNeeded (DtTime tNow)
 
virtual ~DtTickable ()
 
virtual void setTickableEnabled (bool enabled)
 
virtual void setIsThreadSafe (bool safe)
 
virtual bool isThreadSafe () const
 
virtual void setTickableListState (TickableListState safeList)
 
virtual TickableListState tickableListState () const
 
virtual void setUpdatePeriod (unsigned int period)
 
virtual unsigned int updatePeriod () const
 
virtual bool adaptiveTickLodEnabled () const
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static DtOsgEarthPaperMapManager & instance (DtDe &de)
 
static const std::string & theClassName ()
 

Protected Types

using MapGroup = std::set< LayerState >
 

Protected Member Functions

 DtOsgEarthPaperMapManager (DtDe &de)
 
virtual void slot_paperMapEnabledChanged (bool setting)
 
virtual void slot_paperMapLayerTimeoutChanged (double timeout)
 
virtual void slot_observerAdded (const std::string &observerName)
 
virtual void slot_observerRemoved (const std::string &observerName)
 
virtual void slot_onCurrentObserverChanged (DtInputDriver *inputDriver, DtObserver *observer)
 
virtual void slot_observerGroupChanged (DtObserver *observer, std::string obsGroup)
 
virtual void slot_projectionChanged (DtObserverObject *observer, bool is2D)
 
virtual void slot_osgEarthMapNodeFound (DtTerrainPatchObject &tpo)
 
virtual void slot_terrainPatchAboutToBeDeleted (DtTerrainPatchObject &patch)
 
virtual void slot_paperMapIntersectionOverrideChanged (bool setting)
 
- Protected Member Functions inherited from makVrv::DtTickable
 DtTickable (DtTickableManagerInterface *manager)
 
 DtTickable ()=delete
 
virtual void slot_managerAboutToBeDeleted ()
 

Protected Attributes

DtDe & myDe
 
std::map< std::string, MapGroup > myMapGroups
 
std::string myActiveGroupName = {}
 
std::map< DtObserverObject
*, bool > 
myObserverObj2DMap
 
bool myAnyObserverIn3D = true
 
double myLayerTimeOut = 0.0
 
bool myPaperMapFeatureEnabled = true
 
bool myIntersectionOverrideEnabled = true
 
DtObserver * myCurrentObserver = nullptr
 
- Protected Attributes inherited from makVrv::DtTickable
DtTickableManagerInterface * myManager
 
DtSignalConnectionManager myConnections
 
unsigned int myFrameCounter
 
unsigned int myFrameToUpdate
 
unsigned int myUpdatePeriod
 
unsigned int myTickableIndex
 
DtTime myLastUpdateTime
 
bool myIsThreadSafe
 
TickableListState myTickableListState
 

Friends

class DtOsgEarthPaperMapManagerCreator
 

Additional Inherited Members

- Public Types inherited from makVrv::DtTickable
enum  TickableListState { TickableNotOnList, TickableOnMainList, TickableOnThreadSafeList }
 

Member Typedef Documentation

Constructor & Destructor Documentation

makVrv::DtOsgEarthPaperMapManager::DtOsgEarthPaperMapManager ( )
delete

CTOR (unimplemented default CTOR)

virtual makVrv::DtOsgEarthPaperMapManager::~DtOsgEarthPaperMapManager ( )
virtual

DTOR.

makVrv::DtOsgEarthPaperMapManager::DtOsgEarthPaperMapManager ( DtOsgEarthPaperMapManager &  in)
delete

Copy Constructor not implemented - Copy not allowed.

makVrv::DtOsgEarthPaperMapManager::DtOsgEarthPaperMapManager ( DtDe &  de)
protected

CTOR. Protected. Only creator can create.

Member Function Documentation

DtOsgEarthPaperMapManager& makVrv::DtOsgEarthPaperMapManager::operator= ( const DtOsgEarthPaperMapManager &  )
delete

Assignment Operator not implemented - Assignment not allowed.

virtual void makVrv::DtOsgEarthPaperMapManager::addToGroups ( std::string  groupStr,
osgEarth::VisibleLayer *  layer,
bool  isect 
)
virtual

Processes the mapgroup string (ex. "air, naval,default"), adds that layer to the groups, and identifies if the layer should be visible in 3D.

virtual void makVrv::DtOsgEarthPaperMapManager::addToGroup ( std::string  groupName,
osgEarth::VisibleLayer *  layer,
bool  isect 
)
virtual

Helper function for addToGroups, add a layer to a single group and marks whether the group should be visible in 3D.

virtual void makVrv::DtOsgEarthPaperMapManager::activateGroup ( std::string  groupName)
virtual

Configure the map to the layers in a group are visible.

std::string makVrv::DtOsgEarthPaperMapManager::activeGroup ( )

Get the name of the currently active group (or "default" if none selected)

virtual void makVrv::DtOsgEarthPaperMapManager::reset ( )
virtual

Turn off all groups and clear out data structures for which groups has which osgEarth layers.

virtual bool makVrv::DtOsgEarthPaperMapManager::hasGroup ( const std::string &  groupName)
virtual

Do we know about this group name?

virtual void makVrv::DtOsgEarthPaperMapManager::updateAnyObserver3D ( )
virtual

Is any observer in 3D?

virtual void makVrv::DtOsgEarthPaperMapManager::addLayer ( osgEarth::Layer *  layer)
virtual

Add a layer to our manager and see if it has any mapgroup keywords.

virtual void makVrv::DtOsgEarthPaperMapManager::removeLayer ( osgEarth::Layer *  layer)
virtual

Remove a layer from the manager.

virtual void makVrv::DtOsgEarthPaperMapManager::printState ( )
virtual

Print out all the group names and layer pointers.

virtual std::vector<std::string> makVrv::DtOsgEarthPaperMapManager::groupNames ( )
virtual

Get all the group names.

virtual void makVrv::DtOsgEarthPaperMapManager::update ( DtTime  tNow)
overridevirtual

The update function called by DtTickableManager during update-ticks.

Parameters
[in]tNowis the current time-stamp.

Implements makVrv::DtTickable.

virtual DtTime makVrv::DtOsgEarthPaperMapManager::lastUpdateTime ( ) const
virtual

Get the time-stamp of the last update.

Returns
The last update time.
virtual std::vector<std::string> makVrv::DtOsgEarthPaperMapManager::getGroupsForLayer ( osgEarth::VisibleLayer *  layer)
virtual

Find the groups associated with this layer.

virtual bool makVrv::DtOsgEarthPaperMapManager::layerInActiveGroup ( osgEarth::VisibleLayer *  layer)
virtual

Is this layer in an active group?

virtual void makVrv::DtOsgEarthPaperMapManager::removeGroup ( std::string  groupName)
virtual

Remove the layers in this group from all our tracking data structures and then remove the group.

virtual void makVrv::DtOsgEarthPaperMapManager::slot_paperMapEnabledChanged ( bool  setting)
protectedvirtual

Turn this feature on, off.

virtual void makVrv::DtOsgEarthPaperMapManager::slot_paperMapLayerTimeoutChanged ( double  timeout)
protectedvirtual

Set the timeout before a non-visible layer is closed.

virtual void makVrv::DtOsgEarthPaperMapManager::slot_observerAdded ( const std::string &  observerName)
protectedvirtual

Detect when a new observer is created so we can monitor if it is 2D or 3D.

virtual void makVrv::DtOsgEarthPaperMapManager::slot_observerRemoved ( const std::string &  observerName)
protectedvirtual

Detect when a new observer is destroyed so we can stop monitoring it.

virtual void makVrv::DtOsgEarthPaperMapManager::slot_onCurrentObserverChanged ( DtInputDriver *  inputDriver,
DtObserver *  observer 
)
protectedvirtual

Detect when the current observer changes.

virtual void makVrv::DtOsgEarthPaperMapManager::slot_observerGroupChanged ( DtObserver *  observer,
std::string  obsGroup 
)
protectedvirtual

Did the current observer change is paper map layer (from loading an observer view)

virtual void makVrv::DtOsgEarthPaperMapManager::slot_projectionChanged ( DtObserverObject *  observer,
bool  is2D 
)
protectedvirtual

Called by signal when an observer's projection (3D/2D) changes.

virtual void makVrv::DtOsgEarthPaperMapManager::slot_osgEarthMapNodeFound ( DtTerrainPatchObject &  tpo)
protectedvirtual

Add some callbacks when a new map node is found.

virtual void makVrv::DtOsgEarthPaperMapManager::slot_terrainPatchAboutToBeDeleted ( DtTerrainPatchObject &  patch)
protectedvirtual

Another signal for when a terrain is destroyed.

virtual void makVrv::DtOsgEarthPaperMapManager::slot_paperMapIntersectionOverrideChanged ( bool  setting)
protectedvirtual

Set all layers to intersect when not visible (not just if the layer in the osgEarth file has a <mapgroup_isect> annotation.

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

Get/create instance of layer visibility manager.

static const std::string& makVrv::DtOsgEarthPaperMapManager::theClassName ( )
static

Get the name this class is registered by.

Friends And Related Function Documentation

friend class DtOsgEarthPaperMapManagerCreator
friend

Friended with creator so that it can use our constructor.

Member Data Documentation

DtDe& makVrv::DtOsgEarthPaperMapManager::myDe
protected
std::map<std::string, MapGroup> makVrv::DtOsgEarthPaperMapManager::myMapGroups
protected
std::string makVrv::DtOsgEarthPaperMapManager::myActiveGroupName = {}
protected
std::map<DtObserverObject*, bool> makVrv::DtOsgEarthPaperMapManager::myObserverObj2DMap
protected
bool makVrv::DtOsgEarthPaperMapManager::myAnyObserverIn3D = true
protected
double makVrv::DtOsgEarthPaperMapManager::myLayerTimeOut = 0.0
protected
bool makVrv::DtOsgEarthPaperMapManager::myPaperMapFeatureEnabled = true
protected
bool makVrv::DtOsgEarthPaperMapManager::myIntersectionOverrideEnabled = true
protected
DtObserver* makVrv::DtOsgEarthPaperMapManager::myCurrentObserver = nullptr
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)