ug4
ug::TElemSelector< TBaseElem > Class Template Reference

specialization of ISelector for a subset of the elements in a grid of class Grid. More...

#include <selector_grid_elem.h>

+ Inheritance diagram for ug::TElemSelector< TBaseElem >:

Public Types

typedef geometry_traits< TBaseElem >::const_iterator const_iterator
 
typedef geometry_traits< TBaseElem >::iterator iterator
 
- Public Types inherited from ug::Selector
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

template<class TElem >
geometry_traits< TElem >::iterator begin ()
 
iterator begin ()
 
template<class TElem >
geometry_traits< TElem >::const_iterator begin () const
 
const_iterator begin () const
 
template<class TElem >
geometry_traits< TElem >::iterator begin (size_t)
 calls begin<TElem>(); More...
 
template<class TElem >
geometry_traits< TElem >::iterator end ()
 
iterator end ()
 
template<class TElem >
geometry_traits< TElem >::const_iterator end () const
 
const_iterator end () const
 
template<class TElem >
geometry_traits< TElem >::iterator end (size_t)
 calls end<TElem>(); More...
 
 TElemSelector ()
 
 TElemSelector (Grid &grid)
 
- Public Member Functions inherited from ug::Selector
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...
 
Gridgrid () 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 ()
 

Additional Inherited Members

- Protected Types inherited from ug::Selector
typedef Grid::traits< Edge >::AttachedElementList AttachedEdgeList
 
typedef Grid::traits< Face >::AttachedElementList AttachedFaceList
 
typedef Grid::traits< Vertex >::AttachedElementList AttachedVertexList
 
typedef Grid::traits< Volume >::AttachedElementList AttachedVolumeList
 
typedef Grid::traits< Edge >::SectionContainer EdgeSectionContainer
 
typedef Grid::traits< Face >::SectionContainer FaceSectionContainer
 
typedef Grid::traits< Vertex >::SectionContainer VertexSectionContainer
 
typedef Grid::traits< Volume >::SectionContainer VolumeSectionContainer
 
- Protected Types inherited from ug::ISelector
typedef Grid::traits< Edge >::AttachedElementList AttachedEdgeList
 
typedef Grid::traits< Face >::AttachedElementList AttachedFaceList
 
typedef Grid::traits< Vertex >::AttachedElementList AttachedVertexList
 
typedef Grid::traits< Volume >::AttachedElementList AttachedVolumeList
 
typedef Attachment< unsigned char > AUChar
 
typedef Grid::traits< Edge >::SectionContainer EdgeSectionContainer
 
typedef Grid::traits< Face >::SectionContainer FaceSectionContainer
 
typedef Grid::traits< Vertex >::SectionContainer VertexSectionContainer
 
typedef Grid::traits< Volume >::SectionContainer VolumeSectionContainer
 
- Protected Member Functions inherited from ug::Selector
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 >::SectionContainersection_container ()
 returns the section container for the given type, subset and level More...
 
template<class TElem >
const Grid::traits< TElem >::SectionContainersection_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 inherited from ug::Selector
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, AUCharm_aaSelEDGE
 
Grid::AttachmentAccessor< Face, AUCharm_aaSelFACE
 
Grid::AttachmentAccessor< Volume, AUCharm_aaSelVOL
 
Grid::AttachmentAccessor< Vertex, AUCharm_aaSelVRT
 
AUChar m_aSelected
 
bool m_bAutoselectionEnabled
 
bool m_bSelectionInheritanceEnabled
 
bool m_bStrictInheritanceEnabled
 
pcl::InterfaceCommunicator< EdgeLayoutm_icomEDGE
 
pcl::InterfaceCommunicator< FaceLayoutm_icomFACE
 
pcl::InterfaceCommunicator< VolumeLayoutm_icomVOL
 
pcl::InterfaceCommunicator< VertexLayoutm_icomVRT
 
Gridm_pGrid
 
uint m_supportedElements
 

Detailed Description

template<class TBaseElem>
class ug::TElemSelector< TBaseElem >

specialization of ISelector for a subset of the elements in 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 class Grid that only works on one element type (either Vertex, Edge, Face or Volume). Normally you will use the typedefs VertexSelector, EdgeSelector, FaceSelector or VolumeSelector instead of this class.

The following methods are the most used:

  • select, deselect, is_selected (see ISelector)
  • begin, end, num, clear.

You may specify the element-type on which begin, end, num and clear operate via a template parameter.

Grid g;
FaceSelector fsel(g);
// ... create elements and select some
// number of selected triangles
int nSelTris = fsel.num<Triangle>();
// iteration over all faces
for(FaceIterator iter = fsel.begin(i);
iter != fsel.end(i); ++iter){
// ...
}
TElemSelector< Face > FaceSelector
Definition: selector_grid_elem.h:144
ElementStorage< Face >::SectionContainer::iterator FaceIterator
Definition: grid_base_object_traits.h:79

Member Typedef Documentation

◆ const_iterator

◆ iterator

template<class TBaseElem >
typedef geometry_traits<TBaseElem>::iterator ug::TElemSelector< TBaseElem >::iterator

Constructor & Destructor Documentation

◆ TElemSelector() [1/2]

◆ TElemSelector() [2/2]

template<class TBaseElem >
ug::TElemSelector< TBaseElem >::TElemSelector ( Grid grid)
inline

Member Function Documentation

◆ begin() [1/5]

template<class TBaseElem >
template<class TElem >
geometry_traits< TElem >::iterator ug::Selector::begin ( class TElem  )
inline

◆ begin() [2/5]

◆ begin() [3/5]

template<class TBaseElem >
template<class TElem >
geometry_traits< TElem >::const_iterator ug::Selector::begin ( class TElem  )
inline

◆ begin() [4/5]

template<class TBaseElem >
const_iterator ug::TElemSelector< TBaseElem >::begin ( ) const
inline

◆ begin() [5/5]

template<class TBaseElem >
template<class TElem >
geometry_traits< TElem >::iterator ug::Selector::begin ( class TElem  )
inline

◆ end() [1/5]

template<class TBaseElem >
template<class TElem >
geometry_traits< TElem >::iterator ug::Selector::end ( class TElem  )
inline

◆ end() [2/5]

◆ end() [3/5]

template<class TBaseElem >
template<class TElem >
geometry_traits< TElem >::const_iterator ug::Selector::end ( class TElem  )
inline

◆ end() [4/5]

template<class TBaseElem >
const_iterator ug::TElemSelector< TBaseElem >::end ( ) const
inline

◆ end() [5/5]

template<class TBaseElem >
template<class TElem >
geometry_traits< TElem >::iterator ug::Selector::end ( class TElem  )
inline

calls end<TElem>();


The documentation for this class was generated from the following file: