00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020
00021
00022 00023 00024 00025 00026 00027 00028 00029 00030 00031
00032 #ifndef __MESH_H
00033 #define __MESH_H
00034
00035 #include "rvtypes.h"
00036 #include "polygon.h"
00037 #include "vertex.h"
00038 #include "surface.h"
00039 #include "polymod.h"
00040
00041
00043
00046 class Mesh
00047 {
00048 friend class CollapsedMesh;
00049
00050 public:
00051 Mesh(RV_PRM_Mesh*, FILE *, bool intermediate);
00052 Mesh(RV_W_Mesh*, FILE *, bool intermediate);
00053 Mesh();
00054
00058 Mesh(Mesh *);
00059 ~Mesh();
00060
00061 void translate(rvfloat dx, rvfloat dy, rvfloat dz);
00062 void translate(Vector &v) {translate(v.x(),v.y(),v.z());};
00063 void rotate(Matrix_3x3 &);
00064
00070 void write_w(FILE *, bool is_im_file);
00071
00076 bool isDegenerated(void);
00077
00081 void cleanupPolyList(void);
00082
00086 void cleanupVertexList(void);
00087
00091 void optimize(void);
00092
00093 int numPolys(void);
00094 int numSolidPolys(void);
00095
00096 Surface *createPolySurface(int pidx);
00097
00101 void add(Polygon *p);
00102
00106 void add(Vertex *v);
00107
00114 void deleteSomePolys(bool delUnsolids, bool delInvisibles);
00115
00116 00117 00118
00119 bool apply(PolygonModifier *);
00120
00121 00122 00123 00124
00125 void calc_visible_bounds(AxisBox &abox);
00126
00127 protected:
00128 void load(FILE *, bool intermediate, bool is_Instance);
00129
00130 void calc_bounds(void);
00131
00132 public:
00133 Polygon **poly;
00134 RV_W_Mesh data;
00135 Vertex **verts;
00136 int max_polys;
00137 int max_verts;
00138 };
00139
00140
00141
00142 #endif