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

TriStrips.h

Go to the documentation of this file.
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 
00015 #include "nvsgcommon.h"
00016 
00017 #include "nvsg/nvsg.h"
00018 #include "nvsg/GeoSet.h"
00019 
00020 namespace nvsg
00021 {
00023 
00036   class TriStrips : public GeoSet
00037   {
00038     public:
00040 
00041       NVSG_API static const TriStrips * create( void );
00042 
00044 
00045       NVSG_API static const TriStrips * createFromBase( const GeoSet &rhs );
00046 
00048 
00049       NVSG_API virtual const TriStrips * clone() const;
00050    
00052 
00053       NVSG_API virtual bool    isDataShared( void )  const;
00054 
00056 
00057       NVSG_API virtual DataID  getDataID( void )     const;
00058 
00060 
00061       NVSG_API bool  hasStrips( void )  const;
00062 
00064 
00065       NVSG_API size_t  getNumberOfStrips( void )  const;
00066 
00068 
00069       NVSG_API const IndexSet * getStrips() const;
00070 
00072 
00073       NVSG_API void setStrips( const IndexSet* pStrips  
00074                              , size_t numStrips            
00075                              );
00076 
00078 
00090       NVSG_API void setStrips( size_t pos 
00091                              , const IndexSet* pStrips  
00092                              , size_t numStrips            
00093                              );
00094 
00096 
00099       NVSG_API virtual void  calculateTangentSpace( size_t tu = 0  
00100                                                   , size_t tg = 1  
00101                                                   , size_t bn = 2  
00102                                                   );
00103 
00104     protected:
00106       NVSG_API TriStrips(void);
00107 
00109       NVSG_API TriStrips( const GeoSet &rhs );
00110 
00112       NVSG_API TriStrips( const TriStrips &rhs );
00113 
00115       NVSG_API virtual ~TriStrips(void);
00116 
00117     private:
00118       void  calculateTangentBinormal( size_t tu, size_t i, size_t i1, size_t i2, nvmath::Vec3f &tangent, nvmath::Vec3f &binormal );
00119 
00120       nvutil::RCPtr<nvutil::RCVector<IndexSet> > m_triStrips; // tristrip indices
00121   };
00122 
00123   // - - - - - - - - - - - - - - - - - - - - - - - - - 
00124   // inlines
00125   // - - - - - - - - - - - - - - - - - - - - - - - - - 
00126 
00127   inline bool TriStrips::hasStrips()  const 
00128   { 
00129     return( !m_triStrips->empty() ); 
00130   }
00131 
00132   inline size_t TriStrips::getNumberOfStrips()  const
00133   { 
00134     return( m_triStrips->size() ); 
00135   }
00136 
00137   inline const IndexSet * TriStrips::getStrips( void ) const 
00138   { 
00139     __TRACE();
00140     return( &(*m_triStrips)[0] ); 
00141   }
00142 
00143 }

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