52 MERGE_MODE_BY_LABEL = 2
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 CSOGroup and applies them.
static CSOGroupOverflowHandling getDefaultOverflowHandling()
Returns the default overflow handling for a CSOGroup.
CSOGroupRules(unsigned int numMaxCSOs=0)
Constructor.
void applyRemoveFromGroupRule(CSO &cso, bool useUndoRedo)
Applies the remove-from-group rule to the cso (is is executed any time a CSO is removed from the CSOG...
static CSORemoveHandling getDefaultDeleteGroupCSOHandling()
Returns the default handling for removal from CSOGroups.
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 CSOGroups.
void reset()
Sets default values to all members.
void setNumMaximumCSOs(unsigned int numMaxCSOs)
Sets the maximum number of CSOs allowed in the CSOGroup where the rules are applied to.
void setDeleteGroupCSOHandling(CSORemoveHandling handling)
Sets the handling mode for CSOs when this CSOGroup is deleted, i.e., should they also be removed from...
void _combineCSOAndGroup(CSO &cso, CSOGroup &csoGroup)
Establishes a bidirectional link between the specified CSO and the specified CSOGroup.
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 whether one could add a CSO to the specified CSOGroup.
void _breakCSOandGroup(CSO &cso, CSOGroup &csoGroup)
Removes the bidirectional link between the specified CSO and the specified CSOGroup.
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 specified cso to the specified csoGroup if the rules allow that.
static unsigned int getDefaultNumMaximumCSOs()
Returns the default value for the maximum amount of CSOs in a CSOGroup.
~CSOGroupRules()
Destructor.
void setOverflowHandling(CSOGroupOverflowHandling handling)
Sets the overflow handling, i.e., what has to be done when one wants to add CSO and _numMaxCSOs is re...
void setRemoveFromGroupHandling(CSORemoveHandling handling)
Sets the handling mode for CSOs that are removed from the CSOGroup, i.e., should they also be removed...
A CSOGroup comprises a number of CSOs, which themselves can be in a number of different CSOGroups.
The CSO represents a contour segmentation object.
CSORemoveHandling
Enumeration for the removal handling of CSOs from CSOGroup and whether CSOGroup is deleted.
@ REMOVE_NEVER
If a CSO is removed from a CSOGroup, it is not deleted from the list.
@ REMOVE_ALWAYS
If a CSO is removed from a CSOGroup, it is also deleted from the list.
@ REMOVE_IF_IN_NO_GROUP
If a CSO is removed from a CSOGroup, it is only deleted from the list if it is in no CSOGroup anymore...
@ NUM_REMOVE_MODES
Number of modes.
CSOGroupOverflowHandling
Enumeration for the CSOGroup overflow handling modes.
@ OVERFLOW_DELETE_LAST
If a CSOGroup is full, the last CSO in the CSOGroup is replaced by the newly generated CSO.
@ OVERFLOW_DELETE_ALL
If a CSOGroup is full, all CSOs in the CSOGroup are deleted.
@ NUM_OVERFLOW_MODES
Number of modes.
@ OVERFLOW_IGNORE_NEW
If a CSOGroup is full, one cannot generate a new CSO.
@ OVERFLOW_DELETE_FIRST
If a CSOGroup is full, the first CSO in the CSOGroup is replaced by the newly generated CSO.