Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

DrawableUnifyTraverser.h

00001 // Copyright NVIDIA Corporation 2002-2004
00002 // TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
00003 // *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
00004 // OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
00005 // AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS
00006 // BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
00007 // WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
00008 // BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
00009 // ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS
00010 // BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES 
00011 
00012 #pragma once
00013 
00014 #include "nvsgcommon.h"
00015 
00016 #include "nvsg/Face.h"
00017 #include "nvtraverser/Traverser.h"
00018 
00019 namespace nvtraverser
00020 {
00022 
00023   class DrawableUnifyTraverser : public Traverser
00024   {
00025     public:
00027       NVSG_API DrawableUnifyTraverser( void );
00028 
00029     public:
00031 
00033       NVSG_API bool getIgnoreNames( void ) const;
00034 
00036 
00037       NVSG_API void setIgnoreNames( bool ignore   
00038                                   );
00039 
00040     protected:
00042       NVSG_API virtual ~DrawableUnifyTraverser( void );
00043 
00045 
00046       NVSG_API virtual void handleGeoNode( const nvsg::GeoNode * p 
00047                                          );
00048 
00050 
00051       NVSG_API virtual void handleStateSet( const nvsg::StateSet * p 
00052                                           );
00053 
00055 
00056       NVSG_API virtual void handleQuads( const nvsg::Quads * p 
00057                                        );
00058 
00060 
00061       NVSG_API virtual void handleAnimatedQuads( const nvsg::AnimatedQuads * p 
00062                                                );
00063 
00065 
00066       NVSG_API virtual void handleQuadStrips( const nvsg::QuadStrips * p 
00067                                             );
00068 
00070 
00071       NVSG_API virtual void handleTriangles( const nvsg::Triangles * p 
00072                                            );
00073 
00075 
00076       NVSG_API virtual void handleAnimatedTriangles( const nvsg::AnimatedTriangles * p 
00077                                                    );
00078 
00080 
00081       NVSG_API virtual void handleSkinnedTriangles( const nvsg::SkinnedTriangles * p 
00082                                                   );
00083 
00085 
00086       NVSG_API virtual void handleTriStrips( const nvsg::TriStrips * p 
00087                                            );
00088 
00089     protected:
00090       void combine( nvsg::GeoSet *p0, const nvsg::GeoSet *p1 );
00091       void combine( nvsg::Quads *p0, const nvsg::Quads *p1 );
00092       void combine( nvsg::QuadStrips *p0, const nvsg::QuadStrips *p1 );
00093       void combine( nvsg::Triangles *p0, const nvsg::Triangles *p1 );
00094       void combine( nvsg::TriStrips *p0, const nvsg::TriStrips *p1 );
00095 
00096     private:
00097       bool  m_ignoreNames;
00098       const nvsg::StateSet *                                                  m_currentStateSet;
00099       std::vector<std::pair<const nvsg::Drawable*,const nvsg::StateSet*> >    m_drawableToDelete;
00100       std::vector<std::pair<const nvsg::Quads*,const nvsg::StateSet*> >       m_quadsToKeep;
00101       std::vector<std::pair<const nvsg::QuadStrips*,const nvsg::StateSet*> >  m_quadStripsToKeep;
00102       std::vector<std::pair<const nvsg::Triangles*,const nvsg::StateSet*> >   m_trianglesToKeep;
00103       std::vector<std::pair<const nvsg::TriStrips*,const nvsg::StateSet*> >   m_triStripsToKeep;
00104       std::vector<nvsg::Face3>    m_shiftedFaces3;
00105       std::vector<nvsg::Face4>    m_shiftedFaces4;
00106       std::vector<nvsg::IndexSet> m_shiftedIndexSets;
00107   };
00108 
00109   inline bool DrawableUnifyTraverser::getIgnoreNames( void ) const
00110   {
00111     return( m_ignoreNames );
00112   }
00113 
00114   inline void DrawableUnifyTraverser::setIgnoreNames( bool ignore )
00115   {
00116     m_ignoreNames = ignore;
00117   }
00118 
00119 }

Generated on Tue Mar 1 13:19:16 2005 for NVSGSDK by NVIDIA