#pragma once #include "..\munga\entity.h" #include "..\munga\affnmtrx.h" #include "..\munga\graph2d.h" #include "..\munga\memstrm.h" class L4GaugeImage; class L4GaugeImageList; class L4GaugeImagePrimitive; class L4GaugeImageListResource; class L4GaugeImagePrimitiveResource; class L4GaugeImageResource; //####################################################################### // L4GaugeImage //####################################################################### class L4GaugeImage SIGNATURED { public: //-------------------------------------------------------------------- // Create L4GaugeImage from memory stream //-------------------------------------------------------------------- L4GaugeImage(MemoryStream *mem_stream); static L4GaugeImage *Make(const char *file_name); static L4GaugeImage *Make(ResourceDescription::ResourceID new_resource_id); //-------------------------------------------------------------------- // Destructor //-------------------------------------------------------------------- ~L4GaugeImage(); //-------------------------------------------------------------------- // TestInstance //-------------------------------------------------------------------- Logical TestInstance() const; //-------------------------------------------------------------------- // CreateL4GaugeImageStream //-------------------------------------------------------------------- static ResourceDescription::ResourceID CreateL4GaugeImageStream( ResourceFile *resource_file, const char *model_name, NotationFile *model_file, const ResourceDirectories *directories ); //-------------------------------------------------------------------- //-------------------------------------------------------------------- void Draw( Scalar LOD_value, // smaller = more detail (1.0 = 'normal') Scalar scale_value, // metersPerPixel GraphicsView *graphics_view, int default_color, AffineMatrix &localToView, int boxed_color = 0 ); protected: static Logical MemoryStreamWrite( MemoryStream *mem_stream, NotationFile *gim_file ); //==================================================================== // Protected data //==================================================================== int vertexCount, // number of vertices in vertexArray LODCount; // number of seperate LOD's Point3D *vertexArray; // pointer to array of vertices Scalar *LODScales; // pointer to array of scalar 'scale' values L4GaugeImageList **LODList; // LODList points to an array of pointers to // L4GaugeImageLists. }; //####################################################################### // L4GaugeImageList //####################################################################### class L4GaugeImageList SIGNATURED { friend class L4GaugeImage; protected: //-------------------------------------------------------------------- // Create L4GaugeList from memory stream //-------------------------------------------------------------------- L4GaugeImageList(MemoryStream *mem_stream); //-------------------------------------------------------------------- // Destructor //-------------------------------------------------------------------- ~L4GaugeImageList(); //-------------------------------------------------------------------- // TestInstance //-------------------------------------------------------------------- Logical TestInstance() const; //-------------------------------------------------------------------- //-------------------------------------------------------------------- static Logical MemoryStreamWrite( MemoryStream *mem_stream, NotationFile *gim_file, const char *page_name ); //-------------------------------------------------------------------- //-------------------------------------------------------------------- void Draw( GraphicsView *graphics_view, int default_color, AffineMatrix &localToView, Point3D *untransformed_vertex_array, Point3D *transformed_vertex_array, Logical *transformed_flag_array, Scalar scale_factor, int boxed_color ); //==================================================================== // Protected data //==================================================================== int primitiveCount; // number of primitives in primitiveList L4GaugeImagePrimitive **primitiveList; // primitiveList points to an array of pointers to // L4GaugeImagePrimitives. }; //####################################################################### // L4GaugeImagePrimitive //####################################################################### class L4GaugeImagePrimitive SIGNATURED { friend class L4GaugeImageList; protected: //-------------------------------------------------------------------- // Create L4GaugeImagePrimitive from memory stream //-------------------------------------------------------------------- L4GaugeImagePrimitive(MemoryStream *mem_stream); static int CreateL4GaugeImagePrimitiveResource( NotationFile *gim_file, const char *gim_name, const ResourceDirectories *directories, char *primitive_data, L4GaugeImagePrimitiveResource *prim_res ); //-------------------------------------------------------------------- // Destructor //-------------------------------------------------------------------- ~L4GaugeImagePrimitive(); //-------------------------------------------------------------------- // TestInstance //-------------------------------------------------------------------- Logical TestInstance() const; //-------------------------------------------------------------------- //-------------------------------------------------------------------- static Logical MemoryStreamWrite( MemoryStream *mem_stream, const char *type_name, const char *data ); //-------------------------------------------------------------------- //-------------------------------------------------------------------- void Draw( GraphicsView *graphics_view, int default_color, AffineMatrix &localToView, Point3D *untransformed_vertex_array, Point3D *transformed_vertex_array, Logical *transformed_flag_array, Scalar scale_factor, Rectangle2D *bounds ); //-------------------------------------------------------------------- //-------------------------------------------------------------------- void TransformVertex( AffineMatrix &local_to_view, Point3D &untransformed_vertex, Point3D *transformed_vertex, Logical &transformed_flag, Scalar scale_factor, Rectangle2D *bounds ); //-------------------------------------------------------------------- // These are the supported attribute types. //-------------------------------------------------------------------- enum { attributeNormal=0, attributeUnscaled=0x0001 }; //-------------------------------------------------------------------- // These are the supported primitive types. //-------------------------------------------------------------------- enum primitiveType { primitiveVector=0, numberOfTypes }; //==================================================================== // Protected data //==================================================================== int attributes, // general attributes color; // a specially parsed attribute primitiveType type; // the primitive's type union { //-------------------------------- // type = primitiveVector //-------------------------------- struct { int indexCount, // the number of indices *indexList; // pointer to an array of indices } vector; } data; };