# IRdMesh Interface Reference

Inherits IUnknown.

List of all members.

## Public Member Functions
HRESULT | Clear (void)
HRESULT | Create ([in] IRsGenStream *pVerticesStream,[in] IRsGenStream *pTrianglesStream,[in] IRsGenStream *pFacesStream)
HRESULT | GetVerticesStreamGroup ([out, retval] IRdStreamGroup **ppVerticesStreamGrp)
HRESULT | SetVerticesStreamGroup ([in] IRdStreamGroup *pVerticesStreamGrp)
HRESULT | GetTrianglesStreamGroup ([out, retval] IRdStreamGroup **ppTrianglesStreamGrp)
HRESULT | SetTrianglesStreamGroup ([in] IRdStreamGroup *pTrianglesStreamGrp)
HRESULT | GetFacesStreamGroup ([out, retval] IRdStreamGroup **ppFacesStreamGrp)
HRESULT | SetFacesStreamGroup ([in] IRdStreamGroup *pFacesStreamGrp)
RtDWORD | GetNumVertices (void)
HRESULT | SetNumVertices ([in] RtDWORD dwNumVertices)
HRESULT | LockVerticesStream ([in] RtStreamId idStream,[in] RtDWORD dwFlags,[out, retval] void **ppVerticesStream)
HRESULT | UnLockVerticesStream ([in] RtStreamId idStream)
HRESULT | AttachVerticesStream ([in] IRsGenStream *pGenStream)
HRESULT | DeleteVerticesStream ([in] RtStreamId idStream)
HRESULT | DetachVerticesStream ([in] RtStreamId idStream,[out, retval] IRsGenStream **ppGenStream)
HRESULT | GetVerticesStream ([in] RtStreamId idStream,[out, retval] IRsGenStream **ppGenStream)
HRESULT | GetVerticesStreamByName ([in] BSTR idStream,[out, retval] IRsGenStream **ppGenStream)
RtDWORD | GetNumTriangles (void)
HRESULT | SetNumTriangles ([in] RtDWORD dwNumTriangles)
HRESULT | LockTrianglesStream ([in] RtStreamId idStream,[in] RtDWORD dwFlags,[out, retval] void **ppTrianglesStream)
HRESULT | UnLockTrianglesStream ([in] RtStreamId idStream)
HRESULT | AttachTrianglesStream ([in] IRsGenStream *pGenStream)
HRESULT | DeleteTrianglesStream ([in] RtStreamId idStream)
HRESULT | DetachTrianglesStream ([in] RtStreamId idStream,[out, retval] IRsGenStream **ppGenStream)
HRESULT | GetTrianglesStream ([in] RtStreamId idStream,[out, retval] IRsGenStream **ppGenStream)
HRESULT | GetTrianglesStreamByName ([in] BSTR idStream,[out, retval] IRsGenStream **ppGenStream)
RtDWORD | GetNumFaces (void)
HRESULT | SetNumFaces ([in] RtDWORD dwNumFaces)
HRESULT | LockFacesStream ([in] RtStreamId idStream,[in] RtDWORD dwFlags,[out, retval] void **ppFacesStream)
HRESULT | UnLockFacesStream ([in] RtStreamId idStream)
HRESULT | AttachFacesStream ([in] IRsGenStream *pGenStream)
HRESULT | DeleteFacesStream ([in] RtStreamId idStream)
HRESULT | DetachFacesStream ([in] RtStreamId idStream,[out, retval] IRsGenStream **ppGenStream)
HRESULT | GetFacesStream ([in] RtStreamId idStream,[out, retval] IRsGenStream **ppGenStream)
HRESULT | LockCustStream ([in] RtStreamId idStream,[in] RtDWORD dwFlags,[out] void **ppCustStream)
HRESULT | UnLockCustStream ([in] RtStreamId idStream)
HRESULT | DeleteCustStream ([in] RtStreamId idStream)
HRESULT | AttachCustStream ([in] IRsGenStream *pGenStream)
HRESULT | DetachCustStream ([in] RtStreamId idStream,[out, retval] IRsGenStream **ppGenStream)
HRESULT | GetCustStream ([in] RtStreamId idStream,[out, retval] IRsGenStream **ppGenStream)
HRESULT | GetCustStreamByName ([in] BSTR idStream,[out, retval] IRsGenStream **ppGenStream)
HRESULT | GetCustStreamCount ([out, retval] RtDWORD *pdwCount)
HRESULT | GetCustStreamByIndex ([in] RtDWORD dwIndex,[out, retval] IRsGenStream **ppGenStream)
HRESULT | GetVertices ([out, retval] IRdVertexStream **pVal)
HRESULT | GetNormals ([out, retval] IRdVertexNormalsStream **pVal)
HRESULT | GetTriangles ([out, retval] IRdTriangleStream **pVal)

