MGeometryPrimitive Class Reference

#include <MGeometryPrimitive.h>

Class Description

This method is obsolete.

Deprecated:
Use MHWRender::MRenderItem and MHWRender::MIndexBuffer instead.

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:

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 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]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:
MGeometryData::ElementType dataType ( ) const

Return element data type.

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

The documentation for this class was generated from the following files:
  • MGeometryPrimitive.h
  • MGeometryPrimitive.cpp