C++ API Reference
MGeometryPrimitive Class Reference

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

#include <MGeometryPrimitive.h>

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. More...
 
 ~MGeometryPrimitive ()
 Destructor. More...
 
int uniqueID () const
 Return the per session unique identifier. More...
 
DrawPrimitiveType drawPrimitiveType () const
 Get the data type for the data. More...
 
unsigned int elementCount () const
 Return element count. More...
 
MGeometryData::ElementType dataType () const
 Return element data type. More...
 
const void * data () const
 Retrieve a pointer to the internal data. More...
 

Friends

class MGeometryLegacy
 
class MVaryingParameter
 
class MHardwareRenderer
 

Detailed Description

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:

  • kPoint : individual unconnected points.
  • kLine : individual unconnected line segments.
  • kLineStrip : connected line strip.
  • kLineLoop : closed line loop.
  • kTriangle : filled triangle.
  • kTriangleStrip : filled triangle strip.
  • kTriangleFan : filled triangle fan
  • kQuad : filled quadrilateral (quad).
  • kQuadStrip : filled quad strip.
  • kPolygon : filled N-sided polygon

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:
dx11Shader/dx11Shader.cpp, and hlslShader/hlslShader.cpp.

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

OPENMAYA_MAJOR_NAMESPACE_OPEN MGeometryPrimitive ( const MGeometryPrimitive other)

Copy constructor.

Parameters
[in]otherMGeometryPrimitive 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.
Examples:
dx11Shader/dx11Shader.cpp.
unsigned int elementCount ( ) const

Return element count.

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

Return element data type.

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

Retrieve a pointer to the internal data.

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

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