## Detailed Description

IRdMesh data object contain mesh representation of the object.

- It provides storage for vertices, triangles and faces,
- It provides serialization, stream managements... .
- Meshes in Rosetta are defined by indexed data streams.
- Indexes are usualy stored in triangle streams or vertex streams, data objects are stored in custom streams.
  Example:
  Create IRdTriangleStream with triangles.
- Each item of triangle tripple index structure contains index to vertex stream.
- Vertex stream (IRdVertexStream) contain actual positions of vertices in object space.
  To add texture coordinates, create IRdUVTriangleStream and fill it with indices to UV coordinates.
- UV coordinates are stored in IRdUVCoordStream.

## Member Function Documentation

HRESULT IRdMesh::Clear | ( | void |  | ) |

Clears all streams in mesh.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::Create | ( | [in] IRsGenStream * | pVerticesStream,
|  | [in] IRsGenStream * | pTrianglesStream,
|  | [in] IRsGenStream * | pFacesStream |
| ) |  |  |

Creates mesh with given streams for vertices, triangles = triple indices and faces.

Parameters:

  | pVerticesStream | [in] Stream with vertex coordinates.
  | pTrianglesStream | [in] Stream with triangle triple indices.
  | pFacesStream | [in] Stream with identification of faces to triangles.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::GetVerticesStreamGroup | ( | [out, retval] IRdStreamGroup ** | ppVerticesStreamGrp | ) |

Returns stream group object with all streams for vertices.

Returns:
  ppVerticesStreamGrp [out,retval] Returned vertex stream group object.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::SetVerticesStreamGroup | ( | [in] IRdStreamGroup * | pVerticesStreamGrp | ) |

Sets stream group object with all streams for vertices.

Parameters:

  | pVerticesStreamGrp | [in] Given vertex stream group object.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::GetTrianglesStreamGroup | ( | [out, retval] IRdStreamGroup ** | ppTrianglesStreamGrp | ) |

Returns stream group object with all streams for triangles.

Returns:
  ppTrianglesStreamGrp [out,retval] Returned triangle stream group object.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::SetTrianglesStreamGroup | ( | [in] IRdStreamGroup * | pTrianglesStreamGrp | ) |

Sets stream group object with all streams for triangles.

Parameters:

  | pTrianglesStreamGrp | [in] Triangle stream group object to be set.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::GetFacesStreamGroup | ( | [out, retval] IRdStreamGroup ** | ppFacesStreamGrp | ) |

Returns stream group object with all streams for faces.

Returns:
  ppFacesStreamGrp [out,retval] Returned face stream group object.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::SetFacesStreamGroup | ( | [in] IRdStreamGroup * | pFacesStreamGrp | ) |

Sets stream group object with all streams for faces.

Parameters:

  | pFacesStreamGrp | [in] Face stream group object.

Returns:
  standard HRESULT processing can be applied to returned value.

RtDWORD IRdMesh::GetNumVertices | ( | void |  | ) |

Returns number of vertices.

Returns:
  pdwNumVertices number of vertices.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::SetNumVertices | ( | [in] RtDWORD | dwNumVertices | ) |

Sets number of vertices.

Parameters:

  | dwNumVertices | [in] Number of vertices.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::LockVerticesStream | ( | [in] RtStreamId | idStream,
|  | [in] RtDWORD | dwFlags,
|  | [out, retval] void ** | ppVerticesStream |
| ) |  |  |

Locks given vertex stream and returns access pointer to that stream.

Parameters:

  | idStream | [in] Identification of stream to be locked.
  | dwFlags | [in] Flags for locking.

Returns:
  ppVerticesStream [out,retval] Returned locked stream.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::UnLockVerticesStream | ( | [in] RtStreamId | idStream | ) |

Unlocks given vertex stream.

Parameters:

  | idStream | [in] Identification of stream to be unlocked.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::AttachVerticesStream | ( | [in] IRsGenStream * | pGenStream | ) |

Inserts stream into vertex stream group.

