Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
extra_connectivity.h
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 H_HEXDOM_ALGO_EXTRA_CONNECTIVITY_H
41 #define H_HEXDOM_ALGO_EXTRA_CONNECTIVITY_H
42 
44 #include <geogram/mesh/mesh.h>
45 #include <cmath>
46 
47 namespace GEO {
48 
55  void reset();
56  index_t org(index_t corner_id);
57  index_t dest(index_t corner_id);
58  index_t opposite(index_t corner_id);
59  index_t next_around_vertex(index_t cir);
60  index_t facet(index_t corner_id);
61  index_t local_id(index_t corner_id);
62 
63  index_t next(index_t corner_id);
64  index_t prev(index_t corner_id);
65  vec3 geom(index_t corner_id);
66 
67  Mesh* m;
68  vector<index_t> v2c; // vertex to corner
69  vector<index_t> c2f; // corner to facet
70  vector<index_t> c2c; // corner to next corner sharing the same vertex
71  };
72 
73 
80  void reset();
81  index_t org(index_t corner_id);
82  index_t dest(index_t corner_id);
83  index_t opposite(index_t corner_id);
84  index_t next_around_vertex(index_t cir);
85  index_t facet(index_t corner_id);
86  index_t local_id(index_t corner_id);
87  index_t next_CCW(index_t h) { return opposite(prev(h)); }
88  index_t next_CW(index_t h) { return next(opposite(h)); }
89 
90 
91  index_t next(index_t corner_id);
92  index_t prev(index_t corner_id);
93  vec3 geom(index_t corner_id);
94 
95  Mesh* m;
96  Attribute<bool> facet_is_valid;
97  vector<index_t> v2c; // vertex to corner
98  vector<index_t> c2f; // corner to facet
99  vector<index_t> c2c; // corner to next corner sharing the same vertex
100  };
101 
102  void halfedge_manip_example(Mesh* m);
103 
107  void create_facet_adjacence(Mesh* m, bool has_border = false);
108 
114  void compute_tet_edge_graph(Mesh* m,vector<index_t>& v2e, bool store_both_directions);
115  void restore_v2e(Mesh* m, vector<index_t>& v2e);
116 
121  void cell_edges_in_RCS(Mesh* m, vector<index_t>& offset_from_org, vector<index_t>& dest);
122 
129 }
130 #endif
Specialization of Attribute for booleans.
Definition: attributes.h:1524
Represents a mesh.
Definition: mesh.h:2693
Included by all headers in exploragram.
The class that represents a mesh.
Global Vorpaline namespace.
Definition: basic.h:55
void compute_tet_edge_graph(Mesh *m, vector< index_t > &v2e, bool store_both_directions)
geo_index_t index_t
The type for storing and manipulating indices.
Definition: numeric.h:329
void cell_edges_in_RCS(Mesh *m, vector< index_t > &offset_from_org, vector< index_t > &dest)
bool v2f_is_valid(Mesh *m, vector< vector< index_t > > &v2f, vector< index_t > &to_kill)
void create_facet_adjacence(Mesh *m, bool has_border=false)