MeVisLab Scripting Reference
|
#include <mlCSOListWrapper.h>
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 | |
MLCSOWrapper * | addCSOCopy (MLCSOWrapper *csoWrapper, bool useUndoRedo=true) |
MLCSOWrapper * | addCSOCopy (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 () |
MLCSOListWrapper * | deepCopy () |
QVariantList | getCSOGroups () |
MLCSOWrapper * | getSelectedCSOAt (unsigned int index) const |
MLCSOGroupWrapper * | getSelectedGroupAt (unsigned int index) const |
QVariantList | getCenterOfSelectedCSOs () const |
QVariantList | getCenterOfSelectedGroups () const |
MLCSOWrapper * | getCSOAt (unsigned int idx) |
MLCSOWrapper * | getCSOById (unsigned int id) |
unsigned int | getCSOIndex (unsigned int id) |
MLCSOGroupWrapper * | getGroupAt (unsigned int idx) |
MLCSOGroupWrapper * | getGroupById (unsigned int id) |
MLCSOGroupWrapper * | getGroupByLabel (QString label) |
QList< unsigned int > | getCSOIdList () |
QList< unsigned int > | getGroupIdList () |
QList< unsigned int > | getSelectedCSOIdList () |
QList< unsigned int > | getSelectedGroupIdList () |
void | clearSelectedCSOs () |
void | clearSelectedGroups () |
void | clearSelectedSeedPoints () |
MLCSOWrapper * | getCSOCurrentlyUnderMouse () |
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) |
MLCSOGroupWrapper * | addGroup (const QString &label, bool useUndoRedo=true) |
MLCSOWrapper * | addCSO (const QVariantList &seedPoints, const QVariantList &pathPointLists, bool closed, bool useUndoRedo) |
MLCSOWrapper * | addPoint (const QVariantList &position, const QString &subtype="point") |
MLCSOWrapper * | addCircle (const QVariantList &midPoint, const QVariantList &normal, double radius, double pointDistanceInMM=1., const QString &subtype="circle") |
MLCSOWrapper * | addArrow (const QVariantList &pointAt, const QVariantList &direction, double length, double pointDistanceInMM=1., const QString &subtype="arrow") |
MLCSOWrapper * | addPolygon (const QVariantList &points, double pointDistanceInMM=1., const QString &subtype="polygon") |
MLCSOWrapper * | addPolyline (const QVariantList &points, double pointDistanceInMM=1., const QString &subtype="polyline") |
MLCSOWrapper * | addClosedSpline (const QVariantList &points, bool useInterpolation=true, double pointDistanceInMM=1., const QString &subtype="spline") |
MLCSOWrapper * | addOpenSpline (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 |
MLABModule * | getCSOManager () const |
Signals | |
void | csoEventReceived (QObject *csoEvent) |
Specialized event signals. The argument is always a CSOEventWrapper. | |
NOTE: These signals and their behavior are still preliminary.
|
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 |
A class that wraps CSOList objects for use in Scripting.
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.
|
slot |
Adds an arrow pointing to pointAt from direction with a length.
|
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.
|
slot |
Adds a spline interpolated closed polygon with the given points as seed points.
If useInterpolation is set to 'false', spline approximation is used.
|
slot |
Adds a new CSO with given seed- and path-points (list of list of points).
Example:
|
slot |
Adds a copy of the given CSO (which can be in another list) to this list and return its wrapper.
|
slot |
Adds a copy of the CSO with the given id to this list and returns its wrapper.
|
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
|
slot |
Adds a new group with given label to the list and returns its wrapper.
|
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.
|
slot |
Adds a spline interpolated open polygon with the given points as seed points.
If useInterpolation is set to 'false', spline approximation is used.
|
slot |
Methods to add CSOs of different types to the CSOList. Adds a point CSO at the given position.
|
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:
|
slot |
Adds a linearly interpolated open polyline with the given points as seed points.
|
slot |
Breaks all combinations of the given group and any CSO.
Returns false if the groupId is invalid.
|
slot |
Breaks the combination of the given CSO and the given group.
Returns false if either the csoID or the groupId is invalid.
|
slot |
Breaks all combinations of the given CSO and any group.
Returns false if the csoID is invalid.
|
slot |
Returns whether there are possible redoes.
|
slot |
Returns whether there are possible undoes.
|
inlineslot |
|
slot |
Clears all selected CSOs.
|
slot |
Clears all selected groups.
|
slot |
Clears all selected seed points of all CSOs.
|
slot |
Clears the undo/redo stack. Return whether this was successful.
|
inlineslot |
|
slot |
Closes a group of commands that are undone/redone as one.
|
slot |
Combines the given CSO with the given group.
Returns false if either the csoID or the groupId is invalid.
|
slot |
Copies the selected CSOs into a temporary list
|
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.
|
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.
|
slot |
Returns a deep copy of this list.
|
slot |
Remove notification callback: deregister the method determined by methodName of the given module for the CSO notifications defined by flags.
|
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.
|
slot |
Returns the center position of all bounding boxes of all selected CSOs.
Returns an empty list is no CSO is selected.
|
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.
|
slot |
Returns the CSO at the given position in the internal list.
|
slot |
Returns the CSO with the given unique id.
Returns NULL if no such CSO is stored in the list.
|
slot |
Returns the CSO currently under the mouse cursor.
|
slot |
|
slot |
Returns list of the current CSOs ids.
|
slot |
Returns the index of the CSO with the given id in its list.
|
inlineslot |
Returns the MLABModule of the CSOManager of the CSOList
|
slot |
Returns a list of CSOs.
|
slot |
Returns the current group depth of the undo stack for testing purposes.
Returns -1 if there is no undoRedo manager available.
|
slot |
Returns the group at the given index position.
|
slot |
Returns the group with the given id.
|
slot |
Returns the group with the given label.
|
slot |
Returns list of the current groups ids.
|
slot |
Returns a list of groups.
|
slot |
Returns the number of registered notification callbacks for given flag.
|
slot |
|
slot |
Returns the number of CSOs.
|
slot |
Returns the number of groups.
|
slot |
Returns the number of selected CSOs.
|
slot |
Returns the number of selectedGroups.
|
slot |
Returns the selected CSO at the given index; no checking!
|
slot |
Returns list of ids of the currently selected CSOs.
|
slot |
Returns the selected group at the given index; no checking!
|
slot |
Returns list of ids of the currently selected groups.
|
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.
|
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.
|
slot |
Returns whether the given CSO is currently selected.
If a CSOGroup is selected, its member CSOs are also marked as being selected.
|
slot |
Returns whether the given group is currently selected.
|
slot |
Return the messages from the last saveTo/loadFrom call.
|
slot |
Load content from QByteArray. Returns whether the buffer could be successfully deserialized.
|
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().
|
slot |
|
slot |
Prevent the CSOList from sending any CSOEvents until unmuteEvents is called
|
inlineslot |
Notifies all observers with this flag.
|
slot |
Opens a group of commands that are undone/redone as one.
|
slot |
Paste copied CSOs from temporary list into the list The returned list contains the ids of the pasted CSOs.
|
slot |
Performs a redo (if the undo stack is not empty).
|
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.
|
slot |
Removes all CSOs and Groups and resets all else.
Returns whether the operation was successful.
|
inlineslot |
Removes a CSO by its id and removes it from all groups.
|
slot |
Removes the CSO with the given id from the list of selected CSOs.
Returns whether the selection has been changed by this action
|
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.
|
inlineslot |
Removes a Group by its id and removes it from all CSOs.
|
slot |
Removes the group with the given id from the list of selected CSOs.
Returns whether the selection has been changed by this action.
|
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.
|
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.
|
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.
|
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().
|
slot |
Sets new stack size of the undo/redo manager. Return whether this was successful.
|
slot |
Performs an undo of the last modification (if undo stack is not empty).
|
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.
|
read |
Property to read the centers of the selected CSOs.
|
read |
Property to read the centers of the selected Groups.
|
read |
|
read |
Property to read number of CSOs
|
read |
Property to read number of groups.
|
read |
Property to read number of selected CSOs.
|
read |
Property to read number of selected groups.