VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtBuoyBeaconLayer.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
13 #include <vrvCore/DtUniqueID.h>
14 
16 
17 #include <matrix/vlVector.h>
18 
19 #include <map>
20 #include <list>
21 #include <string>
22 #include <unordered_map>
23 
24 namespace makVrv
25 {
26  class DtDe;
27  class DtAgentManagerInterface;
28  class DtBuoyOrBeaconFacade;
29  class DtBuoyBeaconModelStringParser;
30  class DtTextureAtlasIndexParser;
31 
36  {
37  public:
39  typedef std::map<DtUniqueID, DtBuoyOrBeaconFacade*> BuoyBeaconMap;
40 
46  {
47  AttachableLights = 0,
48  AttachableDaymarks = 1,
49  AttachableTopmarks = 2
50  };
51 
53  static const int NumAttachableTypes = 3;
54 
58  typedef bool HasAttachable[NumAttachableTypes];
59 
61  DtBuoyBeaconLayer(DtDe& de, DtAgentManagerInterface& sceneInterface);
62 
64  virtual ~DtBuoyBeaconLayer();
65 
70  // The initial (streamed-in) location of the object
74  virtual void addBuoyOrBeacon( DtBuoyOrBeaconFacade* buoy,
75  const DtVector& initialPosition, HasAttachable attachables );
76 
79  virtual bool destroyBuoyOrBeacon( DtUniqueID elementId );
80 
83  virtual DtBuoyOrBeaconFacade* findBuoyOrBeacon( DtUniqueID elementId );
84 
86  const BuoyBeaconMap& buoysAndBeacons() const;
87 
91  DtUniqueID findBuoyOrBeaconWithAttachablePosition( AttachableTypes type,
92  const DtVector& position );
93 
97  void moveBuoyOrBeaconToDetachedFromList( AttachableTypes type,
98  DtUniqueID elementId );
99 
103  void moveBuoyOrBeaconToAttachedToList( AttachableTypes type,
104  DtUniqueID elementId );
105 
108  void set2dIconsEnabled(bool enabled);
109 
110  protected:
111 
115  void slot_sceneCreated();
116 
118  void slot_postInitialize();
119 
122  virtual void initializeFeatureCreators();
123 
125  typedef std::unordered_multimap<std::string, std::string> StylesMap;
126 
130  bool readStyleListFile( const std::string& path,
131  const std::string& layerListFileName, StylesMap& map );
132 
133  protected:
134  static const char* S57AttrMapFilename;
135  static const char* S57ModelDefByNameMap;
136  static const char* S57LayerList;
137  static const char* S57Defaults;
138  static const char* S57IconMap;
139 
140  protected:
147  std::string myName;
148 
150 
153  typedef std::unordered_map<DtUniqueID, DtVector>
155 
158  PendingItemAttachmentMap myDetachedBuoysAndBeacons[NumAttachableTypes];
159 
162  PendingItemAttachmentMap myAttachedBuoysAndBeacons[NumAttachableTypes];
163 
164  boost::signalslib::connection myPostInitializeConnection;
165  };
166 }
DtSignalConnectionManager myConnections
Definition: DtBuoyBeaconLayer.h:144
BuoyBeaconMap myBuoysAndBeacons
Definition: DtBuoyBeaconLayer.h:143
std::unordered_map< DtUniqueID, DtVector > PendingItemAttachmentMap
List of buoy and beacons ids and locations that should be attached to an attachable item...
Definition: DtBuoyBeaconLayer.h:154
DtAgentManagerInterface & mySceneInterface
Definition: DtBuoyBeaconLayer.h:142
static const char * S57IconMap
Definition: DtBuoyBeaconLayer.h:138
static const char * S57Defaults
Definition: DtBuoyBeaconLayer.h:137
StylesMap myStylesMap
Definition: DtBuoyBeaconLayer.h:149
DtDe & myDe
Definition: DtBuoyBeaconLayer.h:141
DtTextureAtlasIndexParser * myTextureAtlasIndexParser
Definition: DtBuoyBeaconLayer.h:146
Definition: DtTextureAtlasIndexParser.h:33
DtBuoyBeaconModelStringParser * myBuoyMarkerStringParser
Definition: DtBuoyBeaconLayer.h:145
std::unordered_multimap< std::string, std::string > StylesMap
Type for sets of style names (layers) we listen to.
Definition: DtBuoyBeaconLayer.h:125
The DtBuoyBeaconLayer is the base implementation of a layer of data which contains buoys and beacons ...
Definition: DtBuoyBeaconLayer.h:35
AttachableTypes
These are used to tell managers of attachable items what type of item they manage; they are also used...
Definition: DtBuoyBeaconLayer.h:45
std::map< DtUniqueID, DtBuoyOrBeaconFacade * > BuoyBeaconMap
List of Buoys and Beacons.
Definition: DtBuoyBeaconLayer.h:39
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
static const char * S57LayerList
Definition: DtBuoyBeaconLayer.h:136
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
static const char * S57ModelDefByNameMap
Definition: DtBuoyBeaconLayer.h:135
The DtBuoyBeaconModelStringParser parses the buoy attributes found in the strings used by streamed bu...
Definition: DtBuoyBeaconModelStringParser.h:66
boost::signalslib::connection myPostInitializeConnection
Definition: DtBuoyBeaconLayer.h:164
static const char * S57AttrMapFilename
Definition: DtBuoyBeaconLayer.h:134
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
std::string myName
Definition: DtBuoyBeaconLayer.h:147
Base class to provide boost signal/slot management.
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:72
The DtEntityFacade is a facade around agents that make up an entity. This entity facade represents a ...
Definition: DtBuoyOrBeaconFacade.h:24
Contains DLL export macros.

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)