# Ogre::MeshSerializerImpl Class Reference

Internal implementation of Mesh reading / writing for the latest version of the .mesh format. More...

`#include <OgreMeshSerializerImpl.h>`

Inheritance diagram for Ogre::MeshSerializerImpl:

List of all members.

## Public Member Functions

| MeshSerializerImpl ()
virtual | ~MeshSerializerImpl ()
void | exportMesh (const Mesh *pMesh, const String &filename)
| Exports a mesh to the file specified.
void | importMesh (DataStreamPtr &stream, Mesh *pDest)
| Imports Mesh and (optionally) Material data from a .mesh file DataStream.

## Protected Member Functions

virtual void | writeSubMeshNameTable (const Mesh *pMesh)
virtual void | writeMesh (const Mesh *pMesh)
virtual void | writeSubMesh (const SubMesh *s)
virtual void | writeSubMeshOperation (const SubMesh *s)
virtual void | writeGeometry (const VertexData *pGeom)
virtual void | writeSkeletonLink (const String &skelName)
virtual void | writeMeshBoneAssignment (const VertexBoneAssignment &assign)
virtual void | writeSubMeshBoneAssignment (const VertexBoneAssignment &assign)
virtual void | writeLodInfo (const Mesh *pMesh)
virtual void | writeLodSummary (unsigned short numLevels, bool manual)
virtual void | writeLodUsageManual (const MeshLodUsage &usage)
virtual void | writeLodUsageGenerated (const Mesh *pMesh, const MeshLodUsage &usage, unsigned short lodNum)
virtual void | writeBoundsInfo (const Mesh *pMesh)
virtual void | writeEdgeList (const Mesh *pMesh)
virtual size_t | calcMeshSize (const Mesh *pMesh)
virtual size_t | calcSubMeshSize (const SubMesh *pSub)
virtual size_t | calcGeometrySize (const VertexData *pGeom)
virtual size_t | calcSkeletonLinkSize (const String &skelName)
virtual size_t | calcBoneAssignmentSize (void)
virtual size_t | calcSubMeshOperationSize (const SubMesh *pSub)
virtual size_t | calcSubMeshNameTableSize (const Mesh *pMesh)
virtual size_t | calcEdgeListSize (const Mesh *pMesh)
virtual size_t | calcEdgeListLodSize (const EdgeData *data, bool isManual)
virtual size_t | calcEdgeGroupSize (const EdgeData::EdgeGroup &group)
virtual void | readTextureLayer (DataStreamPtr &stream, Mesh *pMesh, MaterialPtr &pMat)
virtual void | readSubMeshNameTable (DataStreamPtr &stream, Mesh *pMesh)
virtual void | readMesh (DataStreamPtr &stream, Mesh *pMesh)
virtual void | readSubMesh (DataStreamPtr &stream, Mesh *pMesh)
virtual void | readSubMeshOperation (DataStreamPtr &stream, Mesh *pMesh, SubMesh *sub)
virtual void | readGeometry (DataStreamPtr &stream, Mesh *pMesh, VertexData *dest)
virtual void | readGeometryVertexDeclaration (DataStreamPtr &stream, Mesh *pMesh, VertexData *dest)
virtual void | readGeometryVertexElement (DataStreamPtr &stream, Mesh *pMesh, VertexData *dest)
virtual void | readGeometryVertexBuffer (DataStreamPtr &stream, Mesh *pMesh, VertexData *dest)
virtual void | readSkeletonLink (DataStreamPtr &stream, Mesh *pMesh)
virtual void | readMeshBoneAssignment (DataStreamPtr &stream, Mesh *pMesh)
virtual void | readSubMeshBoneAssignment (DataStreamPtr &stream, Mesh *pMesh, SubMesh *sub)
virtual void | readMeshLodInfo (DataStreamPtr &stream, Mesh *pMesh)
virtual void | readMeshLodUsageManual (DataStreamPtr &stream, Mesh *pMesh, unsigned short lodNum, MeshLodUsage &usage)
virtual void | readMeshLodUsageGenerated (DataStreamPtr &stream, Mesh *pMesh, unsigned short lodNum, MeshLodUsage &usage)
virtual void | readBoundsInfo (DataStreamPtr &stream, Mesh *pMesh)
virtual void | readEdgeList (DataStreamPtr &stream, Mesh *pMesh)
virtual void | flipFromLittleEndian (void *pData, size_t vertexCount, size_t vertexSize, const VertexDeclaration::VertexElementList &elems)
| Flip an entire vertex buffer from little endian.
virtual void | flipToLittleEndian (void *pData, size_t vertexCount, size_t vertexSize, const VertexDeclaration::VertexElementList &elems)
| Flip an entire vertex buffer to little endian.
virtual void | flipEndian (void *pData, size_t vertexCount, size_t vertexSize, const VertexDeclaration::VertexElementList &elems)
| Flip the endianness of an entire vertex buffer, passed in as a pointer to locked or temporary memory.
virtual void | writeFileHeader (void)
virtual void | writeChunkHeader (uint16 id, uint32 size)
void | writeFloats (const float *const pfloat, size_t count)
void | writeFloats (const double *const pfloat, size_t count)
void | writeShorts (const uint16 *const pShort, size_t count)
void | writeInts (const uint32 *const pInt, size_t count)
void | writeBools (const bool *const pLong, size_t count)
void | writeObject (const Vector3 &vec)
void | writeObject (const Quaternion &q)
void | writeString (const String &string)
void | writeData (const void *const buf, size_t size, size_t count)
virtual void | readFileHeader (DataStreamPtr &stream)
virtual unsigned short | readChunk (DataStreamPtr &stream)
void | readBools (DataStreamPtr &stream, bool *pDest, size_t count)
void | readFloats (DataStreamPtr &stream, float *pDest, size_t count)
void | readFloats (DataStreamPtr &stream, double *pDest, size_t count)
void | readShorts (DataStreamPtr &stream, uint16 *pDest, size_t count)
void | readInts (DataStreamPtr &stream, uint32 *pDest, size_t count)
void | readObject (DataStreamPtr &stream, Vector3 &pDest)
void | readObject (DataStreamPtr &stream, Quaternion &pDest)
String | readString (DataStreamPtr &stream)
String | readString (DataStreamPtr &stream, size_t numChars)
virtual void | flipToLittleEndian (void *pData, size_t size, size_t count=1)
virtual void | flipFromLittleEndian (void *pData, size_t size, size_t count=1)
virtual void | flipEndian (void *pData, size_t size, size_t count)
virtual void | flipEndian (void *pData, size_t size)

