Public Types | Public Member Functions | Friends

MGeometryPrimitive Class Reference

Search for all occurrences

Detailed Description

Geometric index container.

MGeometryPrimitive is a class describes the topology used for accessing MGeometryData.

Topology is specified as a set of index values which references into data elements in an MGeometryData. Index values can be assumed to be stored in contiguous memory.

A "draw primitive type" indicates the format of the indexing as follows:

Internal Maya data which is passed to the user via this class is always assumed to be non-modifiable. If modified, stability cannot be ensured.

Examples:

D3DGeometryItem.cpp, hlslShader.cpp, and OpenGLViewportRenderer.cpp.

#include <MGeometryPrimitive.h>

List of all members.

Public Types

enum   DrawPrimitiveType {
  kInvalidIndexType = 0, kPoints, kLines, kLineStrip,
  kLineLoop, kTriangles, kTriangleStrip, kTriangleFan,
  kQuads, kQuadStrip, kPolygon, kMaxDrawPrimitiveTypeIndex
}
 

Specifies the data primitive type constructed by the indexing array.

More...

Public Member Functions

  MGeometryPrimitive (const MGeometryPrimitive &other)
  Copy constructor.
  ~MGeometryPrimitive ()
  Destructor.
int  uniqueID () const
  Return the per session unique identifier.
DrawPrimitiveType  drawPrimitiveType () const
  Get the data type for the data.
unsigned int  elementCount () const
  Return element count.
MGeometryData::ElementType  dataType () const
  Return element data type.
const void *  data () const
  Retrieve a pointer to the internal data.

Friends

class  MGeometry
class  MVaryingParameter
class  MHardwareRenderer

Member Enumeration Documentation

Specifies the data primitive type constructed by the indexing array.

Enumerator:
kInvalidIndexType 

Default value is not valid.

kPoints 

Corresponds to GL_POINTS in OpenGL.

kLines 

Corresponds to GL_LINES in OpenGL (individual unconnected line segments)

kLineStrip 

Corresponds to GL_LINE_STRIP in OpenGL.

kLineLoop 

Corresponds to GL_LINE_LOOP in OpenGL (non-filled, connected line segments)

kTriangles 

Corresponds to GL_TRIANGLES In OpenGL.

kTriangleStrip 

Corresponds to GL_TRIANGLE_STRIP in OpenGL.

kTriangleFan 

Corresponds to GL_TRIANGLE_FAN in OpenGL.

kQuads 

Corresponds to GL_QUADS in OpenGL.

kQuadStrip 

Corresponds to GL_QUAD_STRIP in OpenGL.

kPolygon 

Corresponds to GL_POLYGON in OpenGL.

kMaxDrawPrimitiveTypeIndex 

Number of primitive types.


Constructor & Destructor Documentation

Copy constructor.

Parameters:
[in] other MGeometryPrimitive to copy.

The internal data pointer is copied and its reference count incremented.

Destructor.

Class destructor.


Member Function Documentation

int uniqueID ( ) const

Return the per session unique identifier.

Returns:
Unique data identifier.
MGeometryPrimitive::DrawPrimitiveType drawPrimitiveType ( ) const

Get the data type for the data.

Returns:
Geometry data type. MGeometryPrimitive::kInvalid on error.
unsigned int elementCount ( ) const

Return element count.

Returns:
Element count. 0 is returned on error.
Examples:
D3DGeometryItem.cpp, hlslShader.cpp, and OpenGLViewportRenderer.cpp.
MGeometryData::ElementType dataType ( ) const

Return element data type.

Returns:
Element type. MGeometryData::kInvalidElementType is returned on error.
const void * data ( ) const

Retrieve a pointer to the internal data.

Returns:
Void pointer to the data. Pointer is NULL on error.
Examples:
D3DGeometryItem.cpp, hlslShader.cpp, and OpenGLViewportRenderer.cpp.

MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive
MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive MGeometryPrimitive