Parameters:

  | pGenStream | [in] Stream to be inserted.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::DeleteVerticesStream | ( | [in] RtStreamId | idStream | ) |

Delete stream from vertex stream group.

Parameters:

  | idStream | [in] Stream identifier.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::DetachVerticesStream | ( | [in] RtStreamId | idStream,
|  | [out, retval] IRsGenStream ** | ppGenStream |
| ) |  |  |

Removes stream from vertex stream group and returns it.

Parameters:

  | idStream | [in] Stream identifier.

Returns:
  ppGenStream [out,retval] Returned detached stream.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::GetVerticesStream | ( | [in] RtStreamId | idStream,
|  | [out, retval] IRsGenStream ** | ppGenStream |
| ) |  |  |

Returns stream from vertex stream group.

Parameters:

  | idStream | [in] Stream identifier.

Returns:
  ppGenStream [out,retval] Returned stream.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::GetVerticesStreamByName | ( | [in] BSTR | idStream,
|  | [out, retval] IRsGenStream ** | ppGenStream |
| ) |  |  |

Returns stream from vertex stream group identified by class name.

Parameters:

  | idStream | [in] Stream identifier.

Returns:
  ppGenStream [out,retval] Returned stream.

  standard HRESULT processing can be applied to returned value.

RtDWORD IRdMesh::GetNumTriangles | ( | void |  | ) |

Returns number of triangles.

Returns:
  pdwNumTriangles Number of triangles.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::SetNumTriangles | ( | [in] RtDWORD | dwNumTriangles | ) |

Sets number of triangles.

Parameters:

  | dwNumTriangles | [in] Number of triangles.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::LockTrianglesStream | ( | [in] RtStreamId | idStream,
|  | [in] RtDWORD | dwFlags,
|  | [out, retval] void ** | ppTrianglesStream |
| ) |  |  |

Locks given triangle stream and returns access pointer to that stream.

Parameters:

  | idStream | [in] Identification of stream to be locked.
  | dwFlags | [in] Flags for locking.

Returns:
  ppTrianglesStream [out,retval] Returned locked stream.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::UnLockTrianglesStream | ( | [in] RtStreamId | idStream | ) |

Unlocks given triangle stream.

Parameters:

  | idStream | [in] Identification of stream to be unlocked.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::AttachTrianglesStream | ( | [in] IRsGenStream * | pGenStream | ) |

Inserts stream into triangle stream group.

Parameters:

  | pGenStream | [in] Stream to be inserted.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::DeleteTrianglesStream | ( | [in] RtStreamId | idStream | ) |

Delete stream from triangle stream group.

Parameters:

  | idStream | [in] Stream identifier.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::DetachTrianglesStream | ( | [in] RtStreamId | idStream,
|  | [out, retval] IRsGenStream ** | ppGenStream |
| ) |  |  |

Removes stream from triangle stream group and returns it.

Parameters:

  | idStream | [in] Stream identifier.

Returns:
  ppGenStream [out,retval] Returned detached stream.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::GetTrianglesStream | ( | [in] RtStreamId | idStream,
|  | [out, retval] IRsGenStream ** | ppGenStream |
| ) |  |  |

Returns stream from triangle stream group.

Parameters:

  | idStream | [in] Stream identifier.

Returns:
  ppGenStream [out,retval] Returned stream.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::GetTrianglesStreamByName | ( | [in] BSTR | idStream,
|  | [out, retval] IRsGenStream ** | ppGenStream |
| ) |  |  |

Returns stream from triangle stream group by class name.

Parameters:

  | idStream | [in] Stream identifier (class name).

Returns:
  ppGenStream [out,retval] Returned stream.

  standard HRESULT processing can be applied to returned value.

RtDWORD IRdMesh::GetNumFaces | ( | void |  | ) |

Returns number of faces.

Returns:
  pdwNumFaces [out,retval] Number of faces.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::SetNumFaces | ( | [in] RtDWORD | dwNumFaces | ) |

Sets number of faces.

Parameters:

  | dwNumFaces | [in] Number of faces.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::LockFacesStream | ( | [in] RtStreamId | idStream,
|  | [in] RtDWORD | dwFlags,
|  | [out, retval] void ** | ppFacesStream |
| ) |  |  |

Locks given face stream and returns access pointer to that stream.

Parameters:

  | idStream | [in] Identification of stream to be locked.
  | dwFlags | [in] Flags for locking.