## Protected Attributes

bool | mIsSkeletallyAnimated
uint32 | mCurrentstreamLen
FILE * | mpfFile
String | mVersion

## Detailed Description

Internal implementation of Mesh reading / writing for the latest version of the .mesh format.

Remarks:
  In order to maintain compatibility with older versions of the .mesh format, there will be alternative subclasses of this class to load older versions, whilst this class will remain to load the latest version.

Definition at line 46 of file OgreMeshSerializerImpl.h.

## Constructor & Destructor Documentation

Ogre::MeshSerializerImpl::MeshSerializerImpl | ( |  | ) |

virtual Ogre::MeshSerializerImpl::~MeshSerializerImpl | ( |  | ) | `[virtual]`

## Member Function Documentation

virtual size_t Ogre::MeshSerializerImpl::calcBoneAssignmentSize | ( | void |  | ) | `[protected, virtual]`

virtual size_t Ogre::MeshSerializerImpl::calcEdgeGroupSize | ( | const EdgeData::EdgeGroup & | group | ) | `[protected, virtual]`

virtual size_t Ogre::MeshSerializerImpl::calcEdgeListLodSize | ( | const EdgeData * | data,
|  | bool | isManual
| ) | `[protected, virtual]`

virtual size_t Ogre::MeshSerializerImpl::calcEdgeListSize | ( | const Mesh * | pMesh | ) | `[protected, virtual]`

virtual size_t Ogre::MeshSerializerImpl::calcGeometrySize | ( | const VertexData * | pGeom | ) | `[protected, virtual]`

virtual size_t Ogre::MeshSerializerImpl::calcMeshSize | ( | const Mesh * | pMesh | ) | `[protected, virtual]`

virtual size_t Ogre::MeshSerializerImpl::calcSkeletonLinkSize | ( | const String & | skelName | ) | `[protected, virtual]`

virtual size_t Ogre::MeshSerializerImpl::calcSubMeshNameTableSize | ( | const Mesh * | pMesh | ) | `[protected, virtual]`

virtual size_t Ogre::MeshSerializerImpl::calcSubMeshOperationSize | ( | const SubMesh * | pSub | ) | `[protected, virtual]`

virtual size_t Ogre::MeshSerializerImpl::calcSubMeshSize | ( | const SubMesh * | pSub | ) | `[protected, virtual]`

void Ogre::MeshSerializerImpl::exportMesh | ( | const Mesh * | pMesh,
|  | const String & | filename
| ) |

Exports a mesh to the file specified.

Remarks:
  This method takes an externally created Mesh object, and exports both it and optionally the Materials it uses to a .mesh file.

Parameters:

  pMesh | Pointer to the Mesh to export
  filename | The destination filename

virtual void Ogre::Serializer::flipEndian | ( | void * | pData,
|  | size_t | size
| ) | `[protected, virtual, inherited]`

virtual void Ogre::Serializer::flipEndian | ( | void * | pData,
|  | size_t | size,
|  | size_t | count
| ) | `[protected, virtual, inherited]`

virtual void Ogre::MeshSerializerImpl::flipEndian | ( | void * | pData,
|  | size_t | vertexCount,
|  | size_t | vertexSize,
|  | const VertexDeclaration::VertexElementList & | elems
| ) | `[protected, virtual]`

| Flip the endianness of an entire vertex buffer, passed in as a pointer to locked or temporary memory.

virtual void Ogre::Serializer::flipFromLittleEndian | ( | void * | pData,
|  | size_t | size,
|  | size_t | count = 1
| ) | `[protected, virtual, inherited]`

virtual void Ogre::MeshSerializerImpl::flipFromLittleEndian | ( | void * | pData,
|  | size_t | vertexCount,
|  | size_t | vertexSize,
|  | const VertexDeclaration::VertexElementList & | elems
| ) | `[protected, virtual]`

| Flip an entire vertex buffer from little endian.

virtual void Ogre::Serializer::flipToLittleEndian | ( | void * | pData,
|  | size_t | size,
|  | size_t | count = 1
| ) | `[protected, virtual, inherited]`

virtual void Ogre::MeshSerializerImpl::flipToLittleEndian | ( | void * | pData,
|  | size_t | vertexCount,
|  | size_t | vertexSize,
|  | const VertexDeclaration::VertexElementList & | elems
| ) | `[protected, virtual]`

| Flip an entire vertex buffer to little endian.

void Ogre::MeshSerializerImpl::importMesh | ( | DataStreamPtr & | stream,
|  | Mesh * | pDest
| ) |

Imports Mesh and (optionally) Material data from a .mesh file DataStream.

Remarks:
  This method imports data from a DataStream opened from a .mesh file and places it's contents into the Mesh object which is passed in.

Parameters:

  stream | The DataStream holding the .mesh data. Must be initialised (pos at the start of the buffer).
  pDest | Pointer to the Mesh object which will receive the data. Should be blank already.

void Ogre::Serializer::readBools | ( | DataStreamPtr & | stream,
|  | bool * | pDest,
|  | size_t | count
| ) | `[protected, inherited]`

virtual void Ogre::MeshSerializerImpl::readBoundsInfo | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh
| ) | `[protected, virtual]`

virtual unsigned short Ogre::Serializer::readChunk | ( | DataStreamPtr & | stream | ) | `[protected, virtual, inherited]`

virtual void Ogre::MeshSerializerImpl::readEdgeList | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh
| ) | `[protected, virtual]`

virtual void Ogre::Serializer::readFileHeader | ( | DataStreamPtr & | stream | ) | `[protected, virtual, inherited]`

void Ogre::Serializer::readFloats | ( | DataStreamPtr & | stream,
|  | double * | pDest,
|  | size_t | count
| ) | `[protected, inherited]`

void Ogre::Serializer::readFloats | ( | DataStreamPtr & | stream,
|  | float * | pDest,
|  | size_t | count
| ) | `[protected, inherited]`

virtual void Ogre::MeshSerializerImpl::readGeometry | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh,
|  | VertexData * | dest
| ) | `[protected, virtual]`

| Reimplemented in Ogre::MeshSerializerImpl_v1_2.

virtual void Ogre::MeshSerializerImpl::readGeometryVertexBuffer | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh,
|  | VertexData * | dest
| ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::readGeometryVertexDeclaration | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh,
|  | VertexData * | dest
| ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::readGeometryVertexElement | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh,
|  | VertexData * | dest
| ) | `[protected, virtual]`

void Ogre::Serializer::readInts | ( | DataStreamPtr & | stream,
|  | uint32 * | pDest,
|  | size_t | count
| ) | `[protected, inherited]`

virtual void Ogre::MeshSerializerImpl::readMesh | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh
| ) | `[protected, virtual]`

| Reimplemented in Ogre::MeshSerializerImpl_v1_2.

virtual void Ogre::MeshSerializerImpl::readMeshBoneAssignment | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh
| ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::readMeshLodInfo | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh
| ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::readMeshLodUsageGenerated | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh,
|  | unsigned short | lodNum,
|  | MeshLodUsage & | usage
| ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::readMeshLodUsageManual | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh,
|  | unsigned short | lodNum,
|  | MeshLodUsage & | usage
| ) | `[protected, virtual]`

void Ogre::Serializer::readObject | ( | DataStreamPtr & | stream,
|  | Quaternion & | pDest
| ) | `[protected, inherited]`

void Ogre::Serializer::readObject | ( | DataStreamPtr & | stream,
|  | Vector3 & | pDest
| ) | `[protected, inherited]`

