MeVisLab Scripting Reference
MLCSOListWrapper Class Reference

Inherits MLRefCountedBaseWrapper.

Public Types

enum  NotificationType {
  NOTIFICATION_NONE = 0 , NOTIFICATION_CSO_SELECTION = ml::CSOList::NOTIFICATION_CSO_SELECTION , NOTIFICATION_GROUP_SELECTION = ml::CSOList::NOTIFICATION_GROUP_SELECTION , NOTIFICATION_CSO_FINISHED = ml::CSOList::NOTIFICATION_CSO_FINISHED ,
  NOTIFICATION_GROUP_FINISHED = ml::CSOList::NOTIFICATION_GROUP_FINISHED , NOTIFICATION_REPAINT = ml::CSOList::NOTIFICATION_REPAINT , NOTIFICATION_INTERACTION_INIT = ml::CSOList::NOTIFICATION_INTERACTION_INIT , NOTIFICATION_START_NEW_CSO = ml::CSOList::NOTIFICATION_START_NEW_CSO ,
  NOTIFICATION_CSO_MOVED = ml::CSOList::NOTIFICATION_CSO_MOVED , NOTIFICATION_CSO_UNDER_MOUSE_CHANGED = ml::CSOList::NOTIFICATION_CSO_UNDER_MOUSE_CHANGED , NOTIFICATION_CSO_REMOVED = 512 , NOTIFICATION_CLEARED = 1024 ,
  NOTIFICATION_GROUP_ADDED = 2048 , NOTIFICATION_GROUP_REMOVED = 4096 , NOTIFICATION_ALL = 0xffff
}
 

Public Slots

MLCSOWrapperaddCSOCopy (MLCSOWrapper *csoWrapper, bool useUndoRedo=true)
 
MLCSOWrapperaddCSOCopy (unsigned int id, bool useUndoRedo=true)
 
bool removeAll (bool useUndoRedo=true)
 
void removeCSO (unsigned int id, bool useUndoRedo=true)
 
void removeCSOs (bool removeCSOsWithoutParentGroupsOnly=false, bool removeEditableCSOsOnly=false, bool removeSelectedCSOsOnly=false)
 
void removeGroup (unsigned int id, bool useUndoRedo=true)
 
void removeGroups (bool removeEmptyGroupsOnly=false, bool removeEditableGroupsOnly=false, bool removeChildCSOs=true, bool removeSelectedGroupsOnly=false)
 
void resetUniqueCSOLabelIdMap ()
 
void resetUniqueGroupLabelIdMap ()
 
unsigned int getNumCSOs () const
 
unsigned int getNumGroups () const
 
unsigned int getNumSelectedCSOs () const
 
unsigned int getNumSelectedGroups () const
 
unsigned int getNumCSOGroups () const
 
QVariantList getCSOs ()
 
QVariantList getGroups ()
 
MLCSOListWrapperdeepCopy ()
 
QVariantList getCSOGroups ()
 
MLCSOWrappergetSelectedCSOAt (unsigned int index) const
 
MLCSOGroupWrappergetSelectedGroupAt (unsigned int index) const
 
QVariantList getCenterOfSelectedCSOs () const
 
QVariantList getCenterOfSelectedGroups () const
 
MLCSOWrappergetCSOAt (unsigned int idx)
 
MLCSOWrappergetCSOById (unsigned int id)
 
unsigned int getCSOIndex (unsigned int id)
 
MLCSOGroupWrappergetGroupAt (unsigned int idx)
 
MLCSOGroupWrappergetGroupById (unsigned int id)
 
MLCSOGroupWrappergetGroupByLabel (QString label)
 
QList< unsigned int > getCSOIdList ()
 
QList< unsigned int > getGroupIdList ()
 
QList< unsigned int > getSelectedCSOIdList ()
 
QList< unsigned int > getSelectedGroupIdList ()
 
void clearSelectedCSOs ()
 
void clearSelectedGroups ()
 
void clearSelectedSeedPoints ()
 
MLCSOWrappergetCSOCurrentlyUnderMouse ()
 
bool combineCSOandGroup (unsigned int csoId, unsigned int groupId, bool useUndoRedo=true)
 
bool breakCSOandGroup (unsigned int csoId, unsigned int groupId, bool useUndoRedo=true)
 
bool breakCSOfromAllGroups (unsigned int csoId, bool useUndoRedo=true)
 
