NTrace
GPU ray tracing framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FW::Mesh< V > Class Template Reference

#include <Mesh.hpp>

Inherits FW::MeshBase.

Public Member Functions

 Mesh (void)
 
 Mesh (const MeshBase &other)
 
 ~Mesh (void)
 
const V * getVertexPtr (int idx=0) const
 
V * getMutableVertexPtr (int idx=0)
 
const V & vertex (int idx) const
 
V & mutableVertex (int idx)
 
void setVertex (int idx, const V &value)
 
void setVertices (int idx, const V *ptr, int num)
 
V & addVertex (const V &value)
 
V & addVertex (void)
 
V * addVertices (const V *ptr, int num)
 
const V & operator[] (int vidx) const
 
V & operator[] (int vidx)
 
Mesh & operator= (const Mesh &other)
 
- Public Member Functions inherited from FW::MeshBase
 MeshBase (void)
 
 MeshBase (const MeshBase &other)
 
 ~MeshBase (void)
 
int addAttrib (AttribType type, AttribFormat format, int length)
 
void addAttribs (const MeshBase &other)
 
int numAttribs (void) const
 
const AttribSpec & attribSpec (int attrib) const
 
int findAttrib (AttribType type) const
 
int findNextAttrib (AttribType type, int prevAttrib) const
 
bool isCompatible (const MeshBase &other) const
 
void clear (void)
 
void set (const MeshBase &other)
 
void append (const MeshBase &other)
 
void compact (void)
 
int numVertices (void) const
 
int vertexStride (void) const
 
void resetVertices (int num)
 
void clearVertices (void)
 
void resizeVertices (int num)
 
const U8 * getVertexPtr (int idx=0) const
 
U8 * getMutableVertexPtr (int idx=0)
 
const U8 * vertex (int idx) const
 
U8 * mutableVertex (int idx)
 
void setVertex (int idx, const void *ptr)
 
void setVertices (int idx, const void *ptr, int num)
 
U8 * addVertex (const void *ptr=NULL)
 
U8 * addVertices (const void *ptr, int num)
 
Vec4f getVertexAttrib (int idx, int attrib) const
 
void setVertexAttrib (int idx, int attrib, const Vec4f &v)
 
int numSubmeshes (void) const
 
int numTriangles (void) const
 
void resizeSubmeshes (int num)
 
void clearSubmeshes (void)
 
const Array< Vec3i > & indices (int submesh) const
 
Array< Vec3i > & mutableIndices (int submesh)
 
void setIndices (int submesh, const Vec3i *ptr, int size)
 
void setIndices (int submesh, const S32 *ptr, int size)
 
void setIndices (int submesh, const Array< Vec3i > &v)
 
const Material & material (int submesh) const
 
Material & material (int submesh)
 
int addSubmesh (void)
 
Buffer & getVBO (void)
 
int vboAttribOffset (int attrib)
 
int vboAttribStride (int attrib)
 
int vboIndexOffset (int submesh)
 
int vboIndexSize (int submesh)
 
void setGLAttrib (GLContext *gl, int attrib, int loc)
 
void draw (GLContext *gl, const Mat4f &posToCamera, const Mat4f &projection, GLContext::Program *prog=NULL, bool gouraud=false)
 
bool isInMemory (void) const
 
void freeMemory (void)
 
bool isInVBO (void) const
 
void freeVBO (void)
 
void xformPositions (const Mat4f &mat)
 
void xformNormals (const Mat3f &mat, bool normalize=true)
 
void xform (const Mat4f &mat)
 
void getBBox (Vec3f &lo, Vec3f &hi) const
 
void recomputeNormals (void)
 
void flipTriangles (void)
 
void clean (void)
 
void collapseVertices (void)
 
void dupVertsPerSubmesh (void)
 
void fixMaterialColors (void)
 
void simplify (F32 maxError)
 
const U8 * operator[] (int vidx) const
 
U8 * operator[] (int vidx)
 
MeshBase & operator= (const MeshBase &other)
 
MeshBase & operator+= (const MeshBase &other)
 

Additional Inherited Members

- Public Types inherited from FW::MeshBase
enum  AttribType {
  AttribType_Position = 0, AttribType_Normal, AttribType_Color, AttribType_TexCoord,
  AttribType_AORadius, AttribType_Max
}
 
enum  AttribFormat { AttribFormat_U8 = 0, AttribFormat_S32, AttribFormat_F32, AttribFormat_Max }
 
enum  TextureType {
  TextureType_Diffuse = 0, TextureType_Alpha, TextureType_Displacement, TextureType_Normal,
  TextureType_Environment, TextureType_Max
}
 

Detailed Description

template<class V>
class FW::Mesh< V >

Definition at line 214 of file Mesh.hpp.

Constructor & Destructor Documentation

template<class V>
FW::Mesh< V >::Mesh ( void  )
inline

Definition at line 217 of file Mesh.hpp.

template<class V>
FW::Mesh< V >::Mesh ( const MeshBase &  other)
inline

Definition at line 218 of file Mesh.hpp.

template<class V>
FW::Mesh< V >::~Mesh ( void  )
inline

Definition at line 219 of file Mesh.hpp.

Member Function Documentation

template<class V>
V& FW::Mesh< V >::addVertex ( const V &  value)
inline

Definition at line 227 of file Mesh.hpp.

template<class V>
V& FW::Mesh< V >::addVertex ( void  )
inline

Definition at line 228 of file Mesh.hpp.

template<class V>
V* FW::Mesh< V >::addVertices ( const V *  ptr,
int  num 
)
inline

Definition at line 229 of file Mesh.hpp.

template<class V>
V* FW::Mesh< V >::getMutableVertexPtr ( int  idx = 0)
inline

Definition at line 222 of file Mesh.hpp.

template<class V>
const V* FW::Mesh< V >::getVertexPtr ( int  idx = 0) const
inline

Definition at line 221 of file Mesh.hpp.

template<class V>
V& FW::Mesh< V >::mutableVertex ( int  idx)
inline

Definition at line 224 of file Mesh.hpp.

template<class V>
Mesh& FW::Mesh< V >::operator= ( const Mesh< V > &  other)
inline

Definition at line 233 of file Mesh.hpp.

template<class V>
const V& FW::Mesh< V >::operator[] ( int  vidx) const
inline

Definition at line 231 of file Mesh.hpp.

template<class V>
V& FW::Mesh< V >::operator[] ( int  vidx)
inline

Definition at line 232 of file Mesh.hpp.

template<class V>
void FW::Mesh< V >::setVertex ( int  idx,
const V &  value 
)
inline

Definition at line 225 of file Mesh.hpp.

template<class V>
void FW::Mesh< V >::setVertices ( int  idx,
const V *  ptr,
int  num 
)
inline

Definition at line 226 of file Mesh.hpp.

template<class V>
const V& FW::Mesh< V >::vertex ( int  idx) const
inline

Definition at line 223 of file Mesh.hpp.


The documentation for this class was generated from the following file: