ug4
ug::ISelector Class Referenceabstract

base-implementation of a selector More...

#include <selector_interface.h>

+ Inheritance diagram for ug::ISelector:

Public Types

enum  { DESELECTED = 0 , SELECTED = 1 }
 
typedef byte status_t
 

Public Member Functions

bool autoselection_enabled ()
 
virtual void broadcast_selection_states (bool deselect=false, bool includeGhosts=false)
 broadcasts the current selection More...
 
virtual void clear ()=0
 
virtual bool contains_edges () const =0
 returns true if the selector contains edges More...
 
virtual bool contains_faces () const =0
 returns true if the selector contains faces More...
 
virtual bool contains_vertices () const =0
 returns true if the selector contains vertices More...
 
virtual bool contains_volumes () const =0
 returns true if the selector contains volumes 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...
 
virtual GridObjectCollection get_grid_objects () const =0
 returns a geometric object collection, containing all selected objects More...
 
template<class TElem >
byte get_mark (TElem *elem) const
 returns the selection state of the specified elelent More...
 
Gridgrid () const
 
virtual void grid_to_be_destroyed (Grid *grid)
 
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 Types

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

virtual void add_to_list (Edge *elem)=0
 
virtual void add_to_list (Face *elem)=0
 
virtual void add_to_list (Vertex *elem)=0
 
virtual void add_to_list (Volume *elem)=0
 
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...
 
virtual void erase_from_list (Edge *elem)=0
 
virtual void erase_from_list (Face *elem)=0
 
virtual void erase_from_list (Vertex *elem)=0
 
virtual void erase_from_list (Volume *elem)=0
 
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

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
 

Private Member Functions

template<class TIntfcCom >
void broadcast_selection_states (bool deselect, bool includeGhosts, TIntfcCom &icom)
 Copy Constructor not yet implemented! More...
 
 ISelector (const ISelector &sel)
 

Detailed Description

base-implementation of a selector

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.

Derived classes like Selector and MGSelector or VertexSelector, EdgeSelector, FaceSelector and VolumeSelector keep selected elements in linked lists and allow the user to iterate over them. If a selected element is removed from the underlying grid, it is automatically removed from the element-lists of all associated selectors.

Please note that the selector has to be registered at a grid before it may be used. Derived classes may use the protected method set_grid to do so, or pass a grid directly to the constructor.

This is a base implementation that can not be instatiated. It features most cruical methods like is_selected, select, deselect etc.

autoselection and selection_inheritance can be enabled here. If autoselection is enabled, then all elements that are created while the selector is registered at a grid will automatically be selected.

If selection_inheritance is enabled, then all elements that are created while the selector is registered at a grid, and whose parents (from the same grid) are selected will be automatically selected, too. selection_inheritance is ignored if autoselection is enabled.

Support for different element-types can be enabled / disabled by derived classes using set_supported_elements, enable_element_support or disable_element_support.

Derived classes have to store the selected elements in linked lists of type ISelector::SectionContainer and should feature begin and end itertors to the sections of those lists.

ISelector communicates with derived classes via the methods add_to_list and erase_from_list.

Especially for the implementation of erase_from_list the protected member function get_iterator may be useful, which returns the iterator that is associated with the selected element.

If a derived class wants to change the selection-status of an element behind the scenes (avoids select, deselect), then it may use the protected methods mark_selected, mark_deselected.

Member Typedef Documentation

◆ AttachedEdgeList

◆ AttachedFaceList

◆ AttachedVertexList

◆ AttachedVolumeList

◆ AUChar

typedef Attachment<unsigned char> ug::ISelector::AUChar
protected

◆ EdgeSectionContainer

◆ FaceSectionContainer

◆ status_t

◆ VertexSectionContainer

◆ VolumeSectionContainer

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
DESELECTED 
SELECTED 

Constructor & Destructor Documentation

◆ ISelector() [1/3]

ug::ISelector::ISelector ( uint  supportedElements = SE_ALL)

◆ ISelector() [2/3]

◆ ~ISelector()

ug::ISelector::~ISelector ( )
virtual

◆ ISelector() [3/3]

ug::ISelector::ISelector ( const ISelector sel)
inlineprivate

Member Function Documentation

◆ add_to_list() [1/4]

virtual void ug::ISelector::add_to_list ( Edge elem)
protectedpure virtual

