VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtOsgEarthCache.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
11 
12 #include <osgEarth/Bounds>
13 #include <osgEarth/Progress>
14 #include <osgEarth/GeoData>
15 
16 #include <vrvUtil/DtUnicode.h>
18 
19 // Class Forward Declarations
20 namespace osgEarth
21 {
22  class Profile;
23  class CacheSeed;
24  class MapNode;
25  class ModelLayer;
26  class TaskService;
27  class TileVisitor;
28  class CacheEstimator;
29  class TileKey;
30  namespace Features
31  {
32  class FeatureModelGraph;
33  }
34 }
35 
36 namespace makVrv
37 {
38  // Class Forward Declarations
39  class DtDe;
40  class DtOsgEarthCacheEstimator;
41  class DtOsgEarthCacheProgressCallback;
42 
46  {
47  public:
48  friend class DtOsgEarthCacheCreator;
49 
50  //let the WidgetProgressCallback emit updateProgress signal
51  friend class DtWidgetProgressCallback;
52 
54  virtual ~DtOsgEarthCache();
55 
57  virtual void setMapNode(osgEarth::MapNode* mapNode);
58 
60  virtual void setLowestLOD(int lowestLOD);
61 
63  virtual void setHighestLOD(int highestLOD);
64 
66  virtual void setBound(const osgEarth::Bounds& bound);
67 
71  virtual void getEstimateInfo(double& time, double& size);
72 
75  virtual const std::vector<std::string>& imageLayers();
76 
79  virtual const std::vector<std::string>& elevationLayers();
80 
83  virtual std::vector<std::string> modelLayers();
84 
86  virtual void reset();
87 
89  virtual void startCache();
90 
93  virtual DtUnicode currentLayerName();
94 
96  virtual void cancelCache();
97 
100  virtual bool isFinished();
101 
104  virtual bool isCanceled();
105 
108  virtual void setSkipImageLayers(bool skip);
109 
112  virtual void setSkipElevationLayers(bool skip);
113 
116  virtual void setSkipModelLayers(bool skip);
117 
119  boost::signal<void(int)> signal_updateProgress;
121  boost::signal<void()> signal_cacheFinished;
122 
123  private:
125  DtOsgEarthCache();
129  DtOsgEarthCache &operator=(const DtOsgEarthCache &);
130 
131  protected:
134  DtOsgEarthCache(DtDe&de);
135 
137  virtual void cacheModelLayers();
138 
140  virtual void cacheModelLayer(osgEarth::ModelLayer* modelLayer);
141 
145  virtual osgEarth::GeoExtent getModelLayerExtent(osgEarth::Features::FeatureModelGraph* featureModelGraph);
146 
150  virtual osgEarth::Features::FeatureModelGraph* findFeatureModelGraph(osgEarth::ModelLayer* modelLayer);
151 
153  virtual void discoverModelLayers();
154 
158  virtual void cacheModelLayerImplementation(osgEarth::TaskService* service, osgEarth::ModelLayer* modelLayer);
159 
160  protected:
162  osgEarth::Bounds myBound;
163  osgEarth::MapNode* myMapNode;
164  osgEarth::TileVisitor* myTileVisitor;
166  osgEarth::CacheSeed* myCacheSeed;
175  std::vector<std::string> myImageLayers;
176  std::vector<std::string> myElevationLayers;
177  std::vector<osgEarth::ModelLayer*> myIntersectModelLayers;
178  };
179 
182  class DT_DLL_VRVOSGEARTH DtOsgEarthCacheProgressCallback : public osgEarth::ProgressCallback
183  {
184  public:
185 
188 
191 
193  DtUnicode currentProcessingLayerName();
194 
196  void setCurrentLayName(const DtUnicode& name);
197 
201  void startCacheModelLayer(int tiles, const DtUnicode& name);
202 
204  void reset();
205 
207  void increaseModelLayerProgress();
208 
216  virtual bool reportProgress(
217  double current,
218  double total,
219  unsigned currentStage,
220  unsigned totalStages,
221  const std::string& msg);
222 
228  OpenThreads::Mutex myProgressMutex;
229  };
230 
234  : public DtVirtualBaseClass
235  {
236  public:
237  static DtOsgEarthCacheCreator& instance(DtDe& de);
238  static void registerInstance(DtDe& de, DtOsgEarthCacheCreator* creator);
239  virtual DtOsgEarthCache* create(DtDe& de) const;
240  };
241 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)