VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtHeightMapManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
15 
16 #include <vrvCore/DtKeyedData.h>
17 
20 
21 #include <osg/Camera>
22 #include <osg/View>
23 #include <osg/Drawable>
24 #include <osg/Texture2D>
25 
26 namespace makVrv
27 {
28  // forward declarations
29  class DtDe;
30  class DtHeightMapManager;
31  class DtTerrainPatchObject;
32  class DtCoordinateSystem;
33 
36 
39 
41  template <>
42  inline const char* creatorTypeName<DtHeightMapManager>(void) { return "DtHeightMapManagerCreator"; }
43 
44 
48  {
49  public:
51  virtual ~DtHeightMapManager();
52 
53  protected:
54  //friend so that it and only it can create the DtHeightMapManagers
56 
58  DtHeightMapManager(DtDe& de, const std::string& name, osg::View*& view);
59 
60  private:
62  DtHeightMapManager() = delete;
64  DtHeightMapManager(const DtHeightMapManager& other) = delete;
66  DtHeightMapManager& operator=(const DtHeightMapManager& other) = delete;
67 
68  public:
69 
71  virtual void setupHeightMap(void);
72 
74  virtual float heightMapResolution() const;
75 
78  virtual void updateHeightCamera(unsigned int frameNum, const osg::Vec3d& currentPosition);
79 
81  virtual void enableHeightMapCamera(bool enable);
82 
84  virtual bool heightCameraEnabled() const;
85 
87  virtual const osg::Matrix& heightMapMatrix() const;
88 
90  virtual const osg::ref_ptr<osg::Texture2D> heightMapTexture() const;
91 
93  virtual osg::Camera* heightCamera();
94 
96  virtual void postDrawFBOCallback(osg::RenderInfo& renderInfo);
97 
99  virtual bool heightMapChanged(void) const;
100 
102  virtual const osg::View* osgView(void) const;
103 
104  protected:
106  virtual void clearHeightmap();
107 
109  virtual void updateHeightMapMatrix();
110 
112  virtual osg::Matrixd oglRevDepthOrtho(double left, double right,
113  double bottom, double top,
114  double zNear, double zFar);
115 
119  virtual void computeBasis(const osg::Vec3d& inGeocentricPos, osg::Matrixd& rotOut);
120 
123  virtual void slot_oceanHeightMapTextureSizeChanged(int pixels);
124 
126  virtual void slot_oceanHeightMapResolutionChanged(float resolution);
127 
129  virtual void slot_terrainDataChanged(DtTerrainPatchObject& tpo);
130 
132  virtual void slot_wireframeModeChanged();
133 
135  virtual void slot_coordinateSystemChanged();
136 
138  virtual int heightMapTextureSize() const;
139 
141  virtual void slot_preTick(void);
142  protected:
143 
147  unsigned int myHeightUpdateFrame;
152 
153  const bool myShadingRateIsSupported; // true if shading rate extension is supported
154 
157  osg::Matrix myHeightMapMatrix;
160 
162 
163  //Doesn't need to be a ref pointer since it is never accessed. Only used to compare to another pointer.
164  osg::View* myOsgView;
165 
168  DtCoordinateSystem* myCoordinateSystem = nullptr;
169 
170  bool myHeightMapChanged = false;
171 
172  const unsigned int myHeightCameraNodeMask;
173  };
174 }
This represents an arbitrary user pointer/data within DtKeyedData.
Definition: DtKeyedData.h:95
Contains makVrv::DtDrawFBOCallback class.
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
osg::Matrixd myHeightReferenceBasis
Definition: DtHeightMapManager.h:145
float myResolution
Definition: DtHeightMapManager.h:149
double myLastUpdateTime
Definition: DtHeightMapManager.h:151
bool myForceUpdate
Definition: DtHeightMapManager.h:148
A DtTerrainPatchObject contains the methods for loading a file as a terrain. When loading a file as a...
Definition: DtTerrainPatchObject.h:35
osg::View * myOsgView
Definition: DtHeightMapManager.h:164
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:22
osg::Vec3d myLastHeightReferencePos
Definition: DtHeightMapManager.h:144
osg::ref_ptr< osg::Camera > myHeightCamera
Definition: DtHeightMapManager.h:159
friend DtHeightMapManagerCreator
Definition: DtHeightMapManager.h:55
osg::ref_ptr< osg::Texture2D > myDepthTexture
Definition: DtHeightMapManager.h:156
unsigned int myHeightUpdateFrame
Definition: DtHeightMapManager.h:147
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtVirtualBaseClassCreator< DtHeightMapManager, const std::string &, osg::View *& > DtHeightMapManagerCreator
creator
Definition: DtHeightMapManager.h:35
int myHeightMapDimension
Definition: DtHeightMapManager.h:158
bool mySavedPerfOverlayOn
Definition: DtHeightMapManager.h:150
osg::ref_ptr< osg::Texture2D > myHeightMap
Definition: DtHeightMapManager.h:155
osg::Matrix myHeightMapMatrix
Definition: DtHeightMapManager.h:157
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
Base class to provide boost signal/slot management.
DtSignalConnectionManager myConnections
Definition: DtHeightMapManager.h:161
A class to manage automatic periodic updating of a height map generated from the database dynamically...
Definition: DtHeightMapManager.h:47
Contains DLL export macros.
const char * creatorTypeName< DtHeightMapManager >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtHeightMapManager.h:42
const unsigned int myHeightCameraNodeMask
Definition: DtHeightMapManager.h:172
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:72
const bool myShadingRateIsSupported
Definition: DtHeightMapManager.h:153
osg::Vec3d myLastHeightUpdatePos
Definition: DtHeightMapManager.h:146
Contains the DtKeyedData class declaration.

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)