ug4
|
specialization of ISelector for a grid of class Grid. More...
#include <selector_grid.h>
Classes | |
struct | traits |
The traits class holds some important types for each element-type. More... | |
Public Types | |
typedef ISelector | BaseClass |
typedef Grid | grid_type |
Public Types inherited from ug::ISelector | |
enum | { DESELECTED = 0 , SELECTED = 1 } |
typedef byte | status_t |
Public Member Functions | |
void | assign_grid (Grid &grid) |
void | assign_grid (Grid *grid) |
template<class TElem > | |
TElem * | back () |
returns the last selected element of the given type. More... | |
template<class TElem > | |
geometry_traits< TElem >::iterator | begin () |
template<class TElem > | |
geometry_traits< TElem >::const_iterator | begin () const |
template<class TElem > | |
geometry_traits< TElem >::iterator | begin (size_t) |
calls begin<TElem>(); More... | |
virtual void | clear () |
template<class TElem > | |
void | clear () |
virtual bool | contains_edges () const |
returns true if the selector contains edges More... | |
virtual bool | contains_faces () const |
returns true if the selector contains faces More... | |
virtual bool | contains_vertices () const |
returns true if the selector contains vertices More... | |
virtual bool | contains_volumes () const |
returns true if the selector contains volumes More... | |
void | disable_element_support (uint shElements) |
disable support for element-types. More... | |
EdgeIterator | edges_begin () |
EdgeIterator | edges_end () |
bool | empty () const |
template<class TElem > | |
bool | empty () const |
bool | empty (size_t) const |
calls empty(); More... | |
template<class TElem > | |
bool | empty (size_t) const |
void | enable_element_support (uint shElements) |
enable support for element-types. Does not invalidate previous settings. More... | |
template<class TElem > | |
geometry_traits< TElem >::iterator | end () |
template<class TElem > | |
geometry_traits< TElem >::const_iterator | end () const |
template<class TElem > | |
geometry_traits< TElem >::iterator | end (size_t) |
calls end<TElem>(); More... | |
FaceIterator | faces_begin () |
FaceIterator | faces_end () |
template<class TElem > | |
TElem * | front () |
returns the first selected element of the given type. More... | |
virtual GridObjectCollection | get_grid_objects () const |
returns a geometric object collection, containing all selected objects More... | |
virtual void | grid_to_be_destroyed (Grid *grid) |
template<class TElem > | |
size_t | num () const |
size_t | num () const |
uint | num (size_t) const |
calls num(); More... | |
template<class TElem > | |
size_t | num (size_t) const |
calls num<TElem>(); More... | |
size_t | num_levels () const |
always returns 1 More... | |
Selector (Grid &grid, uint supportedElements=SE_ALL) | |
Selector (uint supportedElements=SE_ALL) | |
void | set_supported_elements (uint shElements) |
set the type of elements that shall be handled by the Selector. More... | |
VertexIterator | vertices_begin () |
VertexIterator | vertices_end () |
VolumeIterator | volumes_begin () |
VolumeIterator | volumes_end () |
virtual | ~Selector () |
Public Member Functions inherited from ug::ISelector | |
bool | autoselection_enabled () |
virtual void | broadcast_selection_states (bool deselect=false, bool includeGhosts=false) |
broadcasts the current selection More... | |
void | deselect (GridObject *elem) |
template<class TElem > | |
void | deselect (TElem *elem) |
template<class TIterator > | |
void | deselect (TIterator iterBegin, TIterator iterEnd) |
virtual void | edge_created (Grid *grid, Edge *e, GridObject *pParent=NULL, bool replacesParent=false) |
Notified whenever a new element of the given type is created in the given grid. More... | |
virtual void | edge_to_be_erased (Grid *grid, Edge *e, Edge *replacedBy=NULL) |
Notified whenever an element of the given type is erased from the given grid. More... | |
virtual void | edges_to_be_merged (Grid *grid, Edge *target, Edge *elem1, Edge *elem2) |
Notified when two elements of the same type are going to be merged. More... | |
bool | elements_are_supported (uint shElements) const |
returns true if the given element-types are supported. More... | |
virtual void | elements_to_be_cleared (Grid *grid) |
void | enable_autoselection (bool bEnable) |
void | enable_selection_inheritance (bool bEnable) |
void | enable_strict_inheritance (bool bEnable) |
virtual void | face_created (Grid *grid, Face *f, GridObject *pParent=NULL, bool replacesParent=false) |
Notified whenever a new element of the given type is created in the given grid. More... | |
virtual void | face_to_be_erased (Grid *grid, Face *f, Face *replacedBy=NULL) |
Notified whenever an element of the given type is erased from the given grid. More... | |
virtual void | faces_to_be_merged (Grid *grid, Face *target, Face *elem1, Face *elem2) |
Notified when two elements of the same type are going to be merged. More... | |
template<class TElem > | |
byte | get_mark (TElem *elem) const |
returns the selection state of the specified elelent More... | |
Grid * | grid () const |
template<class TElem > | |
bool | is_selected (TElem *elem) const |
returns true if an element is selected More... | |
ISelector (Grid &grid, uint supportedElements=SE_ALL) | |
ISelector (uint supportedElements=SE_ALL) | |
bool | selection_inheritance_enabled () |
bool | strict_inheritance_enabled () |
template<class TElem > | |
void | unmark (TElem *elem) |
deselects an element More... | |
virtual void | vertex_created (Grid *grid, Vertex *vrt, GridObject *pParent=NULL, bool replacesParent=false) |
Notified whenever a new element of the given type is created in the given grid. More... | |
virtual void | vertex_to_be_erased (Grid *grid, Vertex *vrt, Vertex *replacedBy=NULL) |
Notified whenever an element of the given type is erased from the given grid. More... | |
virtual void | vertices_to_be_merged (Grid *grid, Vertex *target, Vertex *elem1, Vertex *elem2) |
Notified when two elements of the same type are going to be merged. More... | |
virtual void | volume_created (Grid *grid, Volume *vol, GridObject *pParent=NULL, bool replacesParent=false) |
Notified whenever a new element of the given type is created in the given grid. More... | |
virtual void | volume_to_be_erased (Grid *grid, Volume *vol, Volume *replacedBy=NULL) |
Notified whenever an element of the given type is erased from the given grid. More... | |
virtual void | volumes_to_be_merged (Grid *grid, Volume *target, Volume *elem1, Volume *elem2) |
Notified when two elements of the same type are going to be merged. More... | |
virtual | ~ISelector () |
void | select (GridObject *elem, byte status) |
selects an element More... | |
void | select (GridObject *elem) |
selects an element More... | |
template<class TElem > | |
void | select (TElem *elem, byte status) |
selects an element More... | |
template<class TElem > | |
void | select (TElem *elem) |
selects an element More... | |
template<class TIterator > | |
void | select (TIterator iterBegin, TIterator iterEnd, byte status=1) |
selects an element More... | |
template<class TElem > | |
void | mark (TElem *elem) |
selects an element More... | |
template<class TElem > | |
void | mark (TElem *elem, byte status) |
selects an element More... | |
byte | get_selection_status (GridObject *elem) const |
returns the selection state of the specified elelent More... | |
byte | get_selection_status (Vertex *vrt) const |
returns the selection state of the specified elelent More... | |
byte | get_selection_status (Edge *edge) const |
returns the selection state of the specified elelent More... | |
byte | get_selection_status (Face *face) const |
returns the selection state of the specified elelent More... | |
byte | get_selection_status (Volume *vol) const |
returns the selection state of the specified elelent More... | |
Public Member Functions inherited from ug::GridObserver | |
virtual | ~GridObserver () |
Protected Member Functions | |
virtual void | add_to_list (Edge *elem) |
virtual void | add_to_list (Face *elem) |
virtual void | add_to_list (Vertex *elem) |
virtual void | add_to_list (Volume *elem) |
void | clear_lists () |
virtual void | erase_from_list (Edge *elem) |
virtual void | erase_from_list (Face *elem) |
virtual void | erase_from_list (Vertex *elem) |
virtual void | erase_from_list (Volume *elem) |
template<class TElem > | |
int | get_section_index () const |
template<class TElem > | |
Grid::traits< TElem >::SectionContainer & | section_container () |
returns the section container for the given type, subset and level More... | |
template<class TElem > | |
const Grid::traits< TElem >::SectionContainer & | section_container () const |
returns the const section container for the given type, subset and level More... | |
VertexSectionContainer::iterator | get_iterator (Vertex *o) |
returns the iterator at which the given element lies in the section container More... | |
EdgeSectionContainer::iterator | get_iterator (Edge *o) |
returns the iterator at which the given element lies in the section container More... | |
FaceSectionContainer::iterator | get_iterator (Face *o) |
returns the iterator at which the given element lies in the section container More... | |
VolumeSectionContainer::iterator | get_iterator (Volume *o) |
returns the iterator at which the given element lies in the section container More... | |
Protected Member Functions inherited from ug::ISelector | |
void | disable_element_support (uint shElements) |
disable support for element-types. More... | |
template<class TElem > | |
void | elems_to_be_merged (Grid *grid, TElem *target, TElem *elem1, TElem *elem2) |
helper for GridObserver callbacks. More... | |
void | enable_element_support (uint shElements) |
enable support for element-types. Does not invalidate previous settings. More... | |
void | mark_deselected (Edge *elem) |
void | mark_deselected (Face *elem) |
void | mark_deselected (Vertex *elem) |
void | mark_deselected (Volume *elem) |
void | mark_selected (Edge *elem, byte status) |
void | mark_selected (Face *elem, byte status) |
void | mark_selected (Vertex *elem, byte status) |
void | mark_selected (Volume *elem, byte status) |
void | set_grid (Grid *grid) |
performs grid registration / deregistration and initialisation of the observer. More... | |
void | set_supported_elements (uint shElements) |
set the type of elements that shall be handled by the SubsetHandler. More... | |
Protected Attributes | |
EdgeSectionContainer | m_edges |
FaceSectionContainer | m_faces |
VertexSectionContainer | m_vertices |
Copy Constructor not yet implemented! More... | |
VolumeSectionContainer | m_volumes |
Protected Attributes inherited from ug::ISelector | |
Grid::AttachmentAccessor< Edge, AUChar > | m_aaSelEDGE |
Grid::AttachmentAccessor< Face, AUChar > | m_aaSelFACE |
Grid::AttachmentAccessor< Volume, AUChar > | m_aaSelVOL |
Grid::AttachmentAccessor< Vertex, AUChar > | m_aaSelVRT |
AUChar | m_aSelected |
bool | m_bAutoselectionEnabled |
bool | m_bSelectionInheritanceEnabled |
bool | m_bStrictInheritanceEnabled |
pcl::InterfaceCommunicator< EdgeLayout > | m_icomEDGE |
pcl::InterfaceCommunicator< FaceLayout > | m_icomFACE |
pcl::InterfaceCommunicator< VolumeLayout > | m_icomVOL |
pcl::InterfaceCommunicator< VertexLayout > | m_icomVRT |
Grid * | m_pGrid |
uint | m_supportedElements |
Private Member Functions | |
Selector (const Selector &sel) | |
specialization of ISelector for a grid of class Grid.
A selector is a useful class, that allows the user to mark elements of a grid as selected or deselected. The selection status is maintained even if new elements are created or old ones deleted. Features like autoselection and selection_inheritance allow users to follow the creation and removal of elements in all kind of algorithms.
Please note that the selector has to be registered at a grid before it may be used. You may register it using the constructor or the method assign_grid.
This is a specialization of ISelector for the Grid class.
The following methods are the most used:
You may specify the element-type on which begin, end, num and clear operate via a template parameter:
|
protected |
|
protected |
|
protected |
|
protected |
typedef ISelector ug::Selector::BaseClass |
|
protected |
|
protected |
typedef Grid ug::Selector::grid_type |
|
protected |
|
protected |
References assign_grid(), and ug::ISelector::grid().
|
virtual |
|
inlineprivate |
|
protectedvirtual |
Implements ug::ISelector.
References ug::Edge::container_section().
|
protectedvirtual |
Implements ug::ISelector.
References ug::Face::container_section().
|
protectedvirtual |
Implements ug::ISelector.
References ug::Vertex::container_section().
|
protectedvirtual |
Implements ug::ISelector.
References ug::Volume::container_section().
void ug::Selector::assign_grid | ( | Grid & | grid | ) |
void ug::Selector::assign_grid | ( | Grid * | grid | ) |
TElem * ug::Selector::back |
returns the last selected element of the given type.
Make sure that elements of the given type exist! Behaviour is undefined, if not.
|
inline |
Referenced by ug::AdjustSelection(), ug::AdjustSubsetsForSimulation(), ug::ArteExpandFracs3D::assignOrigFracInfos(), ug::HangingNodeRefiner_Grid::collect_objects_for_refine(), ug::AssemblingTuner< TAlgebra >::collect_selected_elements(), ug::CopySelected(), ug::CopySelectedElements(), ug::CopySelection(), ug::ArteExpandFracs3D::countAndSelectFracBaseNums(), ug::ArteExpandFracs3D::createNewElements(), ug::CutEdgesWithPlane(), ug::DistributeExpansionMarks3D(), ug::ExpandFractures2d(), ug::ExpandFractures2dArte(), ug::ExpandFractures3d(), ug::ExtrudeCylinder(), ug::ArteExpandFracs3D::loop2EstablishNewVertices(), ug::HangingNodeRefiner_Grid::post_refine(), ug::Refine(), ug::ResolveTriangleIntersections(), ug::SelectionFill(), ug::SelectLinkedFlatAndDegeneratedFaces(), ug::SelectLinkedFlatFaces(), ug::SelectSmoothEdgePath(), and ug::SeparateSubsetsByLowerDimSeparators().
|
inline |
|
inline |
calls begin<TElem>();
|
virtual |
Implements ug::ISelector.
Referenced by ug::AdaptSurfaceGridToCylinder(), ug::AdjustSubsetsForSimulation(), ug::AllGatherGrid(), ug::CutEdgesWithPlane(), ug::Duplicate(), ug::ExtrudeCylinder(), ug::GatherGrid(), ug::GenerateIcosphere(), ug::PerformSwaps(), ug::Refine(), ug::ProjectionHandler::refinement_begins(), ug::ResolveTriangleIntersections(), ug::SelectRegion(), and ug::WriteLGM().
|
inlinevirtual |
Implements ug::ISelector.
References ug::ISelector::m_pGrid, and ug::ISelector::mark_deselected().
|
protected |
Referenced by grid_to_be_destroyed().
|
inlinevirtual |
returns true if the selector contains edges
Implements ug::ISelector.
|
inlinevirtual |
returns true if the selector contains faces
Implements ug::ISelector.
|
inlinevirtual |
returns true if the selector contains vertices
Implements ug::ISelector.
|
inlinevirtual |
returns true if the selector contains volumes
Implements ug::ISelector.
void ug::Selector::disable_element_support | ( | uint | shElements | ) |
disable support for element-types.
pass an or-combination of constants enumerated in SelectorElements.
References ug::ISelector::disable_element_support(), ug::ISelector::elements_are_supported(), ug::SE_EDGE, ug::SE_FACE, ug::SE_VERTEX, and ug::SE_VOLUME.
Referenced by assign_grid(), and set_supported_elements().
|
inline |
|
inline |
|
inline |
References num().
Referenced by empty(), ug::PerformCollapses(), ug::PerformSplits(), ug::PerformSwaps(), ug::ResolveTriangleIntersections(), and ug::SeparateSubsetsByLowerDimSeparators().
|
inline |
|
inline |
void ug::Selector::enable_element_support | ( | uint | shElements | ) |
enable support for element-types. Does not invalidate previous settings.
pass an or-combination of constants enumerated in SelectorElements.
References ug::ISelector::elements_are_supported(), ug::ISelector::enable_element_support(), ug::Grid::get_attachment_pipe(), ug::ISelector::m_pGrid, ug::SE_EDGE, ug::SE_FACE, ug::SE_VERTEX, and ug::SE_VOLUME.
Referenced by assign_grid(), and set_supported_elements().
|
inline |
Referenced by ug::AdjustSelection(), ug::AdjustSubsetsForSimulation(), ug::ArteExpandFracs3D::assignOrigFracInfos(), ug::HangingNodeRefiner_Grid::collect_objects_for_refine(), ug::AssemblingTuner< TAlgebra >::collect_selected_elements(), ug::CopySelected(), ug::CopySelectedElements(), ug::CopySelection(), ug::ArteExpandFracs3D::countAndSelectFracBaseNums(), ug::ArteExpandFracs3D::createNewElements(), ug::CutEdgesWithPlane(), ug::DistributeExpansionMarks3D(), ug::ExpandFractures2d(), ug::ExpandFractures2dArte(), ug::ExpandFractures3d(), ug::ExtrudeCylinder(), ug::ArteExpandFracs3D::loop2EstablishNewVertices(), ug::HangingNodeRefiner_Grid::post_refine(), ug::Refine(), ug::ResolveTriangleIntersections(), ug::SelectionFill(), ug::SelectLinkedFlatAndDegeneratedFaces(), ug::SelectLinkedFlatFaces(), and ug::SelectSmoothEdgePath().
|
inline |
|
inline |
calls end<TElem>();
|
protectedvirtual |
Implements ug::ISelector.
References ug::Edge::container_section(), and get_iterator().
|
protectedvirtual |
Implements ug::ISelector.
References ug::Face::container_section(), and get_iterator().
|
protectedvirtual |
Implements ug::ISelector.
References ug::Vertex::container_section(), and get_iterator().
|
protectedvirtual |
Implements ug::ISelector.
References ug::Volume::container_section(), and get_iterator().
|
inline |
|
inline |
TElem * ug::Selector::front |
returns the first selected element of the given type.
Make sure that elements of the given type exist! Behaviour is undefined, if not.
|
virtual |
returns a geometric object collection, containing all selected objects
Implements ug::ISelector.
References m_edges, m_faces, m_vertices, and m_volumes.
Referenced by ug::AllGatherGrid(), ug::BroadcastGrid(), ug::GatherGrid(), ug::Refine(), and ug::ProjectionHandler::refinement_begins().
|
inlineprotected |
returns the iterator at which the given element lies in the section container
This method may only be called if the element is indeed selected
|
inlineprotected |
returns the iterator at which the given element lies in the section container
This method may only be called if the element is indeed selected
|
inlineprotected |
returns the iterator at which the given element lies in the section container
This method may only be called if the element is indeed selected
Referenced by erase_from_list().
|
inlineprotected |
returns the iterator at which the given element lies in the section container
This method may only be called if the element is indeed selected
|
inlineprotected |
|
virtual |
Reimplemented from ug::ISelector.
References clear_lists(), ug::ISelector::grid(), and ug::ISelector::grid_to_be_destroyed().
|
inline |
Referenced by ug::Duplicate(), empty(), num(), ug::HangingNodeRefiner_Grid::num_marked_elems(), ug::PerformSwaps(), ug::Refine(), and ug::WriteNG().
|
inline |
|
inline |
calls num<TElem>();
|
inline |
always returns 1
Referenced by ug::GetNeighborhood().
|
inlineprotected |
returns the section container for the given type, subset and level
References m_edges, m_faces, m_vertices, and m_volumes.
Referenced by section_container().
|
inlineprotected |
returns the const section container for the given type, subset and level
References m_edges, m_faces, m_vertices, m_volumes, and section_container().
void ug::Selector::set_supported_elements | ( | uint | shElements | ) |
set the type of elements that shall be handled by the Selector.
Pass an or-combination of constants enumerated in SelectorElements.
References disable_element_support(), enable_element_support(), and ug::ISelector::m_supportedElements.
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
Referenced by get_grid_objects(), and section_container().
|
protected |
Referenced by get_grid_objects(), and section_container().
|
protected |
Copy Constructor not yet implemented!
Referenced by get_grid_objects(), and section_container().
|
protected |
Referenced by get_grid_objects(), and section_container().