void Ogre::Serializer::readShorts | ( | DataStreamPtr & | stream,
|  | uint16 * | pDest,
|  | size_t | count
| ) | `[protected, inherited]`

virtual void Ogre::MeshSerializerImpl::readSkeletonLink | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh
| ) | `[protected, virtual]`

String Ogre::Serializer::readString | ( | DataStreamPtr & | stream,
|  | size_t | numChars
| ) | `[protected, inherited]`

String Ogre::Serializer::readString | ( | DataStreamPtr & | stream | ) | `[protected, inherited]`

virtual void Ogre::MeshSerializerImpl::readSubMesh | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh
| ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::readSubMeshBoneAssignment | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh,
|  | SubMesh * | sub
| ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::readSubMeshNameTable | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh
| ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::readSubMeshOperation | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh,
|  | SubMesh * | sub
| ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::readTextureLayer | ( | DataStreamPtr & | stream,
|  | Mesh * | pMesh,
|  | MaterialPtr & | pMat
| ) | `[protected, virtual]`

void Ogre::Serializer::writeBools | ( | const bool *const | pLong,
|  | size_t | count
| ) | `[protected, inherited]`

virtual void Ogre::MeshSerializerImpl::writeBoundsInfo | ( | const Mesh * | pMesh | ) | `[protected, virtual]`

virtual void Ogre::Serializer::writeChunkHeader | ( | uint16 | id,
|  | uint32 | size
| ) | `[protected, virtual, inherited]`

void Ogre::Serializer::writeData | ( | const void *const | buf,
|  | size_t | size,
|  | size_t | count
| ) | `[protected, inherited]`

virtual void Ogre::MeshSerializerImpl::writeEdgeList | ( | const Mesh * | pMesh | ) | `[protected, virtual]`

virtual void Ogre::Serializer::writeFileHeader | ( | void |  | ) | `[protected, virtual, inherited]`

void Ogre::Serializer::writeFloats | ( | const double *const | pfloat,
|  | size_t | count
| ) | `[protected, inherited]`

void Ogre::Serializer::writeFloats | ( | const float *const | pfloat,
|  | size_t | count
| ) | `[protected, inherited]`

virtual void Ogre::MeshSerializerImpl::writeGeometry | ( | const VertexData * | pGeom | ) | `[protected, virtual]`

void Ogre::Serializer::writeInts | ( | const uint32 *const | pInt,
|  | size_t | count
| ) | `[protected, inherited]`

virtual void Ogre::MeshSerializerImpl::writeLodInfo | ( | const Mesh * | pMesh | ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::writeLodSummary | ( | unsigned short | numLevels,
|  | bool | manual
| ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::writeLodUsageGenerated | ( | const Mesh * | pMesh,
|  | const MeshLodUsage & | usage,
|  | unsigned short | lodNum
| ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::writeLodUsageManual | ( | const MeshLodUsage & | usage | ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::writeMesh | ( | const Mesh * | pMesh | ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::writeMeshBoneAssignment | ( | const VertexBoneAssignment & | assign | ) | `[protected, virtual]`

void Ogre::Serializer::writeObject | ( | const Quaternion & | q | ) | `[protected, inherited]`

void Ogre::Serializer::writeObject | ( | const Vector3 & | vec | ) | `[protected, inherited]`

void Ogre::Serializer::writeShorts | ( | const uint16 *const | pShort,
|  | size_t | count
| ) | `[protected, inherited]`

virtual void Ogre::MeshSerializerImpl::writeSkeletonLink | ( | const String & | skelName | ) | `[protected, virtual]`

void Ogre::Serializer::writeString | ( | const String & | string | ) | `[protected, inherited]`

virtual void Ogre::MeshSerializerImpl::writeSubMesh | ( | const SubMesh * | s | ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::writeSubMeshBoneAssignment | ( | const VertexBoneAssignment & | assign | ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::writeSubMeshNameTable | ( | const Mesh * | pMesh | ) | `[protected, virtual]`

virtual void Ogre::MeshSerializerImpl::writeSubMeshOperation | ( | const SubMesh * | s | ) | `[protected, virtual]`

## Member Data Documentation

uint32 Ogre::Serializer::mCurrentstreamLen `[protected, inherited]`

| Definition at line 49 of file OgreSerializer.h.

bool Ogre::MeshSerializerImpl::mIsSkeletallyAnimated `[protected]`

| Definition at line 71 of file OgreMeshSerializerImpl.h.

FILE* Ogre::Serializer::mpfFile `[protected, inherited]`

| Definition at line 50 of file OgreSerializer.h.

String Ogre::Serializer::mVersion `[protected, inherited]`

| Definition at line 51 of file OgreSerializer.h.

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

- OgreMeshSerializerImpl.h

Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 13:01:14 2006