MeVisLab Toolbox Reference
ml::CSOGroupRules Class Reference

This handles rules like the maximum number of CSOs in a group and applies them. More...

#include <CSOGroupRules.h>

Public Member Functions

 CSOGroupRules (unsigned int numMaxCSOs=0)
 Constructor. More...
 
 ~CSOGroupRules ()
 Destructor. More...
 
void reset ()
 Sets default values to all members. More...
 
void setNumMaximumCSOs (unsigned int numMaxCSOs)
 Sets the maximum number of CSOs allowed in the group where the rules are applied to. More...
 
unsigned int getNumMaximumCSOs () const
 Returns the maximum number of CSOs. More...
 
void setOverflowHandling (CSOGroupOverflowHandling handling)
 Sets the overflow handling, i.e. what has to done when one wants to add CSO and _numMaxCSOs is reached. More...
 
CSOGroupOverflowHandling getOverflowHandling () const
 Returns the _overflowHandling mode. More...
 
void setRemoveFromGroupHandling (CSORemoveHandling handling)
 Sets the handling mode for CSOs that are removed from the group, i.e. should they also be removed from the list... More...
 
CSORemoveHandling getRemoveFromGroupHandling () const
 Returns the _removeFromGroupHandling mode. More...
 
void setDeleteGroupCSOHandling (CSORemoveHandling handling)
 Sets the handling mode for CSOs when this group is deleted, i.e. should they also be removed from the list... More...
 
CSORemoveHandling getDeleteGroupCSOHandling () const
 Returns the _deleteGroupCSOHandling mode. More...
 
bool mayAddCSO (CSOGroup &csoGroup) const
 Checks if one could add a CSO to the group csoGroup. More...
 
void applyTo (CSOGroup &csoGroup)
 Applies the rules to the csoGroup. More...
 
CSOaddNewCSO (CSOGroup &csoGroup, bool useUndoRedo=true)
 Adds a new CSO to the csoGroup according to the rules. More...
 
bool addCSO (CSO &cso, CSOGroup &csoGroup, bool useUndoRedo=true)
 Adds the given cso to the given csoGroup if the rules allow that. More...
 
void removeCSO (CSO &cso, CSOGroup &csoGroup, bool useUndoRedo=true)
 Removes a CSO from the csoGroup according to the rules. More...
 
void applyDeletionRule (CSOGroup &csoGroup)
 Applies the delete group rules to the csoGroup. More...
 
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) More...
 

Static Public Member Functions

static unsigned int getDefaultNumMaximumCSOs ()
 Returns the default value for the maximum amount of CSOs in a group. More...
 
static CSOGroupOverflowHandling getDefaultOverflowHandling ()
 Returns the default overflow handling for a group. More...
 
static CSORemoveHandling getDefaultRemoveFromGroupHandling ()
 Returns the default handling for removal from groups. More...
 
static CSORemoveHandling getDefaultDeleteGroupCSOHandling ()
 Returns the default handling for removal from groups. More...
 

Protected Member Functions

void _removeAllCSO (CSOGroup &csoGroup, bool useUndoRedo=true)
 Removes all CSOs from the csoGroup according to the rules. More...
 
void _combineCSOAndGroup (CSO &cso, CSOGroup &csoGroup)
 establishes bidirectional link between given cso and group More...
 
void _breakCSOandGroup (CSO &cso, CSOGroup &csoGroup)
 removes bidirectional link between given cso and group More...
 

Detailed Description

This handles rules like the maximum number of CSOs in a group and applies them.

Definition at line 57 of file CSOGroupRules.h.

Constructor & Destructor Documentation

◆ CSOGroupRules()

ml::CSOGroupRules::CSOGroupRules ( unsigned int  numMaxCSOs = 0)

Constructor.

◆ ~CSOGroupRules()

ml::CSOGroupRules::~CSOGroupRules ( )

Destructor.

Member Function Documentation

◆ _breakCSOandGroup()

void ml::CSOGroupRules::_breakCSOandGroup ( CSO cso,
CSOGroup csoGroup 
)
protected

removes bidirectional link between given cso and group

◆ _combineCSOAndGroup()

void ml::CSOGroupRules::_combineCSOAndGroup ( CSO cso,
CSOGroup csoGroup 
)
protected

establishes bidirectional link between given cso and group

◆ _removeAllCSO()

void ml::CSOGroupRules::_removeAllCSO ( CSOGroup csoGroup,
bool  useUndoRedo = true 
)
protected

Removes all CSOs from the csoGroup according to the rules.

◆ addCSO()

bool ml::CSOGroupRules::addCSO ( CSO cso,
CSOGroup csoGroup,
bool  useUndoRedo = true 
)

