VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EffectMapExtension.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright(c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #ifndef OSGEARTH_EFFECTMAP_EXTENSION
10 #define OSGEARTH_EFFECTMAP_EXTENSION 1
11 
12 #include "EffectMapOptions.h"
13 #include "EffectMapTerrainEffect.h"
14 #include <osgEarth/Extension>
15 #include <osgEarth/MapNode>
16 #include <set>
17 
18 #include <osg/observer_ptr>
20 
21 namespace makVrv
22 {
23  class DtDe;
24 }
25 
26 namespace osgEarth
27 {
28  namespace EffectMap
29  {
30  using namespace osgEarth;
31 
37  class EffectMapExtension : public Extension,
38  public ExtensionInterface<MapNode>,
39  public EffectMapOptions
40  {
41  public:
42  META_Object(osgearth_ext_EffectMap, EffectMapExtension);
43 
44  // CTORs
46  EffectMapExtension(const EffectMapOptions& options);
47 
48  // DTOR
49  virtual ~EffectMapExtension();
50 
51  protected: // Object
53  EffectMapExtension(const EffectMapExtension& rhs, const osg::CopyOp& op) : myEffect(NULL) { }
54 
55 
56  public: // Extension
57 
59  virtual void setDBOptions(const osgDB::Options* dbOptions);
60 
62  virtual const ConfigOptions& getConfigOptions() const { return *this; }
63 
64 
65  public: // ExtensionInterface<MapNode>
66 
68  bool connect(MapNode* mapNode);
69 
71  bool disconnect(MapNode* mapNode);
72 
73 
74  protected: // Object
76  virtual void addEffectMapLayer(MapNode* mapNode);
77 
80  virtual const std::string generateShareTexUniformName() const;
81 
84  virtual const std::string generateShareTexMatUniformName() const;
85 
86  virtual makVrv::DtDe* findDtDeInOptions() const;
87 
89  virtual void connectSignals();
90 
93  virtual void slot_effectMapRainStateChanged(bool enabled);
94 
97  virtual void slot_effectMapSnowStateChanged(bool enabled);
98 
102  virtual bool shouldDeferCreation() const;
103 
105  virtual bool createLayerAndEffect(MapNode* mapNode);
106 
107  protected:
108 
109  osg::observer_ptr<osgEarth::MapNode> myMapNode;
111 
112  private:
113 
116  static std::set<EffectMapOptions::EffectType> theEffectTypes;
117  static int theEffectMapCount;
118  };
119 
120  }
121 } // namespace osgEarth::EffectMap
122 
123 #endif // OSGEARTH_EFFECTMAP_EXTENSION
osg::ref_ptr< const osgDB::Options > myDbOptions
Definition: EffectMapExtension.h:114
EffectMapExtension(const EffectMapExtension &rhs, const osg::CopyOp &op)
protected copy constructor that does nothing
Definition: EffectMapExtension.h:53
makVrv::DtSignalConnectionManager myConnections
Definition: EffectMapExtension.h:110
static std::set< EffectMapOptions::EffectType > theEffectTypes
Definition: EffectMapExtension.h:116
static int theEffectMapCount
Definition: EffectMapExtension.h:117
Extension for loading the effect mapping effect on demand.
Definition: EffectMapExtension.h:37
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
Effect that applies effect mapping to the terrain.
Definition: EffectMapTerrainEffect.h:30
virtual const ConfigOptions & getConfigOptions() const
get the configuration options for this extention (typecast of this object)
Definition: EffectMapExtension.h:62
effect map earth file options
EffectMapTerrainEffect * myEffect
Definition: EffectMapExtension.h:115
Base class to provide boost signal/slot management.
Options governing effect mapping of the terrain.
Definition: EffectMapOptions.h:27
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
osg::observer_ptr< osgEarth::MapNode > myMapNode
Definition: EffectMapExtension.h:109
Effect that applies effect mapping to the terrain.

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)