//===========================================================================// // Copyright (C) Microsoft Corporation. All rights reserved. // //===========================================================================// #pragma once #define MLR_MLRINDEXEDPOLYMESH_HPP #if !defined(MLR_MLR_HPP) #include #endif #if !defined(MLR_MLRINDEXEDPRIMITIVE_HPP) #include #endif namespace MidLevelRenderer { //########################################################################## //#################### MLRIndexedPolyMesh ############################ //########################################################################## class MLRIndexedPolyMesh: public MLRIndexedPrimitive { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Initialization // public: static void InitializeClass(); static void TerminateClass(); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Constructors/Destructors // protected: MLRIndexedPolyMesh( Stuff::MemoryStream *stream, int version ); ~MLRIndexedPolyMesh(); public: MLRIndexedPolyMesh(); static MLRIndexedPolyMesh* Make( Stuff::MemoryStream *stream, int version ); void Save(Stuff::MemoryStream *stream); void* operator new(size_t size) { Verify(size == sizeof(MLRIndexedPolyMesh)); return AllocatedMemory->New(); } void operator delete(void *where) {AllocatedMemory->Delete(where);} private: static Stuff::MemoryBlock *AllocatedMemory; public: virtual void InitializeDrawPrimitive(int, int=0); virtual void SetPrimitiveLength(unsigned char *, int); virtual void GetPrimitiveLength(unsigned char **, int*); void FindFacePlanes(); virtual int FindBackFace(const Stuff::Point3D&); const Stuff::Plane *GetPolygonPlane(int i) { Check_Object(this); Verify(i testList; Stuff::DynamicArrayOf facePlanes; }; MLRIndexedPolyMesh* CreateIndexedCube(Stuff::Scalar, Stuff::RGBAColor*, Stuff::Vector3D*, MLRState*); }