cgma
|
00001 //- Class: FacetorTool 00002 //- Description: FacetorTool is a template class that accepts both CubitNode, CubitTri, CubitEdge classes 00003 //- and CubitPoint, CubitFacet, CubitFacetEdge classes. CubitPoint, CubitFacet, and 00004 //- CubitFacetEdge classes have been modified to account for the difference between the mdb 00005 //= entities and geometric entities. 00006 //------------------------------------------------------------------------- 00007 // Filename : FacetorTool.hpp 00008 // 00009 // Purpose : 2D Delaunay Mesher 00010 // 00011 // Creator : Christopher Hynes 00012 // 00013 // Creation Date : 5/31/2002 00014 // 00015 // Owner : Steve Owen 00016 //------------------------------------------------------------------------- 00017 00018 #ifndef FACETOR_TOOL_HPP 00019 #define FACETOR_TOOL_HPP 00020 00021 #include "CubitFacet.hpp" 00022 #include "CubitFacetEdge.hpp" 00023 #include "CubitPoint.hpp" 00024 00025 class CubitFacet; 00026 class CubitFacetEdge; 00027 class CubitPoint; 00028 class ParamTool; 00029 00030 //template <class X> class DLIList; 00031 #include "DLIList.hpp" 00032 00033 template<class SURF, class TRI, class EDGE, class NODE, class TRICHILD, class NODECHILD, class SIZEFUNC> 00034 class FacetorTool 00035 { 00036 public: 00037 FacetorTool(){}; 00038 00039 FacetorTool( SURF *ref_face_ptr, 00040 DLIList<NODE *> &bounding_nodes, 00041 NODE **boundary_edge_start_nodes, 00042 NODE **boundary_edge_end_nodes, 00043 int num_boundary_edges, 00044 SIZEFUNC *sizing_function, 00045 ParamTool *ptool); 00046 00047 ~FacetorTool(void); 00048 00049 CubitStatus mesh_surf(DLIList<TRI *> &facet_list); 00050 //- mesh the surface 00051 //- returns a facet_list of the mesh entities. If using mesh entities, these are already 00052 //- added to the surface 00053 CubitStatus mesh_surfwoIP(DLIList<TRI *> &facet_list); 00054 //- mesh the surface with out interior point refinement 00055 CubitStatus mesh_surfwoIPBC(DLIList<TRI *> &facet_list); 00056 //- mesh the surface with out interior point refinement or boundary constraints 00057 00058 00059 private: 00060 ParamTool *pTool; //paramtool needed for sizing function interpolation 00061 SURF *refFacePtr; // id for surface 00062 DLIList<TRI *> *facetList; // list of tris created 00063 DLIList<NODE *> *boundingNodes; 00064 NODE **boundaryEdgeStartNodes; 00065 NODE **boundaryEdgeEndNodes; 00066 SIZEFUNC *sizingFunction; 00067 int numBoundaryEdges; 00068 //- bounding edges on the surfaces represented by their start 00069 //- and end nodes 00070 00071 NODE *boxNodes[4]; 00072 //- temporary nodes created enclosing the surface to facilitate 00073 //- Delaunay node insertion 00074 00075 int curVisitFlag; 00076 //- current visited flag for triangles 00077 00078 CubitStatus insert_hard_points(DLIList<NODE*> &hard_points); 00079 //- insert hard points into the mesh 00080 00081 CubitStatus init_box(); 00082 //- create two initial bounding triangles 00083 00084 CubitStatus insert_nodes( DLIList<NODE *> *&bounding_nodes ); 00085 //- insert a list of nodes into an existing triangulation 00086 00087 CubitStatus constrain_boundary(void); 00088 //- recover the boundary edges from the mesh 00089 00090 CubitStatus delete_exterior(void); 00091 //- delete the triangles on the outside of the boundary and on 00092 //- the interior of any holes 00093 00094 CubitStatus delete_tris(DLIList<TRI *> &tri_list, int marked_flag); 00095 //- delete the triangles in the list with the spacified marked_flag 00096 00097 CubitStatus mark_tris(TRI *tri_ptr, int &num_found_edges); 00098 //- recursive function to mark all the triangles up to a marked edge 00099 00100 CubitStatus refine_interior(DLIList<TRI*> &tri_list); 00101 //- generate nodes on the interior of the tiangulation to 00102 //- improve quality. This inserts nodes at the circumcenters of 00103 //- triangles roughly based on the algorithm by Jonathon Shewchuk 00104 00105 CubitStatus classify_triangles(DLIList<TRI *> &tri_list, 00106 DLIList<TRI*>* sorted_lists, 00107 const int num_lists, 00108 const double interval); 00109 //- order the triangles in the current mesh by their worst angle 00110 00111 TRI *next_triangle(DLIList<TRI*>* sorted_lists, 00112 const int num_lists); 00113 //- get the next triangle to process; 00114 00115 void clean_up_data(void); 00116 //- clean up any data we've allocated 00117 00118 }; 00119 00120 #include "FacetorTool.cpp" 00121 #endif // FACETOR_TOOL_HPP 00122