$extrastylesheet
00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 00003 00004 // This library is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public 00006 // License as published by the Free Software Foundation; either 00007 // version 2.1 of the License, or (at your option) any later version. 00008 00009 // This library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // Lesser General Public License for more details. 00013 00014 // You should have received a copy of the GNU Lesser General Public 00015 // License along with this library; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 00019 #ifndef LIBMESH_MESH_TRIANGLE_INTERFACE_H 00020 #define LIBMESH_MESH_TRIANGLE_INTERFACE_H 00021 00022 00023 #include "libmesh/libmesh_config.h" 00024 00025 #ifdef LIBMESH_HAVE_TRIANGLE 00026 00027 // Local Includes 00028 #include "libmesh/enum_elem_type.h" 00029 #include "libmesh/libmesh.h" 00030 #include "libmesh/mesh_serializer.h" 00031 00032 // C++ includes 00033 #include <cstddef> 00034 #include <vector> 00035 00036 namespace libMesh 00037 { 00038 00039 // Forward Declarations 00040 00041 class UnstructuredMesh; 00042 00049 class TriangleInterface 00050 { 00051 public: 00058 explicit 00059 TriangleInterface(UnstructuredMesh& mesh); 00060 00064 ~TriangleInterface() {} 00065 00070 enum TriangulationType 00071 { 00077 GENERATE_CONVEX_HULL = 0, 00078 00089 PSLG = 1, 00090 00094 INVALID_TRIANGULATION_TYPE 00095 }; 00096 00102 class Hole; 00103 class PolygonHole; 00104 class ArbitraryHole; 00105 00110 void triangulate(); 00111 00115 ElemType& elem_type() {return _elem_type;} 00116 00121 Real& desired_area() {return _desired_area;} 00122 00127 Real& minimum_angle() {return _minimum_angle;} 00128 00132 std::string& extra_flags() {return _extra_flags;} 00133 00137 TriangulationType& triangulation_type() {return _triangulation_type;} 00138 00142 bool& insert_extra_points() {return _insert_extra_points;} 00143 00148 bool& smooth_after_generating() {return _smooth_after_generating;} 00149 00154 void attach_hole_list(const std::vector<Hole*>* holes) {_holes = holes;} 00155 00167 std::vector<std::pair<unsigned int, unsigned int> > segments; 00168 00169 private: 00173 UnstructuredMesh& _mesh; 00174 00179 const std::vector<Hole*>* _holes; 00180 00185 ElemType _elem_type; 00186 00190 Real _desired_area; 00191 00195 Real _minimum_angle; 00196 00200 std::string _extra_flags; 00201 00207 TriangulationType _triangulation_type; 00208 00214 bool _insert_extra_points; 00215 00220 bool _smooth_after_generating; 00221 00225 MeshSerializer _serializer; 00226 }; 00227 00228 } // namespace libMesh 00229 00230 00231 00232 #endif // LIBMESH_HAVE_TRIANGLE 00233 00234 #endif // ifndef LIBMESH_MESH_TRIANGLE_INTERFACE_H