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 #include <boost/thread.hpp>
19 
20 namespace makVrv
21 {
22  class DtOsgEffectTextureController;
23  class DtOsgFileCache;
24  class DtOsgShaderManager;
25 
32  class DT_DLL_VRVOSG DtOsgEffectTextureVisitor : public osg::NodeVisitor
33  {
34  public:
35  static const char* IgnoreHint;
36 
38  DtOsgEffectTextureVisitor(DtOsgFileCache& fileCache, DtOsgShaderManager& shaderMgr, const osgDB::Options* options, DtDe& de);
39 
41  virtual ~DtOsgEffectTextureVisitor();
42 
45  void reset();
46 
49  unsigned getNumEffectTexturesInstalled() const;
50 
52  bool isEffectTexture(osg::Texture* tex) const;
53 
59  virtual bool checkAndSetIgnoreHint(osg::Object* obj, bool val);
60 
64  virtual void setIgnoreHint(osg::Object* obj, bool val);
65 
66  static boost::mutex s_visitorMutex;
67 
68  public: // osg::NodeVisitor overrides
69 
70  void apply(osg::Node& node);
71  void apply(osg::Geode& geode);
72 
73  protected:
74  // Check whether an object should be ignored during traversal
75  virtual bool ignore(osg::Object* obj);
76 
77  // scan a stateset and apply effect textures as necessary.
78  void apply(osg::StateSet* stateSet);
79 
80  bool installEffectTextures(osg::Texture* tex, int texUnit, osg::StateSet* stateSet);
81 
82  unsigned myCount;
83 
84  typedef std::vector<osg::ref_ptr<DtOsgEffectTextureController> > Controllers;
86  osg::ref_ptr<const osgDB::Options> myDbOptions;
87 
90  DtDe& myDe; // CAUTION: only threadsafe usage of myDe is allowed from this class
91  };
92 }

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)