VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgOverlayManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 #include <vrvOsg/vrvOsg.h>
13 #include <vrvCore/DtUniqueID.h>
15 #include <boost/unordered_map.hpp>
16 #include <set>
17 
18 
19 namespace makVrv
20 {
21 
22  class DtOsgRenderer;
23  class DtOsgOverlayResourceProvider;
24  class DtChannelManager;
25  class DtChannel;
26  class DtOverlayRenderer;
27  class DtWidgetPicker;
28  class DtFontManager;
29 
33  {
34  public:
35 
38 
40  virtual ~DtOsgOverlayManager();
41 
42  inline DtDe& de()
43  {
44  return myDe;
45  }
46 
50  virtual bool handleMouseEvent(const DtMouseEvent& ev, DtChannel& channel);
51 
55  bool processWidgetEvent( DtElementID id, const DtMouseEvent &ev,
56  DtChannel& channel );
57 
59  virtual void render(DtChannel* channel, bool projectedGeocentricEffect,
60  float projectedGeocentricAlpha,
61  double* position, double* matrix, double* projectionMatrix, double viewportSize[2]);
62 
64  virtual void releaseResources();
65 
67  virtual DtOsgOverlayResourceProvider* resourceProvider();
68 
70  DtOverlayRenderer& overlayRenderer(unsigned int layerId);
71 
74  DtOverlayRenderer& overlayRenderer(DtChannel* channel);
75  DtOverlayRenderer& overlayRenderer3D(DtChannel* channel);
76 
79  DtOverlayRenderer& overlayRenderer(DtChannel* channel, int modelSet);
80 
82  virtual void enableOverlayOnChannel(unsigned int layerId, bool enabled,
83  DtChannel& channel);
84 
88  virtual void enableModelSetOnChannel(int modelSet, bool enabled,
89  DtChannel& channel);
90 
92  DtWidgetPicker& widgetPicker(unsigned int layerId);
93 
96  DtWidgetPicker& widgetPicker(DtChannel* channel);
97  DtWidgetPicker& widgetPicker3D(DtChannel* channel);
98 
100  DtWidgetPicker& widgetPicker(DtChannel* channel, int modelSet);
101 
103  virtual void destroyOverlayLayer(unsigned int layerId);
104 
106  virtual bool overlayLayerIsVisible(unsigned int layerId) const;
107 
111  virtual void setOverlayLayerVisibility(unsigned int layerId, bool visible);
112  protected:
113 
114  typedef boost::unordered_map<DtChannel*, unsigned int>
116 
117  //Map that maps from channel to supported model set renderer, the sets should be in order.
118  typedef boost::unordered_map<DtChannel*, std::map<int, unsigned int> >
120 
122  virtual void slot_channelToBeDestroyed(DtChannel*);
123 
126  unsigned int allocateChannelSpecificLayerId();
127  void deallocateChannelSpecificLayerId(unsigned int layerId);
128 
129  void destroyChannelSpecificOverlayLayer(
130  ChannelSpecificOverlayMap &map, DtChannel* channel );
131 
133  DtOverlayRenderer& overlayRenderer( ChannelSpecificOverlayMap &map,
134  DtChannel* channel );
135 
138  DtWidgetPicker& widgetPicker( ChannelSpecificOverlayMap &map,
139  DtChannel* channel );
140 
143  virtual void destroyChannelModelSetOverlayLayers(DtChannel*);
144 
145  protected:
146 
148  {
149  public:
151  virtual ~DtPickableOverlay();
152 
153  DtOverlayRenderer& getOrCreateRenderer(
154  DtOsgOverlayResourceProvider* provider);
155  DtWidgetPicker& getOrCreatePicker(
156  DtOsgOverlayResourceProvider* provider);
157  DtOverlayRenderer* findRenderer();
158  DtWidgetPicker* findPicker();
159 
160  protected:
163 
164  };
165 
166  typedef boost::unordered_map<unsigned int,DtPickableOverlay*> OverlayMap;
167 
168  //Map, the sets should be in order.
169  typedef boost::unordered_map<DtChannel*, std::set<unsigned int> >
171 
172  // Some customers have the data in a different directory
173  // keep the set data path around so the tactical graphics
174  // can load their shaders from the right path
175  static std::string myDataPath;
176 
184  bool myChannelSpecificLayerIdUsageList[
185  Channel_SpecificEnd - Channel_SpecificStart + 1 ];
187  };
188 
191  {
193  virtual DtOverlayManager* create(DtDe& de);
194  };
195 }

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)