33#ifndef __H__UG__selection_tools__
34#define __H__UG__selection_tools__
50#define TOOLTIP_SELECT_LINKED_MANIFOLD_FACES "Selects faces linked with the selection, not crossing non-manifold edges."
51#define TOOLTIP_SELECT_NON_MANIFOLD_EDGES "Selects edges with more than 2 associated faces."
52#define TOOLTIP_CLEAR_SELECTION "Clears the selection."
53#define TOOLTIP_SELECT_ELEMENTS_BY_INDEX_RANGE "Selects elements by the given index ranges (e.g.: \"0,1,2-5,9,11-23\")."
54#define TOOLTIP_SELECT_SMOOTH_EDGE_PATH "Selects a smooth edge path."
55#define TOOLTIP_SELECT_BOUNDARY_VERTICES "Selects vertices that lie on the boundary of the geometry"
56#define TOOLTIP_SELECT_INNER_VERTICES "Selects vertices that do not lie on the boundary of the geometry"
57#define TOOLTIP_SELECT_BOUNDARY_EDGES "Selects edges that lie on the boundary of the geometry"
58#define TOOLTIP_SELECT_INNER_EDGES "Selects edges that do not lie on the boundary of the geometry"
59#define TOOLTIP_SELECT_BOUNDARY_FACES "Selects faces that lie on the boundary of the geometry"
60#define TOOLTIP_SELECT_INNER_FACES "Selects faces that do not lie on the boundary of the geometry"
61#define TOOLTIP_SELECT_SHORT_EDGES "Selects edges that are shorter than a given threshold."
62#define TOOLTIP_SELECT_LONG_EDGES "Selects edges that are longer than a given threshold."
63#define TOOLTIP_SELECT_CREASE_EDGES "Selects edges that at which triangles meet in a given angle."
64#define TOOLTIP_SELECT_DEGENERATE_FACES "Selects faces that have a height shorter than a given threshold."
65#define TOOLTIP_SELECT_LINKED_FLAT_FACES "Selects linked faces of selected faces that have a similar normal."
66#define TOOLTIP_SELECT_LINKED_BOUNDARY_EDGES "Selects linked boundary edges of selected edges."
67#define TOOLTIP_SELECT_LINKED_BOUNDARY_FACES "Selects linked boundary faces of selected faces."
68#define TOOLTIP_SELECT_INTERSECTING_TRIANGLES "Selects intersecting triangles. Neighbors are ignored."
69#define TOOLTIP_SELECT_ASSOCIATED_VERTICES "Selects vertices that belong to selected edges, faces and volumes."
70#define TOOLTIP_SELECT_ASSOCIATED_EDGES "Selects edges that belong to selected faces and volumes."
71#define TOOLTIP_SELECT_ASSOCIATED_FACES "Selects faces that belong to selected volumes."
72#define TOOLTIP_SELECT_ALL "Selects all vertices, edges ,faces and volumes of the current grid"
73#define TOOLTIP_SELECT_ALL_VERTICES "Selects all vertices of the current grid"
74#define TOOLTIP_DESELECT_ALL_VERTICES "Deselects all vertices of the current grid"
75#define TOOLTIP_SELECT_ALL_EDGES "Selects all edges of the current grid"
76#define TOOLTIP_DESELECT_ALL_EDGES "Deselects all edges of the current grid"
77#define TOOLTIP_SELECT_ALL_FACES "Selects all faces of the current grid"
78#define TOOLTIP_DESELECT_ALL_FACES "Deselects all faces of the current grid"
79#define TOOLTIP_SELECT_ALL_VOLUMES "Selects all volumes of the current grid"
80#define TOOLTIP_DESELECT_ALL_VOLUMES "Deselects all volumes of the current grid"
81#define TOOLTIP_SELECT_MARKED_VERTICES "Selects vertices which are marked."
82#define TOOLTIP_SELECT_MARKED_EDGES "Selects edges which are marked."
83#define TOOLTIP_SELECT_MARKED_FACES "Selects faces which are marked."
84#define TOOLTIP_SELECT_UNORIENTABLE_VOLUMES "Selects all volumes whose orientation can not be determined"
85#define TOOLTIP_EXTEND_SELECTION "Selects neighbors of selected elements."
86#define TOOLTIP_EXTEND_SELECTION_IN_DIRECTION "Selects neighbors of selected elements whose center can be reached in the given direction from the center of already selected elements."
87#define TOOLTIP_SELECT_VERTEX_BY_INDEX "Selects a vertex given its index."
88#define TOOLTIP_SELECT_EDGE_BY_INDEX "Selects a edge given its index."
89#define TOOLTIP_SELECT_FACE_BY_INDEX "Selects a face given its index."
90#define TOOLTIP_SELECT_FACES_BY_NORMAL "Selects faces given a normal and a maximum deviation angle."
91#define TOOLTIP_SELECT_VOLUME_BY_INDEX "Selects a volume given its index."
92#define TOOLTIP_SELECT_VOLUMES_BY_TYPE "Selects all volumes of a given type."
93#define TOOLTIP_SELECT_VERTEX_BY_COORDINATE "Selects a vertex given a coordinate."
94#define TOOLTIP_SELECT_EDGE_BY_COORDINATE "Selects the edge whose center is closest to the specified coordinate."
95#define TOOLTIP_SELECT_CLOSEST_EDGE "Selects the edge closest to the specified coordinate with respect to its perpendicular distance (or distance to the closest edge vertex resp., if the projection lies outside of the line segment)."
96#define TOOLTIP_SELECT_FACE_BY_COORDINATE "Selects the face whose center is closest to the specified coordinate."
97#define TOOLTIP_SELECT_VOLUME_BY_COORDINATE "Selects the volume whose center is closest to the specified coordinate."
98#define TOOLTIP_SELECT_VERTEX_BY_CYL_COORDINATE "Selects a vertex given a cylindrical coordinate."
99#define TOOLTIP_SELECT_EDGE_BY_CYL_COORDINATE "Selects the edge whose center is closest to the specified cylindrical coordinate."
100#define TOOLTIP_SELECT_FACE_BY_CYL_COORDINATE "Selects the face whose center is closest to the specified cylindrical coordinate."
101#define TOOLTIP_SELECT_VOLUME_BY_CYL_COORDINATE "Selects the volume whose center is closest to the specified cylindrical coordinate."
102#define TOOLTIP_SELECT_UNCONNECTED_VERTICES "Selects vertices which are not connected to the given element type."
103#define TOOLTIP_SELECT_SUBSET "Selects all elements of a subset."
104#define TOOLTIP_SELECT_SUBSET_BOUNDARY "Selects the boundary of a subset."
105#define TOOLTIP_SELECT_UNASSIGNED_ELEMENTS "Selects all elements not assigned to any subset."
106#define TOOLTIP_INVERT_SELECTION "Inverts current selection."
107#define TOOLTIP_EDGE_SELECTION_FILL "Selects neighbours of selected edges over non-selected vertices."
108#define TOOLTIP_FACE_SELECTION_FILL "Selects neighbours of selected faces over non-selected edges."
109#define TOOLTIP_VOLUME_SELECTION_FILL "Selects neighbours of selected volumes over non-selected faces."
110#define TOOLTIP_SELECT_SELECTION_BOUNDARY "Selects the boundary of the current selection."
111#define TOOLTIP_SELECT_BENT_QUADRILATERALS "Selects quadrilaterals which do not lie in a plane."
112#define TOOLTIP_CLOSE_SELECTION "Selects all associated elements of lower dimensions."
113#define TOOLTIP_RESTRICT_SELECTION_TO_SUBSET "Deselects all elements from the selection that are not in the specified subset."
114#define TOOLTIP_SELECT_SLIVERS "Selects flat tetrahedrons. Threshold-ratio specifies the minimal ratio between the distance of two opposing edges to the length of the longest edge."
115#define TOOLTIP_SELECT_SELECTION_KINK_VERTICES "Selects kink vertices in selected paths"
116#define TOOLTIP_SELECT_SUBSET_KINK_VERTICES "Selects kink vertices in subset-paths"
117#define TOOLTIP_SELECT_LINKED_EDGES "Repeatedly selects all edges which are vertex-neighbors of selected edges."
118#define TOOLTIP_SELECT_LINKED_FACES "Repeatedly selects all faces which are edge-neighbors of selected faces."
119#define TOOLTIP_SELECT_LINKED_VOLUMES "Repeatedly selects all volumes which are face-neighbors of selected volumes."
120#define TOOLTIP_SELECT_SHORT_POLYCHAINS "Selects polygonal chains which are shorter than the given threshold."
121#define TOOLTIP_SELECT_INTERFACE_ELEMENTS "Selects elements which are adjacent to higher dimensional elements of different subsets."
122#define TOOLTIP_SELECT_ANISOTROPIC_ELEMENTS "Selects elements and associated long edges wich have a shortest-to-longest edge ratio smaller than the specified one."
123#define TOOLTIP_SELECT_ELEMENTS_BY_SPLIT_PLANE "Selects elements whose center lies in front of the specified plane."
124#define TOOLTIP_SELECT_EDGES_BY_DIRECTION "Selects all edges which do not deviate further from the specified direction than the given angle. A minimal required deviation angle can also be specified."
125#define TOOLTIP_SELECT_SUBSET_EDGES_BY_DIRECTION "Selects all subset edges which do not deviate further from the specified direction than the given angle. A minimal required deviation angle can also be specified."
126#define TOOLTIP_SELECT_ELEMENTS_IN_COORDINATE_RANGE "Selects all elements whose center lies in the specified range."
127#define TOOLTIP_DESELECT_ELEMENTS_IN_COORDINATE_RANGE "Deselects all elements whose center lies in the specified range."
128#define TOOLTIP_SELECT_VERTEX_IN_BOX "Selects all vertices in the given box"
129#define TOOLTIP_SELECT_EDGE_IN_BOX "Selects all edges in the given box"
130#define TOOLTIP_SELECT_FACE_IN_BOX "Selects all faces in the given box"
131#define TOOLTIP_SELECT_VOLUME_IN_BOX "Selects all volumes in the given box"
132#define TOOLTIP_SELECT_VERTEX_IN_CYLINDER "Selects all vertices in the given cylinder"
133#define TOOLTIP_SELECT_EDGE_IN_CYLINDER "Selects all edges in the given cylinder"
134#define TOOLTIP_SELECT_FACE_IN_CYLINDER "Selects all faces in the given cylinder"
135#define TOOLTIP_SELECT_VOLUME_IN_CYLINDER "Selects all volumes in the given cylinder"
137#define TOOLTIP_CLEAR_MARKS "Clears all marks"
138#define TOOLTIP_MARK_CREASE_EDGES "Marks edges whose associated faces have a certain angle as crease-edge."
139#define TOOLTIP_MARK_SELECTION "Marks selected vertices and edges."
140#define TOOLTIP_UNMARK_SELECTION "Unmarks selected elements."
141#define TOOLTIP_MARK_CORNERS_OF_MARKED_EDGES "Marks selected vertices as fixed, if they lie at a sharp corner of a marked path or if they are at endpoints or at junctions of marked edges."
155 const char* vrtRanges,
156 const char* edgeRanges,
157 const char* faceRanges,
158 const char* volRanges,
159 bool clearSelection);
165 int neighborhoodSize,
170template <
class TElem>
176 TElem* e = FindClosestByCoordinate<TElem>(coord,
187template <
class TElem>
190 number x = rho * cos(phi);
191 number y = rho * sin(phi);
194 return SelectElemByCoordinate<TElem>(obj, coord);
232template <
class TElem>
238 regardSelectedNbrsOnly);
242template <
class TElem>
299 bool stopAtSelectedVrts);
350template <
class TElem>
353 SelectLinkedElements<TElem>(obj->
selector());
363 bool ignoreOrientation,
364 bool traverseDegeneratedFaces,
365 bool stopAtSelectedEdges);
380 number maxDeviationAngle);
433template <
int icoord,
int selFlag,
class TElem>
444 iter != g.
end<TElem>(); ++iter)
447 if(c[icoord] >= min && c[icoord] <= max)
448 sel.
select(*iter, selFlag);
452template <
int icoord,
int selFlag>
463 SelectElementsInCoordinateRange<icoord, selFlag, Vertex>(mesh, min, max);
465 SelectElementsInCoordinateRange<icoord, selFlag, Edge>(mesh, min, max);
467 SelectElementsInCoordinateRange<icoord, selFlag, Face>(mesh, min, max);
469 SelectElementsInCoordinateRange<icoord, selFlag, Volume>(mesh, min, max);
474template <
class TElem>
483 iter !=
grid.end<TElem>(); ++iter)
492template <
class TElem>
509 iter !=
grid.end<TElem>(); ++iter)
parameterString p
Definition Biogas.lua:1
parameterString s
Definition Biogas.lua:2
geometry_traits< TGeomObj >::iterator begin()
geometry_traits< TGeomObj >::iterator end()
void select(GridObject *elem, byte status)
SubsetHandler & subset_handler()
Definition mesh.h:100
Selector & selector()
Definition mesh.h:102
position_accessor_t & position_accessor()
returns accessor to vertex positions
Definition mesh.h:113
Grid & grid()
Definition mesh.h:99
UG_API TVertexPositionAttachmentAccessor::ValueType CalculateCenter(const Edge *e, TVertexPositionAttachmentAccessor &aaPosVRT)
void VolumeSelectionFill(Mesh *obj)
Definition selection_tools.cpp:1052
void SelectShortEdges(Mesh *obj, number maxLength)
Definition selection_tools.cpp:475
void SelectMarkedFaces(Mesh *obj)
Definition selection_tools.cpp:650
void DeselectAllFaces(Mesh *obj)
Definition selection_tools.cpp:844
void DeselectAllVertices(Mesh *obj)
Definition selection_tools.cpp:314
void SelectElementsInBox(Mesh *obj, const vector3 &min, const vector3 &max)
Selects elements whose center lie in a box.
Definition selection_tools.h:475
void DeselectAllEdges(Mesh *obj)
Definition selection_tools.cpp:540
void SelectLongEdges(Mesh *obj, number minLength)
Definition selection_tools.cpp:491
void SelectAll(Mesh *obj)
Definition selection_tools.cpp:49
void MarkSelection(Mesh *obj)
Definition selection_tools.cpp:1074
size_t SelectSubsetKinkVertices(Mesh *obj, int subsetIndex, number thresholdAngle, bool selectDarts)
Definition selection_tools.cpp:401
void InvertSelection(Mesh *obj, bool invVrts, bool invEdges, bool invFaces, bool invVols)
Definition selection_tools.cpp:217
void SelectDegenerateFaces(Mesh *obj, number maxHeight)
Definition selection_tools.cpp:707
void SelectShortPolychains(Mesh *m, number maxChainLength, bool closedChainsOnly)
Definition selection_tools.cpp:575
void SelectElementsInCoordinateRange(Mesh *obj, number min, number max)
Definition selection_tools.h:434
void SelectSelectionBoundary(Mesh *obj)
Definition selection_tools.cpp:244
void SelectLinkedFlatFaces(Mesh *obj, number maxDeviationAngle, bool ignoreOrientation, bool traverseDegeneratedFaces, bool stopAtSelectedEdges)
Definition selection_tools.cpp:746
void SelectAssociatedEdges(Mesh *obj)
Definition selection_tools.cpp:526
void SelectVolumesByType(Mesh *obj, bool selHexahedra, bool selOctahedra, bool selPrisms, bool selPyramids, bool selTetrahedra)
Definition selection_tools.cpp:1029
void SelectElementsBySplitPlane(Mesh *obj, bool selectVrts, bool selectEdges, bool selectFaces, bool selectVols, const vector3 &pivot, const vector3 &normal)
Definition selection_tools.cpp:1140
void SelectInnerVertices(Mesh *obj)
Definition selection_tools.cpp:292
void SelectFacesByNormal(Mesh *obj, const vector3 &refNormal, number maxDeviationAngle)
Definition selection_tools.cpp:866
void SelectInnerEdges(Mesh *obj)
Definition selection_tools.cpp:444
void SelectLinkedManifoldFaces(Mesh *obj)
Definition selection_tools.cpp:657
void SelectElementsInCylinder(Mesh *obj, const vector3 &cylBase, const vector3 &cylTop, number radius)
Selects elements whose center lie in a cylinder.
Definition selection_tools.h:493
void SelectAllEdges(Mesh *obj)
Definition selection_tools.cpp:533
bool SelectVertexByIndex(Mesh *obj, int index)
Definition selection_tools.cpp:327
void SelectSmoothEdgePath(Mesh *obj, number maxDeviation, number normalWeight, bool stopAtSelectedVrts)
Definition selection_tools.cpp:466
void SelectLinkedBoundaryEdges(Mesh *obj, bool stopAtSelectedVrts)
Definition selection_tools.cpp:515
void MarkCornersOfMarkedEdges(Mesh *obj, number angle)
Definition selection_tools.cpp:1064
bool SelectVolumeByIndex(Mesh *obj, int index)
Definition selection_tools.cpp:1013
Edge * SelectClosestEdge(Mesh *m, const vector3 &coord)
Definition selection_tools.cpp:609
void SelectEdgesByDirection(Mesh *m, const vector3 &dir, number minDeviationAngle, number maxDeviationAngle, bool selectFlipped)
Definition selection_tools.cpp:581
void FaceSelectionFill(Mesh *obj)
Definition selection_tools.cpp:918
void ClearSelection(Mesh *obj)
Definition selection_tools.cpp:44
void EdgeSelectionFill(Mesh *obj)
Definition selection_tools.cpp:569
size_t SelectBentQuadrilaterals(Mesh *obj, number dotThreshold)
Definition selection_tools.cpp:924
void SelectMarkedEdges(Mesh *obj)
Definition selection_tools.cpp:546
void SelectInnerFaces(Mesh *obj)
Definition selection_tools.cpp:643
TElem * SelectElemByCylindricalCoordinate(Mesh *obj, number rho, number phi, number z)
Definition selection_tools.h:188
void SelectAssociatedFaces(Mesh *obj)
Definition selection_tools.cpp:831
void DeselectAllVolumes(Mesh *obj)
Definition selection_tools.cpp:965
bool SelectFaceByIndex(Mesh *obj, int index)
Definition selection_tools.cpp:850
void SelectBoundaryEdges(Mesh *obj)
Definition selection_tools.cpp:437
size_t SelectUnconnectedVertices(Mesh *obj, bool edgeCons, bool faceCons, bool volCons)
Definition selection_tools.cpp:365
bool SelectEdgeByIndex(Mesh *obj, int index)
Definition selection_tools.cpp:553
int SelectSlivers(Mesh *obj, number thresholdRatio)
Definition selection_tools.cpp:1003
void ExtendSelection(Mesh *obj, int neighborhoodSize)
Definition selection_tools.cpp:81
void SelectCreaseEdges(Mesh *obj, number minAngle)
Definition selection_tools.cpp:507
void SelectIntersectingTriangles(Mesh *obj)
Definition selection_tools.cpp:763
TElem * SelectElemByCoordinate(Mesh *obj, const vector3 &coord)
Definition selection_tools.h:171
void SelectSubsetBoundary(Mesh *obj, int si, bool edgeBnds, bool faceBnds, bool volBnds)
Definition selection_tools.cpp:162
void ExtendSelectionInDirection(Mesh *obj, int neighborhoodSize, const vector3 &dir, number minAngle, number maxAngle)
Definition selection_tools.cpp:86
void SelectUnassignedElements(Mesh *obj, bool selVrts, bool selEdges, bool selFaces, bool selVols)
Definition selection_tools.cpp:196
void SelectAssociatedVertices(Mesh *obj)
Definition selection_tools.cpp:299
void SelectElementsByIndexRange(Mesh *obj, const char *vrtRanges, const char *edgeRanges, const char *faceRanges, const char *volRanges, bool clearSelection)
Definition selection_tools.cpp:59
void SelectLinkedBoundaryFaces(Mesh *obj, bool stopAtSelectedEdges)
Definition selection_tools.cpp:696
size_t SelectSelectionKinkVertices(Mesh *obj, number thresholdAngle, bool selectDarts)
Definition selection_tools.cpp:384
void UnmarkSelection(Mesh *obj)
Definition selection_tools.cpp:1090
void CloseSelection(Mesh *obj)
Definition selection_tools.cpp:254
void SelectBoundaryVertices(Mesh *obj)
Definition selection_tools.cpp:285
void SelectAllVertices(Mesh *obj)
Definition selection_tools.cpp:307
void SelectNonManifoldEdges(Mesh *obj)
Definition selection_tools.cpp:451
void SelectMarkedVertices(Mesh *obj)
Definition selection_tools.cpp:320
void MarkCreaseEdges(Mesh *obj, number minAngle, bool clearMarks)
Definition selection_tools.cpp:1103
void SelectAnisotropicElements(Mesh *obj, number minEdgeRatio)
Definition selection_tools.h:243
void SelectAllVolumes(Mesh *obj)
Definition selection_tools.cpp:958
void SelectInterfaceElements(Mesh *obj, bool regardSelectedNbrsOnly)
Definition selection_tools.h:233
void SelectBoundaryFaces(Mesh *obj)
Definition selection_tools.cpp:636
void SelectSubset(Mesh *obj, int si, bool selVrts, bool selEdges, bool selFaces, bool selVols)
Definition selection_tools.cpp:103
void ClearMarks(Mesh *obj)
Definition selection_tools.cpp:1059
int SelectUnorientableVolumes(Mesh *obj)
Definition selection_tools.cpp:971
void SelectSubsetEdgesByDirection(Mesh *m, int subsetIndex, const vector3 &dir, number minDeviationAngle, number maxDeviationAngle, bool selectFlipped)
Definition selection_tools.cpp:594
void SelectAllFaces(Mesh *obj)
Definition selection_tools.cpp:837
void SelectLinkedElements(Mesh *obj)
Definition selection_tools.h:351
bool BoxBoundProbe(const vector_t &v, const vector_t &boxMin, const vector_t &boxMax)
number ProjectPointToRay(vector_t &vOut, const vector_t &v, const vector_t &from, const vector_t &dir)
MathVector< 3, number > vector3
void VecSubtract(vector_t &vOut, const vector_t &v, typename vector_t::value_type s)
void RestrictSelectionToSubset(Selector &sel, const SubsetHandler &sh, int si)
Definition selection_tools.cpp:260
TVector::value_type VecDistanceSq(const TVector &v1, const TVector &v2, const TMatrix &M)
void MarkForAnisotropicRefinement(Grid &grid, TRef &ref, number minEdgeRatio, TIter elemsBegin, TIter elemsEnd, TAAPos aaPos)
geometry_traits< TElem >::iterator iterator