Plugins
topology_tools.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2017: G-CSC, Goethe University Frankfurt
3  * Author: Sebastian Reiter
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __H__UG__topology_tools__
34 #define __H__UG__topology_tools__
35 
36 #include <vector>
37 #include "../mesh.h"
43 
44 #define TOOLTIP_RESOLVE_SELF_INTERSECTIONS "Resolves self intersections of faces and edges."
45 #define TOOLTIP_RESOLVE_EDGE_INTERSECTIONS "Makes sure that all edge intersections are represented by a vertex."
46 #define TOOLTIP_RESOLVE_TRIANGLE_INTERSECTIONS "Makes sure that all triangle intersections are represented by an edge and vertices."
47 #define TOOLTIP_PROJECT_VERTICES_TO_CLOSE_EDGES "Projects selected vertices to selected close edges."
48 #define TOOLTIP_PROJECT_VERTICES_TO_CLOSE_FACES "Projects selected vertices to selected close faces."
49 #define TOOLTIP_INTERSECT_CLOSE_EDGES "Performs intersections between selected close edges."
50 #define TOOLTIP_ERASE_SELECTED_ELEMENTS "Erases selected elements and associated unreferenced geometry."
51 #define TOOLTIP_REMOVE_DOUBLES "Removes selected vertices that are close to each other"
52 #define TOOLTIP_REMOVE_DOUBLE_EDGES "Removes selected duplicates of selected edges."
53 #define TOOLTIP_REMOVE_DOUBLE_FACES "Removes selected duplicates of selected faces."
54 #define TOOLTIP_MERGE_AT_FIRST "Merges all selected objects into a single vertex at the first selected vertex."
55 #define TOOLTIP_MERGE_AT_CENTER "Merges all selected objects into a single vertex at the center of the selection."
56 #define TOOLTIP_MERGE_AT_LAST "Merges all selected objects into a single vertex at the last selected vertex."
57 #define TOOLTIP_COLLAPSE_EDGE "Collapses the edge and removes adjacent triangles."
58 #define TOOLTIP_SPLIT_EDGE "Splits the edge and inserts new triangles."
59 #define TOOLTIP_SWAP_EDGE "Swaps selected edges that are adjacent to exactly two triangles."
60 #define TOOLTIP_PLANE_CUT "Cuts selected edges along the given plane."
61 #define TOOLTIP_ADJUST_EDGE_ORIENTATION "Adjusts the orientation of boundary edges to associated faces."
62 #define TOOLTIP_FIX_FACE_ORIENTATION "Tries to change orientation of selected faces so that all neighbouring faces point into the same direction. Only works correctly for manifold selections."
63 #define TOOLTIP_FIX_FACE_SUBSET_ORIENTATIONS "Iterates over all subset and tries to fix face orientation for each. Only works correctly for manifold subsets."
64 #define TOOLTIP_FIX_VOLUME_ORIENTATION "Changes orientation of selected volumes, so that they are oriented correctly."
65 #define TOOLTIP_INVERT_FACE_ORIENTATION "Inverts the orientation of all selected faces."
66 #define TOOLTIP_CREATE_HEXAHEDRA_FROM_SELECTED_PRISMS "Creates hexahedra from pairs of selected prisms which share a quadrilateral side. For best performance, matching prisms should be selected directly after one another."
67 
68 
69 namespace ug{
70 namespace promesh{
71 
74 
76  Mesh* obj,
77  bool eraseUnusedVrts,
78  bool eraseUnusedEdges,
79  bool eraseUnusedFaces);
80 
81 size_t RemoveDoubles(Mesh* obj, number threshold);
82 
83 size_t RemoveDoubleEdges(Mesh* obj);
84 
85 size_t RemoveDoubleFaces(Mesh* obj);
86 
87 void MergeAtFirst(Mesh* obj);
88 
89 void MergeAtCenter(Mesh* obj);
90 
91 void MergeAtLast(Mesh* obj);
92 
93 void CollapseEdge(Mesh* obj);
94 
95 void SplitEdge(Mesh* obj);
96 
97 void SwapEdge(Mesh* obj);
98 
99 void PlaneCut(Mesh* obj, const vector3& p, const vector3& n);
100 
101 void AdjustEdgeOrientation(Mesh* obj);
102 
103 void FixFaceOrientation(Mesh* obj);
104 
105 void FixFaceSubsetOrientations(Mesh* obj);
106 
107 int FixVolumeOrientation(Mesh* obj);
108 
109 void InvertFaceOrientation(Mesh* obj);
110 
111 void ResolveEdgeIntersection(Mesh* obj, number snapThreshold);
112 
113 void ResolveTriangleIntersections(Mesh* obj, number snapThreshold);
114 
115 void ProjectVerticesToCloseEdges(Mesh* obj, number snapThreshold);
116 
117 void ProjectVerticesToCloseFaces(Mesh* obj, number snapThreshold);
118 
119 void IntersectCloseEdges(Mesh* obj, number snapThreshold);
120 
121 void ResolveSelfIntersections(Mesh* obj, number snapThreshold);
122 
123 void CreateHexahedraFromSelectedPrisms(Mesh* obj);
124 
126 
127 }}// end of namespace
128 
129 #endif
parameterString p
Definition: Biogas.lua:1
void CreateHexahedraFromSelectedPrisms(Mesh *obj)
Definition: topology_tools.cpp:432
int FixVolumeOrientation(Mesh *obj)
Definition: topology_tools.cpp:283
void FixFaceSubsetOrientations(Mesh *obj)
Definition: topology_tools.cpp:273
void SplitEdge(Mesh *obj)
Definition: topology_tools.cpp:195
void SwapEdge(Mesh *obj)
Definition: topology_tools.cpp:219
size_t RemoveDoubleFaces(Mesh *obj)
Definition: topology_tools.cpp:95
void PlaneCut(Mesh *obj, const vector3 &p, const vector3 &n)
Definition: topology_tools.cpp:246
size_t RemoveDoubleEdges(Mesh *obj)
Definition: topology_tools.cpp:85
size_t RemoveDoubles(Mesh *obj, number threshold)
returns the number of removed vertices
Definition: topology_tools.cpp:74
void ProjectVerticesToCloseEdges(Mesh *obj, number snapThreshold)
Definition: topology_tools.cpp:345
void MergeAtCenter(Mesh *obj)
Definition: topology_tools.cpp:119
void MergeAtFirst(Mesh *obj)
Definition: topology_tools.cpp:105
void MergeAtLast(Mesh *obj)
Definition: topology_tools.cpp:134
void IntersectCloseEdges(Mesh *obj, number snapThreshold)
Definition: topology_tools.cpp:373
void ProjectVerticesToCloseFaces(Mesh *obj, number snapThreshold)
Definition: topology_tools.cpp:359
void FixFaceOrientation(Mesh *obj)
Definition: topology_tools.cpp:264
void CollapseEdge(Mesh *obj)
Definition: topology_tools.cpp:153
void ResolveTriangleIntersections(Mesh *obj, number snapThreshold)
Definition: topology_tools.cpp:322
void EraseSelectedElements(Mesh *obj, bool eraseUnusedVrts, bool eraseUnusedEdges, bool eraseUnusedFaces)
Definition: topology_tools.cpp:44
void ResolveSelfIntersections(Mesh *obj, number snapThreshold)
Definition: topology_tools.cpp:383
void ResolveEdgeIntersection(Mesh *obj, number snapThreshold)
Definition: topology_tools.cpp:301
void InvertFaceOrientation(Mesh *obj)
Definition: topology_tools.cpp:293
void AdjustEdgeOrientation(Mesh *obj)
Definition: topology_tools.cpp:252
double number