00001 #ifndef _ELEM_TABLES_H_
00002 #define _ELEM_TABLES_H_
00003
00004 #include "MathHelper.h"
00005 #include "CutPlane.h"
00006 #include "GraphicElem.hpp"
00007
00008
00009 extern int iQuadEdgesIds[4][2];
00010 extern int iQuadFlags[16];
00011 extern int iQuadEdges[16][7];
00012 extern const int iPrizmEdges[9][2];
00014
00015
00016 typedef FemViewer::fvmath::CVec3d myVec3d;
00017 typedef FemViewer::Node_t myVertex;
00018 typedef FemViewer::Vertex Vertex;
00019 typedef FemViewer::CutPlane myPlane;
00020
00021 struct comp {
00022 inline bool operator()(const Vertex& a,const Vertex& b){
00023 if(!FemViewer::fvmath::is_near( a.position.x , b.position.x, 0.001f )) return a.position.x < b.position.x;
00024 if(!FemViewer::fvmath::is_near( a.position.y , b.position.y, 0.001f )) return a.position.y < b.position.y;
00025 if(!FemViewer::fvmath::is_near( a.position.z , b.position.z, 0.001f )) return a.position.z < b.position.z;
00026 return false;
00027 }
00028 };
00029
00030
00031
00032
00033
00034
00035 extern int IsPrismSelected(const double coords[6*4],const double* plane);
00036
00037 extern int IsTetraSelected(const double coords[4*4],const double* plane);
00038
00039 extern unsigned int CutElement(const double vertices[18], const int nodes[7],const myPlane* cut_plane,std::vector<myVertex>& out_vertices);
00040
00041 extern void indexVBO(std::vector< Vertex >& inout_vertices,std::vector< unsigned int >& inout_indices);
00042
00043 extern unsigned TessellateTriangle(const myVertex* a,const myVertex* b,const myVertex* c,
00044 int ndiv,
00045 std::vector<myVertex>& vertices, std::vector<unsigned>& indices);
00046
00047 #endif