Cortex 6.0.0
Public Member Functions | Static Public Member Functions

IECore::MeshPrimitive Class Reference

#include <MeshPrimitive.h>

Inheritance diagram for IECore::MeshPrimitive:

List of all members.

Public Member Functions

 IE_CORE_DECLAREOBJECT (MeshPrimitive, Primitive)
 MeshPrimitive ()
 Construct a MeshPrimitive with no faces.
 MeshPrimitive (ConstIntVectorDataPtr verticesPerFace, ConstIntVectorDataPtr vertexIds, const std::string &interpolation="linear", V3fVectorDataPtr p=0)
virtual size_t variableSize (PrimitiveVariable::Interpolation interpolation) const
virtual void render (Renderer *renderer) const
 Render the mesh.
Topology access

These functions allow access to get and set topology after construction.

size_t numFaces () const
const IntVectorDataverticesPerFace () const
const IntVectorDatavertexIds () const
const std::string & interpolation () const
virtual void setTopology (ConstIntVectorDataPtr verticesPerFace, ConstIntVectorDataPtr vertexIds, const std::string &interpolation="linear")
void setInterpolation (const std::string &interpolation)
PolygonIterator faceBegin ()
PolygonIterator faceEnd ()

Static Public Member Functions

static MeshPrimitivePtr createBox (const Imath::Box3f &b)
static MeshPrimitivePtr createPlane (const Imath::Box2f &b)

Detailed Description

The MeshPrimitive represents a collection of polygonal faces. The faces should be planar and may not have holes, but can have concavities. By default a polygon is considered frontfacing if it's vertices wind in an anticlockwise direction from the point of view of the camera - this can be changed at the point of rendering by setting attributes in the Renderer. This definition of winding order is the same as the OpenGL and Maya conventions but the opposite of RenderMan's.


Constructor & Destructor Documentation

IECore::MeshPrimitive::MeshPrimitive ( ConstIntVectorDataPtr  verticesPerFace,
ConstIntVectorDataPtr  vertexIds,
const std::string &  interpolation = "linear",
V3fVectorDataPtr  p = 0 
)

Construct a MeshPrimitive. The number of faces specified by verticesPerFace->readable()->size(). Copies of the IntVectorData objects are taken rather than references to the initial data.


Member Function Documentation

static MeshPrimitivePtr IECore::MeshPrimitive::createBox ( const Imath::Box3f &  b) [static]

Creates a box mesh.

Todo:
Add subdivisions and texture coordinates.
static MeshPrimitivePtr IECore::MeshPrimitive::createPlane ( const Imath::Box2f &  b) [static]

Creates a plane at z=0, with the geometric normal facing down positive z.

Todo:
Add subdivisions.
virtual size_t IECore::MeshPrimitive::variableSize ( PrimitiveVariable::Interpolation  interpolation) const [virtual]

Returns the number of values a piece of data must provide for the given interpolation type. Must be implemented in all derived classes.

Implements IECore::Primitive.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends