33 #ifndef __H__LIB_GRID__SELECTION_UTIL__
34 #define __H__LIB_GRID__SELECTION_UTIL__
63 template <
class TAAPosVRT>
65 Selector& sel, TAAPosVRT& aaPos);
71 template <
class TAAPosVRT>
92 template <
class TSelector>
102 template <
class TSelector,
class TIterator>
111 template <
class TSelector>
122 template <
class TElem,
class TIterator>
145 template <
class TSelector,
class TElemIterator>
147 TElemIterator elemsEnd,
165 template <
class TSelector,
class TElemIterator>
167 TElemIterator elemsEnd,
185 template <
class TSelector,
class TElemIterator>
187 TElemIterator elemsEnd,
205 template <
class TSelector,
class TElemIterator>
207 TElemIterator elemsEnd,
219 template <
class TSelector>
227 template <
class TSelector>
242 template <
class TElem,
class TSelector>
247 template <
class TElemIterator>
249 TElemIterator elemsEnd);
253 template <
class TElemIterator>
255 TElemIterator elemsEnd);
259 template <
class TEdgeIterator>
260 void SelectCreaseEdges(ISelector& sel, TEdgeIterator edgesBegin, TEdgeIterator edgesEnd,
262 bool ignoreBoundaryEdges =
true,
277 template <
class TIter>
285 template <
class TIter>
287 const TIter begin,
const TIter end,
288 bool regardSelectedNbrsOnly =
false);
294 template <
class TElem>
307 template <
class TSelector>
331 template <
class TSelector,
class TAAPos>
336 const typename TAAPos::ValueType& dir,
357 template <
class TGeomObj>
381 template <
class TGeomObj,
class TAAPos>
382 bool SelectRegion(Selector& sel,
const typename TAAPos::ValueType& p, TAAPos& aaPos,
406 template <
class TAAPos>
417 template <
class TAAPos>
448 bool stopAtSelVrts =
true,
455 template <
class TAAPos>
469 template <
class TSelector>
481 template <
class TSelector>
493 template <
class TSelector>
505 template <
class TSelector>
515 template <
class TSelector>
525 template <
class TSelector>
540 template <
class TElem>
543 cbIsSelectable = ConsiderAll(),
545 cbIsTraversable = ConsiderAll());
560 bool ignoreOrientation =
false,
561 bool stopAtSelectedEdges =
false,
580 bool ignoreOrientation =
false,
581 bool stopAtSelectedEdges =
false,
595 template <
class TAAPosVRT>
605 template <
class elem_t>
609 std::vector<size_t>& vrtIndsOut,
610 std::vector<size_t>& edgeIndsOut,
611 std::vector<size_t>& faceIndsOut,
612 std::vector<size_t>& volIndsOut);
621 template <
class elem_t>
625 const std::vector<size_t>& vrtInds,
626 const std::vector<size_t>& edgeInds,
627 const std::vector<size_t>& faceInds,
628 const std::vector<size_t>& volInds);
base-implementation of a selector
Definition: selector_interface.h:126
@ SELECTED
Definition: selector_interface.h:132
byte status_t
Definition: selector_interface.h:128
Definition: subset_handler_interface.h:223
static number FaceArea(TDomain &dom, ISubsetHandler &sh, int si, size_t lvl)
Definition: domain_bridge.cpp:262
void DeselectBoundarySelectionVertices(TSelector &sel)
deselects all vertices that are connected to unselected elements.
Definition: selection_util.cpp:885
void SelectCreaseEdges(ISelector &sel, TEdgeIterator edgesBegin, TEdgeIterator edgesEnd, number minAngle, APosition aVrtPos, bool ignoreBoundaryEdges=true, ISelector::status_t state=ISelector::SELECTED)
Selects edges which at which triangles meet in a large angle.
Definition: selection_util_impl.hpp:499
void SelectAssociatedGenealogy(MGSelector &msel, bool selectAssociatedElements)
Selects the complete genealogy of all selected elements.
Definition: selection_util.cpp:422
void SelectLinkedElements(ISelector &sel, typename Grid::traits< TElem >::callback cbIsSelectable=ConsiderAll(), typename Grid::traits< typename TElem::side >::callback cbIsTraversable=ConsiderAll())
Repeatedly traverses sides of selected elements and selects associated elements.
Definition: selection_util_impl.hpp:762
void EraseSelectedObjects(TSelector &sel)
Erases selected objects from the associated grid.
Definition: selection_util.cpp:145
void SelectSubsetEdgesByDirection(Selector &sel, SubsetHandler &sh, int subsetIndex, TAAPos &aaPos, const vector3 &dir, number minDeviationAngle, number maxDeviationAngle, bool selectFlipped)
Selects all subset edges that face a given direction.
Definition: selection_util_impl.hpp:464
void SelectAssociated(ISelector &sel, TIterator begin, TIterator end, ISelector::status_t status=ISelector::SELECTED)
Selects all elements of type TElem, which touch an element between begin and end.
Definition: selection_util_impl.hpp:209
void InvertSelection(TSelector &sel)
Inverts the selection.
Definition: selection_util.cpp:167
void SelectAreaBoundary(ISelector &sel, const TIter begin, const TIter end)
selects sides that are only adjacent to one of the given inner elements
Definition: selection_util_impl.hpp:549
void SelectInnerSelectionVertices(TSelector &sel)
selects all vertices that are only connected to selected elements.
Definition: selection_util.cpp:641
bool SelectRegion(Selector &sel, const typename TAAPos::ValueType &p, TAAPos &aaPos, typename Grid::traits< typename TGeomObj::side >::callback cbRegionBoundary)
Selects the region which contains the given point.
Definition: selection_util_impl.hpp:643
void SelectAssociatedVertices(TSelector &sel, TElemIterator elemsBegin, TElemIterator elemsEnd, ISelector::status_t status=ISelector::SELECTED)
selects all associated vertices of the elements between elemsBegin and elemsEnd
Definition: selection_util_impl.hpp:229
void SelectAssociatedGridObjects(TSelector &sel, ISelector::status_t status)
selects associated geometric objects of selected ones on each level.
Definition: selection_util.cpp:221
void SelectInnerSelectionEdges(TSelector &sel)
selects all edges that are only connected to selected elements.
Definition: selection_util.cpp:748
void SelectElementsByIndex(ISelector &sel, const std::vector< size_t > &inds)
Selects elements with the specified indices.
Definition: selection_util.cpp:1253
void DeselectBoundarySelectionEdges(TSelector &sel)
deselects all edges that are connected to unselected elements.
Definition: selection_util.cpp:948
void DeselectBoundarySelectionFaces(TSelector &sel)
deselects all faces that are connected to unselected elements.
Definition: selection_util.cpp:1003
void AssignSelectionStateToSides(TSelector &sel, bool recursive)
Assigns the selection state of selected elements to associated sides.
Definition: selection_util_impl.hpp:294
void SelectInnerElements(ISelector &sel, TElemIterator elemsBegin, TElemIterator elemsEnd)
selects elements that do not lie on the associated grid's boundary
Definition: selection_util_impl.hpp:341
void SelectInterfaceElements(ISelector &sel, ISubsetHandler &sh, const TIter begin, const TIter end, bool regardSelectedNbrsOnly=false)
Selects elements which are adjacent to higher dimensional elements of different subsets.
Definition: selection_util_impl.hpp:588
void SelectSubset(ISelector &sel, const ISubsetHandler &sh, int si, ISelector::status_t status)
Select all elements specified by a subset index ans selection status.
Definition: selection_util.cpp:1297
void CloseSelection(TSelector &sel)
Selects all associated elements of lower dimensions.
Definition: selection_util.cpp:262
void ExtendSelection(TSelector &sel, size_t extSize, ISelector::status_t status)
extends the selection to neighbours of selected elements.
Definition: selection_util.cpp:294
void SelectLinkedFlatFaces(Selector &sel, number maxDeviationAngle, bool ignoreOrientation, bool stopAtSelectedEdges, APosition &aPos)
Extends the selection of faces to all neighbouring faces that have a similar normal.
Definition: selection_util.cpp:1036
UG_API void ExtendSelectionInDirection(TSelector &sel, size_t extSize, const typename TAAPos::ValueType &dir, number minAngle, number maxAngle, const TAAPos &aaPos, ISelector::status_t status=ISelector::SELECTED)
extends the selection to neighbours of selected elements in the given direction.
Definition: selection_util_impl.hpp:358
void SelectBoundaryElements(ISelector &sel, TElemIterator elemsBegin, TElemIterator elemsEnd)
selects elements that lie on the associated grid's boundary
Definition: selection_util_impl.hpp:326
void SelectAssociatedVolumes(TSelector &sel, TElemIterator elemsBegin, TElemIterator elemsEnd, ISelector::status_t status=ISelector::SELECTED)
selects all associated faces of the elements between elemsBegin and elemsEnd
Definition: selection_util_impl.hpp:286
void SelectAssociatedFaces(TSelector &sel, TElemIterator elemsBegin, TElemIterator elemsEnd, ISelector::status_t status=ISelector::SELECTED)
selects all associated faces of the elements between elemsBegin and elemsEnd
Definition: selection_util_impl.hpp:265
void SelectSubsetElements(ISelector &sel, ISubsetHandler &sh, int subsetIndex, ISelector::status_t status=ISelector::SELECTED)
selects all elements of the given type in the given subset
Definition: selection_util_impl.hpp:629
void SelectInnerSelectionFaces(TSelector &sel)
selects all faces that are only connected to selected elements.
Definition: selection_util.cpp:835
void SelectLinkedFlatAndDegeneratedFaces(Selector &sel, number maxDeviationAngle, bool ignoreOrientation, bool stopAtSelectedEdges, number degThreshold, APosition &aPos)
Extends the selection of faces to all neighbouring faces that have a similar normal.
Definition: selection_util.cpp:1111
void TranslateSelection(Selector &sel, const typename TAAPosVRT::ValueType &offset, TAAPosVRT &aaPos)
moves all vertices touching the selection by the specified offset.
Definition: selection_util_impl.hpp:128
void SelectAssociatedEdges(TSelector &sel, TElemIterator elemsBegin, TElemIterator elemsEnd, ISelector::status_t status=ISelector::SELECTED)
selects all associated edges of the elements between elemsBegin and elemsEnd
Definition: selection_util_impl.hpp:244
size_t CollectVerticesTouchingSelection(std::vector< Vertex * > &vrtsOut, ISelector &sel)
Collects all vertices which are selected or which touch a selected element.
Definition: selection_util.cpp:77
void SelectSmoothEdgePath(Selector &sel, number thresholdDegree, number normalWeight, bool stopAtSelVrts, APosition &aPos)
selects for each selected edge all edges that can be reached by a smooth path.
Definition: selection_util.cpp:457
void SelectShortPolychains(ISelector &sel, number maxLength, bool closedChainsOnly, TAAPos aaPos)
Selects regular polygonal chains which are shorter than a given threshold.
Definition: selection_util_impl.hpp:673
void SelectEdgesByDirection(Selector &sel, TAAPos &aaPos, const vector3 &dir, number minDeviationAngle, number maxDeviationAngle, bool selectFlipped)
Selects all edges that face a given direction.
Definition: selection_util_impl.hpp:431
void SelectionFill(Selector &sel, typename Grid::traits< typename TGeomObj::side >::callback cbRegionBoundary)
Extends the selection around selected objects until selected sides are reached.
Definition: selection_util.cpp:363
#define UG_API
Definition: ug_config.h:65
double number
Definition: types.h:124
void CalculateCenter(vector_t ¢erOut, const vector_t *pointSet, size_t numPoints)
calculates the center of a point-set
Definition: math_util_impl.hpp:98
MathVector< 3, number > vector3
a 3d vector
Definition: ugmath_types.h:72
const number SMALL
Definition: math_constants.h:41
GridSubsetHandler SubsetHandler
Definition: subset_handler_grid.h:376
APosition3 APosition
Definition: common_attachments.h:76
APosition aPosition("position", true)
The standard 3d position type.
Definition: common_attachments.h:84
void GetSelectedElementIndices(const ISelector &sel, std::vector< size_t > &indsOut)
Definition: selection_util.cpp:1213
boost::function< bool(base_object *)> callback
callback type for the elements base type.
Definition: grid.h:150