ug4
resolve_intersections.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2015: 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__resolve_intersections__
34 #define __H__UG__resolve_intersections__
35 
36 #include "lib_grid/grid/grid.h"
37 
38 namespace ug{
39 
40 template <class TAAPosVRT>
41 Vertex* ResolveVertexEdgeIntersection(Grid& grid, Vertex* v,
42  Edge* e, TAAPosVRT& aaPos,
43  number snapThreshold);
44 
50 template <class TAAPosVRT>
51 bool ResolveVertexFaceIntersection(Grid& grid, Vertex* v,
52  Face* f, TAAPosVRT& aaPos,
53  number snapThreshold,
54  std::vector<Face*>* pNewFacesOut);
55 
61 template <class TAAPosVRT>
62 Vertex* ResolveEdgeEdgeIntersection(Grid& grid, Edge* e1, Edge* e2,
63  TAAPosVRT& aaPos, number snapThreshold);
64 
70 template <class TAAPosVRT>
71 bool ResolveEdgeFaceIntersection(Grid& grid, Edge* e, Face* f,
72  TAAPosVRT& aaPos, number snapThreshold);
73 
80 template <class TAAPosVRT>
83  TAAPosVRT& aaPos,
84  number snapThreshold);
85 
89 template <class TObjectCollection, class TAPos>
91  TObjectCollection& elems,
92  TAPos& aPos,
93  number snapThreshold);
94 
98 template <class TObjectCollection, class TAAPosVRT>
99 bool IntersectCloseEdges(Grid& grid,
100  TObjectCollection& elems,
101  TAAPosVRT& aaPos,
102  number snapThreshold);
103 
104 
106 
107 template <class TAAPosVRT>
108 int FindCloseVertexInArray(const std::vector<Vertex*>& array,
109  const typename TAAPosVRT::ValueType& p,
110  TAAPosVRT& aaPos, number snapThreshold);
111 
113 template <class TAAPosVRT>
114 int FindClosestVertexInArray(const std::vector<Vertex*>& array, const Vertex* p,
115  TAAPosVRT& aaPos, number snapThreshold);
116 
118 template <class TAAPosVRT, class vector_t>
119 int FindClosestVertexInPointSet(const vector_t* pointSet, const Vertex* p,
120  TAAPosVRT& aaPos, number snapThreshold,
121  size_t numPoints);
122 
124 
126 template <class TAPos>
128  TriangleIterator trisEnd, number snapThreshold,
129  TAPos& aPos);
130 
131 }// end of namespace
132 
134 // include implementation
136 #endif
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
a helper class that holds a collection of possibly unconnected geometric-objects.
Definition: grid_object_collection.h:96
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
double number
Definition: types.h:124
the ug namespace
int FindClosestVertexInPointSet(const vector_t *pointSet, const Vertex *p, TAAPosVRT &aaPos, number snapThreshold, size_t numPoints)
returns the index of the closest vertex to p if closer than snapThreshold
Definition: resolve_intersections_impl.hpp:1039
bool ProjectVerticesToCloseEdges(Grid &grid, GridObjectCollection elems, TAAPosVRT &aaPos, number snapThreshold)
bool ResolveVertexFaceIntersection(Grid &grid, Vertex *v, Face *f, TAAPosVRT &aaPos, number snapThreshold, std::vector< Face * > *pNewFacesOut)
Definition: resolve_intersections_impl.hpp:188
Vertex * ResolveEdgeEdgeIntersection(Grid &grid, Edge *e1, Edge *e2, TAAPosVRT &aaPos, number snapThreshold)
Definition: resolve_intersections_impl.hpp:417
geometry_traits< Triangle >::iterator TriangleIterator
Definition: grid_objects_2d.h:211
int FindCloseVertexInArray(const std::vector< Vertex * > &array, const typename TAAPosVRT::ValueType &p, TAAPosVRT &aaPos, number snapThreshold)
returns the index of the first vertex closer to p than snapThreshold.
int FindClosestVertexInArray(const std::vector< Vertex * > &array, const Vertex *p, TAAPosVRT &aaPos, number snapThreshold)
returns the index of the closest vertex to p if closer than snapThreshold.
bool IntersectCloseEdges(Grid &grid, TObjectCollection &elems, TAAPosVRT &aaPos, number snapThreshold)
Definition: resolve_intersections_impl.hpp:932
bool ResolveEdgeFaceIntersection(Grid &grid, Edge *e, Face *f, TAAPosVRT &aaPos, number snapThreshold)
Definition: resolve_intersections_impl.hpp:477
Vertex * ResolveVertexEdgeIntersection(Grid &grid, Vertex *v, Edge *e, TAAPosVRT &aaPos, number snapThreshold)
Definition: resolve_intersections_impl.hpp:137
bool ResolveTriangleIntersections(Grid &grid, TriangleIterator trisBegin, TriangleIterator trisEnd, number snapThreshold, TAPos &aPos)
Definition: resolve_intersections_impl.hpp:1353
bool ProjectVerticesToCloseFaces(Grid &grid, TObjectCollection &elems, TAPos &aPos, number snapThreshold)
Definition: resolve_intersections_impl.hpp:826