bool breakAllCSOsFromGroup (unsigned int groupId, bool useUndoRedo=true)
 
bool isCSOSelected (unsigned int id) const
 
bool isGroupSelected (unsigned int id) const
 
bool addCSOToSelection (unsigned int id)
 
bool removeCSOFromSelection (unsigned int id)
 
bool addGroupToSelection (unsigned int id)
 
bool removeGroupFromSelection (unsigned int id)
 
MLCSOGroupWrapperaddGroup (const QString &label, bool useUndoRedo=true)
 
MLCSOWrapperaddCSO (const QVariantList &seedPoints, const QVariantList &pathPointLists, bool closed, bool useUndoRedo)
 
MLCSOWrapperaddPoint (const QVariantList &position, const QString &subtype="point")
 
MLCSOWrapperaddCircle (const QVariantList &midPoint, const QVariantList &normal, double radius, double pointDistanceInMM=1., const QString &subtype="circle")
 
MLCSOWrapperaddArrow (const QVariantList &pointAt, const QVariantList &direction, double length, double pointDistanceInMM=1., const QString &subtype="arrow")
 
MLCSOWrapperaddPolygon (const QVariantList &points, double pointDistanceInMM=1., const QString &subtype="polygon")
 
MLCSOWrapperaddPolyline (const QVariantList &points, double pointDistanceInMM=1., const QString &subtype="polyline")
 
MLCSOWrapperaddClosedSpline (const QVariantList &points, bool useInterpolation=true, double pointDistanceInMM=1., const QString &subtype="spline")
 
MLCSOWrapperaddOpenSpline (const QVariantList &points, bool useInterpolation=true, double pointDistanceInMM=1., const QString &subtype="spline")
 
void undo ()
 
void redo ()
 
bool clearUndoStack ()
 
bool clearRedoStack ()
 
bool clearUndoRedoStack ()
 
bool canUndo () const
 
bool canRedo () const
 
void openUndoRedoGroup (const QString &description="Contour Operation")
 
void closeUndoRedoGroup ()
 
bool setMaxNumUndos (int maxNumUndos)
 
int getCurrentUndoGroupDepth ()
 
void muteEvents ()
 
void unmuteEvents ()
 
bool saveTo (const QString &filename, bool binary) const
 
bool loadFrom (const QString &filename)
 
bool loadFrom (const QString &filename, const QString &message)
 
QString lastLoadSaveMessage () const
 
QByteArray dump (bool binary=true)
 
bool load (const QByteArray &buffer)
 
QString getUniqueCSOLabel (QString label, QString format, bool addIdAlways)
 
QString getUniqueGroupLabel (QString label, QString format, bool addIdAlways)
 
void notifyObservers (int notificationFlag)
 
void registerForNotification (unsigned int flags, MLABModule *module, QString methodName)
 
void deregisterForNotification (unsigned int flags, MLABModule *module, QString methodName)
 
int getNumberOfRegisteredNotifiers (unsigned int flag)
 
void copySelectedCSOs ()
 
QVariantList pasteCopiedCSOs () const
 
MLABModulegetCSOManager () const
 

Signals

void csoEventReceived (QObject *csoEvent)
 
Specialized event signals. The argument is always a CSOEventWrapper.

NOTE: These signals and their behavior are still preliminary.


void csoAdded (QObject *csoEvent)
 
void csoCreated (QObject *csoEvent)
 
void csoGeometryChanged (QObject *csoEvent)
 
void csoUserDataChanged (QObject *csoEvent)
 
void csoInteractionFinished (QObject *csoEvent)
 
void csoAboutToBeRemoved (QObject *csoEvent)
 
void csoAddedToGroup (QObject *csoEvent)
 
void csoAboutToBeRemovedFromGroup (QObject *csoEvent)
 
void csoSeedPointDeleted (QObject *csoEvent)
 
void csoSelectionChanged (QObject *csoEvent)
 
void csoDescriptionChanged (QObject *csoEvent)
 
void csoListAboutToBeCleared (QObject *csoEvent)
 
void csoListCleared (QObject *csoEvent)
 

Static Public Member Functions

static ml::RefCountedBase * createObject (const QVariantList &arguments)
 

Properties

unsigned int numCSOs
 
unsigned int numGroups
 
unsigned int numSelectedCSOs
 
unsigned int numSelectedGroups
 
QVariantList centerOfSelectedCSOs
 
QVariantList centerOfSelectedGroups
 
