VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgEarthCacheHandler.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
13 
14 
15 #include <osg/Matrix>
16 #include <osgEarth/Bounds>
19 #include <matrix/vlVector.h>
20 
21 #include <QThread>
22 
23 // Class Forward Declarations
24 namespace osgEarth
25 {
26  class MapNode;
27 }
28 
29 namespace makVrv
30 {
31  // Class Forward Declarations
32  class DtCameraNode;
33  class DtOsgEarthCache;
34  class DtOsgEarthCacheInterface;
35  class DtFilledPolygon;
36  class DtWindow;
37  class DtChannel;
38  class DtOsgEarthCacheEditingEventProcessor;
39  class DtOverlayRenderer;
40  class DtWidgetPicker;
41  class DtWindowConfiguration;
42  class DtDisplayUnitsConverter;
43 
47  {
48  Q_OBJECT
49  public:
51 
53  virtual ~DtOsgEarthCacheHandler();
54 
57  virtual void onGenerateCacheButtonClicked();
58  virtual void onSelectOsgEarthChanged(const std::string& file);
59  virtual void onSpecifyCacheAreaCheckBoxChanged(int checked);
60  virtual void onEstimateMessageBoxResult(int result);
61  virtual void onProgressUpdate(int progress);
62  virtual void onCleanup();
63  virtual void onClearAreaButtonClicked();
64  virtual void onStartLongitudeChanged(double value, bool isFromSlider);
65  virtual void onStartLatitudeChanged(double value, bool isFromSlider);
66  virtual void onEndLongitudeChanged(double value, bool isFromSlider);
67  virtual void onEndLatitudeChanged(double value, bool isFromSlider);
68  virtual void onLowestLODChanged(int lowLOD);
69  virtual void onHighestLODChanged(int highLOD);
70  virtual void onCancelButtonClicked();
71  virtual void onCacheFinished();
72  virtual void onCacheFinishedMessageBoxResult(int result);
74 
76  virtual bool isFinished();
77 
79  virtual bool isCanceled();
80 
81  signals:
82 
84  void QtSignal_updateProgress(int progress);
85 
87  void QtSignal_cacheFinished();
88 
89  public:
90 
92  virtual void run();
93 
95  virtual void initialize();
96 
98  virtual void setMapNode(osgEarth::MapNode* mapNode);
99 
101  virtual void setLowestLOD(int lowestLevel);
102 
104  virtual void setHighestLOD(int highestLevel);
105 
107  virtual void setBound(const osgEarth::Bounds& bound);
108 
110  virtual std::string getEstimateInfo();
111 
115  virtual void cleanup(bool checkSpecifyCacheCheckBox, bool deleteAll = false);
116 
119  virtual osgEarth::Bounds getCorrectBound();
120 
122  virtual osg::Matrix getWorldToWindowMatirx();
123 
125  DtOsgEarthCacheEditingEventProcessor* getEventProcessor();
126 
128  DtOsgEarthCacheInterface* getOsgEarthCacheInterface();
129 
130  protected:
131 
135 
137  virtual void initializeChannel();
138 
140  virtual void slot_postTick();
141 
144  virtual void slot_place(const DtVector& geocentricPos);
145 
148  virtual void slot_locationChanged(const DtVector& geocentricPos);
149 
151  virtual void slot_drag();
152 
154  virtual void slot_windowToBeDestroyed(DtWindow* window);
155 
157  virtual void slot_channelToBeDestroyed(const std::string& display, const std::string& window
158  ,const std::string& channel);
159 
162  virtual void slot_updateProgress(int progress);
163 
165  virtual void slot_cacheFinished();
166 
168  virtual void connectSignals();
169 
171  virtual void disconnectSignals();
172 
174  virtual std::string formatEstimateTimeandSpace(double estimateTime, double estimateSize);
175 
177  {
178  public:
179  VertexInfo();
180  virtual ~VertexInfo();
182  virtual void reset();
184  virtual void highlight(bool highlight);
186  virtual void initialize(const DtVector& normalColor, const DtVector& highLightColor,
187  DtOverlayRenderer* render, DtWidgetPicker& picker);
189  virtual void hide();
191  virtual void draw();
192 
193  double myWindowX;
194  double myWindowY;
207  };
208 
209  class CacheArea
210  {
211  public:
212  CacheArea(DtDe& dtde,DtVector rectangleColor);
213 
214  virtual ~CacheArea();
215 
216  virtual void initialize(DtOsgEarthCacheHandler* osgEarthCacheHandler,
217  DtOverlayRenderer* render, DtWidgetPicker& picker);
218 
222  virtual void setVertexGeocentric(int index, const DtVector& geocentric);
223 
228  virtual void setVertexLongitude(int index, double longitude,bool isFromSlider);
229 
234  virtual void setVertexLatitude(int index, double latitude, bool isFromSlider);
235 
238  virtual double getVertexLongitude(int index);
239 
242  virtual double getVertexLatitude(int index);
243 
246  virtual void place(const DtVector& geocentric);
247 
250  virtual void locationChanged(const DtVector& geocentricPos);
251 
253  virtual void drag();
254 
258  virtual void markAsDirty(bool fromGeocentric);
259 
262  virtual void cleanup(bool deleteAll);
263 
267  virtual void update(double mouseX,double mouseY);
268 
270  virtual void updateWindowCoordinate();
271 
274  virtual void updateHidePoints();
275 
279  virtual void draw(double mouseX, double mouseY);
280 
284  virtual void handleHighlight(double mouseX,double mouseY);
285 
289  virtual void geodeticToGeocentric(const DtVector& geodetic, DtVector& geocentric);
290 
294  virtual void geocentricToGeodetic(const DtVector& geocentric, DtVector& geodetic);
295 
299  virtual void geocentricToWindow(const DtVector& geocentric, double& mouseX, double& mouseY);
300 
303  virtual void setCreating(bool creating);
304 
307  virtual void setPlaced(bool placed);
308 
311  virtual void setDragging(bool dragging);
312 
318  VertexInfo* myVertexs[4];
326  bool myIsDirty;
332  };
333 
334  protected:
344  osgEarth::MapNode* myMapNode;
353  };
354 
358  : public DtVirtualBaseClass
359  {
360  public:
361  static DtOsgEarthCacheHandlerCreator& instance(DtDe& de);
362  static void registerInstance(DtDe& de, DtOsgEarthCacheHandlerCreator* creator);
363  virtual DtOsgEarthCacheHandler* create(DtDe& de, DtOsgEarthCacheInterface* iFace) const;
364  };
365 }

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)