Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members
CIsosurface.h
Go to the documentation of this file.00001 #ifndef __CIsosurface_h__ 00002 #define __CIsosurface_h__ 00003 00005 // MarSTD version 2004 - (c)2004 - Marcel Smit // 00006 // // 00007 // [email protected] // 00008 // [email protected] // 00009 // // 00010 // This code may not be used in a commercial product without my // 00011 // permission. If you redistribute it, this message must remain // 00012 // intact. If you use this code, some acknowledgement would be // 00013 // appreciated. ;-) // 00015 00017 00018 00019 00020 #include "CPoly.h" 00021 00023 typedef struct 00024 { 00025 float p[3]; 00026 float n[3]; 00027 float e; 00028 int normalized; 00029 } CIsosurfaceValue; 00030 00032 typedef struct 00033 { 00034 float p[3]; 00035 float n[3]; 00036 } CIsosurfaceVertex; 00037 00038 // Geometry: Iso surface: Cube definition. 00039 typedef struct 00040 { 00041 CIsosurfaceValue* v[8]; 00042 } CIsosurfaceCube; 00043 00045 class CIsosurfaceMetaball 00046 { 00047 00048 public: 00049 00050 CIsosurfaceMetaball() 00051 { 00052 00053 } 00054 ~CIsosurfaceMetaball() 00055 { 00056 00057 } 00058 00059 public: 00060 00061 float p[3]; 00062 float a; 00063 00064 }; 00065 00067 00111 class CIsosurface 00112 { 00113 00114 public: 00115 00116 CIsosurface(); 00117 ~CIsosurface(); 00118 00119 public: 00120 00121 CIsosurfaceValue*** v; 00122 CIsosurfaceCube*** cube; 00123 int sx, sy, sz; 00124 float treshold; 00125 00126 public: 00127 00134 void setSize(int sx, int sy, int sz); 00135 00136 public: 00137 00145 void calculate(CIsosurfaceMetaball* ball, int balls); 00149 void calculateNormals(); 00155 void output(void (*triangle)(CIsosurfaceVertex* v)); 00165 void output(int triangles, CIsosurfaceVertex* v, void (*triangle)(int num, CIsosurfaceVertex* v)); 00170 void output(CMesh& mesh); 00171 00172 }; 00173 00174 #endif
Generated on Tue Feb 8 21:59:02 2005 for MarSTDv2004 by
