VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtOsgEffectTextureVisitor.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
14 #include <osg/NodeVisitor>
15 #include <osgDB/Options>
16 #include <set>
17 
18 namespace makVrv
19 {
20  class DtOsgEffectTextureController;
21  class DtOsgFileCache;
22  class DtOsgShaderManager;
23 
30  class DT_DLL_VRVOSG DtOsgEffectTextureVisitor : public osg::NodeVisitor
31  {
32  public:
33  static const char* IgnoreHint;
34 
36  DtOsgEffectTextureVisitor(DtOsgFileCache& fileCache, DtOsgShaderManager& shaderMgr, const osgDB::Options* options, DtDe& de);
37 
39  virtual ~DtOsgEffectTextureVisitor();
40 
43  void reset();
44 
47  unsigned getNumEffectTexturesInstalled() const;
48 
50  bool isEffectTexture(osg::Texture* tex) const;
51 
55  static void setIgnoreHint(osg::Object* obj, bool val);
56 
57  public: // osg::NodeVisitor overrides
58 
59  void apply(osg::Node& node);
60  void apply(osg::Geode& geode);
61 
62  protected:
63  // Check whether an object should be ignored during traversal
64  bool ignore(osg::Object* obj);
65 
66  // scan a stateset and apply effect textures as necessary.
67  void apply(osg::StateSet* stateSet);
68 
69  bool installEffectTextures(osg::Texture* tex, int texUnit, osg::StateSet* stateSet);
70 
71  unsigned myCount;
72 
73  typedef std::vector<osg::ref_ptr<DtOsgEffectTextureController> > Controllers;
75  osg::ref_ptr<const osgDB::Options> myDbOptions;
76 
79  DtDe& myDe; // CAUTION: only threadsafe usage of myDe is allowed from this class
80  };
81 }

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)