Implemented in ug::MGSelector, and ug::Selector.

◆ add_to_list() [2/4]

virtual void ug::ISelector::add_to_list ( Face elem)
protectedpure virtual

Implemented in ug::MGSelector, and ug::Selector.

◆ add_to_list() [3/4]

virtual void ug::ISelector::add_to_list ( Vertex elem)
protectedpure virtual

Implemented in ug::MGSelector, and ug::Selector.

Referenced by select().

◆ add_to_list() [4/4]

virtual void ug::ISelector::add_to_list ( Volume elem)
protectedpure virtual

Implemented in ug::MGSelector, and ug::Selector.

◆ autoselection_enabled()

bool ug::ISelector::autoselection_enabled ( )
inline

◆ broadcast_selection_states() [1/2]

template<class TIntfcCom >
void ug::ISelector::broadcast_selection_states ( bool  deselect,
bool  includeGhosts,
TIntfcCom &  icom 
)
private

◆ broadcast_selection_states() [2/2]

void ug::ISelector::broadcast_selection_states ( bool  deselect = false,
bool  includeGhosts = false 
)
virtual

broadcasts the current selection

This method is only interesting for parallel algorithms. By setting 'deselect' to true, all copies of an element will be deselected if one or more copies already were deselected.

If 'deselect' is false (this is the default), the selection-states of all copies of an element will be united and applied to all copies of that element.

Set 'includeGhosts' to true, to also broadcast the selection-state to ghost-copies. Default is false.

References deselect(), m_icomEDGE, m_icomFACE, m_icomVOL, m_icomVRT, and m_pGrid.

◆ clear()

virtual void ug::ISelector::clear ( )
pure virtual

◆ contains_edges()

virtual bool ug::ISelector::contains_edges ( ) const
pure virtual

returns true if the selector contains edges

Implemented in ug::MGSelector, and ug::Selector.

Referenced by ug::GridWriterUGX::add_selector().

◆ contains_faces()

virtual bool ug::ISelector::contains_faces ( ) const
pure virtual

returns true if the selector contains faces

Implemented in ug::MGSelector, and ug::Selector.

Referenced by ug::GridWriterUGX::add_selector().

◆ contains_vertices()

virtual bool ug::ISelector::contains_vertices ( ) const
pure virtual

returns true if the selector contains vertices

Implemented in ug::MGSelector, and ug::Selector.

Referenced by ug::GridWriterUGX::add_selector().

◆ contains_volumes()

virtual bool ug::ISelector::contains_volumes ( ) const
pure virtual

returns true if the selector contains volumes

Implemented in ug::MGSelector, and ug::Selector.

Referenced by ug::GridWriterUGX::add_selector().

◆ deselect() [1/3]

◆ deselect() [2/3]

template<class TElem >
void ug::ISelector::deselect ( TElem *  elem)
inline

◆ deselect() [3/3]

template<class TIterator >
void ug::ISelector::deselect ( TIterator  iterBegin,
TIterator  iterEnd 
)
inline

References deselect().

◆ disable_element_support()

void ug::ISelector::disable_element_support ( uint  shElements)
protected

◆ edge_created()

void ug::ISelector::edge_created ( Grid grid,
Edge e,
GridObject pParent = NULL,
bool  replacesParent = false 
)
virtual

Notified whenever a new element of the given type is created in the given grid.

Creation callbacks are called in the order in which the GridObservers were registered at the given grid.

If replacesParent is true, then pParent is of the same base type as the created object (e.g. in case of edge_created, the parent is an Edge*). This case usually appears, when a contraining object is replaced by a regular grid object if the same base type during refinement. The method is called with replacesParent == true by Grid::create_and_replace methods.

Please note: If replacesParent == true, then a call to OBJECT_to_be_erased(grid, pParent, obj) will follow (OBJECT and obj are pseudonyms for the concrete type).

Reimplemented from ug::GridObserver.

References autoselection_enabled(), ug::GridObject::base_object_id(), ug::EDGE, elements_are_supported(), get_selection_status(), grid(), m_bStrictInheritanceEnabled, m_pGrid, mark_deselected(), ug::SE_EDGE, select(), selection_inheritance_enabled(), and UG_ASSERT.

◆ edge_to_be_erased()

void ug::ISelector::edge_to_be_erased ( Grid grid,
Edge e,
Edge replacedBy = NULL 
)
virtual

Notified whenever an element of the given type is erased from the given grid.

Erase callbacks are called in reverse order in which the GridObservers were registered at the given grid.

if replacedBy != NULL the erased object is only replaced by another grid object of the same base type. This usually happens when constraining objects are replaced by regular objects in refinements. (E.g. a constraining edge by become a regular Edge; note that both objects are of type Edge*).

Reimplemented from ug::GridObserver.

References deselect(), elements_are_supported(), grid(), m_pGrid, and ug::SE_EDGE.

◆ edges_to_be_merged()

void ug::ISelector::edges_to_be_merged ( Grid grid,
Edge target,
Edge elem1,
Edge elem2 
)
virtual

Notified when two elements of the same type are going to be merged.

Note that this method is invoked by Grid::objects_will_be_merged, which is called from outside the grid class. Implementors of algorithms in which objects are merged are thus responsible to call Grid::objects_will_be_merged.

This callback is called in addition to ..._created and ..._to_be_erased callbacks and should thus only be used if small adjustments have to be made during a merge.

Note that target may be identical to elem1 or elem2.

Reimplemented from ug::GridObserver.

References elems_to_be_merged(), grid(), and boost::target().

◆ elements_are_supported()

◆ elements_to_be_cleared()

void ug::ISelector::elements_to_be_cleared ( Grid grid)
virtual

Reimplemented from ug::GridObserver.

References clear().

◆ elems_to_be_merged()

template<class TElem >
void ug::ISelector::elems_to_be_merged ( Grid grid,
TElem *  target,
TElem *  elem1,
TElem *  elem2 
)
protected

◆ enable_autoselection()

◆ enable_element_support()

◆ enable_selection_inheritance()

◆ enable_strict_inheritance()

void ug::ISelector::enable_strict_inheritance ( bool  bEnable)

restricts subset inheritance so that new elements derive their selection status only from parents with the same base-type. Disabled by default. NOTE: strict inheritance only has an effect if selection inheritance is enabled.

References m_bStrictInheritanceEnabled.

Referenced by ug::ExpandFractures3d(), ug::AdaptiveRegularRefiner_MultiGrid::set_grid(), and ug::ArteExpandFracs3D::setSelector().

◆ erase_from_list() [1/4]

virtual void ug::ISelector::erase_from_list ( Edge elem)
protectedpure virtual

Implemented in ug::MGSelector, and ug::Selector.

◆ erase_from_list() [2/4]

virtual void ug::ISelector::erase_from_list ( Face elem)
protectedpure virtual

Implemented in ug::MGSelector, and ug::Selector.

◆ erase_from_list() [3/4]

virtual void ug::ISelector::erase_from_list ( Vertex elem)
protectedpure virtual

Implemented in ug::MGSelector, and ug::Selector.

Referenced by deselect().

◆ erase_from_list() [4/4]

virtual void ug::ISelector::erase_from_list ( Volume elem)
protectedpure virtual

Implemented in ug::MGSelector, and ug::Selector.

◆ face_created()

void ug::ISelector::face_created ( Grid grid,
Face f,
GridObject pParent = NULL,
bool  replacesParent = false 
)
virtual

Notified whenever a new element of the given type is created in the given grid.

Creation callbacks are called in the order in which the GridObservers were registered at the given grid.

If replacesParent is true, then pParent is of the same base type as the created object (e.g. in case of edge_created, the parent is an Edge*). This case usually appears, when a contraining object is replaced by a regular grid object if the same base type during refinement. The method is called with replacesParent == true by Grid::create_and_replace methods.

Please note: If replacesParent == true, then a call to OBJECT_to_be_erased(grid, pParent, obj) will follow (OBJECT and obj are pseudonyms for the concrete type).

Reimplemented from ug::GridObserver.

References autoselection_enabled(), ug::GridObject::base_object_id(), elements_are_supported(), ug::FACE, get_selection_status(), grid(), m_bStrictInheritanceEnabled, m_pGrid, mark_deselected(), ug::SE_FACE, select(), selection_inheritance_enabled(), and UG_ASSERT.

◆ face_to_be_erased()

void ug::ISelector::face_to_be_erased ( Grid grid,
Face f,
Face replacedBy = NULL 
)
virtual

