Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
mesh_global_param.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2000-2022 Inria
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  * * Neither the name of the ALICE Project-Team nor the names of its
14  * contributors may be used to endorse or promote products derived from this
15  * software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  *
29  * Contact: Bruno Levy
30  *
31  * https://www.inria.fr/fr/bruno-levy
32  *
33  * Inria,
34  * Domaine de Voluceau,
35  * 78150 Le Chesnay - Rocquencourt
36  * FRANCE
37  *
38  */
39 
40 #ifndef GEOGRAM_MESH_PARAM_MESH_GLOBAL_PARAM
41 #define GEOGRAM_MESH_PARAM_MESH_GLOBAL_PARAM
42 
43 #include <geogram/basic/common.h>
45 #include <geogram/basic/geometry.h>
46 
53 namespace GEO {
54 
55  class Mesh;
56 
57  namespace GlobalParam2d {
58 
68  void GEOGRAM_API frame_field(
69  Mesh* mesh, Attribute<vec3>& B,
70  double hard_angle_threshold=45.0
71  );
72 
73 
74  namespace Internal {
75 
86  void GEOGRAM_API compute_R_ff(
87  Mesh* mesh, Attribute<vec3>& B, Attribute<index_t>& R_ff
88  );
89 
101  void GEOGRAM_API compute_R_fv(
102  Mesh* mesh,
104  );
105 
106 
117  void GEOGRAM_API mark_singular_vertices(
118  Mesh* mesh,
119  Attribute<index_t>& R_ff, Attribute<bool>& v_is_singular
120  );
121 
130  void GEOGRAM_API brush(Mesh* mesh, Attribute<vec3>& B);
131 
142  void GEOGRAM_API do_the_ball(
143  Mesh* mesh,
144  Attribute<index_t>& R_ff, Attribute<index_t>& c_on_border
145  );
146 
147 
156  void GEOGRAM_API do_the_ball_no_brush_no_zip(
157  Mesh* mesh, Attribute<index_t>& c_on_border
158  );
159 
160 
179  void GEOGRAM_API get_B_on_edge(
180  Mesh* mesh, Attribute<vec3>& B, Attribute<index_t>& R_ff,
181  index_t f, index_t c,
182  vec3& Bc, vec3& BTc
183  );
184 
185 
186  enum { CNSTR_NONE = 0, CNSTR_U = 1, CNSTR_V = 2 };
187 
200  void GEOGRAM_API get_constraints(
201  Mesh* mesh, Attribute<vec3>& B, Attribute<index_t>& R_ff,
202  Attribute<index_t>& constraint
203  );
204 
217  Mesh* mesh, index_t c, Attribute<vec3>& B
218  );
219 
220 
226  index_t GEOGRAM_API inverse_R(index_t R);
227 
228 
234  void GEOGRAM_API snap_tex_coord(double& coord);
235 
248  void GEOGRAM_API transfer_B_to_vertices(
249  Mesh* mesh,
251  Attribute<index_t>& R_fv
252  );
253 
254  }
255  }
256 }
257 
258 #endif
Generic mechanism for attributes.
Specialization of Attribute for booleans.
Definition: attributes.h:1524
Manages an attribute attached to a set of object.
Definition: attributes.h:1394
Represents a mesh.
Definition: mesh.h:2693
Common include file, providing basic definitions. Should be included before anything else by all head...
Geometric functions in 2d and 3d.
index_t get_edge_constraints(Mesh *mesh, index_t c, Attribute< vec3 > &B)
Tests whether U and V are constrained for a given edge.
void get_B_on_edge(Mesh *mesh, Attribute< vec3 > &B, Attribute< index_t > &R_ff, index_t f, index_t c, vec3 &Bc, vec3 &BTc)
Gets the field B evaluated at a given mesh edge.
void brush(Mesh *mesh, Attribute< vec3 > &B)
Brushes the direction field.
void compute_R_fv(Mesh *mesh, Attribute< index_t > &R_ff, Attribute< index_t > &R_fv)
Computes for each facet corner the number of times the facet vector B should be rotated along the fac...
void get_constraints(Mesh *mesh, Attribute< vec3 > &B, Attribute< index_t > &R_ff, Attribute< index_t > &constraint)
Determines the constraints for all edges of the mesh.
void compute_R_ff(Mesh *mesh, Attribute< vec3 > &B, Attribute< index_t > &R_ff)
Computes for each pair of adjacent facets the number of times the facet vector B should be rotated al...
void do_the_ball(Mesh *mesh, Attribute< index_t > &R_ff, Attribute< index_t > &c_on_border)
Computes the border of the ball.
void transfer_B_to_vertices(Mesh *mesh, Attribute< vec3 > &B, Attribute< vec3 > &Bv, Attribute< index_t > &R_fv)
Transfers a facet vector field to a vertex vector field.
void mark_singular_vertices(Mesh *mesh, Attribute< index_t > &R_ff, Attribute< bool > &v_is_singular)
Marks the singular vertices of the direction field.
void do_the_ball_no_brush_no_zip(Mesh *mesh, Attribute< index_t > &c_on_border)
Computes the border of the ball.
index_t inverse_R(index_t R)
Gets the inverse of a rotation.
void snap_tex_coord(double &coord)
Snaps a texture coordinate.
void frame_field(Mesh *mesh, Attribute< vec3 > &B, double hard_angle_threshold=45.0)
Computes a guidance frame field for global parameterization.
Global Vorpaline namespace.
Definition: basic.h:55
geo_index_t index_t
The type for storing and manipulating indices.
Definition: numeric.h:329