VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtNavigationFeatureManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/DtTickable.h>
13 #include <vrvCore/DtUniqueID.h>
15 
17 
18 #include <matrix/vlVector.h>
19 
20 #include <boost/unordered_map.hpp>
21 
22 #include <map>
23 
24 namespace makVrv
25 {
26  class DtDe;
27  class DtAgentManagerInterface;
28  class DtNavigationFeatureStringParser;
29  class DtBuoyOrBeaconFacade;
30  class DtNavigationFeature;
31  class DtNavigationFeatureBuilder;
32 
39  {
40  public:
42  typedef std::map<DtUniqueID, DtNavigationFeature*>
44 
46  DtNavigationFeatureManager(const std::string& name, DtDe& de,
47  DtAgentManagerInterface& sceneInterface,
48  DtBuoyBeaconLayer& buoyBeaconLayer,
50  const std::string& featureLayerList,
51  const std::string& featureAttrMapFilename,
52  DtNavigationFeatureBuilder* featureBuilder,
53  int presenceSwitchNum, int typeSwitchNum );
54 
56  virtual ~DtNavigationFeatureManager();
57 
61  bool readFeatureStyleListFile( const std::string& path,
62  const std::string& layerListFileName );
63 
66  virtual void addFeature( DtNavigationFeature* feature );
67 
69  DtNavigationFeature* findFeature( DtUniqueID elementId );
70 
73  virtual bool destroyFeature( DtUniqueID id );
74 
76  const FeatureMap& features() const;
78  FeatureMap& features();
80 
83  virtual DtUniqueID findFeatureWithPosition( const DtVector& position );
84 
85  protected:
88 
91 
94 
95  virtual void setPresenceSwitchNumber( int switchNum );
96  virtual int presenceSwitchNumber() const;
97 
98  virtual void setTypeSwitchNumber( int typeNum );
99  virtual int typeSwitchNumber() const;
100 
102  virtual void attachToBuoyOrBeacon( DtNavigationFeature& controller,
103  DtBuoyOrBeaconFacade& buoyOrBeacon );
104 
106  virtual void detachFromBuoyOrBeacon( DtNavigationFeature& controller,
107  DtBuoyOrBeaconFacade& buoy );
108 
111  virtual void moveFeatureToDetachedFeatureList( DtUniqueID controllerId );
112 
115  virtual void moveFeatureToAttachedFeatureList( DtUniqueID controllerId );
116 
119  virtual void initializeFeatureCreators();
120 
123  virtual void slot_featureToBeDeleted( const std::string& myLayerName,
124  DtUniqueID featureId );
125 
128  virtual void slot_buoyOrBeaconCreated( DtBuoyOrBeaconFacade& buoy,
129  const DtVector& initialPosition );
130 
133  virtual void slot_buoyOrBeaconAboutToBeDestroyed(
134  const DtBuoyOrBeaconFacade& buoy );
135 
139  void slot_sceneCreated();
140 
142  void slot_postInitialize();
143 
144  protected:
149  std::string myName;
151  std::string myFeatureLayerList;
156 
157  typedef std::list<std::string> FeatureStylesList;
158 
161 
163  typedef boost::unordered_map<DtUniqueID, DtVector>
165 
168 
172 
175  typedef boost::unordered_map<DtUniqueID, DtUniqueID>
177 
180 
183 
184  boost::signalslib::connection myPostInitializeConnection;
185 
186  };
187 }
boost::unordered_map< DtUniqueID, DtUniqueID > FeatureToFeatureMap
Type for hash tables of features to attached buoys and attached buoys to features.
Definition: DtNavigationFeatureManager.h:176
DtAgentManagerInterface & mySceneInterface
Definition: DtNavigationFeatureManager.h:146
boost::signalslib::connection myPostInitializeConnection
Definition: DtNavigationFeatureManager.h:184
The DtBuoyBeaconLayer is the base implementation of a layer of data which contains buoys and beacons ...
Definition: DtBuoyBeaconLayer.h:36
DtDe & myDe
Definition: DtNavigationFeatureManager.h:145
FeatureToFeatureMap myFeatureToBuoyOrBeaconMap
Definition: DtNavigationFeatureManager.h:178
boost::unordered_map< DtUniqueID, DtVector > PendingFeatureAttachmentMap
Type for hash table of feature ids and locations.
Definition: DtNavigationFeatureManager.h:164
std::string myName
Definition: DtNavigationFeatureManager.h:149
DtNavigationFeatureBuilder implements a DtStreamedFeatureCreator for navigation features (ex...
Definition: DtNavigationFeatureBuilder.h:34
Contains makVrv::DtBuoyBeaconLayer class.
The DtNavigationFeatureManager matches streamed features to other streamed features (buoys and beacon...
Definition: DtNavigationFeatureManager.h:38
std::string myFeatureLayerList
Definition: DtNavigationFeatureManager.h:151
FeatureToFeatureMap myBuoyOrBeaconToFeatureMap
Definition: DtNavigationFeatureManager.h:179
AttachableTypes
These are used to tell managers of attachable items what type of item they manage; they are also used...
Definition: DtBuoyBeaconLayer.h:46
std::string myFeatureAttrMapFilename
Definition: DtNavigationFeatureManager.h:152
PendingFeatureAttachmentMap myAttachedFeatures
...here. When buoys attached to a feature page out, they move back to the waiting list ...
Definition: DtNavigationFeatureManager.h:171
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
DtSignalConnectionManager myConnections
Definition: DtNavigationFeatureManager.h:148
The DtNavigationFeature can be attached to any articulated model through an articulated model agent...
Definition: DtNavigationFeature.h:29
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtBuoyBeaconLayer & myBuoyBeaconLayer
Access to the buoys.
Definition: DtNavigationFeatureManager.h:182
PendingFeatureAttachmentMap myDetachedFeatures
Features start here. When attached they move to...
Definition: DtNavigationFeatureManager.h:167
DtNavigationFeatureBuilder * myNavigationFeatureBuilder
Definition: DtNavigationFeatureManager.h:153
Base class to provide boost signal/slot management.
Contains the declaration for makVrv::DtTickable.
FeatureStylesList myFeatureStylesList
The list of osgEarth model styles we want to be notified about.
Definition: DtNavigationFeatureManager.h:160
Contains makVrv::DtUniqueID type.
The abstract interface necessary for agents.
Definition: DtAgentManagerInterface.h:33
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:70
int myPresenceSwitchNumber
Definition: DtNavigationFeatureManager.h:154
int myTypeSwitchNumber
Definition: DtNavigationFeatureManager.h:155
DtBuoyBeaconLayer::AttachableTypes myAttachableType
Definition: DtNavigationFeatureManager.h:150
FeatureMap myFeatures
Definition: DtNavigationFeatureManager.h:147
std::list< std::string > FeatureStylesList
Definition: DtNavigationFeatureManager.h:157
The DtEntityFacade is a facade around agents that make up an entity. This entity facade represents a ...
Definition: DtBuoyOrBeaconFacade.h:24
std::map< DtUniqueID, DtNavigationFeature * > FeatureMap
Type for a map of controller IDs to DtNavigationFeature.
Definition: DtNavigationFeatureManager.h:43

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)