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

QuadStrips.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 #ifdef _DEBUG
00021 # ifndef new
00022 #  define new new(__FILE__, __LINE__)
00023 #  define _DEFINED_DBGNEW // restrict the 'new' macro to this header file only
00024 # endif
00025 #endif
00026 
00027 namespace nvsg
00028 {  
00030 
00042   class QuadStrips : public GeoSet
00043   {
00044     public:
00046 
00047       NVSG_API static const QuadStrips * create( void );
00048 
00050 
00051       NVSG_API static const QuadStrips * createFromBase( const GeoSet &rhs );
00052 
00054 
00055       NVSG_API virtual const QuadStrips * clone( void ) const;
00056 
00058 
00059       NVSG_API virtual bool isDataShared( void ) const;
00060 
00062 
00063       NVSG_API virtual DataID getDataID( void ) const;
00064 
00066 
00067       NVSG_API bool hasStrips( void ) const;
00068 
00070 
00071       NVSG_API size_t getNumberOfStrips( void ) const;
00072 
00074 
00075       NVSG_API const IndexSet * getStrips() const;
00076 
00078 
00079       NVSG_API void setStrips( const IndexSet* pStrips    
00080                              , size_t numStrips           
00081                              );
00082 
00084 
00096       NVSG_API void setStrips( size_t pos 
00097                              , const IndexSet* pStrips  
00098                              , size_t numStrips            
00099                              );
00100 
00102 
00105       NVSG_API virtual void calculateTangentSpace( size_t tu = 0    
00106                                                  , size_t tg = 1    
00107                                                  , size_t bn = 2    
00108                                                  );
00109 
00110     protected:
00112       NVSG_API QuadStrips( void );
00113 
00115       NVSG_API QuadStrips( const GeoSet &rhs );
00116 
00118       NVSG_API QuadStrips( const QuadStrips &rhs );
00119 
00121       NVSG_API virtual ~QuadStrips( void );
00122 
00123     private:
00124       void  calculateTangentBinormal( size_t tu, size_t i, size_t i1, size_t i2, nvmath::Vec3f &tangent, nvmath::Vec3f &binormal );
00125 
00126       nvutil::RCPtr<nvutil::RCVector<IndexSet> >  m_quadStrips; // quadstrip indices
00127   };
00128 
00129   // - - - - - - - - - - - - - - - - - - - - - - - - - 
00130   // inlines
00131   // - - - - - - - - - - - - - - - - - - - - - - - - - 
00132 
00133   inline bool QuadStrips::hasStrips( void ) const 
00134   {
00135     __TRACE();
00136     return( !m_quadStrips->empty() ); 
00137   }
00138 
00139   inline size_t QuadStrips::getNumberOfStrips( void ) const
00140   { 
00141     __TRACE();
00142     return( m_quadStrips->size() ); 
00143   }
00144 
00145   inline const IndexSet * QuadStrips::getStrips( void ) const 
00146   { 
00147     __TRACE();
00148     return( &(*m_quadStrips)[0] ); 
00149   }
00150 }
00151 
00152 #ifdef _DEFINED_DBGNEW
00153 # undef new
00154 #endif

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