Notified whenever an element of the given type is erased from the given grid.

Erase callbacks are called in reverse order in which the GridObservers were registered at the given grid.

if replacedBy != NULL the erased object is only replaced by another grid object of the same base type. This usually happens when constraining objects are replaced by regular objects in refinements. (E.g. a constraining edge by become a regular Edge; note that both objects are of type Edge*).

Reimplemented from ug::GridObserver.

References deselect(), elements_are_supported(), grid(), m_pGrid, and ug::SE_FACE.

◆ faces_to_be_merged()

void ug::ISelector::faces_to_be_merged ( Grid grid,
Face target,
Face elem1,
Face elem2 
)
virtual

Notified when two elements of the same type are going to be merged.

Note that this method is invoked by Grid::objects_will_be_merged, which is called from outside the grid class. Implementors of algorithms in which objects are merged are thus responsible to call Grid::objects_will_be_merged.

This callback is called in addition to ..._created and ..._to_be_erased callbacks and should thus only be used if small adjustments have to be made during a merge.

Note that target may be identical to elem1 or elem2.

Reimplemented from ug::GridObserver.

References elems_to_be_merged(), grid(), and boost::target().

◆ get_grid_objects()

◆ get_mark()

template<class TElem >
byte ug::ISelector::get_mark ( TElem *  elem) const
inline

returns the selection state of the specified elelent

In this context, 'get_mark' is simply a synonym for 'get_selection_status' and simply forwards to the corresponding method.

◆ get_selection_status() [1/5]

byte ug::ISelector::get_selection_status ( Edge edge) const
inline

returns the selection state of the specified elelent

References ug::SE_EDGE.

◆ get_selection_status() [2/5]

byte ug::ISelector::get_selection_status ( Face face) const
inline

returns the selection state of the specified elelent

References ug::SE_FACE.

◆ get_selection_status() [3/5]

◆ get_selection_status() [4/5]

byte ug::ISelector::get_selection_status ( Vertex vrt) const
inline

returns the selection state of the specified elelent

References ug::SE_VERTEX.

◆ get_selection_status() [5/5]

byte ug::ISelector::get_selection_status ( Volume vol) const
inline

returns the selection state of the specified elelent

References ug::SE_VOLUME.

◆ grid()

◆ grid_to_be_destroyed()

void ug::ISelector::grid_to_be_destroyed ( Grid grid)
virtual

◆ is_selected()

◆ mark() [1/2]

template<class TElem >
void ug::ISelector::mark ( TElem *  elem)
inline

selects an element

In this context 'mark' is simply a synonym for 'select' and simply forwards to the corresponding 'select' method.

◆ mark() [2/2]

template<class TElem >
void ug::ISelector::mark ( TElem *  elem,
byte  status 
)
inline

selects an element

In this context 'mark' is simply a synonym for 'select' and simply forwards to the corresponding 'select' method.

◆ mark_deselected() [1/4]

void ug::ISelector::mark_deselected ( Edge elem)
inlineprotected

References ug::SE_EDGE.

◆ mark_deselected() [2/4]

void ug::ISelector::mark_deselected ( Face elem)
inlineprotected

References ug::SE_FACE.

◆ mark_deselected() [3/4]

void ug::ISelector::mark_deselected ( Vertex elem)
inlineprotected

◆ mark_deselected() [4/4]

void ug::ISelector::mark_deselected ( Volume elem)
inlineprotected

References ug::SE_VOLUME.

◆ mark_selected() [1/4]

void ug::ISelector::mark_selected ( Edge elem,
byte  status 
)
inlineprotected

References ug::SE_EDGE.

◆ mark_selected() [2/4]

void ug::ISelector::mark_selected ( Face elem,
byte  status 
)
inlineprotected

References ug::SE_FACE.

◆ mark_selected() [3/4]

void ug::ISelector::mark_selected ( Vertex elem,
byte  status 
)
inlineprotected

References ug::SE_VERTEX.

Referenced by select().

◆ mark_selected() [4/4]

void ug::ISelector::mark_selected ( Volume elem,
byte  status 
)
inlineprotected

References ug::SE_VOLUME.

◆ select() [1/5]

void ug::ISelector::select ( GridObject elem)
inline

selects an element

You may optionally pass a status-flag. Note that 0 is reserved for non-selected elements. status thus has to be bigger then 0.

