VR-Forces 4.1 Class Documentation
DtOsgOverlayManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtOsgOverlayManager.h,v $ $Revision: 1.13 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #pragma once
14 #include <vrvOsg/vrvOsg.h>
16 #include <vrvCore/DtUniqueID.h>
18 #include <boost/unordered_map.hpp>
19 #include <set>
20 
21 namespace makVrv
22 {
23 
24  class DtOsgRenderer;
25  class DtOsgOverlayResourceProvider;
26  class DtChannelManager;
27  class DtChannel;
28  class DtOverlayRenderer;
29  class DtWidgetPicker;
30  class DtFontManager;
31 
35  {
36  public:
37 
40 
43 
44  inline DtDe& de()
45  {
46  return myDe;
47  }
48 
52  virtual bool handleMouseEvent(const DtMouseEvent& ev, DtChannel& channel);
53 
57  bool processWidgetEvent( DtElementID id, const DtMouseEvent &ev,
58  DtChannel& channel );
59 
61  virtual void render(DtChannel* channel, bool projectedGeocentricEffect,
62  float projectedGeocentricAlpha,
63  double* position, double* matrix, double viewportSize[2]);
64 
66  virtual void releaseResources();
67 
69  virtual DtOsgOverlayResourceProvider* resourceProvider();
70 
72  DtOverlayRenderer& overlayRenderer(unsigned int layerId);
73 
76  DtOverlayRenderer& overlayRenderer(DtChannel* channel);
77  DtOverlayRenderer& overlayRenderer3D(DtChannel* channel);
78 
81  DtOverlayRenderer& overlayRenderer(DtChannel* channel, int modelSet);
82 
84  virtual void enableOverlayOnChannel(unsigned int layerId, bool enabled,
85  DtChannel& channel);
86 
90  virtual void enableModelSetOnChannel(int modelSet, bool enabled,
91  DtChannel& channel);
92 
94  DtWidgetPicker& widgetPicker(unsigned int layerId);
95 
98  DtWidgetPicker& widgetPicker(DtChannel* channel);
99  DtWidgetPicker& widgetPicker3D(DtChannel* channel);
100 
102  DtWidgetPicker& widgetPicker(DtChannel* channel, int modelSet);
103 
105  virtual void destroyOverlayLayer(unsigned int layerId);
106 
108  virtual bool overlayLayerIsVisible(unsigned int layerId) const;
109 
113  virtual void setOverlayLayerVisibility(unsigned int layerId, bool visible);
114 
116  virtual void setPerformanceStatsOverlayEnabled(bool show);
117 
119  virtual bool performanceStatsOverlayEnabled() const;
120 
121  protected:
122 
123  typedef boost::unordered_map<DtChannel*, unsigned int>
125 
126  //Map that maps from channel to supported model set renderer, the sets should be in order.
127  typedef boost::unordered_map<DtChannel*, std::map<int, unsigned int> >
129 
131  virtual void slot_channelToBeDestroyed(DtChannel*);
132 
135  unsigned int allocateChannelSpecificLayerId();
136 
137  void destroyChannelSpecificOverlayLayer(
138  const ChannelSpecificOverlayMap &map, DtChannel* channel );
139 
141  DtOverlayRenderer& overlayRenderer( ChannelSpecificOverlayMap &map,
142  DtChannel* channel );
143 
146  DtWidgetPicker& widgetPicker( ChannelSpecificOverlayMap &map,
147  DtChannel* channel );
148 
151  virtual void destroyChannelModelSetOverlayLayers(DtChannel*);
152 
153  protected:
154 
156  {
157  public:
160 
161  DtOverlayRenderer& getOrCreateRenderer(
162  DtOsgOverlayResourceProvider* provider);
163  DtWidgetPicker& getOrCreatePicker(
164  DtOsgOverlayResourceProvider* provider);
165  DtOverlayRenderer* findRenderer();
166  DtWidgetPicker* findPicker();
167 
168  protected:
171 
172  };
173 
174  typedef boost::unordered_map<unsigned int,DtPickableOverlay*> OverlayMap;
175 
176  //Map, the sets should be in order.
177  typedef boost::unordered_map<DtChannel*, std::set<unsigned int> >
179 
187  bool myChannelSpecificLayerIdUsageList[
188  Channel_SpecificEnd - Channel_SpecificStart + 1 ];
190  };
191 
194  {
196  virtual DtOverlayManager* create(DtDe& de);
197  };
198 }

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)