unsigned int numCSOGroups
 

Detailed Description

A class that wraps CSOList objects for use in Scripting.

Member Enumeration Documentation

◆ NotificationType

Notification flags for using in notifyObservers(int flag). The flags are all of the form 2^n, so they can be added to send a single notification containing combined information.

csoList.notifyObservers(csoList.NOTIFICATION_CSO_FINISHED)
Enumerator
NOTIFICATION_NONE 

No notification.

NOTIFICATION_CSO_SELECTION 

The selection of CSOs has changed.

NOTIFICATION_GROUP_SELECTION 

The selection of CSOGroups has changed.

NOTIFICATION_CSO_FINISHED 

The generation or modification of CSOs has finished.

NOTIFICATION_GROUP_FINISHED 

The generation of modification of CSOGroups has finished.

NOTIFICATION_REPAINT 

Rendering modules should repaint.

NOTIFICATION_INTERACTION_INIT 

Interaction modules should reset their states, e.g., reset pointers to CSOs.

NOTIFICATION_START_NEW_CSO 

The generation of a new CSO has started.

NOTIFICATION_CSO_MOVED 

CSOs have been moved but are otherwise left unchanged.

NOTIFICATION_CSO_UNDER_MOUSE_CHANGED 

The CSO currently under the mouse cursor has changed.

NOTIFICATION_CSO_REMOVED 

CSOs have been removed.

NOTIFICATION_CLEARED 

The CSOList has been cleared, all CSOs and CSOGroups have been removed.

NOTIFICATION_GROUP_ADDED 

CSOGroups have been added.

NOTIFICATION_GROUP_REMOVED 

CSOGroups have been removed.

NOTIFICATION_ALL 

Fire all notifications at once. Use with care.

Member Function Documentation

◆ addArrow

MLCSOWrapper* MLCSOListWrapper::addArrow ( const QVariantList &  pointAt,
const QVariantList &  direction,
double  length,
double  pointDistanceInMM = 1.,
const QString &  subtype = "arrow" 
)
slot

Adds an arrow pointing to pointAt from direction with a length.

◆ addCircle

MLCSOWrapper* MLCSOListWrapper::addCircle ( const QVariantList &  midPoint,
const QVariantList &  normal,
double  radius,
double  pointDistanceInMM = 1.,
const QString &  subtype = "circle" 
)
slot

Adds a circle CSO with its midPoint at the given position and a given radius.

The given normal defines the plane the CSO lies in.

◆ addClosedSpline

MLCSOWrapper* MLCSOListWrapper::addClosedSpline ( const QVariantList &  points,
bool  useInterpolation = true,
double  pointDistanceInMM = 1.,
const QString &  subtype = "spline" 
)
slot

Adds a spline interpolated closed polygon with the given points as seed points.

If useInterpolation is set to 'false', spline approximation is used.

◆ addCSO

MLCSOWrapper* MLCSOListWrapper::addCSO ( const QVariantList &  seedPoints,
const QVariantList &  pathPointLists,
bool  closed,
bool  useUndoRedo 
)
slot

Adds a new CSO with given seed- and path-points (list of list of points).

Example:

csoList = ctx.field("CSOListContainer.outCSOList").object()
seedPoints = ( (0,0,0), (1,1,1), (2,2,2) )
pathPointLists = ( ((0,0,0), (1,1,1)), ((1,1,1), (2,2,2)), ((2,2,2), (0,0,0)) )
cso = csoList.addCSO( seedPoints, pathPointLists, True, True)
csoList.notifyObservers(csoList.NOTIFICATION_CSO_FINISHED)

◆ addCSOCopy [1/2]

MLCSOWrapper* MLCSOListWrapper::addCSOCopy ( MLCSOWrapper csoWrapper,
bool  useUndoRedo = true 
)
slot

Adds a copy of the given CSO (which can be in another list) to this list and return its wrapper.

◆ addCSOCopy [2/2]

MLCSOWrapper* MLCSOListWrapper::addCSOCopy ( unsigned int  id,
bool  useUndoRedo = true 
)
slot

Adds a copy of the CSO with the given id to this list and returns its wrapper.

◆ addCSOToSelection

bool MLCSOListWrapper::addCSOToSelection ( unsigned int  id)
slot

Adds the CSO with the given id to the list of selected CSOs (no double entry).

Returns whether the selection has been changed by this action

◆ addGroup

