VR-Forces 4.5 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 #include <boost/thread.hpp>
19 #include <boost/unordered_map.hpp>
20 
21 namespace makVrv
22 {
23  class DtOsgEffectTextureController;
24  class DtOsgFileCache;
25  class DtOsgShaderManager;
26 
33  class DT_DLL_VRVOSG DtOsgEffectTextureVisitor : public osg::NodeVisitor
34  {
35  public:
36  static const char* IgnoreHint;
37 
39  DtOsgEffectTextureVisitor(DtOsgFileCache& fileCache, const osgDB::Options* options);
40 
42  virtual ~DtOsgEffectTextureVisitor();
43 
46  void reset();
47 
50  unsigned getNumEffectTexturesInstalled() const;
51 
53  bool isEffectTexture(osg::Texture* tex) const;
54 
60  virtual bool checkAndSetIgnoreHint(osg::Object* obj, bool val);
61 
65  virtual void setIgnoreHint(osg::Object* obj, bool val);
66 
67  static boost::mutex s_visitorMutex;
68 
69  typedef std::pair<std::string, std::string> RegLowFileNames;
70  static boost::unordered_map<std::string, std::vector<std::pair<std::string, std::string> > > myDirFileList;
71 
72  public: // osg::NodeVisitor overrides
73 
74  void apply(osg::Node& node);
75  void apply(osg::Geode& geode);
76 
77  protected:
78  // Check whether an object should be ignored during traversal
79  virtual bool ignore(osg::Object* obj);
80 
81  // scan a stateset and apply effect textures as necessary.
82  void apply(osg::StateSet* stateSet);
83 
84  bool installEffectTextures(osg::Texture* tex, int texUnit, osg::StateSet* stateSet);
85 
86  unsigned myCount;
87 
88  typedef std::vector<osg::ref_ptr<DtOsgEffectTextureController> > Controllers;
90  osg::ref_ptr<const osgDB::Options> myDbOptions;
91 
93  };
94 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)