VR-Forces 5.0.2 Developer's Guide
 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) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
13 #include <osgEarth/Bounds>
14 #include <osgEarth/Progress>
15 #include <vrvUtil/DtUnicode.h>
17 
18 // Class Forward Declarations
19 namespace osgEarth
20 {
21  class MapNode;
22  class TileKey;
23  namespace Util {
24  class TileVisitor;
25  }
26  namespace Contrib {
27  class CacheSeed;
28  }
29 }
30 
31 namespace osg
32 {
33  class Camera;
34 }
35 
36 namespace osgDB
37 {
38  class DatabasePager;
39 }
40 
41 namespace makVrv
42 {
43  // Class Forward Declarations
44  class DtDe;
45  class DtOsgEarthCacheProgressCallback;
46  class DtObserverObject;
47  class DtOsgEarthCacheTileHandler;
48  class DtChannel;
49 
54  {
55  public:
56  friend class DtOsgEarthCacheCreator;
57 
58  //let the WidgetProgressCallback emit updateProgress signal
59  friend class DtWidgetProgressCallback;
60 
61  enum Method
62  {
64  FLY_VIEWPOINT_CACHE
65  };
66 
68  virtual ~DtOsgEarthCache();
69 
71  virtual void setMapNode(osgEarth::MapNode* mapNode);
72 
75  virtual void setLowestLod(int lowestLod);
76 
79  virtual int lowestLod() const;
80 
83  virtual void setHighestLod(int highestLod);
84 
87  virtual int highestLod() const;
88 
90  virtual void setCacheMethod(Method method);
91 
93  virtual Method cacheMethod() const;
94 
96  virtual void setBound(const osgEarth::Bounds& bound);
97 
99  virtual osgEarth::Bounds bound() const;
100 
103  virtual void setCacheImageLayers(bool val);
104 
106  virtual void setCacheElevationLayers(bool val);
107 
112  virtual void initializeChannel(DtChannel* channel);
113 
115  virtual void reset();
116 
118  virtual void startCache();
119 
121  virtual void apiCache();
122 
124  virtual void viewPointCache();
125 
127  virtual void cancelCache();
128 
131  virtual bool isCanceled();
132 
133  public:
134 
136  boost::signalslib::signal<void(int)> signal_updateProgress;
138  boost::signalslib::signal<void(std::string)> signal_updateProgressText;
140  boost::signalslib::signal<void()> signal_cacheFinished;
141 
142  private:
143 
145  DtOsgEarthCache();
149  DtOsgEarthCache &operator=(const DtOsgEarthCache &);
150 
151  protected:
152 
155  DtOsgEarthCache(DtDe& de);
156 
159  class DT_DLL_VRVOSGEARTH DtOsgEarthCacheProgressCallback : public osgEarth::ProgressCallback
160  {
161  public:
162 
165 
168 
170  bool reportProgress(
171  double current,
172  double total,
173  unsigned currentStage,
174  unsigned totalStages,
175  const std::string& msg);
176 
177  protected:
180  };
181 
182  protected:
185  osgEarth::Bounds myBound;
188  osgEarth::MapNode* myMapNode;
190  osgEarth::Contrib::CacheSeed* myCacheSeed;
193 
198  };
199 
203  : public DtVirtualBaseClass
204  {
205  public:
206  static DtOsgEarthCacheCreator& instance(DtDe& de);
207  static void registerInstance(DtDe& de, DtOsgEarthCacheCreator* creator);
208  virtual DtOsgEarthCache* create(DtDe& de) const;
209  };
210 }
osgEarth::MapNode * myMapNode
Definition: DtOsgEarthCache.h:188
DtOsgEarthCache * myOsgEarthCache
Definition: DtOsgEarthCache.h:178
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
bool myCacheElevation
Definition: DtOsgEarthCache.h:197
Creator for the DtOsgEarthCache.
Definition: DtOsgEarthCache.h:202
int myHighestLod
Definition: DtOsgEarthCache.h:187
Method
Definition: DtOsgEarthCache.h:61
int myCurrentProgress
Definition: DtOsgEarthCache.h:179
osg::ref_ptr< DtOsgEarthCacheTileHandler > myTileHandler
Definition: DtOsgEarthCache.h:192
#define DT_DLL_VRVOSGEARTH
Definition: vrvOsgEarth.h:21
DtOsgEarthCache.
Definition: DtOsgEarthCache.h:53
boost::signalslib::signal< void(std::string)> signal_updateProgressText
Signal to emit to update the current progess text to be displayed.
Definition: DtOsgEarthCache.h:138
boost::signalslib::signal< void(int)> signal_updateProgress
Signal to emit to update the cache progress.
Definition: DtOsgEarthCache.h:136
The abstract Channel Class.
Definition: DtChannel.h:35
osg::ref_ptr< DtOsgEarthCacheProgressCallback > myProgressCallback
Definition: DtOsgEarthCache.h:191
osgEarth::Contrib::CacheSeed * myCacheSeed
Definition: DtOsgEarthCache.h:190
Contains makVrv::DtVirtualBaseClass class.
DtOsgEarthCacheProgressCallback, used to update the cache progress in the progress bar...
Definition: DtOsgEarthCache.h:159
bool myCacheImage
Definition: DtOsgEarthCache.h:196
bool myCanceled
Definition: DtOsgEarthCache.h:194
Definition: DtOsgEarthCache.h:63
int myLowestLod
Definition: DtOsgEarthCache.h:186
boost::signalslib::signal< void()> signal_cacheFinished
Signal to emit when cache finished.
Definition: DtOsgEarthCache.h:140
std::string myCurrentProcessingTile
Definition: DtOsgEarthCache.h:195
osg::ref_ptr< osgEarth::Util::TileVisitor > myTileVisitor
Definition: DtOsgEarthCache.h:189
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
osgEarth::Bounds myBound
Definition: DtOsgEarthCache.h:185
Contains DLL export macros.
DtDe & myDe
Definition: DtOsgEarthCache.h:183
Method myCacheMethod
Definition: DtOsgEarthCache.h:184

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)