VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | 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]

Public Types

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

Public Member Functions

 DtOsgEarthPaperMapManager ()=delete
 
virtual ~DtOsgEarthPaperMapManager ()
 
 DtOsgEarthPaperMapManager (DtOsgEarthPaperMapManager &in)=delete
 
DtOsgEarthPaperMapManageroperator= (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 void resetGroupMasks ()
 
virtual void enableAllGroupMasks ()
 
virtual void defaultGroupMasksVisible (ShowIn show)
 
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 void closeLayer (osgEarth::VisibleLayer *layer)
 
virtual void openLayer (osgEarth::VisibleLayer *layer)
 
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 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 lodSystemEnabled () const
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static DtOsgEarthPaperMapManagerinstance (DtDe &de)
 
static const std::string & theClassName ()
 

Protected Types

typedef std::map
< DtObserverObject *, bool
ObserverObj2DMap
 
typedef std::set
< osgEarth::VisibleLayer * > 
PaperMapLayerSet
 
typedef std::map< std::string,
PaperMapLayerSet
GroupLayerMap
 
typedef std::map
< osgEarth::VisibleLayer
*, bool
LayerBoolMap
 
typedef std::map
< osgEarth::VisibleLayer
*, DtTime
LayerTimeMap
 

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 ()
 
virtual void slot_managerAboutToBeDeleted ()
 

Protected Attributes

DtDemyDe
 
DtSignalConnectionManager myConnections
 
GroupLayerMap myGroupMap
 
LayerBoolMap myLayerIsInDefault
 
LayerBoolMap myGroupIsect
 
std::string myActiveGroupName
 
ObserverObj2DMap myObserverObj2DMap
 
bool myAnyObserverIn3D
 
LayerTimeMap myLayerTime
 
double myLayerTimeOut
 
bool myPaperMapFeatureEnabled
 
bool myIntersectionOverride
 
DtObservermyCurrentObserver
 
- Protected Attributes inherited from makVrv::DtTickable
DtTickableManagerInterfacemyManager
 
DtSignalConnectionManager myConnections
 
unsigned int myFrameCounter
 
unsigned int myFrameToUpdate
 
unsigned int myUpdatePeriod
 
DtTime myLastUpdateTime
 
bool myIsThreadSafe
 
TickableListState myTickableListState
 

Friends

class DtOsgEarthPaperMapManagerCreator
 

Member Typedef Documentation

typedef std::set<osgEarth::VisibleLayer*> makVrv::DtOsgEarthPaperMapManager::PaperMapLayerSet
protected
typedef std::map<std::string, PaperMapLayerSet > makVrv::DtOsgEarthPaperMapManager::GroupLayerMap
protected
typedef std::map<osgEarth::VisibleLayer*, bool > makVrv::DtOsgEarthPaperMapManager::LayerBoolMap
protected
typedef std::map<osgEarth::VisibleLayer*, DtTime> makVrv::DtOsgEarthPaperMapManager::LayerTimeMap
protected

Member Enumeration Documentation

Enumerator
SHOW_IN_2D_AND_3D 
SHOW_IN_2D 
SHOW_IN_3D 

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

Set the layer masks for a particular group so that it is 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 void makVrv::DtOsgEarthPaperMapManager::resetGroupMasks ( )
virtual

Go through all the groups and layers and mark them as invisible.

virtual void makVrv::DtOsgEarthPaperMapManager::enableAllGroupMasks ( )
virtual

Go through all the groups and make them visible (ex. if feature is off)

virtual void makVrv::DtOsgEarthPaperMapManager::defaultGroupMasksVisible ( ShowIn  show)
virtual

Set whether the default group is shown in 2D, 3D, or both.

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 void makVrv::DtOsgEarthPaperMapManager::closeLayer ( osgEarth::VisibleLayer *  layer)
virtual

Put a layer on a list to be deleted after a time out (ex. 40 seconds)

virtual void makVrv::DtOsgEarthPaperMapManager::openLayer ( osgEarth::VisibleLayer *  layer)
virtual

Open a layer and take it off the about-to-close list.

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_intersect> 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
DtSignalConnectionManager makVrv::DtOsgEarthPaperMapManager::myConnections
protected
GroupLayerMap makVrv::DtOsgEarthPaperMapManager::myGroupMap
protected
LayerBoolMap makVrv::DtOsgEarthPaperMapManager::myLayerIsInDefault
protected
LayerBoolMap makVrv::DtOsgEarthPaperMapManager::myGroupIsect
protected
std::string makVrv::DtOsgEarthPaperMapManager::myActiveGroupName
protected
ObserverObj2DMap makVrv::DtOsgEarthPaperMapManager::myObserverObj2DMap
protected
bool makVrv::DtOsgEarthPaperMapManager::myAnyObserverIn3D
protected
LayerTimeMap makVrv::DtOsgEarthPaperMapManager::myLayerTime
protected
double makVrv::DtOsgEarthPaperMapManager::myLayerTimeOut
protected
bool makVrv::DtOsgEarthPaperMapManager::myPaperMapFeatureEnabled
protected
bool makVrv::DtOsgEarthPaperMapManager::myIntersectionOverride
protected
DtObserver* makVrv::DtOsgEarthPaperMapManager::myCurrentObserver
protected

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

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)