Branch data Line data Source code
1 : : /* *****************************************************************
2 : : MESQUITE -- The Mesh Quality Improvement Toolkit
3 : :
4 : : Copyright 2010 Sandia National Laboratories. Developed at the
5 : : University of Wisconsin--Madison under SNL contract number
6 : : 624796. The U.S. Government and the University of Wisconsin
7 : : retain certain rights to this software.
8 : :
9 : : This library is free software; you can redistribute it and/or
10 : : modify it under the terms of the GNU Lesser General Public
11 : : License as published by the Free Software Foundation; either
12 : : version 2.1 of the License, or (at your option) any later version.
13 : :
14 : : This library is distributed in the hope that it will be useful,
15 : : but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 : : Lesser General Public License for more details.
18 : :
19 : : You should have received a copy of the GNU Lesser General Public License
20 : : (lgpl.txt) along with this library; if not, write to the Free Software
21 : : Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 : :
23 : : (2010) [email protected]
24 : :
25 : : ***************************************************************** */
26 : :
27 : : /** \file DomainUtil.hpp
28 : : * \brief Utility functions for use in build-in geometric domains
29 : : * \author Jason Kraftcheck
30 : : */
31 : :
32 : : #ifndef MSQ_DOMAIN_UTIL_HPP
33 : : #define MSQ_DOMAIN_UTIL_HPP
34 : :
35 : : #include "Mesquite.hpp"
36 : : #include "MeshInterface.hpp"
37 : : #include <vector>
38 : : #include <stdlib.h> // size_t
39 : :
40 : : namespace MBMesquite
41 : : {
42 : :
43 : : class MsqVertex;
44 : : class Vector3D;
45 : : class Mesh;
46 : :
47 : : namespace DomainUtil
48 : : {
49 : :
50 : : void bounding_box( const MsqVertex* vertex_array, size_t num_vertices, Vector3D& box_min, Vector3D& box_max );
51 : :
52 : : double max_box_extent( const MsqVertex* vertex_array, size_t num_vertices );
53 : :
54 : 4 : inline double default_tolerance( const MsqVertex* vertex_array, size_t num_vertices )
55 : : {
56 : 4 : return 1e-3 * max_box_extent( vertex_array, num_vertices );
57 : : }
58 : :
59 : : void get_fixed_vertices( Mesh* mesh_instance, const Mesh::VertexHandle* vertex_array, size_t num_vertices,
60 : : std::vector< Mesh::VertexHandle >& fixed_handles_out, MsqError& err );
61 : :
62 : : bool non_colinear_vertices( const MsqVertex* vertex_array, size_t num_vertices, Vector3D coords_out[3],
63 : : double epsilon );
64 : :
65 : : bool non_coplanar_vertices( const MsqVertex* vertex_array, size_t num_vertices, Vector3D coords_out[4],
66 : : double epsilon );
67 : :
68 : : } // namespace DomainUtil
69 : :
70 : : } // namespace MBMesquite
71 : :
72 : : #endif
|