If the element is already selected, then select only alters the status- flag of the element. It however does not change the elements position in the list of selected elements.

◆ select() [2/5]

void ug::ISelector::select ( GridObject elem,
byte  status 
)
inline

selects an element

You may optionally pass a status-flag. Note that 0 is reserved for non-selected elements. status thus has to be bigger then 0.

If the element is already selected, then select only alters the status- flag of the element. It however does not change the elements position in the list of selected elements.

References ug::GridObject::base_object_id(), ug::EDGE, ug::FACE, LOG, ug::VERTEX, and ug::VOLUME.

Referenced by ug::AdaptSurfaceGridToCylinder(), ug::AdjustEdgeLength(), ug::AdjustSelection(), ug::AssignVerticalMasterAndSlaveStates(), ug::HangingNodeRefiner_MultiGrid::collect_objects_for_coarsen(), ug::CollectAllVerticesForNG(), ug::CollectInnerVertices(), ug::CollectLines(), ug::CollectSurfaceVertices(), ug::CopySelectionStatus(), ug::ArteExpandFracs3D::countAndSelectFracBaseNums(), ug::DistributeExpansionMarks3D(), edge_created(), elems_to_be_merged(), ug::ExpandFractures2d(), ug::ExpandFractures2dArte(), ug::ComPol_BroadcastCoarsenMarks< TLayout >::extract(), ug::ComPol_Selection< TLayout >::extract(), ug::ComPol_EnableSelectionStateBits< TLayout >::extract(), face_created(), ug::OverlyingSubsetFinder< TDomain >::OverlyingSubsetFinder(), ug::GridReaderUGX::read_selector_elements(), ug::ReadSelectionStatesFromStream(), ug::Refine(), ug::ProjectionHandler::refinement_begins(), ug::ResolveTriangleIntersections(), select(), ug::AdaptionSurfaceGridFunction< TDomain >::select_parents(), ug::SelectAreaBoundary(), ug::SelectAssociated(), ug::SelectAssociatedConstrainedElements(), ug::SelectAssociatedSides(), ug::SelectBoundaryElements(), ug::SelectChildrenOfSelectedShadowRimEdges(), ug::SelectChildrenOfSelectedShadowRimFaces(), ug::SelectChildrenOfSelectedShadowVertices(), ug::SelectCreaseEdges(), ug::SelectDomainElements(), ug::SelectEdgesByDirection(), ug::SelectElementsByIndex(), ug::SelectInnerElements(), ug::SelectInterfaceElements(), ug::SelectionFill(), ug::SelectKinkVertices(), ug::SelectLinkedElements(), ug::SelectLinkedFlatAndDegeneratedFaces(), ug::SelectLinkedFlatFaces(), ug::SelectParents(), ug::SelectRegion(), ug::SelectSelectedRootElementsAsVSlaves(), ug::SelectShortPolychains(), ug::SelectSmoothEdgePath(), ug::SelectSubset(), ug::SelectSubsetEdgesByDirection(), ug::SelectSubsetElements(), ug::SelectUnselectedRootElementsAsVMasters(), ug::SeparateSubsetsByLowerDimSeparators(), vertex_created(), volume_created(), ug::vtk_export_ho(), ug::WriteLGM(), and ug::ZRayTracer< TDomain >::ZRayTracer().

◆ select() [3/5]

template<class TElem >
void ug::ISelector::select ( TElem *  elem)
inline

selects an element

You may optionally pass a status-flag. Note that 0 is reserved for non-selected elements. status thus has to be bigger then 0.

If the element is already selected, then select only alters the status- flag of the element. It however does not change the elements position in the list of selected elements.

◆ select() [4/5]

template<class TElem >
void ug::ISelector::select ( TElem *  elem,
byte  status 
)
inline

selects an element

You may optionally pass a status-flag. Note that 0 is reserved for non-selected elements. status thus has to be bigger then 0.

If the element is already selected, then select only alters the status- flag of the element. It however does not change the elements position in the list of selected elements.

References add_to_list(), deselect(), is_selected(), and mark_selected().

◆ select() [5/5]

template<class TIterator >
void ug::ISelector::select ( TIterator  iterBegin,
TIterator  iterEnd,
byte  status = 1 
)
inline

selects an element

