VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtMergeDuplicateTextureVisitor.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
14 
15 #include <osg/NodeVisitor>
16 namespace makVrv
17 {
18  class DtTextureCollection;
19 
23  class DT_DLL_VRVOSG DtMergeDuplicateTextureVisitor : public osg::NodeVisitor
24  {
25  public:
27 
30  TextureMap& textureMap,
31  const std::string& parentFilePath,
32  bool replaceTexturesWithLoadOnDemandImages,
33  bool compressTextures,
34  bool followProxyNodes);
35 
37  virtual void apply(osg::Geode& geode);
38 
40  virtual void apply(osg::Node& node);
41 
43  virtual void apply(osg::StateSet& stateset);
44 
46  virtual void apply(osg::ProxyNode& node);
47 
49  void clearTextures();
50 
51 
52  protected:
53 
54  //Attempt to find a duplicate texture. It looks up the texture
55  //Via the image in the map and returns a valid texture point to a new
56  //Texture object to replace the original with.
57  //If no duplicate texture is found the returned texture pointer is NULL.
58  osg::ref_ptr<osg::Texture> findDuplicateTexture(osg::Texture* texture);
59 
60 
61  protected:
62  std::string myFilePath;
69  };
70 }
Contains makVrv::DtTextureCollection class.
Apply the same visitor to multiple models and it will merge all duplicate textures that refer to the ...
Definition: DtMergeDuplicateTextureVisitor.h:23
std::string myFilePath
Definition: DtMergeDuplicateTextureVisitor.h:62
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
bool myCompressTextures
Definition: DtMergeDuplicateTextureVisitor.h:65
A thread safe collection, used by the mult-threaded cache, of OSG referenced objects.
Definition: DtOsgReferencedCollection.h:31
bool myUnloadImageDataFlag
Definition: DtMergeDuplicateTextureVisitor.h:64
DtOsgReferencedCollection< DtTextureCollection > TextureMap
Definition: DtMergeDuplicateTextureVisitor.h:26
TextureMap & myTextureCollection
Definition: DtMergeDuplicateTextureVisitor.h:63
bool myProcessProxyNodes
Definition: DtMergeDuplicateTextureVisitor.h:66
Contains makVrv::DtOsgReferencedCollection class.
int myTextureReplacementCount
just used for debugging
Definition: DtMergeDuplicateTextureVisitor.h:68

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)