126 unsigned int _numMaxCSOs;
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
This handles rules like the maximum number of CSOs in a group and applies them.
static CSOGroupOverflowHandling getDefaultOverflowHandling()
Returns the default overflow handling for a group.
CSOGroupRules(unsigned int numMaxCSOs=0)
Constructor.
void applyRemoveFromGroupRule(CSO &cso, bool useUndoRedo)
Applies the remove from group rule to the cso (Is is executed anytime a cso is removed from the group...
static CSORemoveHandling getDefaultDeleteGroupCSOHandling()
Returns the default handling for removal from groups.
CSORemoveHandling getDeleteGroupCSOHandling() const
Returns the _deleteGroupCSOHandling mode.
void applyDeletionRule(CSOGroup &csoGroup)
Applies the delete group rules to the csoGroup.
unsigned int getNumMaximumCSOs() const
Returns the maximum number of CSOs.
void applyTo(CSOGroup &csoGroup)
Applies the rules to the csoGroup.
CSO * addNewCSO(CSOGroup &csoGroup, bool useUndoRedo=true)
Adds a new CSO to the csoGroup according to the rules.
CSORemoveHandling getRemoveFromGroupHandling() const
Returns the _removeFromGroupHandling mode.
static CSORemoveHandling getDefaultRemoveFromGroupHandling()
Returns the default handling for removal from groups.
void reset()
Sets default values to all members.
void setNumMaximumCSOs(unsigned int numMaxCSOs)
Sets the maximum number of CSOs allowed in the group where the rules are applied to.
void setDeleteGroupCSOHandling(CSORemoveHandling handling)
Sets the handling mode for CSOs when this group is deleted, i.e. should they also be removed from the...
void _combineCSOAndGroup(CSO &cso, CSOGroup &csoGroup)
establishes bidirectional link between given cso and group
void removeCSO(CSO &cso, CSOGroup &csoGroup, bool useUndoRedo=true)
Removes a CSO from the csoGroup according to the rules.
bool mayAddCSO(CSOGroup &csoGroup) const
Checks if one could add a CSO to the group csoGroup.
void _breakCSOandGroup(CSO &cso, CSOGroup &csoGroup)
removes bidirectional link between given cso and group
void _removeAllCSO(CSOGroup &csoGroup, bool useUndoRedo=true)
Removes all CSOs from the csoGroup according to the rules.
CSOGroupOverflowHandling getOverflowHandling() const
Returns the _overflowHandling mode.
bool addCSO(CSO &cso, CSOGroup &csoGroup, bool useUndoRedo=true)
Adds the given cso to the given csoGroup if the rules allow that.
static unsigned int getDefaultNumMaximumCSOs()
Returns the default value for the maximum amount of CSOs in a group.
~CSOGroupRules()
Destructor.
void setOverflowHandling(CSOGroupOverflowHandling handling)
Sets the overflow handling, i.e. what has to done when one wants to add CSO and _numMaxCSOs is reache...
void setRemoveFromGroupHandling(CSORemoveHandling handling)
Sets the handling mode for CSOs that are removed from the group, i.e. should they also be removed fro...
A CSOGroup comprises a number of CSOs, which themselves can be in a number of different CSOGroups.
The CSO represents a contour segmentation object.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
CSORemoveHandling
Enumeration for the removal handling of CSOs from group and if group is deleted.
@ REMOVE_NEVER
If a CSO is removed from a group, it is not deleted from the list.
@ REMOVE_ALWAYS
If a CSO is removed from a group, it is also deleted from the list.
@ REMOVE_IF_IN_NO_GROUP
If a CSO is removed from a group, it is only deleted from the list if it is in no group anymore.
@ NUM_REMOVE_MODES
Number of modes.
CSOGroupOverflowHandling
Enumeration for the group overflow handling modes.
@ OVERFLOW_DELETE_LAST
If a CSOGroup is full, the last CSO in the group is replaced by the newly generated CSO.
@ OVERFLOW_DELETE_ALL
If a CSOGroup is full, all CSOs in the group are deleted.
@ NUM_OVERFLOW_MODES
Number of modes.
@ OVERFLOW_IGNORE_NEW
If a CSOGroup is full, one can not generate a new one.
@ OVERFLOW_DELETE_FIRST
If a CSOGroup is full, the first CSO in the group is replaced by the newly generated CSO.