VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgEarthCache.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 
13 
14 #include <osgEarth/Bounds>
15 #include <osgEarth/Progress>
16 #include <osgEarth/GeoData>
17 
18 #include <vrvUtil/DtUnicode.h>
20 
21 // Class Forward Declarations
22 namespace osgEarth
23 {
24  class Profile;
25  class CacheSeed;
26  class MapNode;
27  class ModelLayer;
28  class TaskService;
29  class TileVisitor;
30  class CacheEstimator;
31  class TileKey;
32  namespace Features
33  {
34  class FeatureModelGraph;
35  }
36 }
37 
38 namespace makVrv
39 {
40  // Class Forward Declarations
41  class DtDe;
42  class DtOsgEarthCacheEstimator;
43  class DtOsgEarthCacheProgressCallback;
44 
48  {
49  public:
50  friend class DtOsgEarthCacheCreator;
51 
52  //let the WidgetProgressCallback emit updateProgress signal
53  friend class DtWidgetProgressCallback;
54 
56  virtual ~DtOsgEarthCache();
57 
59  virtual void setMapNode(osgEarth::MapNode* mapNode);
60 
62  virtual void setLowestLOD(int lowestLOD);
63 
65  virtual void setHighestLOD(int highestLOD);
66 
68  virtual void setBound(const osgEarth::Bounds& bound);
69 
73  virtual void getEstimateInfo(double& time, double& size);
74 
77  virtual const std::vector<std::string>& imageLayers();
78 
81  virtual const std::vector<std::string>& elevationLayers();
82 
85  virtual std::vector<std::string> modelLayers();
86 
88  virtual void reset();
89 
91  virtual void startCache();
92 
95  virtual DtUnicode currentLayerName();
96 
98  virtual void cancelCache();
99 
102  virtual bool isFinished();
103 
106  virtual bool isCanceled();
107 
110  virtual void setSkipImageLayers(bool skip);
111 
114  virtual void setSkipElevationLayers(bool skip);
115 
118  virtual void setSkipModelLayers(bool skip);
119 
121  boost::signal<void(int)> signal_updateProgress;
123  boost::signal<void()> signal_cacheFinished;
124 
125  private:
127  DtOsgEarthCache();
131  DtOsgEarthCache &operator=(const DtOsgEarthCache &);
132 
133  protected:
136  DtOsgEarthCache(DtDe&de);
137 
139  virtual void cacheModelLayers();
140 
142  virtual void cacheModelLayer(osgEarth::ModelLayer* modelLayer);
143 
147  virtual osgEarth::GeoExtent getModelLayerExtent(osgEarth::Features::FeatureModelGraph* featureModelGraph);
148 
152  virtual osgEarth::Features::FeatureModelGraph* findFeatureModelGraph(osgEarth::ModelLayer* modelLayer);
153 
155  virtual void discoverModelLayers();
156 
160  virtual void cacheModelLayerImplementation(osgEarth::TaskService* service, osgEarth::ModelLayer* modelLayer);
161 
162  protected:
164  osgEarth::Bounds myBound;
165  osgEarth::MapNode* myMapNode;
166  osgEarth::TileVisitor* myTileVisitor;
168  osgEarth::CacheSeed* myCacheSeed;
177  std::vector<std::string> myImageLayers;
178  std::vector<std::string> myElevationLayers;
179  std::vector<osgEarth::ModelLayer*> myIntersectModelLayers;
180  };
181 
184  class DT_DLL_VRVOSGEARTH DtOsgEarthCacheProgressCallback : public osgEarth::ProgressCallback
185  {
186  public:
187 
190 
193 
195  DtUnicode currentProcessingLayerName();
196 
198  void setCurrentLayName(const DtUnicode& name);
199 
203  void startCacheModelLayer(int tiles, const DtUnicode& name);
204 
206  void reset();
207 
209  void increaseModelLayerProgress();
210 
218  virtual bool reportProgress(
219  double current,
220  double total,
221  unsigned currentStage,
222  unsigned totalStages,
223  const std::string& msg);
224 
231  };
232 
236  : public DtVirtualBaseClass
237  {
238  public:
239  static DtOsgEarthCacheCreator& instance(DtDe& de);
240  static void registerInstance(DtDe& de, DtOsgEarthCacheCreator* creator);
241  virtual DtOsgEarthCache* create(DtDe& de) const;
242  };
243 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)