ug4
ug::GridObserver Class Reference

#include <grid_observer.h>

+ Inheritance diagram for ug::GridObserver:

Public Member Functions

virtual void elements_to_be_cleared (Grid *grid)
 
virtual void grid_to_be_destroyed (Grid *grid)
 
virtual ~GridObserver ()
 
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 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 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 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 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 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 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 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 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 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...
 
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 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...
 

Detailed Description

The grid observer defines an interface that can be specialized by classes that want to be informed about changes in a grid. If a class derives from GridObserver, it can be registered at a grid. Registration is usually performed through a member function of the observer class itself. Most observers can only be registered at one grid at a time.

Please note that methods of different observers are called in the order in which they were registered at the grid. The only exception are the vertex_to_be_erased, edge_to_be_erased, face_to_be_erased and volume_to_be_erased. Those method are called in reverse order of registration.

Constructor & Destructor Documentation

◆ ~GridObserver()

virtual ug::GridObserver::~GridObserver ( )
inlinevirtual

Member Function Documentation

◆ edge_created()

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

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 in ug::ISubsetHandler, ug::ISelector, ug::PeriodicBoundaryManager, ug::CopyAttachmentHandler< TElem, TAttachment >, ug::CopyAttachmentHandler< ug::Vertex, ug::Attachment< ug::NeuriteProjector::SurfaceParams > >, ug::BoolMarker, ug::DistributedGridManager, ug::MultiGrid, ug::AdaptionSurfaceGridFunction< TDomain >, and ug::DelaunayInfo< TAAPos >.

◆ edge_to_be_erased()

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

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 in ug::ISubsetHandler, ug::ISelector, ug::PeriodicBoundaryManager, ug::DistributedGridManager, ug::MultiGrid, and ug::DelaunayInfo< TAAPos >.

◆ edges_to_be_merged()

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

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 in ug::ISubsetHandler, ug::ISelector, and ug::BoolMarker.

◆ elements_to_be_cleared()

virtual void ug::GridObserver::elements_to_be_cleared ( Grid grid)
inlinevirtual

◆ face_created()

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

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 in ug::ISubsetHandler, ug::ISelector, ug::PeriodicBoundaryManager, ug::CopyAttachmentHandler< TElem, TAttachment >, ug::CopyAttachmentHandler< ug::Vertex, ug::Attachment< ug::NeuriteProjector::SurfaceParams > >, ug::BoolMarker, ug::DistributedGridManager, ug::MultiGrid, ug::AdaptionSurfaceGridFunction< TDomain >, and ug::DelaunayInfo< TAAPos >.

◆ face_to_be_erased()

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

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 in ug::ISubsetHandler, ug::ISelector, ug::PeriodicBoundaryManager, ug::DistributedGridManager, ug::MultiGrid, and ug::DelaunayInfo< TAAPos >.

◆ faces_to_be_merged()

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

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 in ug::ISubsetHandler, ug::ISelector, and ug::BoolMarker.

◆ grid_to_be_destroyed()

◆ vertex_created()

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

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 in ug::ISubsetHandler, ug::ISelector, ug::PeriodicBoundaryManager, ug::CopyAttachmentHandler< TElem, TAttachment >, ug::CopyAttachmentHandler< ug::Vertex, ug::Attachment< ug::NeuriteProjector::SurfaceParams > >, ug::BoolMarker, ug::DistributedGridManager, ug::MultiGrid, ug::AdaptionSurfaceGridFunction< TDomain >, and ug::DelaunayInfo< TAAPos >.

◆ vertex_to_be_erased()

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

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 in ug::ISubsetHandler, ug::ISelector, ug::PeriodicBoundaryManager, ug::DistributedGridManager, and ug::MultiGrid.

◆ vertices_to_be_merged()

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

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 in ug::ISubsetHandler, ug::ISelector, and ug::BoolMarker.

◆ volume_created()

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

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 in ug::ISubsetHandler, ug::ISelector, ug::CopyAttachmentHandler< TElem, TAttachment >, ug::CopyAttachmentHandler< ug::Vertex, ug::Attachment< ug::NeuriteProjector::SurfaceParams > >, ug::BoolMarker, ug::MultiGrid, ug::AdaptionSurfaceGridFunction< TDomain >, and ug::DistributedGridManager.

◆ volume_to_be_erased()

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

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 in ug::ISubsetHandler, ug::ISelector, ug::DistributedGridManager, and ug::MultiGrid.

◆ volumes_to_be_merged()

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

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 in ug::ISubsetHandler, ug::ISelector, and ug::BoolMarker.


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