Returns:
  ppFacesStream [out,retval] Returned locked stream.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::UnLockFacesStream | ( | [in] RtStreamId | idStream | ) |

Unlocks given face stream.

Parameters:

  | idStream | [in] Identification of stream to be unlocked.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::AttachFacesStream | ( | [in] IRsGenStream * | pGenStream | ) |

Inserts stream into face stream group.

Parameters:

  | pGenStream | [in] Stream to be inserted.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::DeleteFacesStream | ( | [in] RtStreamId | idStream | ) |

Delete stream from face stream group.

Parameters:

  | idStream | [in] Stream identifier.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::DetachFacesStream | ( | [in] RtStreamId | idStream,
|  | [out, retval] IRsGenStream ** | ppGenStream |
| ) |  |  |

Removes stream from face stream group and returns it.

Parameters:

  | idStream | [in] Stream identifier.

Returns:
  ppGenStream [out,retval] Returned detached stream.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::GetFacesStream | ( | [in] RtStreamId | idStream,
|  | [out, retval] IRsGenStream ** | ppGenStream |
| ) |  |  |

Returns stream from face stream group.

Parameters:

  | idStream | [in] Stream identifier.

Returns:
  ppGenStream [out,retval] Returned stream.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::LockCustStream | ( | [in] RtStreamId | idStream,
|  | [in] RtDWORD | dwFlags,
|  | [out] void ** | ppCustStream |
| ) |  |  |

Locks given custom stream and returns access pointer to that stream.

Parameters:

  | idStream | [in] Identification of stream to be locked.
  | dwFlags | [in] Flags for locking.
  | ppFacesStream | [out] Returned locked stream.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::UnLockCustStream | ( | [in] RtStreamId | idStream | ) |

Unlocks given custom stream.

Parameters:

  | idStream | [in] Identification of stream to be unlocked.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::DeleteCustStream | ( | [in] RtStreamId | idStream | ) |

Deletes given custom stream.

Parameters:

  | idStream | [in] Identification of stream to be deleted.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::AttachCustStream | ( | [in] IRsGenStream * | pGenStream | ) |

Inserts custom stream into mesh.

Parameters:

  | pGenStream | [in] Stream to be inserted.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::DetachCustStream | ( | [in] RtStreamId | idStream,
|  | [out, retval] IRsGenStream ** | ppGenStream |
| ) |  |  |

Removes custom stream from mesh and returns it.

Parameters:

  | idStream | [in] Stream identifier.

Returns:
  ppGenStream [out,retval] Returned detached stream.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::GetCustStream | ( | [in] RtStreamId | idStream,
|  | [out, retval] IRsGenStream ** | ppGenStream |
| ) |  |  |

Returns custom stream.

Parameters:

  | idStream | [in] Custom stream identifier.

Returns:
  ppGenStream [out,retval] Returned custom stream.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::GetCustStreamByName | ( | [in] BSTR | idStream,
|  | [out, retval] IRsGenStream ** | ppGenStream |
| ) |  |  |

Returns custom stream identified by class name.

Parameters:

  | idStream | [in] Custom stream identifier.

Returns:
  ppGenStream [out,retval] Returned custom stream.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::GetCustStreamCount | ( | [out, retval] RtDWORD * | pdwCount | ) |

Returns count of custom stream.

Returns:
  pdwCount [out,retval] Total count of custom stream in this mesh.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::GetCustStreamByIndex | ( | [in] RtDWORD | dwIndex,
|  | [out, retval] IRsGenStream ** | ppGenStream |
| ) |  |  |

Returns custom stream identified by index.

Parameters:

  | dwIndex | [in] Custom stream index.

Returns:
  ppGenStream [out,retval] Returned custom stream.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::GetVertices | ( | [out, retval] IRdVertexStream ** | pVal | ) |

Returns stream with vertices coordinates.

Returns:
  pVal [out, retval] Returned stream with coordinates of vertices.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::GetNormals | ( | [out, retval] IRdVertexNormalsStream ** | pVal | ) |

Returns vertex normals.

Returns:
  pVal [out, retval] Returned stream with vertex normals.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdMesh::GetTriangles | ( | [out, retval] IRdTriangleStream ** | pVal | ) |

Returns stream with normals for vertices.

Returns:
  pVal [out, retval] Returned stream with normals.

  standard HRESULT processing can be applied to returned value.