Cortex  10.0.0-a4
Public Member Functions | Protected Attributes | List of all members
IECore::MeshPrimitiveBuilder Class Reference

#include <MeshPrimitiveBuilder.h>

+ Inheritance diagram for IECore::MeshPrimitiveBuilder:

Public Member Functions

 IE_CORE_DECLAREMEMBERPTR (MeshPrimitiveBuilder)
 
template<typename T >
void addVertex (const Imath::Vec3< T > &p, const Imath::Vec3< T > &n)
 Add a vertex position and normal.
 
void addTriangle (int v0, int v1, int v2)
 
MeshPrimitivePtr mesh () const
 Retrieve the resultant mesh.
 
- Public Member Functions inherited from IECore::RefCounted
 IE_CORE_DECLAREMEMBERPTR (RefCounted)
 
void addRef () const
 Add a reference to the current object.
 
void removeRef () const
 Remove a reference from the current object.
 
RefCount refCount () const
 Returns the current reference count.
 

Protected Attributes

V3fVectorDataPtr m_P
 
V3fVectorDataPtr m_N
 
IntVectorDataPtr m_verticesPerFace
 
IntVectorDataPtr m_vertexIds
 

Additional Inherited Members

- Public Types inherited from IECore::RefCounted
typedef size_t RefCount
 

Detailed Description

MeshPrimitiveBuilder is a class which allows incremental construction of IECore::MeshPrimitive meshes, templated on the base type of the resulting point/normal data (e.g. float or double). Other builders could be created by using this as a model. One possible client of this class is IECore::MarchingCubes.

Todo:
This is too specific to MarchingCubes. Some algorithms want to make faces other than triangles, and some algorithms don't want to supply normals.

Member Function Documentation

void IECore::MeshPrimitiveBuilder::addTriangle ( int  v0,
int  v1,
int  v2 
)

Construct a triangle from the 3 specified vertex indices. The winding order here matches that of IECore::MeshPrimitive


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