VR-Forces 5.0.1 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) 2020 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 <osgEarth/Controls>
17 #include <set>
18 
19 namespace osgEarth
20 {
21  namespace EffectMap
22  {
23  using namespace osgEarth;
24 
28  class EffectMapExtension : public Extension,
29  public ExtensionInterface<MapNode>,
30  public EffectMapOptions
31  {
32  public:
33  META_Object(osgearth_ext_EffectMap, EffectMapExtension);
34 
35  // CTORs
37  EffectMapExtension(const EffectMapOptions& options);
38 
39  // DTOR
40  virtual ~EffectMapExtension();
41 
42  protected: // Object
44  EffectMapExtension(const EffectMapExtension& rhs, const osg::CopyOp& op) : myEffect(NULL) { }
45 
46 
47  public: // Extension
48 
50  virtual void setDBOptions(const osgDB::Options* dbOptions);
51 
53  virtual const ConfigOptions& getConfigOptions() const { return *this; }
54 
55 
56  public: // ExtensionInterface<MapNode>
57 
59  bool connect(MapNode* mapNode);
60 
62  bool disconnect(MapNode* mapNode);
63 
64 
65  protected: // Object
67  virtual void addEffectMapLayer(MapNode* mapNode);
68 
71  virtual std::string generateShareTexUniformName();
72 
75  virtual std::string generateShareTexMatUniformName();
76 
77  private:
80  static std::set<EffectMapOptions::EffectType> theEffectTypes;
81  static int theEffectMapCount;
82  };
83 
84  }
85 } // namespace osgEarth::EffectMap
86 
87 #endif // OSGEARTH_EFFECTMAP_EXTENSION
osg::ref_ptr< const osgDB::Options > myDbOptions
Definition: EffectMapExtension.h:78
EffectMapExtension(const EffectMapExtension &rhs, const osg::CopyOp &op)
protected copy constructor that does nothing
Definition: EffectMapExtension.h:44
static std::set< EffectMapOptions::EffectType > theEffectTypes
Definition: EffectMapExtension.h:80
static int theEffectMapCount
Definition: EffectMapExtension.h:81
Extension for loading the effect mapping effect on demand.
Definition: EffectMapExtension.h:28
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:53
effect map earth file options
EffectMapTerrainEffect * myEffect
Definition: EffectMapExtension.h:79
Options governing effect mapping of the terrain.
Definition: EffectMapOptions.h:27
Effect that applies effect mapping to the terrain.

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)