- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Friends

# MGeometryPrimitive Class Reference

# OpenMayaRender - API module for rendering

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:

- 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:

  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 Search for all occurrences
class | MVaryingParameter Search for all occurrences
class | MHardwareRenderer Search for all occurrences

## Member Enumeration Documentation

enum DrawPrimitiveType

Search for all occurrences

Specifies the data primitive type constructed by the indexing array.

Enumerator:

  kInvalidIndexType | Default value is not valid. Search for all occurrences
  kPoints | Corresponds to GL_POINTS in OpenGL. Search for all occurrences
  kLines | Corresponds to GL_LINES in OpenGL (individual unconnected line segments) Search for all occurrences
  kLineStrip | Corresponds to GL_LINE_STRIP in OpenGL. Search for all occurrences
  kLineLoop | Corresponds to GL_LINE_LOOP in OpenGL (non-filled, connected line segments) Search for all occurrences
  kTriangles | Corresponds to GL_TRIANGLES In OpenGL. Search for all occurrences
  kTriangleStrip | Corresponds to GL_TRIANGLE_STRIP in OpenGL. Search for all occurrences
  kTriangleFan | Corresponds to GL_TRIANGLE_FAN in OpenGL. Search for all occurrences
  kQuads | Corresponds to GL_QUADS in OpenGL. Search for all occurrences
  kQuadStrip | Corresponds to GL_QUAD_STRIP in OpenGL. Search for all occurrences
  kPolygon | Corresponds to GL_POLYGON in OpenGL. Search for all occurrences
  kMaxDrawPrimitiveTypeIndex | Number of primitive types. Search for all occurrences

## Constructor & Destructor Documentation

MGeometryPrimitive | ( | const MGeometryPrimitive & | other | ) |

Copy constructor.

Parameters:

  [in] | other | MGeometryPrimitive to copy.

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

~MGeometryPrimitive | ( |  | ) |

Destructor.

Class destructor.

## Member Function Documentation

int uniqueID | ( |  | ) | const

Search for all occurrences

Return the per session unique identifier.

Returns:
  Unique data identifier.

MGeometryPrimitive::DrawPrimitiveType drawPrimitiveType | ( |  | ) | const

Search for all occurrences

Get the data type for the data.

Returns:
  Geometry data type. MGeometryPrimitive::kInvalid on error.

unsigned int elementCount | ( |  | ) | const

Search for all occurrences

Return element count.

Returns:
  Element count. 0 is returned on error.

Examples:
  D3DGeometryItem.cpp, hlslShader.cpp, and OpenGLViewportRenderer.cpp.

MGeometryData::ElementType dataType | ( |  | ) | const

Search for all occurrences

Return element data type.

Returns:
  Element type. MGeometryData::kInvalidElementType is returned on error.

const void * data | ( |  | ) | const

Search for all occurrences

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