Files Classes Functions Hierarchy
00001 #ifndef TETMARCHDISP_H 00002 #define TETMARCHDISP_H 00003 00004 #include <point.h> 00005 00006 typedef point4<double> pt4; 00007 typedef point4<double> const pt4c; 00008 00009 // 00010 // Brief: Marching Tetrahedrons 00011 // 00012 // This class draws a surface from a tetrahedron. 00013 // 00014 // An outside class iterates over a tetrahedron mesh and 00015 // feed the tetrahedrons into this class for display. 00016 // 00017 // Implements simplist normals: facited. 00018 // 00019 class d4marchdisp 00020 { 00021 // The first point is one color, 00022 // the other three are the other color. 00023 void writeone( pt4c & P0, pt4c & P1, pt4c & P2, pt4c & P3 ) const; 00024 00025 // The first two points are one color, 00026 // the rest the other color. 00027 void writetwo( pt4c & P0, pt4c & P1, pt4c & P2, pt4c & P3 ) const; 00028 00029 void drawtriangle 00030 ( 00031 float const ax, 00032 float const ay, 00033 float const az, 00034 float const bx, 00035 float const by, 00036 float const bz, 00037 float const cx, 00038 float const cy, 00039 float const cz 00040 ) const; 00041 public: 00042 00043 // Colors the triangles surface R,G,B at the vertexs to see the winding. 00044 bool winding; 00045 // Draws a normal line from the triangles surface. 00046 bool seenormal; 00047 00048 double cvalue; 00049 00050 // Constructor with options off. 00051 d4marchdisp(double const _cvalue=0.0) 00052 : winding(false), seenormal(false), cvalue(_cvalue) {} 00053 00054 void eval( pt4c & P0, pt4c & P1, pt4c & P2, pt4c & P3 ) const; 00055 00056 00057 00058 /* 00059 00060 // Pass in the cutt-off value and four points representing the tetrahedron. 00061 // If f is below the cutt-off value the point is colored black, 00062 // else its white. A surface is drawn(triangles) between opposite 00063 // colored points. 00064 void eval 00065 ( 00066 float const fc, // The cut-off value or constant value. 00067 float const x0, 00068 float const y0, 00069 float const z0, 00070 float const f0, 00071 float const x1, 00072 float const y1, 00073 float const z1, 00074 float const f1, 00075 float const x2, 00076 float const y2, 00077 float const z2, 00078 float const f2, 00079 float const x3, 00080 float const y3, 00081 float const z3, 00082 float const f3 00083 ) const; 00084 00085 */ 00086 00087 00088 00089 }; 00090 00091 00092 #endif 00093 00094 00095
1.5.8