VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtMergeDuplicateTextureVisitor.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtMergeDuplicateTextureVisitor.h,v $ $Revision: 1.7 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #pragma once
14 #include <vrvOsg/vrvOsg.h>
15 #include <vrvOsg/DtOsgFileCache.h>
16 #include <osg/NodeVisitor>
17 #include <boost/unordered_map.hpp>
18 #include <vector>
19 
20 namespace makVrv
21 {
25  class DT_DLL_VRVOSG DtMergeDuplicateTextureVisitor : public osg::NodeVisitor
26  {
27  public:
28  typedef boost::unordered_map<std::string,osg::ref_ptr<DtOsgFileCache::TextureCollection> > TextureMap;
29  typedef std::vector<std::pair<std::string,DtOsgFileCache::TextureCollection* > > TextureList;
30 
33  TextureMap& textureMap,
34  TextureList& textureList,
35  const std::string& parentFilePath,
36  bool replaceTexturesWithLoadOnDemandImages,
37  bool compressTextures,
38  bool followProxyNodes);
39 
41  virtual void apply(osg::Geode& geode);
42 
44  virtual void apply(osg::Node& node);
45 
47  virtual void apply(osg::StateSet& stateset);
48 
50  virtual void apply(osg::ProxyNode& node);
51 
53  void clearTextures();
54 
55  protected:
56 
57  //Attempt to find a duplicate texture. It looks up the texture
58  //Via the image in the map and returns a valid texture point to a new
59  //Texture object to replace the original with.
60  //If no duplicate texture is found the returned texture pointer is NULL.
61  osg::ref_ptr<osg::Texture> findDuplicateTexture(osg::Texture& texture);
62 
63  void processTexture( osg::Texture &texture, const osg::Image* img );
64 
65  protected:
66  std::string myFilePath;
72  };
73 }

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)