MLCSOGroupWrapper* MLCSOListWrapper::addGroup ( const QString &  label,
bool  useUndoRedo = true 
)
slot

Adds a new group with given label to the list and returns its wrapper.

◆ addGroupToSelection

bool MLCSOListWrapper::addGroupToSelection ( unsigned int  id)
slot

Adds the group with the given id to the list of selected CSOs (no double entry).

Returns whether the selection has been changed by this action.

◆ addOpenSpline

MLCSOWrapper* MLCSOListWrapper::addOpenSpline ( const QVariantList &  points,
bool  useInterpolation = true,
double  pointDistanceInMM = 1.,
const QString &  subtype = "spline" 
)
slot

Adds a spline interpolated open polygon with the given points as seed points.

If useInterpolation is set to 'false', spline approximation is used.

◆ addPoint

MLCSOWrapper* MLCSOListWrapper::addPoint ( const QVariantList &  position,
const QString &  subtype = "point" 
)
slot

Methods to add CSOs of different types to the CSOList. Adds a point CSO at the given position.

◆ addPolygon

MLCSOWrapper* MLCSOListWrapper::addPolygon ( const QVariantList &  points,
double  pointDistanceInMM = 1.,
const QString &  subtype = "polygon" 
)
slot

Adds a linearly interpolated closed polygon with the given points as seed points.

The list of positions need to be in the following format:

newSquareOnFirstSlice = csoList.addPolygon( [ (100,100,0.5), (200,100,0.5), (200,200,0.5), (100,200,0.5) ] )

◆ addPolyline

MLCSOWrapper* MLCSOListWrapper::addPolyline ( const QVariantList &  points,
double  pointDistanceInMM = 1.,
const QString &  subtype = "polyline" 
)
slot

Adds a linearly interpolated open polyline with the given points as seed points.

◆ breakAllCSOsFromGroup

bool MLCSOListWrapper::breakAllCSOsFromGroup ( unsigned int  groupId,
bool  useUndoRedo = true 
)
slot

Breaks all combinations of the given group and any CSO.

Returns false if the groupId is invalid.

◆ breakCSOandGroup

bool MLCSOListWrapper::breakCSOandGroup ( unsigned int  csoId,
unsigned int  groupId,
bool  useUndoRedo = true 
)
slot

Breaks the combination of the given CSO and the given group.

Returns false if either the csoID or the groupId is invalid.

◆ breakCSOfromAllGroups

bool MLCSOListWrapper::breakCSOfromAllGroups ( unsigned int  csoId,
bool  useUndoRedo = true 
)
slot

Breaks all combinations of the given CSO and any group.

Returns false if the csoID is invalid.

◆ canRedo

bool MLCSOListWrapper::canRedo ( ) const
slot

Returns whether there are possible redoes.

◆ canUndo

bool MLCSOListWrapper::canUndo ( ) const
slot

Returns whether there are possible undoes.

◆ clearRedoStack

bool MLCSOListWrapper::clearRedoStack ( )
inlineslot

◆ clearSelectedCSOs

void MLCSOListWrapper::clearSelectedCSOs ( )
slot

Clears all selected CSOs.

◆ clearSelectedGroups

void MLCSOListWrapper::clearSelectedGroups ( )
slot

Clears all selected groups.

◆ clearSelectedSeedPoints

void MLCSOListWrapper::clearSelectedSeedPoints ( )
slot

Clears all selected seed points of all CSOs.

◆ clearUndoRedoStack

bool MLCSOListWrapper::clearUndoRedoStack ( )
slot

Clears the undo/redo stack. Return whether this was successful.

◆ clearUndoStack

bool MLCSOListWrapper::clearUndoStack ( )
inlineslot

◆ closeUndoRedoGroup

void MLCSOListWrapper::closeUndoRedoGroup ( )
slot

Closes a group of commands that are undone/redone as one.

◆ combineCSOandGroup

bool MLCSOListWrapper::combineCSOandGroup ( unsigned int  csoId,
unsigned int  groupId,
bool  useUndoRedo = true 
)
slot

Combines the given CSO with the given group.

Returns false if either the csoID or the groupId is invalid.

◆ copySelectedCSOs

void MLCSOListWrapper::copySelectedCSOs ( )
slot

Copies the selected CSOs into a temporary list

◆ createObject()

static ml::RefCountedBase* MLCSOListWrapper::createObject ( const QVariantList &  arguments)
static

