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

Triangles.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/Face.h"
00018 #include  "nvsg/GeoSet.h"
00019 
00020 namespace nvsg
00021 {  
00023 
00027   class Triangles : public GeoSet
00028   {
00029     public:
00031 
00032       NVSG_API static const Triangles * create( void );
00033 
00035 
00036       NVSG_API static const Triangles * createFromBase( const GeoSet &rhs  
00037                                                       );
00038       
00040 
00041       NVSG_API virtual const Triangles * clone( void ) const;
00042    
00044 
00045       NVSG_API virtual bool isDataShared( void )  const;
00046 
00048 
00049       NVSG_API virtual DataID getDataID( void ) const;
00050 
00052 
00053       NVSG_API bool hasFaces( void ) const;
00054 
00056 
00057       NVSG_API size_t getNumberOfFaces( void ) const;
00058 
00060 
00061       NVSG_API const Face3 * getFaces( void ) const;
00062 
00064 
00066       NVSG_API void setFaces( const Face3* pFaces    
00067                             , size_t numFaces        
00068                             );
00069 
00071 
00083       NVSG_API void setFaces( size_t pos 
00084                             , const Face3* pFaces    
00085                             , size_t numFaces        
00086                             );
00087 
00089 
00092       NVSG_API virtual void  calculateTangentSpace( size_t tu = 0  
00093                                                   , size_t tg = 1  
00094                                                   , size_t bn = 2  
00095                                                   );
00096 
00097     protected:
00099       NVSG_API Triangles(void);
00100 
00102       NVSG_API Triangles( const GeoSet &rhs );
00103 
00105       NVSG_API Triangles( const Triangles &rhs );
00106 
00108       NVSG_API virtual ~Triangles(void);
00109 
00110     private:
00111       nvutil::RCPtr<nvutil::RCVector<Face3> >  m_faces; // triangle faces
00112   };
00113 
00114   // - - - - - - - - - - - - - - - - - - - - - - - - - 
00115   // inlines
00116   // - - - - - - - - - - - - - - - - - - - - - - - - - 
00117 
00118   inline bool Triangles::hasFaces()  const 
00119   { 
00120     return( !m_faces->empty() ); 
00121   }
00122 
00123   inline size_t Triangles::getNumberOfFaces()  const
00124   { 
00125     return( m_faces->size() ); 
00126   }
00127 
00128   inline const Face3 * Triangles::getFaces( void ) const 
00129   { 
00130     return( &(*m_faces)[0] );
00131   }
00132 }

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