MeshKit
1.0
|
00001 00002 00003 #include <stdlib.h> 00004 #include <stdio.h> 00005 #include <assert.h> 00006 #include <string> 00007 #include <iostream> 00008 #include <fstream> 00009 #include <string.h> 00010 #include <limits.h> 00011 00012 #include <iGeom.h> 00013 #include <iMesh.h> 00014 #include <set> 00015 #include <iRel.h> 00016 #include <vector> 00017 #include "meshkit/MKCore.hpp" 00018 #include "meshkit/MeshScheme.hpp" 00019 00020 00021 namespace MeshKit 00022 { 00023 00024 using namespace std; 00025 00037 class SurfaceFacetMeshReader : public MeshScheme 00038 { 00039 public: 00042 SurfaceFacetMeshReader(MKCore *mk, const MEntVector &ments); 00043 00046 ~SurfaceFacetMeshReader(); 00047 00048 virtual void setup_this(); 00049 00050 virtual void execute_this(); 00051 00052 //Functions needed to register the new meshing class in MK 00053 00058 static bool can_mesh(iBase_EntityType dim) 00059 { return iBase_FACE == dim; } 00060 00067 static bool can_mesh(ModelEnt *me) 00068 { return canmesh_face(me); } 00069 00071 static const char* name() 00072 {return "SurfaceFacetMeshReader";} 00073 00077 static const moab::EntityType* output_types(); 00078 00079 virtual const moab::EntityType* mesh_types_arr() const 00080 { return output_types(); } 00081 00082 void set_mesh_params(double faceting_tolerance=0, double geom_resabs=0); 00083 00084 private: 00085 double facet_tol; 00086 double geom_res; 00087 MKCore *mk; 00088 00092 void facet(ModelEnt *surf); 00093 00094 double vtx2vtx_dist( iGeom::EntityHandle vtx1, iMesh::EntityHandle vtx2); 00095 }; 00096 00097 }