00001 #ifndef _ENUMS_TYPE_H_
00002 #define _ENUMS_TYPE_H_
00003
00004 #include <cstring>
00005 #include "MathHelper.h"
00006 #include "../../include/fv_config.h"
00007
00008
00009 #ifndef LARGE_F
00010 #define LARGE_F 10e10
00011 #endif
00012
00013 namespace FemViewer
00014 {
00015
00016 typedef enum {
00017 REFIN = -1,
00018 FREE = 0,
00019
00020 PRIZM = 5,
00021 BRICK = 6,
00022 TETRA = 7,
00023 } ElemType;
00024
00025 typedef enum {
00026 F_TRIA = 3,
00027 F_QUAD = 4,
00028 } FaceType;
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 typedef enum {
00041 NOT_REF = 0,
00042 REF_ISO = 1,
00043 } RefinementType;
00044
00045 typedef enum {
00046 TENSOR = 0,
00047 COMPLETE = 1,
00048 } BaseType;
00049
00050 typedef enum {
00051 INTERNAL = 0,
00052 EXTERNAL,
00053 } ModuleType;
00054
00055 typedef enum {
00056 LINEAR = 0,
00057 HIGH_ORDER,
00058 } ApproximationType;
00059
00060 typedef enum {
00061 NUM_VERTICES_LIST_WIREFRAME = 0,
00062 NUM_ELEMENTS_LIST_WIREFRAME,
00063 NUM_VERTICES_LIST_COLORMAP,
00064 NUM_ELEMENTS_LIST_COLORMAP,
00065 NUM_VERTICES_LIST_CUTTED_WIREFRAME,
00066 NUM_ELEMENTS_LIST_CUTTED_WIREFRAME,
00067 NUM_VERTICES_LIST_CUTTED_COLORMAP,
00068 NUM_ELEMENTS_LIST_CUTTED_COLORMAP,
00069 COLORBAR_LIST0,
00070 COLORBAR_LIST1,
00071 COLORBAR_LIST2,
00072 ID_COLORMAP_TEXT,
00073 ID_GRID,
00074 ID_AXES,
00075 NUM_TOTAL_LISTS
00076 } GLListType;
00077
00078 typedef enum {
00079 RASTERIZATION_GL = 0,
00080 RAYTRACE_GL_CL,
00081 } Render_t;
00082
00083 typedef enum {
00084 Unknown = -1,
00085 MeshPrizm = 0,
00086 MeshHybrid = 1,
00087 MeshRemesh = 2,
00088 FieldSTD = 0,
00089 FieldDG = 1,
00090 } HandleType;
00091
00092 enum eSelectionCategory
00093 {
00094 All = 0,
00095 Boundary,
00096 Cutted,
00097 };
00098
00099 enum {
00100 vtxTriangle = 0,
00101 vtxQuad,
00102 vtxEdge,
00103 vtxAll
00104 };
00105
00106 enum MouseMode {
00107 MOUSE_NONE,
00108 MOUSE_ROTATE,
00109 MOUSE_TRANSLATE,
00110 MOUSE_ZOOM
00111 };
00112
00113 typedef enum TypeOfRenderer {
00114 Wireframe = 0,
00115 WireframeSlice,
00116 ColorMap,
00117 ColorMapSlice,
00118 ColorMapStd,
00119 ColorMapStdSlice,
00120 ColorMapBar,
00121
00122 Totall
00123 } object_type;
00124
00125 typedef enum RenderGLTypes {
00126 WIREFRAME_GL,
00127 WIREFRAME_CUTS_GL,
00128 COLORMAP_GL,
00129 COLORMAP_CUTS_GL,
00130 COLORMAP_BAR,
00131
00132 NUM_DRAWS,
00133 } gl_object_type;
00134
00135
00136 const double XlocPrizm[18] = {
00137 0.0, 0.0, -1.0,
00138 1.0, 0.0, -1.0,
00139 0.0, 1.0, -1.0,
00140 0.0, 0.0, 1.0,
00141 1.0, 0.0, 1.0,
00142 0.0, 1.0, 1.0
00143 };
00144
00145
00146 const double XlocTetra[12] = {
00147 1.0, 0.0, 0.0,
00148 0.0, 1.0, 0.0,
00149 0.0, 0.0, 1.0,
00150 0.0, 0.0, 0.0,
00151 };
00152
00153 struct isect_info_t {
00154 float t;
00155 float u, v;
00156 int side;
00157 };
00158
00159 struct el_isect_info_t : isect_info_t {
00160 isect_info_t out;
00161 };
00162
00163 enum VertexType {
00164 INSIDE_SHAPE = 0,
00165 EDGE_SHAPE = (1 << 0),
00166 CORNER_SHAPE = (1 << 1),
00167 };
00168
00169
00170
00171
00172
00173 #pragma pack(push,1)
00174
00175 typedef struct _Node_t {
00176 fvmath::CVec3d position;
00177 int info;
00178 int type;
00179 } Node_t;
00180
00181 struct BaseVertex {
00182 typedef float info_t;
00183 fvmath::CVec3f position;
00184 info_t info;
00185
00186
00187 };
00188
00189 struct Vertex : public BaseVertex {
00190 typedef float value_type;
00191 float value;
00192 fvmath::CVec3f color;
00193
00194 Vertex()
00195 {
00196 position = fvmath::CVec3f(LARGE_F,LARGE_F,LARGE_F);
00197 info = 0;
00198 value = -LARGE_F;
00199 color = fvmath::CVec3f(-LARGE_F,-LARGE_F,-LARGE_F);
00200 }
00201
00202 Vertex(fvmath::Vec3f& pos_,int info_ = 0,float val = -LARGE_F)
00203 {
00204 position = pos_;
00205 info = info_;
00206 value = val;
00207 color = fvmath::CVec3f(-LARGE_F,-LARGE_F,-LARGE_F);
00208 }
00209
00210 Vertex(const Node_t& node)
00211 {
00212 BaseVertex::position = node.position;
00213 BaseVertex::info = node.info;
00214 BaseVertex::info = node.info;
00215
00216 }
00217 };
00218 struct MeshVertex {
00219
00220 fvmath::CVec3d position;
00221 double value;
00222 int info;
00223 int type;
00224 };
00225
00226 typedef BaseVertex Origin;
00227
00228 inline bool operator<(const Vertex& a, const Vertex& b) {
00229 if (!fvmath::is_near( a.position.x, b.position.x, 0.001f)) return a.position.x < b.position.x;
00230 if (!fvmath::is_near( a.position.y, b.position.y, 0.001f)) return a.position.y < b.position.y;
00231 if (!fvmath::is_near( a.position.z, b.position.z, 0.001f)) return a.position.z < b.position.z;
00232 return false;
00233 }
00234
00235 #pragma pack(pop)
00236
00237 struct BaseVertexInserterID {
00238 bool operator()(const BaseVertex& lhs,const BaseVertex& rhs) {
00239 return lhs.info < rhs.info;
00240 }
00241 };
00242
00243 enum {
00244 HORIZONTAL=0,
00245 VERTICAL,
00246 };
00247
00248
00249 struct colorbar_config_t {
00250 char type;
00251 char orient;
00252 float x,y;
00253 float w,h;
00254 double min,max;
00255 double start,end;
00256 float out_col[4];
00257
00258
00259 float* colors;
00260 int size;
00261 int stride;
00262 float text_col[4];
00263 float theight;
00264 void* font;
00265 float edge_col[4];
00266 float line_width;
00267 float out_width_coef;
00268 int num_ranges;
00269
00270 };
00271
00272
00273 struct Vertex2D {
00274 float x, y;
00275 };
00276
00277 struct CVertex2D : public Vertex2D {
00278 float r,g,b;
00279 CVertex2D() { memset(this,0,sizeof(Vertex2D)); }
00280 CVertex2D(float xx,float yy,float rr,float gg,float bb)
00281 { x = xx; y = yy; r = rr; g = gg; b = bb; }
00282 };
00283
00284 struct label_t {
00285 float xts,yts;
00286 char label[12];
00287 label_t() { memset(this,0,sizeof(label_t)); }
00288 label_t(float _xs,float _ys,const char* _label)
00289 : xts(_xs),yts(_ys)
00290 {
00291
00292 strcpy(label,_label);
00293 }
00294 label_t(const label_t& rhs)
00295 {
00296
00297 memcpy(this,&rhs,sizeof(label_t));
00298 }
00299
00300 label_t(const label_t&& rhs)
00301 {
00302
00303 memcpy(this,&rhs,sizeof(label_t));
00304 }
00305
00306 };
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363 }
00364
00365 #endif
00366