00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #pragma once
00013
00015 #include <set>
00016
00017 #include "nvsgcommon.h"
00018 #include "nvtraverser/Traverser.h"
00019
00020 namespace nvsg
00021 {
00022 class StateAttribute;
00023 class TextureAttributeItem;
00024 }
00025
00026 namespace nvtraverser
00027 {
00029
00032 class StateSetUnifyTraverser : public Traverser
00033 {
00034 public:
00036 NVSG_API StateSetUnifyTraverser( void );
00037
00038 public:
00040
00042 NVSG_API bool getIgnoreNames( void ) const;
00043
00045
00046 NVSG_API void setIgnoreNames( bool ignore
00047 );
00048
00049 protected:
00051 NVSG_API virtual ~StateSetUnifyTraverser( void );
00052
00054
00056 NVSG_API virtual void handleCgFx( const nvsg::CgFx *p
00057 );
00058
00060
00062 NVSG_API virtual void handleGeoNode( const nvsg::GeoNode *p
00063 );
00064
00066
00069 NVSG_API virtual void handleFaceAttribute( const nvsg::FaceAttribute *p
00070 );
00071
00073
00076 NVSG_API virtual void handleMaterial( const nvsg::Material *p
00077 );
00078
00080
00084 NVSG_API virtual void handleStateSet( const nvsg::StateSet * p
00085 );
00086
00088
00092 NVSG_API virtual void handleTextureAttribute( const nvsg::TextureAttribute *p
00093 );
00094
00096
00099 NVSG_API virtual void handleTextureAttributeItem( const nvsg::TextureAttributeItem *p
00100 , size_t textureUnit
00101 );
00102
00103 private:
00104 const nvsg::CgFx * m_cgfx;
00105 std::set<const nvsg::CgFx*> m_cgfxs;
00106 const nvsg::FaceAttribute * m_faceAttribute;
00107 std::set<const nvsg::FaceAttribute*> m_faceAttributes;
00108 const nvsg::Material * m_material;
00109 std::set<const nvsg::Material*> m_materials;
00110 std::vector<std::pair<const nvsg::StateSet*,const nvsg::StateSet*> > m_stateSet;
00111 std::set<const nvsg::StateSet*> m_stateSets;
00112 const nvsg::TextureAttribute * m_textureAttribute;
00113 std::set<const nvsg::TextureAttribute*> m_textureAttributes;
00114 std::vector<std::pair<size_t,const nvsg::TextureAttributeItem*> > m_textureAttributeItem;
00115 std::set<const nvsg::TextureAttributeItem*> m_textureAttributeItems;
00116
00117 bool m_ignoreNames;
00118 };
00119
00120 inline bool StateSetUnifyTraverser::getIgnoreNames( void ) const
00121 {
00122 return( m_ignoreNames );
00123 }
00124
00125 inline void StateSetUnifyTraverser::setIgnoreNames( bool ignore )
00126 {
00127 m_ignoreNames = ignore;
00128 }
00129
00130 }