Developer Documentation
MeshFunctions.hh
Go to the documentation of this file.
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openflipper.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenFlipper. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41 
42 
43 
44 
45 
46 
47 //=============================================================================
48 //
49 //
50 //=============================================================================
51 
52 
53 #ifndef MESHFUNCTIONS_HH
54 #define MESHFUNCTIONS_HH
55 
56 
64 //== INCLUDES =================================================================
65 
66 #include <vector>
67 
68 //== FORWARDDECLARATIONS ======================================================
69 
70 //== NAMESPACES ===============================================================
71 
73 namespace MeshFunctions {
74 
75 //== DEFINITIONS ==============================================================
76 
83 template < typename MeshT , typename VectorT >
84 bool get_boundary(MeshT& _mesh,
85  typename MeshT::VertexHandle _vh,
86  std::vector< std::pair< VectorT , typename MeshT::VertexHandle > >& _boundary);
87 
94 template < typename MeshT , typename VectorT >
95 bool get_boundary(MeshT& _mesh,
96  std::vector< std::pair< VectorT ,
97  typename MeshT::VertexHandle > >& _boundary);
98 
105 template < typename MeshT , typename VectorT >
106 void smooth_boundary(MeshT& _mesh ,
107  typename MeshT::VertexHandle _vh);
108 
115 template < typename MeshT >
116 bool neighbour(const MeshT& _mesh ,
117  const typename MeshT::FaceHandle& _fh1 ,
118  const typename MeshT::FaceHandle& _fh2 );
119 
128 template < typename MeshT , typename VectorT >
129 bool
130 cut_face(const VectorT& _porigin,
131  const VectorT& _pnormal,
132  const MeshT& _mesh,
133  const typename MeshT::FaceHandle& _fh);
134 
139 template < typename MeshT >
140 double
141 calc_area( const MeshT& _mesh);
142 
148 template < typename MeshT >
149 double
150 calc_angle_around( const MeshT& _mesh , const typename MeshT::VertexHandle& _vh);
151 
158 template< typename MeshT >
159 void transformMesh(ACG::Matrix4x4d _matrix , MeshT& _mesh);
160 
166 template< typename MeshT >
167 void transformHandleVertices(ACG::Matrix4x4d _matrix , MeshT& _mesh);
168 
169 //=============================================================================
170 } // MeshFunctions Namespace
171 //=============================================================================
172 #if defined(INCLUDE_TEMPLATES) && !defined(MESHFUNCTIONS_C)
173 #define MESHFUNCTIONS_TEMPLATES
174 #include "MeshFunctionsT_impl.hh"
175 #endif
176 //=============================================================================
177 #endif // MESHFUNCTIONS_HH defined
178 //=============================================================================
179 
bool get_boundary(MeshT &_mesh, typename MeshT::VertexHandle _vh, std::vector< std::pair< VectorT, typename MeshT::VertexHandle > > &_boundary)
bool neighbour(const MeshT &_mesh, const typename MeshT::FaceHandle &_fh1, const typename MeshT::FaceHandle &_fh2)
double calc_area(const MeshT &_mesh)
void transformHandleVertices(ACG::Matrix4x4d _matrix, MeshT &_mesh)
void transformMesh(ACG::Matrix4x4d _matrix, MeshT &_mesh)
bool cut_face(const VectorT &_porigin, const VectorT &_pnormal, const MeshT &_mesh, const typename MeshT::FaceHandle &_fh)
void smooth_boundary(MeshT &_mesh, typename MeshT::VertexHandle _vh)
Namespace providing different Mesh editing functions.
double calc_angle_around(const MeshT &_mesh, const typename MeshT::VertexHandle &_vh)