MeVisLabToolboxReference
ml::CSOGroupRules Class Reference

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

#include <CSOGroupRules.h>

List of all members.

Public Member Functions

 CSOGroupRules (unsigned int numMaxCSOs=0)
 Constructor.
 ~CSOGroupRules ()
 Destructor.
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.
unsigned int getNumMaximumCSOs () const
 Returns the maximum number of CSOs.
void setOverflowHandling (CSOGroupOverflowHandling handling)
 Sets the overflow handling, i.e. what has to done when one wants to add CSO and _numMaxCSOs is reached.
CSOGroupOverflowHandling getOverflowHandling () const
 Returns the _overflowHandling mode.
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...
CSORemoveHandling getRemoveFromGroupHandling () const
 Returns the _removeFromGroupHandling mode.
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...
CSORemoveHandling getDeleteGroupCSOHandling () const
 Returns the _deleteGroupCSOHandling mode.
bool mayAddCSO (CSOGroup &csoGroup) const
 Checks if one could add a CSO to the group csoGroup.
void applyTo (CSOGroup &csoGroup)
 Applies the rules to the csoGroup.
CSOaddCSO (CSOGroup &csoGroup, bool useUndoRedo=true)
 Adds a new CSO to the csoGroup according to the rules.
bool addCSO (CSO &cso, CSOGroup &csoGroup, bool useUndoRedo=true)
 Adds the given cso to the given csoGroup if the rules allow that.
void applyDeletionRule (CSOGroup &csoGroup)
 Applies the delete group rules to the csoGroup.

Static Public Member Functions

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

Static Public Attributes

static const char * sOverflowHandlingStrings [NUM_OVERFLOW_MODES]
 Defines the strings for overflow handling (displayed in the fields).
static const char * sRemoveHandlingStrings [NUM_REMOVE_MODES]
 Defines the strings for removal handling (displayed in the fields).

Protected Member Functions

void _removeCSO (CSO &cso, CSOGroup &csoGroup, bool useUndoRedo=true)
 Removes a CSO from the csoGroup according to the rules.
void _removeAllCSO (CSOGroup &csoGroup, bool useUndoRedo=true)
 Removes all CSOs from the csoGroup according to the rules.

Detailed Description

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

Definition at line 45 of file CSOGroupRules.h.


Constructor & Destructor Documentation

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

Constructor.

ml::CSOGroupRules::~CSOGroupRules ( )

Destructor.


Member Function Documentation

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

Removes all CSOs from the csoGroup according to the rules.

void ml::CSOGroupRules::_removeCSO ( CSO cso,
CSOGroup csoGroup,
bool  useUndoRedo = true 
) [protected]

Removes a CSO from the csoGroup according to the rules.

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

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

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.

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

Applies the delete group rules to the csoGroup.

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

Applies the rules to the csoGroup.

static CSORemoveHandling ml::CSOGroupRules::getDefaultDeleteGroupCSOHandling ( ) [inline, static]

Returns the default handling for removal from groups.

Definition at line 95 of file CSOGroupRules.h.

References ml::REMOVE_IF_IN_NO_GROUP.

static unsigned int ml::CSOGroupRules::getDefaultNumMaximumCSOs ( ) [inline, static]

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

Definition at line 89 of file CSOGroupRules.h.

static CSOGroupOverflowHandling ml::CSOGroupRules::getDefaultOverflowHandling ( ) [inline, static]

Returns the default overflow handling for a group.

Definition at line 91 of file CSOGroupRules.h.

References ml::OVERFLOW_DELETE_FIRST.

static CSORemoveHandling ml::CSOGroupRules::getDefaultRemoveFromGroupHandling ( ) [inline, static]

Returns the default handling for removal from groups.

Definition at line 93 of file CSOGroupRules.h.

References ml::REMOVE_IF_IN_NO_GROUP.

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

Returns the _deleteGroupCSOHandling mode.

Definition at line 73 of file CSOGroupRules.h.

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

Returns the maximum number of CSOs.

Definition at line 61 of file CSOGroupRules.h.

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

Returns the _overflowHandling mode.

Definition at line 65 of file CSOGroupRules.h.

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

Returns the _removeFromGroupHandling mode.

Definition at line 69 of file CSOGroupRules.h.

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

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

void ml::CSOGroupRules::reset ( )

Sets default values to all members.

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 71 of file CSOGroupRules.h.

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 59 of file CSOGroupRules.h.

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 63 of file CSOGroupRules.h.

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 67 of file CSOGroupRules.h.


Member Data Documentation

const char* ml::CSOGroupRules::sOverflowHandlingStrings[NUM_OVERFLOW_MODES] [static]

Defines the strings for overflow handling (displayed in the fields).

Definition at line 98 of file CSOGroupRules.h.

const char* ml::CSOGroupRules::sRemoveHandlingStrings[NUM_REMOVE_MODES] [static]

Defines the strings for removal handling (displayed in the fields).

Definition at line 100 of file CSOGroupRules.h.


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