VR-Forces 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) 2025 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
13 #include <osgEarth/Bounds>
14 #include <osgEarth/Progress>
16 
17 // Class Forward Declarations
18 namespace osgEarth
19 {
20  class MapNode;
21  namespace Util
22  {
23  class TileVisitor;
24  }
25 }
26 
27 namespace makVrv
28 {
29  // Class Forward Declarations
30  class DtDe;
31  class DtOsgEarthCacheProgressCallback;
32 
37  {
38  public:
39  friend class DtOsgEarthCacheCreator;
40 
41  //let the WidgetProgressCallback emit updateProgress signal
42  friend class DtWidgetProgressCallback;
43 
45  virtual void setMapNode(osgEarth::MapNode* mapNode);
46 
49  virtual void setLowestLod(int lowestLod);
50 
53  virtual int lowestLod() const;
54 
57  virtual void setHighestLod(int highestLod);
58 
61  virtual int highestLod() const;
62 
64  virtual void setBound(const osgEarth::Bounds& bound);
65 
67  virtual osgEarth::Bounds bound() const;
68 
71  virtual void setCacheImageLayers(bool val);
72 
74  virtual void setCacheElevationLayers(bool val);
75 
77  virtual void reset();
78 
80  virtual void startCache();
81 
83  virtual void apiCache();
84 
86  virtual void cancelCache();
87 
90  virtual bool isCanceled();
91 
93  virtual ~DtOsgEarthCache();
94 
95  public:
96 
98  boost::signalslib::signal<void(double,double)> signal_updateProgress;
100  boost::signalslib::signal<void(std::string)> signal_updateProgressText;
102  boost::signalslib::signal<void(bool)> signal_cacheFinished;
103 
104  private:
105 
107  DtOsgEarthCache() = delete;
109  DtOsgEarthCache(const DtOsgEarthCache&) = delete;
111  DtOsgEarthCache& operator=(const DtOsgEarthCache&) = delete;
112 
113  protected:
114 
117  DtOsgEarthCache(DtDe& de);
118 
121  class DT_DLL_VRVOSGEARTH DtOsgEarthCacheProgressCallback : public osgEarth::ProgressCallback
122  {
123  public:
124 
127 
129 
131  virtual bool reportProgress(
132  double current,
133  double total,
134  unsigned currentStage,
135  unsigned totalStages,
136  const std::string& msg) override;
137 
138  protected:
140  int myCurrentProgress = 0;
141  int myTotalStages = 0;
142  };
143 
144  protected:
146  osgEarth::Bounds myBound;
149  osgEarth::MapNode* myMapNode;
151 
155  };
156 
160  : public DtVirtualBaseClass
161  {
162  public:
163  static DtOsgEarthCacheCreator& instance(DtDe& de);
164  static void registerInstance(DtDe& de, DtOsgEarthCacheCreator* creator);
165  virtual DtOsgEarthCache* create(DtDe& de) const;
166  };
167 }
osgEarth::MapNode * myMapNode
Definition: DtOsgEarthCache.h:149
DtOsgEarthCache * myOsgEarthCache
Definition: DtOsgEarthCache.h:139
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:154
Creator for the DtOsgEarthCache.
Definition: DtOsgEarthCache.h:159
int myHighestLod
Definition: DtOsgEarthCache.h:148
Definition: featureContext.h:36
#define DT_DLL_VRVOSGEARTH
Definition: vrvOsgEarth.h:21
DtOsgEarthCache.
Definition: DtOsgEarthCache.h:36
boost::signalslib::signal< void(std::string)> signal_updateProgressText
Signal to emit to update the current progess text to be displayed.
Definition: DtOsgEarthCache.h:100
osg::ref_ptr< DtOsgEarthCacheProgressCallback > myProgressCallback
Definition: DtOsgEarthCache.h:150
boost::signalslib::signal< void(double, double)> signal_updateProgress
Signal to emit to update the cache progress.
Definition: DtOsgEarthCache.h:98
Contains makVrv::DtVirtualBaseClass class.
DtOsgEarthCacheProgressCallback, used to update the cache progress in the progress bar...
Definition: DtOsgEarthCache.h:121
boost::signalslib::signal< void(bool)> signal_cacheFinished
Signal to emit when cache finished.
Definition: DtOsgEarthCache.h:102
bool myCacheImage
Definition: DtOsgEarthCache.h:153
bool myCanceled
Definition: DtOsgEarthCache.h:152
int myLowestLod
Definition: DtOsgEarthCache.h:147
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:76
osgEarth::Bounds myBound
Definition: DtOsgEarthCache.h:146
Contains DLL export macros.
DtDe & myDe
Definition: DtOsgEarthCache.h:145

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)