You may optionally pass a status-flag. Note that 0 is reserved for non-selected elements. status thus has to be bigger then 0.

If the element is already selected, then select only alters the status- flag of the element. It however does not change the elements position in the list of selected elements.

References select().

◆ selection_inheritance_enabled()

bool ug::ISelector::selection_inheritance_enabled ( )
inline

◆ set_grid()

void ug::ISelector::set_grid ( Grid grid)
protected

performs grid registration / deregistration and initialisation of the observer.

If you call this method with NULL, deregistration and cleanup is performed.

Please note: sine set_grid calls virtual methods it shouldn't be invoked from any constructors / destructors.

References clear(), disable_element_support(), enable_element_support(), grid(), m_pGrid, m_supportedElements, ug::OT_EDGE_OBSERVER, ug::OT_FACE_OBSERVER, ug::OT_GRID_OBSERVER, ug::OT_VERTEX_OBSERVER, ug::OT_VOLUME_OBSERVER, ug::Grid::register_observer(), ug::SE_NONE, and ug::Grid::unregister_observer().

Referenced by ug::Selector::assign_grid(), ug::MGSelector::assign_grid(), ug::MGSelector::cleanup(), and grid_to_be_destroyed().

◆ set_supported_elements()

void ug::ISelector::set_supported_elements ( uint  shElements)
protected

set the type of elements that shall be handled by the SubsetHandler.

Pass an or-combination of constants enumerated in SubsetHandlerElements.

See also
SubsetHandler::enable_element_support

References disable_element_support(), enable_element_support(), and m_supportedElements.

◆ strict_inheritance_enabled()

bool ug::ISelector::strict_inheritance_enabled ( )
inline

◆ unmark()

template<class TElem >
void ug::ISelector::unmark ( TElem *  elem)
inline

deselects an element

In this context 'unmark' is simply a synonym for 'deselect'.

◆ vertex_created()

void ug::ISelector::vertex_created ( Grid grid,
Vertex vrt,
GridObject pParent = NULL,
bool  replacesParent = false 
)
virtual

Notified whenever a new element of the given type is created in the given grid.

Creation callbacks are called in the order in which the GridObservers were registered at the given grid.

If replacesParent is true, then pParent is of the same base type as the created object (e.g. in case of edge_created, the parent is an Edge*). This case usually appears, when a contraining object is replaced by a regular grid object if the same base type during refinement. The method is called with replacesParent == true by Grid::create_and_replace methods.

Please note: If replacesParent == true, then a call to OBJECT_to_be_erased(grid, pParent, obj) will follow (OBJECT and obj are pseudonyms for the concrete type).

Reimplemented from ug::GridObserver.

References autoselection_enabled(), ug::GridObject::base_object_id(), elements_are_supported(), get_selection_status(), grid(), m_bStrictInheritanceEnabled, m_pGrid, mark_deselected(), ug::SE_VERTEX, select(), selection_inheritance_enabled(), UG_ASSERT, and ug::VERTEX.

◆ vertex_to_be_erased()

void ug::ISelector::vertex_to_be_erased ( Grid grid,
Vertex vrt,
Vertex replacedBy = NULL 
)
virtual

Notified whenever an element of the given type is erased from the given grid.

Erase callbacks are called in reverse order in which the GridObservers were registered at the given grid.

if replacedBy != NULL the erased object is only replaced by another grid object of the same base type. This usually happens when constraining objects are replaced by regular objects in refinements. (E.g. a constraining edge by become a regular Edge; note that both objects are of type Edge*).

Reimplemented from ug::GridObserver.

References deselect(), elements_are_supported(), grid(), m_pGrid, and ug::SE_VERTEX.

◆ vertices_to_be_merged()

void ug::ISelector::vertices_to_be_merged ( Grid grid,
Vertex target,
Vertex elem1,
Vertex elem2 
)
virtual

Notified when two elements of the same type are going to be merged.

Note that this method is invoked by Grid::objects_will_be_merged, which is called from outside the grid class. Implementors of algorithms in which objects are merged are thus responsible to call Grid::objects_will_be_merged.

This callback is called in addition to ..._created and ..._to_be_erased callbacks and should thus only be used if small adjustments have to be made during a merge.

Note that target may be identical to elem1 or elem2.

Reimplemented from ug::GridObserver.

References elems_to_be_merged(), grid(), and boost::target().

◆ volume_created()

void ug::ISelector::volume_created ( Grid grid,
Volume vol,
GridObject pParent = NULL,
bool  replacesParent = false 
)
virtual

Notified whenever a new element of the given type is created in the given grid.

Creation callbacks are called in the order in which the GridObservers were registered at the given grid.

If replacesParent is true, then pParent is of the same base type as the created object (e.g. in case of edge_created, the parent is an Edge*). This case usually appears, when a contraining object is replaced by a regular grid object if the same base type during refinement. The method is called with replacesParent == true by Grid::create_and_replace methods.

Please note: If replacesParent == true, then a call to OBJECT_to_be_erased(grid, pParent, obj) will follow (OBJECT and obj are pseudonyms for the concrete type).

Reimplemented from ug::GridObserver.

References autoselection_enabled(), ug::GridObject::base_object_id(), elements_are_supported(), get_selection_status(), grid(), m_bStrictInheritanceEnabled, m_pGrid, mark_deselected(), ug::SE_VOLUME, select(), selection_inheritance_enabled(), UG_ASSERT, and ug::VOLUME.

◆ volume_to_be_erased()

void ug::ISelector::volume_to_be_erased ( Grid grid,
Volume vol,
Volume replacedBy = NULL 
)
virtual

Notified whenever an element of the given type is erased from the given grid.

Erase callbacks are called in reverse order in which the GridObservers were registered at the given grid.

if replacedBy != NULL the erased object is only replaced by another grid object of the same base type. This usually happens when constraining objects are replaced by regular objects in refinements. (E.g. a constraining edge by become a regular Edge; note that both objects are of type Edge*).

Reimplemented from ug::GridObserver.

References deselect(), elements_are_supported(), grid(), m_pGrid, and ug::SE_VOLUME.

◆ volumes_to_be_merged()

void ug::ISelector::volumes_to_be_merged ( Grid grid,
Volume target,
Volume elem1,
Volume elem2 
)
virtual

Notified when two elements of the same type are going to be merged.

Note that this method is invoked by Grid::objects_will_be_merged, which is called from outside the grid class. Implementors of algorithms in which objects are merged are thus responsible to call Grid::objects_will_be_merged.

This callback is called in addition to ..._created and ..._to_be_erased callbacks and should thus only be used if small adjustments have to be made during a merge.

Note that target may be identical to elem1 or elem2.

Reimplemented from ug::GridObserver.

References elems_to_be_merged(), grid(), and boost::target().

Member Data Documentation

◆ m_aaSelEDGE

Grid::AttachmentAccessor<Edge, AUChar> ug::ISelector::m_aaSelEDGE
protected

Referenced by enable_element_support().

◆ m_aaSelFACE

Grid::AttachmentAccessor<Face, AUChar> ug::ISelector::m_aaSelFACE
protected

Referenced by enable_element_support().

◆ m_aaSelVOL

Grid::AttachmentAccessor<Volume, AUChar> ug::ISelector::m_aaSelVOL
protected

Referenced by enable_element_support().

◆ m_aaSelVRT

Grid::AttachmentAccessor<Vertex, AUChar> ug::ISelector::m_aaSelVRT
protected

Referenced by enable_element_support().

◆ m_aSelected

AUChar ug::ISelector::m_aSelected
protected

◆ m_bAutoselectionEnabled

bool ug::ISelector::m_bAutoselectionEnabled
protected

Referenced by enable_autoselection(), and ISelector().

◆ m_bSelectionInheritanceEnabled

bool ug::ISelector::m_bSelectionInheritanceEnabled
protected

◆ m_bStrictInheritanceEnabled

bool ug::ISelector::m_bStrictInheritanceEnabled
protected

◆ m_icomEDGE

pcl::InterfaceCommunicator<EdgeLayout> ug::ISelector::m_icomEDGE
protected

◆ m_icomFACE

pcl::InterfaceCommunicator<FaceLayout> ug::ISelector::m_icomFACE
protected

◆ m_icomVOL

pcl::InterfaceCommunicator<VolumeLayout> ug::ISelector::m_icomVOL
protected

◆ m_icomVRT

pcl::InterfaceCommunicator<VertexLayout> ug::ISelector::m_icomVRT
protected

◆ m_pGrid

◆ m_supportedElements


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