Create new CSOList object; this is used by MLAB.createMLBaseObject to create a CSOList.

If the arguments are empty, a new CSOList will be created. If the arguments contain a single CSOList wrapper, a new copy of the CSOList will be returned.

◆ csoEventReceived

void MLCSOListWrapper::csoEventReceived ( QObject *  csoEvent)
signal

This signal is emitted when any event is received from the CSO list.

The argument is a CSOEventWrapper which is only valid while the signal is emitted. Remember that you need to keep the CSOList wrapper around for signals to work.

◆ deepCopy

MLCSOListWrapper* MLCSOListWrapper::deepCopy ( )
slot

Returns a deep copy of this list.

◆ deregisterForNotification

void MLCSOListWrapper::deregisterForNotification ( unsigned int  flags,
MLABModule module,
QString  methodName 
)
slot

Remove notification callback: deregister the method determined by methodName of the given module for the CSO notifications defined by flags.

◆ dump

QByteArray MLCSOListWrapper::dump ( bool  binary = true)
slot

Serialize content to a QByteArray.

If this fails, the resulting QByteArray is empty. If binary is not true, the data is written in a text format, otherwise in a binary format.

◆ getCenterOfSelectedCSOs

QVariantList MLCSOListWrapper::getCenterOfSelectedCSOs ( ) const
slot

Returns the center position of all bounding boxes of all selected CSOs.

Returns an empty list is no CSO is selected.

◆ getCenterOfSelectedGroups

QVariantList MLCSOListWrapper::getCenterOfSelectedGroups ( ) const
slot

Returns the center position of all bounding boxes of all CSOs of all selected groups.

Returns an empty list if no group is selected.

◆ getCSOAt

MLCSOWrapper* MLCSOListWrapper::getCSOAt ( unsigned int  idx)
slot

Returns the CSO at the given position in the internal list.

◆ getCSOById

MLCSOWrapper* MLCSOListWrapper::getCSOById ( unsigned int  id)
slot

Returns the CSO with the given unique id.

Returns NULL if no such CSO is stored in the list.

◆ getCSOCurrentlyUnderMouse

MLCSOWrapper* MLCSOListWrapper::getCSOCurrentlyUnderMouse ( )
slot

Returns the CSO currently under the mouse cursor.

◆ getCSOGroups

QVariantList MLCSOListWrapper::getCSOGroups ( )
slot

◆ getCSOIdList

QList<unsigned int> MLCSOListWrapper::getCSOIdList ( )
slot

Returns list of the current CSOs ids.

◆ getCSOIndex

unsigned int MLCSOListWrapper::getCSOIndex ( unsigned int  id)
slot

Returns the index of the CSO with the given id in its list.

◆ getCSOManager

MLABModule* MLCSOListWrapper::getCSOManager ( ) const
inlineslot

Returns the MLABModule of the CSOManager of the CSOList

◆ getCSOs

QVariantList MLCSOListWrapper::getCSOs ( )
slot

Returns a list of CSOs.

◆ getCurrentUndoGroupDepth

int MLCSOListWrapper::getCurrentUndoGroupDepth ( )
slot

Returns the current group depth of the undo stack for testing purposes.

Returns -1 if there is no undoRedo manager available.

◆ getGroupAt

MLCSOGroupWrapper* MLCSOListWrapper::getGroupAt ( unsigned int  idx)
slot

Returns the group at the given index position.

◆ getGroupById

MLCSOGroupWrapper* MLCSOListWrapper::getGroupById ( unsigned int  id)
slot

Returns the group with the given id.

◆ getGroupByLabel

MLCSOGroupWrapper* MLCSOListWrapper::getGroupByLabel ( QString  label)
slot

Returns the group with the given label.

◆ getGroupIdList

QList<unsigned int> MLCSOListWrapper::getGroupIdList ( )
slot

Returns list of the current groups ids.

◆ getGroups

QVariantList MLCSOListWrapper::getGroups ( )
slot

Returns a list of groups.

◆ getNumberOfRegisteredNotifiers

int MLCSOListWrapper::getNumberOfRegisteredNotifiers ( unsigned int  flag)
slot

Returns the number of registered notification callbacks for given flag.

◆ getNumCSOGroups

unsigned int MLCSOListWrapper::getNumCSOGroups ( ) const
slot

◆ getNumCSOs

unsigned int MLCSOListWrapper::getNumCSOs ( ) const
slot

Returns the number of CSOs.

◆ getNumGroups

unsigned int MLCSOListWrapper::getNumGroups ( ) const
slot

Returns the number of groups.

◆ getNumSelectedCSOs

unsigned int MLCSOListWrapper::getNumSelectedCSOs ( ) const
slot

Returns the number of selected CSOs.

◆ getNumSelectedGroups

unsigned int MLCSOListWrapper::getNumSelectedGroups ( ) const
slot

Returns the number of selectedGroups.

◆ getSelectedCSOAt

MLCSOWrapper* MLCSOListWrapper::getSelectedCSOAt ( unsigned int  index) const
slot

Returns the selected CSO at the given index; no checking!

◆ getSelectedCSOIdList

QList<unsigned int> MLCSOListWrapper::getSelectedCSOIdList ( )
slot

Returns list of ids of the currently selected CSOs.

◆ getSelectedGroupAt

MLCSOGroupWrapper* MLCSOListWrapper::getSelectedGroupAt ( unsigned int  index) const
slot

Returns the selected group at the given index; no checking!

◆ getSelectedGroupIdList

QList<unsigned int> MLCSOListWrapper::getSelectedGroupIdList ( )
slot

Returns list of ids of the currently selected groups.

◆ getUniqueCSOLabel

QString MLCSOListWrapper::getUniqueCSOLabel ( QString  label,
QString  format,
bool  addIdAlways 
)
inlineslot

Returns a unique CSO label that includes the given label and combines it with a unique id using the given format. If the given label itself is unique, an id is only added if addIdAlways is true.

◆ getUniqueGroupLabel

QString MLCSOListWrapper::getUniqueGroupLabel ( QString  label,
QString  format,
bool  addIdAlways 
)
inlineslot

Returns a unique group label that includes the given label and combines it with a unique id using the given format.

If the given label itself is unique, an id is only added if addIdAlways is true.

◆ isCSOSelected

bool MLCSOListWrapper::isCSOSelected ( unsigned int  id) const
slot

Returns whether the given CSO is currently selected.

If a CSOGroup is selected, its member CSOs are also marked as being selected.

◆ isGroupSelected

bool MLCSOListWrapper::isGroupSelected ( unsigned int  id) const
slot

Returns whether the given group is currently selected.

◆ lastLoadSaveMessage

QString MLCSOListWrapper::lastLoadSaveMessage ( ) const
slot

Return the messages from the last saveTo/loadFrom call.

◆ load

bool MLCSOListWrapper::load ( const QByteArray &  buffer)
slot

Load content from QByteArray. Returns whether the buffer could be successfully deserialized.

◆ loadFrom [1/2]

bool MLCSOListWrapper::loadFrom ( const QString &  filename)
slot

Reads out the internal structure for this list (CSOs and Groups) from the given file.

Returns whether the operation was successful.

Possible messages can be read with lastLoadSaveMessage().

◆ loadFrom [2/2]

bool MLCSOListWrapper::loadFrom ( const QString &  filename,
const QString &  message 
)
slot

◆ muteEvents

void MLCSOListWrapper::muteEvents ( )
slot

Prevent the CSOList from sending any CSOEvents until unmuteEvents is called

◆ notifyObservers

void MLCSOListWrapper::notifyObservers ( int  notificationFlag)
inlineslot

Notifies all observers with this flag.

◆ openUndoRedoGroup

void MLCSOListWrapper::openUndoRedoGroup ( const QString &  description = "Contour Operation")
slot

Opens a group of commands that are undone/redone as one.

◆ pasteCopiedCSOs

QVariantList MLCSOListWrapper::pasteCopiedCSOs ( ) const
slot

Paste copied CSOs from temporary list into the list The returned list contains the ids of the pasted CSOs.

◆ redo

void MLCSOListWrapper::redo ( )
slot

Performs a redo (if the undo stack is not empty).

◆ registerForNotification

void MLCSOListWrapper::registerForNotification ( unsigned int  flags,
MLABModule module,
QString  methodName 
)
slot

Add notification callback: register the method determined by methodName of the given module for the CSO notifications defined by flags.

In addition to the common CSO notification flags The flags defined in this header file can be used.

◆ removeAll

bool MLCSOListWrapper::removeAll ( bool  useUndoRedo = true)
slot

Removes all CSOs and Groups and resets all else.

Returns whether the operation was successful.

◆ removeCSO

void MLCSOListWrapper::removeCSO ( unsigned int  id,
bool  useUndoRedo = true 
)
inlineslot

Removes a CSO by its id and removes it from all groups.

◆ removeCSOFromSelection

bool MLCSOListWrapper::removeCSOFromSelection ( unsigned int  id)
slot

Removes the CSO with the given id from the list of selected CSOs.

Returns whether the selection has been changed by this action

◆ removeCSOs

void MLCSOListWrapper::removeCSOs ( bool  removeCSOsWithoutParentGroupsOnly = false,
bool  removeEditableCSOsOnly = false,
bool  removeSelectedCSOsOnly = false 
)
slot

Remove CSOs from this CSOList.

If removeCSOsWithoutParentGroupsOnly is true, only CSOs without parent groups are deleted. If removeEditableCSOsOnly is true, only editable CSOs are deleted. If removeSelectedCSOsOnly is true, only selected CSOs are deleted.

◆ removeGroup

void MLCSOListWrapper::removeGroup ( unsigned int  id,
bool  useUndoRedo = true 
)
inlineslot

Removes a Group by its id and removes it from all CSOs.

◆ removeGroupFromSelection

bool MLCSOListWrapper::removeGroupFromSelection ( unsigned int  id)
slot

Removes the group with the given id from the list of selected CSOs.

Returns whether the selection has been changed by this action.

◆ removeGroups

void MLCSOListWrapper::removeGroups ( bool  removeEmptyGroupsOnly = false,
bool  removeEditableGroupsOnly = false,
bool  removeChildCSOs = true,
bool  removeSelectedGroupsOnly = false 
)
slot

Remove groups from this CSOList.

If removeEmptyGroupsOnly is true, only empty groups are deleted. If removeEditableGroupsOnly is true, only editable groups are deleted. If removeChildCSOs is true, child CSOs of deleted groups are also deleted. If removeSelectedGroupsOnly is true, only selected CSOs are deleted.

◆ resetUniqueCSOLabelIdMap

void MLCSOListWrapper::resetUniqueCSOLabelIdMap ( )
inlineslot

Resets the data structure that is used to determine unique ids for cso labels.

Afterwards, unique ids are still generated. However these ids do not start with the highest previously assigned id. Instead, the first unused id is used. This behavior is identical to id assignment after loading of a stored CSOList.

◆ resetUniqueGroupLabelIdMap

void MLCSOListWrapper::resetUniqueGroupLabelIdMap ( )
inlineslot

Resets the data structure that is used to determine unique ids for group labels.

Afterwards, unique ids are still generated. However these ids do not start with the highest previously assigned id. Instead, the first unused id is used. This behavior is identical to id assignment after loading of a stored CSOList.

◆ saveTo

bool MLCSOListWrapper::saveTo ( const QString &  filename,
bool  binary 
) const
slot

Persistence Pipes the internal structure of a this list (CSOs and Groups) into the given file. Returns whether the operation was successful.

Possible messages can be read with lastLoadSaveMessage().

◆ setMaxNumUndos

bool MLCSOListWrapper::setMaxNumUndos ( int  maxNumUndos)
slot

Sets new stack size of the undo/redo manager. Return whether this was successful.

◆ undo

void MLCSOListWrapper::undo ( )
slot

Performs an undo of the last modification (if undo stack is not empty).

◆ unmuteEvents

void MLCSOListWrapper::unmuteEvents ( )
slot

Revokes a mute request.

If muteEvents was called multiple times, unmuteEvents has to be called the same number of times before events are sent again.

Property Documentation

◆ centerOfSelectedCSOs

QVariantList MLCSOListWrapper::centerOfSelectedCSOs
read

Property to read the centers of the selected CSOs.

◆ centerOfSelectedGroups

QVariantList MLCSOListWrapper::centerOfSelectedGroups
read

Property to read the centers of the selected Groups.

◆ numCSOGroups

unsigned int MLCSOListWrapper::numCSOGroups
read

◆ numCSOs

unsigned int MLCSOListWrapper::numCSOs
read

Property to read number of CSOs

◆ numGroups

unsigned int MLCSOListWrapper::numGroups
read

Property to read number of groups.

◆ numSelectedCSOs

unsigned int MLCSOListWrapper::numSelectedCSOs
read

Property to read number of selected CSOs.

◆ numSelectedGroups

unsigned int MLCSOListWrapper::numSelectedGroups
read

Property to read number of selected groups.