33 #ifndef __H__LIBGRID__SUBSET_HANDLER_INTERFACE__
34 #define __H__LIBGRID__SUBSET_HANDLER_INTERFACE__
236 template <
class TElem>
273 bool elements_are_supported(
uint shElements)
const;
278 void set_supported_elements(
uint shElements);
282 void enable_element_support(
uint shElements);
286 void disable_element_support(
uint shElements);
291 void set_default_subset_index(
int subsetIndex);
298 void enable_subset_inheritance(
bool bEnable);
306 void enable_strict_inheritance(
bool bEnable);
311 inline void subset_required(
int index);
314 inline void subset_required(
int index)
const;
317 inline int num_subsets()
const {
return (
int)m_subsetInfos.size();}
320 const char* get_subset_name(
int subsetIndex)
const;
323 void set_subset_name(
const char*
name,
int subsetIndex);
327 void set_subset_info(
int subsetIndex,
const SubsetInfo& subsetInfo);
333 const SubsetInfo& subset_info(
int subsetIndex)
const;
336 void set_default_subset_info(
const SubsetInfo& defSI);
341 void clear_subset(
int subsetIndex);
342 void clear_subsets();
346 void insert_subset(
int subsetIndex);
348 void erase_subset(
int subsetIndex);
350 void swap_subsets(
int subsetIndex1,
int subsetIndex2);
352 void move_subset(
int indexFrom,
int indexTo);
354 void join_subsets(
int targetSub,
int sub1,
int sub2,
bool eraseUnusedSubs);
356 template <
class TIterator>
357 void assign_subset(TIterator iterBegin, TIterator iterEnd,
int subsetIndex);
360 inline int get_subset_index(
Vertex* elem)
const;
361 inline int get_subset_index(
Edge* elem)
const;
362 inline int get_subset_index(
Face* elem)
const;
363 inline int get_subset_index(
Volume* elem)
const;
369 int get_subset_index(
const char*
name)
const;
374 virtual void grid_to_be_destroyed(
Grid* grid);
375 virtual void elements_to_be_cleared(
Grid* grid);
378 virtual void vertex_created(
Grid* grid,
Vertex* vrt,
380 bool replacesParent =
false);
382 virtual void edge_created(
Grid* grid,
Edge* e,
384 bool replacesParent =
false);
386 virtual void face_created(
Grid* grid,
Face* f,
388 bool replacesParent =
false);
390 virtual void volume_created(
Grid* grid,
Volume* vol,
392 bool replacesParent =
false);
394 virtual void vertex_to_be_erased(
Grid* grid,
Vertex* vrt,
395 Vertex* replacedBy = NULL);
397 virtual void edge_to_be_erased(
Grid* grid,
Edge* e,
398 Edge* replacedBy = NULL);
400 virtual void face_to_be_erased(
Grid* grid,
Face* f,
401 Face* replacedBy = NULL);
403 virtual void volume_to_be_erased(
Grid* grid,
Volume* vol,
404 Volume* replacedBy = NULL);
445 virtual void assign_subset(
GridObject* elem,
int subsetIndex);
579 void set_grid(
Grid* grid);
585 void reset_subset_indices(
uint shElements =
SHE_ALL);
588 void create_required_subsets(
int index);
590 inline void subset_assigned(
Vertex* v,
int subsetIndex);
591 inline void subset_assigned(
Edge* e,
int subsetIndex);
592 inline void subset_assigned(
Face* f,
int subsetIndex);
593 inline void subset_assigned(
Volume* v,
int subsetIndex);
639 template <
class TElem>
640 void elems_to_be_merged(
Grid* grid, TElem*
target,
641 TElem* elem1, TElem* elem2);
location name
Definition: checkpoint_util.lua:128
A linked list of elements living in an attachment.
Definition: attached_list.h:182
Base-class for edges.
Definition: grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
a helper class that holds a collection of possibly unconnected geometric-objects.
Definition: grid_object_collection.h:96
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
Definition: grid_observer.h:80
Definition: subset_handler_interface.h:223
virtual void assign_subset(Volume *elem, int subsetIndex)=0
ASubsetIndex m_aSubsetIndex
Definition: subset_handler_interface.h:746
Grid * m_pGrid
Definition: subset_handler_interface.h:736
virtual bool contains_volumes(int subsetIndex) const =0
returns true if the subset contains volumes
virtual bool contains_vertices(int subsetIndex) const =0
collects all vertices that are in the given subset.
std::vector< SubsetInfo > SubsetInfoVec
Definition: subset_handler_interface.h:729
virtual void assign_subset(Vertex *elem, int subsetIndex)=0
bool m_bSubsetInheritanceEnabled
Definition: subset_handler_interface.h:750
Grid::traits< Edge >::SectionContainer EdgeSectionContainer
Definition: subset_handler_interface.h:562
Grid::traits< Edge >::AttachedElementList AttachedEdgeList
Definition: subset_handler_interface.h:557
Grid::FaceAttachmentAccessor< ASubsetIndex > m_aaSubsetIndexFACE
Definition: subset_handler_interface.h:756
SubsetInfoVec m_subsetInfos
Definition: subset_handler_interface.h:742
virtual void erase_subset_lists()=0
virtual bool contains_faces(int subsetIndex) const =0
returns true if the subset contains faces
virtual void assign_subset(Face *elem, int subsetIndex)=0
virtual bool contains_edges(int subsetIndex) const =0
returns true if the subset contains edges
void alter_subset_index(Volume *v, int subsetIndex)
Definition: subset_handler_interface.h:614
AInt ASubsetIndex
Definition: subset_handler_interface.h:724
Grid::traits< Vertex >::SectionContainer VertexSectionContainer
Definition: subset_handler_interface.h:561
virtual void clear_subset_lists(int index)=0
bool m_bStrictInheritanceEnabled
Definition: subset_handler_interface.h:751
void alter_subset_index(Vertex *v, int subsetIndex)
Definition: subset_handler_interface.h:599
int m_defaultSubsetIndex
Definition: subset_handler_interface.h:749
ISubsetHandler(const ISubsetHandler &sh)
this method is called by ISubsetHandler when attachment_support has been enabled.
Definition: subset_handler_interface.h:724
Grid::traits< Vertex >::AttachedElementList AttachedVertexList
enable subset-attachment support
Definition: subset_handler_interface.h:556
virtual void join_subset_lists(int target, int src1, int src2)=0
join the subset-lists but do not touch the subset-indices.
virtual void erase_subset_lists(int index)=0
erase the subset-lists but do not touch the subset-indices.
bool strict_inheritance_enabled()
Definition: subset_handler_interface.h:307
Grid::VolumeAttachmentAccessor< ASubsetIndex > m_aaSubsetIndexVOL
Definition: subset_handler_interface.h:757
virtual void change_subset_indices(int indOld, int indNew)=0
virtual void assign_subset(Edge *elem, int subsetIndex)=0
uint m_supportedElements
Definition: subset_handler_interface.h:744
Grid::traits< Face >::AttachedElementList AttachedFaceList
Definition: subset_handler_interface.h:558
int get_default_subset_index()
Definition: subset_handler_interface.h:292
SubsetInfo m_defaultSubsetInfo
Definition: subset_handler_interface.h:743
virtual void move_subset_lists(int indexFrom, int indexTo)=0
move the subset-lists but do not touch the subset-indices.
virtual GridObjectCollection get_grid_objects_in_subset(int subsetInd) const =0
Returns the geometric object collection for the given subset.
int num_subsets() const
returns the number of subset-infos (return value is int, since SubsetIndices are of type int)
Definition: subset_handler_interface.h:317
bool subset_inheritance_enabled()
Definition: subset_handler_interface.h:299
Grid::EdgeAttachmentAccessor< ASubsetIndex > m_aaSubsetIndexEDGE
Definition: subset_handler_interface.h:755
Grid::traits< Volume >::AttachedElementList AttachedVolumeList
Definition: subset_handler_interface.h:559
Grid::traits< Face >::SectionContainer FaceSectionContainer
Definition: subset_handler_interface.h:563
void alter_subset_index(Face *f, int subsetIndex)
Definition: subset_handler_interface.h:609
Grid::traits< Volume >::SectionContainer VolumeSectionContainer
Definition: subset_handler_interface.h:564
virtual void swap_subset_lists(int ind1, int ind2)=0
swap the subset-lists but do not touch the subset-indices.
virtual void add_required_subset_lists(int maxIndex)=0
add a subset if required - so that the subset with maxIndex exists.
Grid::VertexAttachmentAccessor< ASubsetIndex > m_aaSubsetIndexVRT
Definition: subset_handler_interface.h:754
void alter_subset_index(Edge *e, int subsetIndex)
Definition: subset_handler_interface.h:604
A variant can represent variables of different types.
Definition: variant.h:87
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
Definition: grid_base_object_traits.h:68
#define UG_API
Definition: ug_config.h:65
unsigned int uint
Definition: types.h:114
size_t target(SM_edge< typename T::value_type > const &e, ug::BidirectionalMatrix< T > const &m)
Definition: bidirectional_boost.h:100
@ SS_NONE
Definition: subset_handler_interface.h:81
@ SS_USER_STATE
Definition: subset_handler_interface.h:82
The traits class holds some important types for each element-type.
Definition: subset_handler_interface.h:237
geometry_traits< TElem >::iterator iterator
Definition: subset_handler_interface.h:238
geometry_traits< TElem >::const_iterator const_iterator
Definition: subset_handler_interface.h:239
a struct that holds information associated with subsets.
Definition: subset_handler_interface.h:97
PropertyMap m_propertyMap
custom properties can be stored in this map.
Definition: subset_handler_interface.h:107
std::map< std::string, Variant > PropertyMap
Definition: subset_handler_interface.h:104
Variant get_property(const char *name, Variant defaultValue=Variant()) const
retrieve the property with the given name
Definition: subset_handler_interface.cpp:62
vector4 color
Definition: subset_handler_interface.h:101
std::string name
Definition: subset_handler_interface.h:99
void set_property(const char *name, Variant prop)
associate a property with the given name
Definition: subset_handler_interface.cpp:50
uint subsetState
an or-combination of SubsetState flags.
Definition: subset_handler_interface.h:102
SubsetInfo()
Definition: subset_handler_interface.cpp:42
int materialIndex
mostly ignored.
Definition: subset_handler_interface.h:100