![]() |
VR-Forces Developer's Guide
|
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>

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 | |
| 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 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 | 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 | |
| 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 ()=delete | |
| virtual void | slot_managerAboutToBeDeleted () |
Protected Attributes | |
| DtDe & | myDe |
| GroupLayerMap | myGroupMap |
| LayerBoolMap | myLayerIsInDefault |
| LayerBoolMap | myGroupIsect |
| std::string | myActiveGroupName |
| ObserverObj2DMap | myObserverObj2DMap |
| bool | myAnyObserverIn3D |
| LayerTimeMap | myLayerTime |
| double | myLayerTimeOut |
| bool | myPaperMapFeatureEnabled |
| bool | myIntersectionOverride |
| DtObserver * | myCurrentObserver |
| vrvSignalsLib::connection | myLodScaleChangedConnection |
| vrvSignalsLib::connection | myPaperMapLayerChangedConnection |
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 |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
delete |
CTOR (unimplemented default CTOR)
|
virtual |
DTOR.
|
delete |
Copy Constructor not implemented - Copy not allowed.
|
protected |
CTOR. Protected. Only creator can create.
|
delete |
Assignment Operator not implemented - Assignment not allowed.
|
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 |
Helper function for addToGroups, add a layer to a single group and marks whether the group should be visible in 3D.
|
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 |
Turn off all groups and clear out data structures for which groups has which osgEarth layers.
|
virtual |
Go through all the groups and layers and mark them as invisible.
|
virtual |
Go through all the groups and make them visible (ex. if feature is off)
|
virtual |
Set whether the default group is shown in 2D, 3D, or both.
|
virtual |
Do we know about this group name?
|
virtual |
Is any observer in 3D?
|
virtual |
Add a layer to our manager and see if it has any mapgroup keywords.
|
virtual |
Remove a layer from the manager.
|
virtual |
Print out all the group names and layer pointers.
|
virtual |
Get all the group names.
|
overridevirtual |
The update function called by DtTickableManager during update-ticks.
| [in] | tNow | is the current time-stamp. |
Implements makVrv::DtTickable.
|
virtual |
Put a layer on a list to be deleted after a time out (ex. 40 seconds)
|
virtual |
Open a layer and take it off the about-to-close list.
|
virtual |
Get the time-stamp of the last update.
|
virtual |
Find the groups associated with this layer.
|
virtual |
Is this layer in an active group?
|
virtual |
Remove the layers in this group from all our tracking data structures and then remove the group.
|
protectedvirtual |
Turn this feature on, off.
|
protectedvirtual |
Set the timeout before a non-visible layer is closed.
|
protectedvirtual |
Detect when a new observer is created so we can monitor if it is 2D or 3D.
|
protectedvirtual |
Detect when a new observer is destroyed so we can stop monitoring it.
|
protectedvirtual |
Detect when the current observer changes.
|
protectedvirtual |
Did the current observer change is paper map layer (from loading an observer view)
|
protectedvirtual |
Called by signal when an observer's projection (3D/2D) changes.
|
protectedvirtual |
Add some callbacks when a new map node is found.
|
protectedvirtual |
Another signal for when a terrain is destroyed.
|
protectedvirtual |
Set all layers to intersect when not visible (not just if the layer in the osgEarth file has a <mapgroup_intersect> annotation.
|
static |
Get/create instance of layer visibility manager.
|
static |
Get the name this class is registered by.
|
friend |
Friended with creator so that it can use our constructor.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |