VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtTritonHeightMapManager.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 
12 #include <vrvTriton/vrvTriton.h>
13 
15 
18 
19 #include <osg/Camera>
20 #include <osg/View>
21 #include <osg/Drawable>
22 #include <osg/Texture2D>
23 
24 namespace Triton
25 {
26  class Camera;
27 }
28 
29 namespace makVrv
30 {
31  class DtTritonDrawable;
32  class DtDe;
33  class DtTritonHeightMapManager;
34 
38  {
39  public:
41  DtTritonDrawableCullHeightMapCallback(osg::View* view);;
42 
43  protected:
46 
47  private:
54 
55  public:
57  virtual bool run(osg::Object* object, osg::Object* data);
58 
59  protected:
60  //Doesn't need to be a ref pointer since it is never accessed. Only used to compare to another pointer.
61  osg::View* myView;
62  };
63 
66  {
67  public:
70 
71  protected:
74 
75  private:
82 
83  public:
85  virtual void operator () (osg::Object* sv);
86 
87  protected:
89  };
90 
94  {
95  public:
98 
99  protected:
102 
103  private:
110 
111  public:
113  virtual void operator () (osg::RenderInfo& renderInfo) const;
114 
115  protected:
118  };
119 
123  {
124  public:
126  virtual ~DtTritonHeightMapManager();
127 
128  protected:
129  //friend so that it and only it can create the DtTritonHeightMapManagers
131 
133  DtTritonHeightMapManager(DtTritonDrawable* parentDrawable, DtDe& de, osg::View* view);
134 
135  private:
141  DtTritonHeightMapManager &operator=(const DtTritonHeightMapManager &other);
142 
143  public:
145  virtual void setTritonCamera(const Triton::Camera* tritonCamera);
146 
148  virtual const Triton::Camera* tritonCamera(void) const;
149 
151  virtual void setupHeightMap( void );
152 
154  virtual void setHeightMapResolution(float resolution);
155 
157  virtual float heightMapResolution() const;
158 
161  virtual void setHeightMapTextureSize(int pixels);
162 
164  virtual int heightMapTextureSize() const;
165 
168  virtual bool updateHeightCamera(unsigned int frameNum,
169  const osg::Vec3& currentPosition, bool isGeocentric );
170 
172  virtual void setHeightCameraAttachment(bool enabled);
173 
175  virtual const osg::Matrix& heightMapMatrix() const;
176 
178  virtual const osg::ref_ptr<osg::Texture2D> heightMapTexture() const;
179 
181  virtual void forceUpdate();
182 
184  virtual DtTritonDrawable* tritonDrawable();
185 
187  virtual osg::Camera* heightCamera();
188 
189  protected:
191  virtual void cleanup();
192 
194  virtual void updateHeightMapMatrix();
195 
197  virtual osg::Matrixd oglRevDepthOrtho(double left, double right,
198  double bottom, double top,
199  double zNear, double zFar);
200 
201  protected:
202 
204  unsigned int myHeightUpdateFrame;
211 
212  bool myShadingRateIsSupported; // true if shading rate extension is supported
213 
216  osg::Matrix myHeightMapMatrix;
219 
221 
223 
225 
226  //Doesn't need to be a ref pointer since it is never accessed. Only used to compare to another pointer.
227  osg::View* myOsgView;
228 
229  const Triton::Camera* myTritonCamera;
230  };
231 
235  {
236  protected:
239 
242 
243  private:
248 
249  public:
251  static DtTritonHeightMapManagerCreator& instance(DtDe& de);
252 
254  static void registerInstance(DtDe& de,
256 
257  public:
259  virtual DtTritonHeightMapManager* create(DtTritonDrawable* parentDrawable, DtDe& de, osg::View* view);
260  };
261 
262 }
A class to manage automatic periodic updating of a height map generated from the database dynamically...
Definition: DtTritonHeightMapManager.h:122
DtTritonHeightMapManager * myHeightMapManager
Definition: DtTritonHeightMapManager.h:116
osg::View * myOsgView
Definition: DtTritonHeightMapManager.h:227
Cull callback used to prevent the height map camera from rendering anything for any views that are no...
Definition: DtTritonHeightMapManager.h:37
Contains makVrv::DtDrawFBOCallback class.
bool myHeightMapCameraUpdateReady
Definition: DtTritonHeightMapManager.h:206
Virtual base class.
Definition: DtVirtualBaseClass.h:22
int myHeightMapDimension
Definition: DtTritonHeightMapManager.h:217
DtDe & myDe
Definition: DtTritonHeightMapManager.h:220
float myResolution
Definition: DtTritonHeightMapManager.h:208
DtTritonHeightMapManager creator.
Definition: DtTritonHeightMapManager.h:234
bool myHeightCameraAttached
Definition: DtTritonHeightMapManager.h:205
osg::Matrix myHeightMapMatrix
Definition: DtTritonHeightMapManager.h:216
DtSignalConnectionManager myConnections
Definition: DtTritonHeightMapManager.h:224
Contains DLL export macros.
Contains makVrv::DtVirtualBaseClass class.
DtTritonHeightMapManager * myHeightMapManager
Definition: DtTritonHeightMapManager.h:88
#define DT_DLL_VRVTRITON
Definition: vrvTriton.h:19
bool myShadingRateIsSupported
Definition: DtTritonHeightMapManager.h:212
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:24
osg::View * myView
Definition: DtTritonHeightMapManager.h:61
osg::ref_ptr< osg::Texture2D > myDepthTexture
Definition: DtTritonHeightMapManager.h:215
bool mySavedPerfOverlayOn
Definition: DtTritonHeightMapManager.h:209
double myLastUpdateTime
Definition: DtTritonHeightMapManager.h:210
Definition: DtDrawFBOCallback.h:62
DtDe & myDe
Definition: DtTritonHeightMapManager.h:117
Base class to provide boost signal/slot management.
bool myForceUpdate
Definition: DtTritonHeightMapManager.h:207
callback which is connected to the post draw callback for the height map camera to setup the height m...
Definition: DtTritonHeightMapManager.h:93
DtTritonDrawable * myDrawable
Definition: DtTritonHeightMapManager.h:222
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
An OSG Drawable representing Triton&#39;s infinite ocean.
Definition: DtTritonDrawable.h:61
osg::ref_ptr< osg::Texture2D > myHeightMap
Definition: DtTritonHeightMapManager.h:214
job added to the main thread job queue by the DtTritonHeightMapPostDrawFBOCallback to update the heig...
Definition: DtTritonHeightMapManager.h:65
const Triton::Camera * myTritonCamera
Definition: DtTritonHeightMapManager.h:229
osg::ref_ptr< osg::Camera > myHeightCamera
Definition: DtTritonHeightMapManager.h:218
osg::Vec3 myLastHeightUpdatePos
Definition: DtTritonHeightMapManager.h:203
unsigned int myHeightUpdateFrame
Definition: DtTritonHeightMapManager.h:204

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)