Adds the given cso to the given csoGroup if the rules allow that.

Returns whether the operation was successful.

◆ addNewCSO()

CSO* ml::CSOGroupRules::addNewCSO ( CSOGroup csoGroup,
bool  useUndoRedo = true 
)

Adds a new CSO to the csoGroup according to the rules.

◆ applyDeletionRule()

void ml::CSOGroupRules::applyDeletionRule ( CSOGroup csoGroup)

Applies the delete group rules to the csoGroup.

◆ applyRemoveFromGroupRule()

void ml::CSOGroupRules::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)

◆ applyTo()

void ml::CSOGroupRules::applyTo ( CSOGroup csoGroup)

Applies the rules to the csoGroup.

◆ getDefaultDeleteGroupCSOHandling()

static CSORemoveHandling ml::CSOGroupRules::getDefaultDeleteGroupCSOHandling ( )
inlinestatic

Returns the default handling for removal from groups.

Definition at line 110 of file CSOGroupRules.h.

References ml::REMOVE_IF_IN_NO_GROUP.

◆ getDefaultNumMaximumCSOs()

static unsigned int ml::CSOGroupRules::getDefaultNumMaximumCSOs ( )
inlinestatic

Returns the default value for the maximum amount of CSOs in a group.

Definition at line 104 of file CSOGroupRules.h.

◆ getDefaultOverflowHandling()

static CSOGroupOverflowHandling ml::CSOGroupRules::getDefaultOverflowHandling ( )
inlinestatic

Returns the default overflow handling for a group.

Definition at line 106 of file CSOGroupRules.h.

References ml::OVERFLOW_DELETE_FIRST.

◆ getDefaultRemoveFromGroupHandling()

static CSORemoveHandling ml::CSOGroupRules::getDefaultRemoveFromGroupHandling ( )
inlinestatic

Returns the default handling for removal from groups.

Definition at line 108 of file CSOGroupRules.h.

References ml::REMOVE_NEVER.

◆ getDeleteGroupCSOHandling()

CSORemoveHandling ml::CSOGroupRules::getDeleteGroupCSOHandling ( ) const
inline

Returns the _deleteGroupCSOHandling mode.

Definition at line 85 of file CSOGroupRules.h.

◆ getNumMaximumCSOs()

unsigned int ml::CSOGroupRules::getNumMaximumCSOs ( ) const
inline

Returns the maximum number of CSOs.

Definition at line 73 of file CSOGroupRules.h.

◆ getOverflowHandling()

CSOGroupOverflowHandling ml::CSOGroupRules::getOverflowHandling ( ) const
inline

Returns the _overflowHandling mode.

Definition at line 77 of file CSOGroupRules.h.

◆ getRemoveFromGroupHandling()

CSORemoveHandling ml::CSOGroupRules::getRemoveFromGroupHandling ( ) const
inline

Returns the _removeFromGroupHandling mode.

Definition at line 81 of file CSOGroupRules.h.

◆ mayAddCSO()

bool ml::CSOGroupRules::mayAddCSO ( CSOGroup csoGroup) const

Checks if one could add a CSO to the group csoGroup.

◆ removeCSO()

void ml::CSOGroupRules::removeCSO ( CSO cso,
CSOGroup csoGroup,
bool  useUndoRedo = true 
)

Removes a CSO from the csoGroup according to the rules.

◆ reset()

void ml::CSOGroupRules::reset ( )

Sets default values to all members.

◆ setDeleteGroupCSOHandling()

void ml::CSOGroupRules::setDeleteGroupCSOHandling ( CSORemoveHandling  handling)
inline

Sets the handling mode for CSOs when this group is deleted, i.e. should they also be removed from the list...

Definition at line 83 of file CSOGroupRules.h.

◆ setNumMaximumCSOs()

void ml::CSOGroupRules::setNumMaximumCSOs ( unsigned int  numMaxCSOs)
inline

Sets the maximum number of CSOs allowed in the group where the rules are applied to.

Definition at line 71 of file CSOGroupRules.h.

◆ setOverflowHandling()

void ml::CSOGroupRules::setOverflowHandling ( CSOGroupOverflowHandling  handling)
inline

Sets the overflow handling, i.e. what has to done when one wants to add CSO and _numMaxCSOs is reached.

Definition at line 75 of file CSOGroupRules.h.

◆ setRemoveFromGroupHandling()

void ml::CSOGroupRules::setRemoveFromGroupHandling ( CSORemoveHandling  handling)
inline

Sets the handling mode for CSOs that are removed from the group, i.e. should they also be removed from the list...

Definition at line 79 of file CSOGroupRules.h.


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