00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 #ifndef  _MxWedge15CellExtract_h
00024 #define  _MxWedge15CellExtract_h
00025 
00026 #include <MeshVizXLM/mesh/geometry/MiGeometryI.h>
00027 
00028 #include <Inventor/STL/vector>
00029 #include <Inventor/STL/utility>
00030 
00031 class MxTabOfMarchingCase;
00032 class MiVolumeCell;
00033 
00053  MxWedge15CellExtract 
00054 {
00055 public:
00056   
00060   static MbVec3d getIsoParametricCoord(const MiGeometryI& meshGeometry, const MiVolumeCell* wedgeCell, const MbVec3d &point);
00061 
00066   static void getWeight(const MiGeometryI& meshGeometry, const MiVolumeCell* wedgeCell, const MbVec3d &point, std::vector<double>& weights)
00067   {
00068     getWeight(getIsoParametricCoord(meshGeometry,wedgeCell,point),weights);
00069   }
00070 
00074   static void getWeight(const MbVec3d &ipcoord, std::vector<double>& weights);
00075 
00080   static void getDerivs(const MbVec3d &ipcoord, std::vector<double>& derivs);
00081 
00085   static bool isPointInsideCell(const MiGeometryI& meshGeometry, const MiVolumeCell* wedgeCell, const MbVec3d &point, std::vector<double>& weights)
00086   {
00087     MbVec3d pcoord = getIsoParametricCoord(meshGeometry,wedgeCell,point);
00088     bool inside = ( -1.E-5 < pcoord[0] &&  pcoord[0] < 1 + 1.E-5 &&
00089                     -1.E-5 < pcoord[1] &&  pcoord[1] < 1 + 1.E-5 &&
00090                     -1.E-5 < pcoord[2] &&  pcoord[2] < 1 + 1.E-5 &&
00091                     -1.E-5 < (pcoord[0]+pcoord[1]) &&  (pcoord[0]+pcoord[1]) < 1 + 1.E-5);
00092     if (inside)
00093       getWeight(pcoord,weights);
00094     return inside;
00095   }
00096 
00097 private:
00098   static bool initClass();
00099   static void exitClass();
00100 
00101   static bool            s_isInit;
00102 
00103   static size_t s_imat0[3][9];
00104   static size_t s_imat1[4][3]; 
00105   static size_t s_imat2[4][3]; 
00106   static size_t s_imat3[2][3]; 
00107   static size_t s_iperm[2][9]; 
00108 };
00109 
00110 #endif
00111 
00112 
00113