MeVisLab Toolbox Reference
ml::CSOList Class Reference

A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation objects. More...

#include <CSOList.h>

Inheritance diagram for ml::CSOList:
ml::RefCountedBase ml::EventSource ml::Base

Classes

struct  CSONotificationCBData
 This struct combines a function pointer, a user data pointer and a flag for the notification observer mechanism. More...
 

Public Types

enum  NotificationType {
  NOTIFICATION_NONE = 0 , NOTIFICATION_CSO_SELECTION = 1 , NOTIFICATION_GROUP_SELECTION = 2 , NOTIFICATION_CSO_FINISHED = 4 ,
  NOTIFICATION_GROUP_FINISHED = 8 , NOTIFICATION_REPAINT = 16 , NOTIFICATION_INTERACTION_INIT = 32 , NOTIFICATION_START_NEW_CSO = 64 ,
  NOTIFICATION_CSO_MOVED = 128 , NOTIFICATION_CSO_UNDER_MOUSE_CHANGED = 256 , NOTIFICATION_UNDO_REDO_STATE_CHANGED = 512
}
 
- Public Types inherited from ml::Base
enum  PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream }
 This enum describes the different persistence interfaces available. More...
 

Public Member Functions

 CSOList ()
 Standard constructor. More...
 
 CSOList (bool shouldRegisterCSOList)
 
 CSOList (const CSOList &csoList)
 Copy constructor. More...
 
void clone (const CSOList &csoList, bool useUndoRedo=false)
 Clones the internal CSOs and CSOGroups of the given CSOList to this one. More...
 
void merge (const CSOList &csoList, bool mergeGroupWithSameLabel, CSOIdToCSOIdMap &origToThisGroupIdMap, CSOIdToCSOIdMap &origToThisCSOIdMap, bool useUndoRedo=false)
 Merges the internal CSOs and CSOGroups of the given CSOList to this one. More...
 
void merge (const CSOList &csoList, const CSOGroupMergeHandling mergeMode, CSOIdToCSOIdMap &origToThisGroupIdMap, CSOIdToCSOIdMap &origToThisCSOIdMap, bool useUndoRedo=false)
 Merges the internal CSOs and CSOGroups of the given CSOList to this one with the given merge mode. More...
 
bool saveTo (std::string &filename, bool binary, std::string &message, ModuleBackgroundTask *task=nullptr) const
 Pipes the internal structure of a this list (CSOs and Groups) into the given file. More...
 
bool saveTo (std::ostream &outStream, bool binary, ModuleBackgroundTask *task=nullptr) const
 Pipes the internal structure of a this list (CSOs and Groups) into the given stream. More...
 
bool loadFrom (std::string &filename, std::string &message, ModuleBackgroundTask *task=nullptr)
 Reads out the internal structure for this list (CSOs and Groups) from the given file. More...
 
bool loadFrom (std::istream &inStream, bool binary, std::string &message, ModuleBackgroundTask *task=nullptr)
 Reads out the internal structure for this list (CSOs and Groups) from the given stream. More...
 
void addNotificationObserver (csoNotificationCB *callback, void *userData)
 Adds a notification observer to this CSOList. More...
 
void removeNotificationObserver (csoNotificationCB *callback, void *userData)
 Removes a notification observer from this CSOList. More...
 
void notifyObservers (int notificationFlag)
 Notifies all observers. More...
 
void registerCSOListForNotificationObservers ()
 Registers this CSOList in the static list of CSOLists for handling observers. More...
 
void updateDisplays ()
 Updates all connected information/managing modules (not the renderers!). More...
 
CSOUndoRedoManagergetUndoRedoManager ()
 Returns a pointer to the undo/redo manager of this CSOList. More...
 
CSOManagergetManager ()
 Returns a pointer to the manager of this CSOList. More...
 
void setUndoRedoManager (CSOUndoRedoManager *undoRedoManager)
 Sets the internal undo/redo manager. More...
 
void setManager (CSOManager *manager)
 Sets the pointer to the internal manager and sets the group default rules. More...
 
unsigned int getCurrentCSOId ()
 Returns the current last id (incremented each call) for CSOs. More...
 
void updateCurrentCSOId (unsigned int newId)
 Updates the current id if the new id is bigger than the current id. More...
 
unsigned int getCurrentGroupId ()
 Returns the current last id (incremented each call) for CSOGroups. More...
 
void setCurrentCSOId (unsigned int id)
 Sets the current last id for CSOs. Do not mess with it. More...
 
void setCurrentGroupId (unsigned int id)
 Sets the current last id for Groups. Do not mess with it. More...
 
void updateCurrentGroupId (const unsigned int newId)
 Updates the current group id if the new id is bigger than the current id. More...
 
bool isSelected (const CSO *cso) const
 Returns whether the given CSO is currently selected. More...
 
bool isSelected (const CSOGroup *group) const
 Returns whether the given CSOGroup is currently selected. More...
 
void addSelected (CSO *cso)
 Adds the given CSO to the list of selected CSOs (no double entry). More...
 
void addSelected (CSOGroup *group)
 Adds the given CSOGroup to the list of selected CSOGroups (no double entry). More...
 
bool setSelected (CSO *cso)
 Sets the given CSO as being selected and deselects all other CSOs. More...
 
bool setSelected (CSOGroup *group)
 Set the given CSOGroup as being selected and deselects all other Groups. More...
 
void clearSelectedCSOs ()
 Clears all selected CSOs. More...
 
void clearSelectedGroups ()
 Clears all selected CSOGroups. More...
 
void clearSelectedSeedPoints ()
 Clears all selected seed points in all CSOs. More...
 
void removeFromSelection (CSO *cso)
 Removes the given CSO from the list of selected CSOs. More...
 
void removeFromSelection (const std::vector< CSO * > &csos)
 Removes the given CSOs from the list of selected CSOs. More...
 
void removeFromSelection (CSOGroup *group)
 Removes the given CSOGroup from the list of selected CSOGroups. More...
 
void removeFromSelection (const std::vector< CSOGroup * > &groups)
 Removes the given CSOGroups from the list of selected CSOGroups. More...
 
unsigned int numSelectedCSOs () const
 Returns the number of selected CSOs. More...
 
unsigned int numSelectedGroups () const
 Returns the number of selected CSOGroups. More...
 
CSOgetSelectedCSOAt (unsigned int index) const
 Returns a pointer to the selected CSO at the given index; no checking! More...
 
CSOGroupgetSelectedGroupAt (unsigned int index) const
 Returns a pointer to the selected CSOGroup at the given index; no checking! More...
 
CSOIdVector getSelectedCSOIds ()
 Returns a vector with ids of the selected CSOs. More...
 
CSOIdVector getSelectedGroupIds ()
 Returns a vector with ids of the selected groups. More...
 
Vector3 getCenterOfSelectedCSOs (bool &resultIsValid) const
 Returns the center position of all bounding boxes of all selected CSOs. More...
 
Vector3 getCenterOfSelectedGroups (bool &resultIsValid) const
 Returns the center position of all bounding boxes of all CSOs of all selected CSOGroups. More...
 
CSOgetCSOCurrentlyUnderMouse () const
 Returns the pointer to the CSO currently under the mouse cursor. More...
 
void setCSOCurrentlyUnderMouse (CSO *csoUnderMouse)
 Sets the pointer to the CSO currently under the mouse cursor. More...
 
Vector3 getCenterOfSelectedCSOs () const
 /deprecated Returns the center position of all bounding boxes of all selected CSOs. More...
 
Vector3 getCenterOfSelectedGroups () const
 /deprecated Returns the center position of all bounding boxes of all CSOs of all selected CSOGroups. More...
 
CSOaddCSO (bool useUndoRedo=true)
 Adds a new CSO to the list and returns its pointer. More...
 
CSOaddCSONoEvent (bool useUndoRedo=true)
 Adds a new CSO to the list and returns its pointer. (Without sending any events). More...
 
CSOaddCSO (const std::vector< Vector3 > &seedPositions, bool closed, bool useUndoRedo)
 Adds a new CSO to the list and returns its pointer. More...
 
CSOaddCSO (unsigned int numSeedPoints, bool closed, bool useUndoRedo)
 Adds a new CSO to the list and returns its pointer. More...
 
CSOaddCSOCopy (CSO *cso, bool useUndoRedo=true, unsigned int csoId=INVALID_CSO_ID)
 Adds a copy of the given CSO to the list and returns a pointer to it. More...
 
CSOGroupaddGroup (bool useUndoRedo=true)
 Adds a new Group to the list and returns a pointer to it. More...
 
CSOGroupaddGroup (const std::string &label, bool useUndoRedo=true)
 Adds a new Group with given label to the list and returns a pointer to it. More...
 
CSOGroupaddGroupCopy (CSOGroup *group, bool useUndoRedo=true, unsigned int groupId=INVALID_CSO_ID)
 Adds a copy of the given Group to this list and returns a pointer to it. More...
 
CSOaddPoint (const Vector3 &position, const std::string &subtype="point")
 Adds a point CSO at the given position. More...
 
CSOaddCircle (const Vector3 &midPoint, const Vector3 &normal, double radius, double pointDistanceInMM=1., const std::string &subtype="circle")
 Adds a circle CSO with its midPoint at the given position and a given radius. More...
 
CSOaddArrow (const Vector3 &pointAt, const Vector3 &direction, double length, double pointDistanceInMM=1., const std::string &subtype="arrow")
 Adds an arrow pointing to pointAt from direction with a length. More...
 
CSOaddPolygon (const std::vector< Vector3 > &points, double pointDistanceInMM=1., const std::string &subtype="polygon")
 Adds a linearly interpolated closed polygon with the given points as seed points. More...
 
CSOaddPolyline (const std::vector< Vector3 > &points, double pointDistanceInMM=1., const std::string &subtype="polyline")
 Adds a linearly interpolated open polyline with the given points as seed points. More...
 
CSOaddClosedSpline (const std::vector< Vector3 > &points, bool useInterpolation=true, double pointDistanceInMM=1., const std::string &subtype="spline")
 Adds a spline interpolated closed polygon with the given points as seed points. More...
 
CSOaddOpenSpline (const std::vector< Vector3 > &points, bool useInterpolation=true, double pointDistanceInMM=1., const std::string &subtype="spline")
 Adds a spline interpolated open polygon with the given points as seed points. More...
 
bool removeCSO (CSO *cso, bool useUndoRedo=true)
 Removes a given CSO from the list and from Groups it is in. More...
 
bool removeCSO (unsigned int id, bool useUndoRedo=true)
 Removes a CSO by its id and removes it from all Groups. More...
 
bool removeAllCSO (bool useUndoRedo=true)
 Removes all CSOs from the list and from all Groups they are in. More...
 
bool removeGroup (CSOGroup *group, bool useUndoRedo=true)
 Removes the given Group and removes the group from all CSOs. More...
 
bool removeGroup (unsigned int id, bool useUndoRedo=true)
 Removes a Group by its id and removes it from all CSOs. More...
 
bool removeAllGroups (bool useUndoRedo)
 Removes all Groups and all groups from all CSOs. More...
 
bool removeGroups (const std::vector< CSOGroup * > &groupsToRemove, bool useUndoRedo=true)
 Removes all Groups with given ids and removes them from CSOs Returns whether the operation was successful. More...
 
bool removeAll (bool useUndoRedo=true)
 Removes all CSOs and Groups and resets all else. More...
 
CSOgetCSOAt (unsigned int index) const
 Returns a pointer to the CSO at the given position in the internal list. More...
 
CSOgetCSOById (unsigned int id) const
 Returns a pointer to the CSO with the given unique id. More...
 
CSOgetCSOByLabel (const std::string &label) const
 Returns a pointer to the first CSO with the given label. More...
 
unsigned int getCSOIndex (CSO *cso) const
 Returns the index of the given CSO in its list. More...
 
unsigned int getCSOIndex (unsigned int id) const
 Returns the index of the CSO with the given id in its list. More...
 
bool hasCSO (CSO *cso) const
 Returns whether there is the given CSO in the list. More...
 
CSOGroupgetGroupById (unsigned int id) const
 Returns a pointer to a Group with the given id. More...
 
CSOGroupgetGroupByLabel (const std::string &label) const
 Returns a pointer to a Group with the given label. More...
 
CSOGroupgetGroupAt (unsigned int index) const
 Returns Group at the given index position. More...
 
unsigned int getGroupIndex (CSOGroup *group) const
 Returns the index of the given Group in its list. More...
 
unsigned int getGroupIndex (unsigned int id) const
 Returns the index of the Group with the given id in its list. More...
 
bool hasGroup (CSOGroup *group) const
 Returns whether there is the given CSOGroup in the list. More...
 
std::string getUniqueCSOLabel (std::string label, std::string format, bool addIdAlways)
 Returns a unique cso label that includes the given label and combines it with a unique id using the given format. More...
 
std::string getUniqueGroupLabel (std::string label, std::string format, bool addIdAlways)
 Returns a unique group label that includes the given label and combines it with a unique id using the given format. More...
 
void resetUniqueCSOLabelIdMap ()
 Resets the data structure that is used to determine unique ids for getUniqueCSOLabel. More...
 
void resetUniqueGroupLabelIdMap ()
 Resets the data structure that is used to determine unique ids for getUniqueCSOLabel Afterwards, unique ids are still generated. More...
 
bool combineCSOandGroup (CSO *cso, CSOGroup *group, bool useUndoRedo=true)
 Combines the given CSO with the given Group. More...
 
void breakCSOandGroup (CSO *cso, CSOGroup *group, bool useUndoRedo=true)
 Breaks the combination of the given CSO and the given Group. More...
 
void breakCSOfromAllGroups (CSO *cso, bool useUndoRedo=true)
 Breaks all combinations of the given CSO and any Group. More...
 
void breakAllCSOsFromGroup (CSOGroup *group, bool useUndoRedo=true)
 Breaks all combinations of the given Group and any CSO. More...
 
void _addGroupRelationCommand (CSO *cso, CSOGroup *group)
 helper method to be used only inside MLCSO More...
 
unsigned int numCSOs () const
 Returns the number of CSOs in the list. More...
 
unsigned int numGroups () const
 Returns the number of CSOGroups. More...
 
CSOIdVector getAllCSOIds () const
 Returns a vector with the ids of the CSOs contained in the list. More...
 
CSOIdVector getAllGroupIds () const
 Returns a vector with the ids of the groups contained in the list. More...
 
void undo ()
 Performs an undo of the last modification. More...
 
void redo ()
 Performs a redo of the last undone modification. More...
 
void enableUndoRedoManager ()
 Enables the undo/redo mechanism. More...
 
void disableUndoRedoManager ()
 Enables the undo/redo mechanism. More...
 
void sendOpenEventGroup ()
 Sends a CSOLIST_EVENT_GROUP_OPEN event to let listeners combine following events. More...
 
void sendCloseEventGroup ()
 Sends a CSOLIST_EVENT_GROUP_CLOSE event to let listeners combine preceding events.. More...
 
void sendModuleEventGroup (CSOEvent *event)
 Sends a module group event. More...
 
void sendPreEvent (CSOEvent::CSOEventType eventType)
 Sends a pre-event with the given event type. More...
 
void sendPreEvent (CSOEvent::CSOEventType eventType, unsigned int csoId)
 Sends a pre-event with the given event type and the CSO id. More...
 
void sendPreEvent (CSOEvent::CSOEventType eventType, unsigned int csoId, const CSOIdVector &groupIds)
 Sends a post-event with the given type, CSO id, and Group ids. More...
 
void sendPreEvent (CSOEvent::CSOEventType eventType, unsigned int csoId, unsigned int groupId)
 Sends a pre-event with the given type, CSO id, and Group id. More...
 
void sendPreEvent (CSOEvent::CSOEventType eventType, const CSOIdVector &csoIds)
 Sends a pre-event with the given event type and the CSO ids. More...
 
void sendPreEvent (CSOEvent::CSOEventType eventType, const CSOIdVector &csoIds, const CSOIdVector &groupIds)
 Sends a pre-event with the given event type, CSO ids, and Group ids. More...
 
void sendPostEvent (CSOEvent::CSOEventType eventType)
 Sends a post-event with the given event type. More...
 
void sendPostEvent (CSOEvent::CSOEventType eventType, unsigned int csoId)
 Sends a post-event with the given type and CSO id. More...
 
void sendPostEvent (CSOEvent::CSOEventType eventType, unsigned int csoId, unsigned int groupId)
 Sends a post-event with the given type, CSO id, and Group id. More...
 
void sendPostEvent (CSOEvent::CSOEventType eventType, const CSOIdVector &csoIds)
 Sends a post-event with the given type and CSO ids. More...
 
void sendPostEvent (CSOEvent::CSOEventType eventType, unsigned int csoId, const CSOIdVector &groupIds)
 Sends a post-event with the given type, CSO id, and Group ids. More...
 
void sendPostEvent (CSOEvent::CSOEventType eventType, const CSOIdVector &csoIds, const CSOIdVector &groupIds)
 Sends a post-event with the given type, CSO ids, and Group ids. More...
 
void muteEvents ()
 Prevent the CSOList from sending any CSOEvents until unmuteEvents is called. More...
 
void unmuteEvents ()
 Revokes a mute request. More...
 
bool isNotMutingEvents ()
 whether CSOEvents are currently emitted More...
 
MLuint64 getListChangeId () const
 Get the list change id, which changes whenever a CSO is added or removed (unique accross all CSOLists). More...
 
MLuint64 getGeometryChangeId () const
 Get the geometry change id, which changes on any CSO geometry change or list change (unique accross all CSOLists). More...
 
void listChanged ()
 Called whenever the list has changed to generate a new id. This also changes the geometry id. More...
 
void geometryChanged ()
 Called whenever the geometry of a CSO has changed. More...
 
void enableRepaintObserver ()
 Enables the repaint observer mechanism. More...
 
void disableRepaintObserver ()
 Disables the repaint observer mechanism. More...
 
void enableFinishedObserver ()
 Enables the finished observer mechanism. More...
 
void disableFinishedObserver ()
 Disables the finished observer mechanism. More...
 
void enableInteractionObserver ()
 Enables the interaction observer mechanism. More...
 
void disableInteractionObserver ()
 Disables the interaction observer mechanism. More...
 
void enableSelectionObserver ()
 Enables the selection observer mechanism. More...
 
void disableSelectionObserver ()
 Disables the selection observer mechanism. More...
 
void enableStartNewCSOObserver ()
 Enables the 'start new CSO' observer mechanism. More...
 
void disableStartNewCSOObserver ()
 Disables the 'start new CSO' observer mechanism. More...
 
void enableCSOMovedObserver ()
 Enables the 'CSO moved' observer mechanism. More...
 
void disableCSOMovedObserver ()
 Disables the 'CSO moved' observer mechanism. More...
 
void enableCSOCurrentlyUnderMouseObserver ()
 Enables the 'CSO currently under mouse' observer mechanism. More...
 
void disableCSOCurrentlyUnderMouseObserver ()
 Disables the 'CSO currently under mouse' observer mechanism. More...
 
bool isUndoRedoManagerEnabled () const
 Returns 'true' if the undo/redo mechanism is enabled, 'false' otherwise. More...
 
void openUndoRedoGroup (const std::string &description="Contour Operation")
 Opens a undo/redo group. All undoable commands after this are grouped together. More...
 
void closeUndoRedoGroup ()
 Closes a undo/redo group. All undoable commands before this are grouped together. More...
 
bool isRepaintNotificationEnabled () const
 Returns whether the repaint notification is enabled. More...
 
bool isFinishedNotificationEnabled () const
 Returns whether the finished notification is enabled. More...
 
bool isInteractionInitNotificationEnabled () const
 Returns whether the interaction init notification is enabled. More...
 
bool isSelectionNotificationEnabled () const
 Returns whether the selection notification is enabled. More...
 
bool isStartNewCSONotificationEnabled () const
 Returns whether the 'start new CSO' notification is enabled. More...
 
bool isCSOMovedNotificationEnabled () const
 Returns whether the 'CSO moved' notification is enabled. More...
 
bool isCSOCurrentlyUnderMouseNotificationEnabled () const
 Returns whether the 'CSO currently under mouse' notification is enabled. More...
 
CSOListRulesgetRules ()
 Return the rules for this CSOList. More...
 
void addStateToTree (TreeNode *) const override
 Attaches the object state as children of the given parent node. More...
 
void readStateFromTree (TreeNode *) override
 Reads the object state from the children of the given parent node. More...
 
 ML_SET_ADDSTATE_VERSION (1)
 
CSOListdeepCopy () const override
 Create a deep copy of the CSOList. More...
 
- Public Member Functions inherited from ml::RefCountedBase
 RefCountedBase ()
 Constructor. More...
 
 RefCountedBase (const RefCountedBase &)
 Explicit copy constructor. More...
 
virtual void incRefCount () const
 Increase reference count. More...
 
virtual void decRefCount () const
 Decrease ref count (object will be deleted if ref count is decremented to 0) More...
 
bool isRefCountedBase () const override
 Returns if the instance is derived from RefCountedBase. More...
 
- Public Member Functions inherited from ml::EventSource
 EventSource ()
 
 EventSource (const EventSource &evSource)
 
 ~EventSource () override
 
void addEventListener (BaseEventCallback *cb, void *userData)
 add event listener callback to this Base object - the userData will be the first argument when the callback is called More...
 
void removeEventListener (BaseEventCallback *cb, void *userData)
 remove event listener callback from this Base object - arguments must be the same as for the addEventListener call More...
 
bool hasEventListeners () const
 check if any event listeners have been added to this Base object; this can be used to skip the sendEvent call (and the potentially expensive building of the event object) altogether More...
 
- Public Member Functions inherited from ml::Base
 Base ()
 Constructor. More...
 
virtual ~Base ()
 Destructor. More...
 
bool isOfAllowedType (const std::vector< const RuntimeType * > &types) const
 Check if this object's type is equal to or derived from one of the types given in the argument. More...
 
virtual std::string detailString () const
 Return a string describing this object. More...
 
virtual bool implementsPersistence (PersistenceInterface) const
 Override this method to declare which persistence interfaces are implemented by your derived class. More...
 
virtual std::string persistentState () const
 Returns a string describing the object's internal state. More...
 
virtual void setPersistentState (const std::string &state)
 Restores the object's internal state from a string that had been previously generated using persistentState(). More...
 
virtual void writeTo (AbstractPersistenceOutputStream *) const
 Write the objects state to the data stream object. More...
 
virtual void readFrom (AbstractPersistenceInputStream *, int)
 Read the objects state from the data stream object. More...
 

Static Public Member Functions

static void removeNotificationObserverFromAllCSOLists (csoNotificationCB *callback, void *userData)
 Removes a certain notification observer from all CSOLists. More...
 
static void alignSeedPathLinks (CSO *cso)
 Aligns seed point positions with path point lists of a given CSO by a squared distance sum criterion. More...
 
static EnumValues< CSOPathPointsStylegetLineStyleModes ()
 
static EnumValues< CSOSeedPointStylegetSeedPointStyles ()
 
static EnumValues< CSOVoxelWriteModesgetVoxelWriteModes ()
 
- Static Public Member Functions inherited from ml::RefCountedBase
static void updateReferenceCountingIfSupported (Base *oldValue, Base *newValue, bool &isRefCountedBase)
 Helper method that handles inc/dec of ref count if base instances support it. More...
 

Protected Member Functions

 ~CSOList () override
 The CSOList destructor is protected since the CSOList ownership is managed by the CSOListPtr intrusive smart pointer. More...
 
void setupCSOList ()
 
- Protected Member Functions inherited from ml::RefCountedBase
 ~RefCountedBase () override
 Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass.h. More...
 
- Protected Member Functions inherited from ml::EventSource
void sendEvent (BaseEvent *event, void *skipListener=nullptr)
 Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass.h. More...
 
- Protected Member Functions inherited from ml::Base
virtual char * getPersistentState () const
 Returns a C string describing the object's internal state. More...
 
virtual void setPersistentState (const char *)
 Restores the object's internal state from a string that had been previously generated using getPersistentState(). More...
 
virtual void clearPersistentState (char *) const
 Disposes a string previously allocated by getPersistentState(). More...
 

Friends

class CSOLoad
 

Additional Inherited Members

- Protected Attributes inherited from ml::RefCountedBase
MLint32 _refCount
 Reference count. More...
 

Detailed Description

A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation objects.

The CSOList is derived from Base and can be used as a data structure in a MeVisLab network. The CSOList has also a CSOUndoRedoManager as a member. The CSOList ownership is managed via smart pointers, make sure to use a CSOListPtr so manage newly created CSOList objects.

Definition at line 60 of file CSOList.h.

Member Enumeration Documentation

◆ NotificationType

Enumerator
NOTIFICATION_NONE 

Flag for the observer mechanism, signalizing no notification at all.

NOTIFICATION_CSO_SELECTION 

Flag for the observer mechanism, should be set if a CSO selection changes.

NOTIFICATION_GROUP_SELECTION 

Flag for the observer mechanism, should be set if a CSOGroup selection changes.

NOTIFICATION_CSO_FINISHED 

Flag for the observer mechanism, should be set if a CSO action is finished.

NOTIFICATION_GROUP_FINISHED 

Flag for the observer mechanism, should be set if a CSOGroup action is finished.

NOTIFICATION_REPAINT 

Flag for the observer mechanism, should be set if a repaint should occur.

NOTIFICATION_INTERACTION_INIT 

Flag for the observer mechanism, should be set if the interaction must be initialized.

NOTIFICATION_START_NEW_CSO 

Flag for the observer mechanism, signalizing that the generation of a new CSO has been started.

NOTIFICATION_CSO_MOVED 

Flag for the observer mechanism, should be set if a CSO was moved.

NOTIFICATION_CSO_UNDER_MOUSE_CHANGED 

Flag for the observer mechanism, should be set if the CSO under the mouse cursor changes.

NOTIFICATION_UNDO_REDO_STATE_CHANGED 

Flag for the observer mechanism, should be set if the availability of undo/redo steps changes.

Definition at line 572 of file CSOList.h.

Constructor & Destructor Documentation

◆ CSOList() [1/3]

ml::CSOList::CSOList ( )

Standard constructor.

◆ CSOList() [2/3]

ml::CSOList::CSOList ( bool  shouldRegisterCSOList)

◆ CSOList() [3/3]

ml::CSOList::CSOList ( const CSOList csoList)

Copy constructor.

◆ ~CSOList()

ml::CSOList::~CSOList ( )
overrideprotected

The CSOList destructor is protected since the CSOList ownership is managed by the CSOListPtr intrusive smart pointer.

If you encounter code that tries to delete a CSOList object, you will very likely need to change the usage of a CSOList* to a CSOListPtr and replace the delete call with a NULL assignment.

Member Function Documentation

◆ _addGroupRelationCommand()

void ml::CSOList::_addGroupRelationCommand ( CSO cso,
CSOGroup group 
)

helper method to be used only inside MLCSO

◆ addArrow()

CSO* ml::CSOList::addArrow ( const Vector3 pointAt,
const Vector3 direction,
double  length,
double  pointDistanceInMM = 1.,
const std::string &  subtype = "arrow" 
)

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

◆ addCircle()

CSO* ml::CSOList::addCircle ( const Vector3 midPoint,
const Vector3 normal,
double  radius,
double  pointDistanceInMM = 1.,
const std::string &  subtype = "circle" 
)

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()

CSO* ml::CSOList::addClosedSpline ( const std::vector< Vector3 > &  points,
bool  useInterpolation = true,
double  pointDistanceInMM = 1.,
const std::string &  subtype = "spline" 
)

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

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

◆ addCSO() [1/3]

CSO* ml::CSOList::addCSO ( bool  useUndoRedo = true)

Adds a new CSO to the list and returns its pointer.

◆ addCSO() [2/3]

CSO* ml::CSOList::addCSO ( const std::vector< Vector3 > &  seedPositions,
bool  closed,
bool  useUndoRedo 
)

Adds a new CSO to the list and returns its pointer.

The given positions are used as seed point positions.

◆ addCSO() [3/3]

CSO* ml::CSOList::addCSO ( unsigned int  numSeedPoints,
bool  closed,
bool  useUndoRedo 
)

Adds a new CSO to the list and returns its pointer.

The resulting CSO has as many seed points as stated.

◆ addCSOCopy()

CSO* ml::CSOList::addCSOCopy ( CSO cso,
bool  useUndoRedo = true,
unsigned int  csoId = INVALID_CSO_ID 
)

Adds a copy of the given CSO to the list and returns a pointer to it.

◆ addCSONoEvent()

CSO* ml::CSOList::addCSONoEvent ( bool  useUndoRedo = true)

Adds a new CSO to the list and returns its pointer. (Without sending any events).

◆ addGroup() [1/2]

CSOGroup* ml::CSOList::addGroup ( bool  useUndoRedo = true)

Adds a new Group to the list and returns a pointer to it.

◆ addGroup() [2/2]

CSOGroup* ml::CSOList::addGroup ( const std::string &  label,
bool  useUndoRedo = true 
)

Adds a new Group with given label to the list and returns a pointer to it.

◆ addGroupCopy()

CSOGroup* ml::CSOList::addGroupCopy ( CSOGroup group,
bool  useUndoRedo = true,
unsigned int  groupId = INVALID_CSO_ID 
)

Adds a copy of the given Group to this list and returns a pointer to it.

Note that this method does not set the 'this' pointer as a new CSOList.

◆ addNotificationObserver()

void ml::CSOList::addNotificationObserver ( csoNotificationCB callback,
void *  userData 
)

Adds a notification observer to this CSOList.

◆ addOpenSpline()

CSO* ml::CSOList::addOpenSpline ( const std::vector< Vector3 > &  points,
bool  useInterpolation = true,
double  pointDistanceInMM = 1.,
const std::string &  subtype = "spline" 
)

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

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

◆ addPoint()

CSO* ml::CSOList::addPoint ( const Vector3 position,
const std::string &  subtype = "point" 
)

Adds a point CSO at the given position.

◆ addPolygon()

CSO* ml::CSOList::addPolygon ( const std::vector< Vector3 > &  points,
double  pointDistanceInMM = 1.,
const std::string &  subtype = "polygon" 
)

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

◆ addPolyline()

CSO* ml::CSOList::addPolyline ( const std::vector< Vector3 > &  points,
double  pointDistanceInMM = 1.,
const std::string &  subtype = "polyline" 
)

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

◆ addSelected() [1/2]

void ml::CSOList::addSelected ( CSO cso)

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

◆ addSelected() [2/2]

void ml::CSOList::addSelected ( CSOGroup group)

Adds the given CSOGroup to the list of selected CSOGroups (no double entry).

◆ addStateToTree()

void ml::CSOList::addStateToTree ( TreeNode ) const
overridevirtual

Attaches the object state as children of the given parent node.

Reimplemented from ml::Base.

◆ alignSeedPathLinks()

static void ml::CSOList::alignSeedPathLinks ( CSO cso)
static

Aligns seed point positions with path point lists of a given CSO by a squared distance sum criterion.

◆ breakAllCSOsFromGroup()

void ml::CSOList::breakAllCSOsFromGroup ( CSOGroup group,
bool  useUndoRedo = true 
)

Breaks all combinations of the given Group and any CSO.

◆ breakCSOandGroup()

void ml::CSOList::breakCSOandGroup ( CSO cso,
CSOGroup group,
bool  useUndoRedo = true 
)

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

◆ breakCSOfromAllGroups()

void ml::CSOList::breakCSOfromAllGroups ( CSO cso,
bool  useUndoRedo = true 
)

Breaks all combinations of the given CSO and any Group.

◆ clearSelectedCSOs()

void ml::CSOList::clearSelectedCSOs ( )

Clears all selected CSOs.

◆ clearSelectedGroups()

void ml::CSOList::clearSelectedGroups ( )

Clears all selected CSOGroups.

◆ clearSelectedSeedPoints()

void ml::CSOList::clearSelectedSeedPoints ( )

Clears all selected seed points in all CSOs.

◆ clone()

void ml::CSOList::clone ( const CSOList csoList,
bool  useUndoRedo = false 
)

Clones the internal CSOs and CSOGroups of the given CSOList to this one.

◆ closeUndoRedoGroup()

void ml::CSOList::closeUndoRedoGroup ( )

Closes a undo/redo group. All undoable commands before this are grouped together.

◆ combineCSOandGroup()

bool ml::CSOList::combineCSOandGroup ( CSO cso,
CSOGroup group,
bool  useUndoRedo = true 
)

Combines the given CSO with the given Group.

◆ deepCopy()

CSOList* ml::CSOList::deepCopy ( ) const
inlineoverridevirtual

Create a deep copy of the CSOList.

Reimplemented from ml::Base.

Definition at line 613 of file CSOList.h.

◆ disableCSOCurrentlyUnderMouseObserver()

void ml::CSOList::disableCSOCurrentlyUnderMouseObserver ( )
inline

Disables the 'CSO currently under mouse' observer mechanism.

Definition at line 533 of file CSOList.h.

◆ disableCSOMovedObserver()

void ml::CSOList::disableCSOMovedObserver ( )
inline

Disables the 'CSO moved' observer mechanism.

Definition at line 528 of file CSOList.h.

◆ disableFinishedObserver()

void ml::CSOList::disableFinishedObserver ( )
inline

Disables the finished observer mechanism.

Definition at line 508 of file CSOList.h.

◆ disableInteractionObserver()

void ml::CSOList::disableInteractionObserver ( )
inline

Disables the interaction observer mechanism.

Definition at line 513 of file CSOList.h.

◆ disableRepaintObserver()

void ml::CSOList::disableRepaintObserver ( )
inline

Disables the repaint observer mechanism.

Definition at line 503 of file CSOList.h.

◆ disableSelectionObserver()

void ml::CSOList::disableSelectionObserver ( )
inline

Disables the selection observer mechanism.

Definition at line 518 of file CSOList.h.

◆ disableStartNewCSOObserver()

void ml::CSOList::disableStartNewCSOObserver ( )
inline

Disables the 'start new CSO' observer mechanism.

Definition at line 523 of file CSOList.h.

◆ disableUndoRedoManager()

void ml::CSOList::disableUndoRedoManager ( )

Enables the undo/redo mechanism.

◆ enableCSOCurrentlyUnderMouseObserver()

void ml::CSOList::enableCSOCurrentlyUnderMouseObserver ( )
inline

Enables the 'CSO currently under mouse' observer mechanism.

Definition at line 531 of file CSOList.h.

◆ enableCSOMovedObserver()

void ml::CSOList::enableCSOMovedObserver ( )
inline

Enables the 'CSO moved' observer mechanism.

Definition at line 526 of file CSOList.h.

◆ enableFinishedObserver()

void ml::CSOList::enableFinishedObserver ( )
inline

Enables the finished observer mechanism.

Definition at line 506 of file CSOList.h.

◆ enableInteractionObserver()

void ml::CSOList::enableInteractionObserver ( )
inline

Enables the interaction observer mechanism.

Definition at line 511 of file CSOList.h.

◆ enableRepaintObserver()

void ml::CSOList::enableRepaintObserver ( )
inline

Enables the repaint observer mechanism.

Definition at line 501 of file CSOList.h.

◆ enableSelectionObserver()

void ml::CSOList::enableSelectionObserver ( )
inline

Enables the selection observer mechanism.

Definition at line 516 of file CSOList.h.

◆ enableStartNewCSOObserver()

void ml::CSOList::enableStartNewCSOObserver ( )
inline

Enables the 'start new CSO' observer mechanism.

Definition at line 521 of file CSOList.h.

◆ enableUndoRedoManager()

void ml::CSOList::enableUndoRedoManager ( )
inline

Enables the undo/redo mechanism.

Definition at line 434 of file CSOList.h.

◆ geometryChanged()

void ml::CSOList::geometryChanged ( )

Called whenever the geometry of a CSO has changed.

◆ getAllCSOIds()

CSOIdVector ml::CSOList::getAllCSOIds ( ) const

Returns a vector with the ids of the CSOs contained in the list.

◆ getAllGroupIds()

CSOIdVector ml::CSOList::getAllGroupIds ( ) const

Returns a vector with the ids of the groups contained in the list.

◆ getCenterOfSelectedCSOs() [1/2]

Vector3 ml::CSOList::getCenterOfSelectedCSOs ( ) const
inline

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

Definition at line 260 of file CSOList.h.

References CSO_DEBUG.

◆ getCenterOfSelectedCSOs() [2/2]

Vector3 ml::CSOList::getCenterOfSelectedCSOs ( bool &  resultIsValid) const

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

'resultIsValid' is false if there are no selected CSOs available.

◆ getCenterOfSelectedGroups() [1/2]

Vector3 ml::CSOList::getCenterOfSelectedGroups ( ) const
inline

/deprecated Returns the center position of all bounding boxes of all CSOs of all selected CSOGroups.

Definition at line 268 of file CSOList.h.

References CSO_DEBUG.

◆ getCenterOfSelectedGroups() [2/2]

Vector3 ml::CSOList::getCenterOfSelectedGroups ( bool &  resultIsValid) const

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

'resultIsValid' is false if there are no selected groups available.

◆ getCSOAt()

CSO* ml::CSOList::getCSOAt ( unsigned int  index) const

Returns a pointer to the CSO at the given position in the internal list.

◆ getCSOById()

CSO* ml::CSOList::getCSOById ( unsigned int  id) const

Returns a pointer to the CSO with the given unique id.

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

◆ getCSOByLabel()

CSO* ml::CSOList::getCSOByLabel ( const std::string &  label) const

Returns a pointer to the first CSO with the given label.

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

◆ getCSOCurrentlyUnderMouse()

CSO* ml::CSOList::getCSOCurrentlyUnderMouse ( ) const
inline

Returns the pointer to the CSO currently under the mouse cursor.

Definition at line 253 of file CSOList.h.

◆ getCSOIndex() [1/2]

unsigned int ml::CSOList::getCSOIndex ( CSO cso) const

Returns the index of the given CSO in its list.

◆ getCSOIndex() [2/2]

unsigned int ml::CSOList::getCSOIndex ( unsigned int  id) const

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

◆ getCurrentCSOId()

unsigned int ml::CSOList::getCurrentCSOId ( )

Returns the current last id (incremented each call) for CSOs.

If there are no CSOs in the list, this id is set back to 0.

◆ getCurrentGroupId()

unsigned int ml::CSOList::getCurrentGroupId ( )

Returns the current last id (incremented each call) for CSOGroups.

If there are no CSOGroups in the list, this id is set back to 0.

◆ getGeometryChangeId()

MLuint64 ml::CSOList::getGeometryChangeId ( ) const
inline

Get the geometry change id, which changes on any CSO geometry change or list change (unique accross all CSOLists).

Definition at line 492 of file CSOList.h.

◆ getGroupAt()

CSOGroup* ml::CSOList::getGroupAt ( unsigned int  index) const

Returns Group at the given index position.

◆ getGroupById()

CSOGroup* ml::CSOList::getGroupById ( unsigned int  id) const

Returns a pointer to a Group with the given id.

◆ getGroupByLabel()

CSOGroup* ml::CSOList::getGroupByLabel ( const std::string &  label) const

Returns a pointer to a Group with the given label.

◆ getGroupIndex() [1/2]

unsigned int ml::CSOList::getGroupIndex ( CSOGroup group) const

Returns the index of the given Group in its list.

◆ getGroupIndex() [2/2]

unsigned int ml::CSOList::getGroupIndex ( unsigned int  id) const

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

◆ getLineStyleModes()

static EnumValues<CSOPathPointsStyle> ml::CSOList::getLineStyleModes ( )
static

◆ getListChangeId()

MLuint64 ml::CSOList::getListChangeId ( ) const
inline

Get the list change id, which changes whenever a CSO is added or removed (unique accross all CSOLists).

Definition at line 490 of file CSOList.h.

◆ getManager()

CSOManager* ml::CSOList::getManager ( )
inline

Returns a pointer to the manager of this CSOList.

Definition at line 149 of file CSOList.h.

◆ getRules()

CSOListRules& ml::CSOList::getRules ( )
inline

Return the rules for this CSOList.

Definition at line 601 of file CSOList.h.

◆ getSeedPointStyles()

static EnumValues<CSOSeedPointStyle> ml::CSOList::getSeedPointStyles ( )
static

◆ getSelectedCSOAt()

CSO* ml::CSOList::getSelectedCSOAt ( unsigned int  index) const
inline

Returns a pointer to the selected CSO at the given index; no checking!

Definition at line 222 of file CSOList.h.

◆ getSelectedCSOIds()

CSOIdVector ml::CSOList::getSelectedCSOIds ( )

Returns a vector with ids of the selected CSOs.

◆ getSelectedGroupAt()

CSOGroup* ml::CSOList::getSelectedGroupAt ( unsigned int  index) const
inline

Returns a pointer to the selected CSOGroup at the given index; no checking!

Definition at line 231 of file CSOList.h.

◆ getSelectedGroupIds()

CSOIdVector ml::CSOList::getSelectedGroupIds ( )

Returns a vector with ids of the selected groups.

◆ getUndoRedoManager()

CSOUndoRedoManager* ml::CSOList::getUndoRedoManager ( )
inline

Returns a pointer to the undo/redo manager of this CSOList.

Definition at line 147 of file CSOList.h.

◆ getUniqueCSOLabel()

std::string ml::CSOList::getUniqueCSOLabel ( std::string  label,
std::string  format,
bool  addIdAlways 
)

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()

std::string ml::CSOList::getUniqueGroupLabel ( std::string  label,
std::string  format,
bool  addIdAlways 
)

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.

◆ getVoxelWriteModes()

static EnumValues<CSOVoxelWriteModes> ml::CSOList::getVoxelWriteModes ( )
static

◆ hasCSO()

bool ml::CSOList::hasCSO ( CSO cso) const

Returns whether there is the given CSO in the list.

◆ hasGroup()

bool ml::CSOList::hasGroup ( CSOGroup group) const

Returns whether there is the given CSOGroup in the list.

◆ isCSOCurrentlyUnderMouseNotificationEnabled()

bool ml::CSOList::isCSOCurrentlyUnderMouseNotificationEnabled ( ) const
inline

Returns whether the 'CSO currently under mouse' notification is enabled.

Definition at line 559 of file CSOList.h.

◆ isCSOMovedNotificationEnabled()

bool ml::CSOList::isCSOMovedNotificationEnabled ( ) const
inline

Returns whether the 'CSO moved' notification is enabled.

Definition at line 557 of file CSOList.h.

◆ isFinishedNotificationEnabled()

bool ml::CSOList::isFinishedNotificationEnabled ( ) const
inline

Returns whether the finished notification is enabled.

Definition at line 549 of file CSOList.h.

◆ isInteractionInitNotificationEnabled()

bool ml::CSOList::isInteractionInitNotificationEnabled ( ) const
inline

Returns whether the interaction init notification is enabled.

Definition at line 551 of file CSOList.h.

◆ isNotMutingEvents()

bool ml::CSOList::isNotMutingEvents ( )

whether CSOEvents are currently emitted

◆ isRepaintNotificationEnabled()

bool ml::CSOList::isRepaintNotificationEnabled ( ) const
inline

Returns whether the repaint notification is enabled.

Definition at line 547 of file CSOList.h.

◆ isSelected() [1/2]

bool ml::CSOList::isSelected ( const CSO cso) const

Returns whether the given CSO is currently selected.

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

◆ isSelected() [2/2]

bool ml::CSOList::isSelected ( const CSOGroup group) const

Returns whether the given CSOGroup is currently selected.

◆ isSelectionNotificationEnabled()

bool ml::CSOList::isSelectionNotificationEnabled ( ) const
inline

Returns whether the selection notification is enabled.

Definition at line 553 of file CSOList.h.

◆ isStartNewCSONotificationEnabled()

bool ml::CSOList::isStartNewCSONotificationEnabled ( ) const
inline

Returns whether the 'start new CSO' notification is enabled.

Definition at line 555 of file CSOList.h.

◆ isUndoRedoManagerEnabled()

bool ml::CSOList::isUndoRedoManagerEnabled ( ) const
inline

Returns 'true' if the undo/redo mechanism is enabled, 'false' otherwise.

Definition at line 538 of file CSOList.h.

◆ listChanged()

void ml::CSOList::listChanged ( )

Called whenever the list has changed to generate a new id. This also changes the geometry id.

◆ loadFrom() [1/2]

bool ml::CSOList::loadFrom ( std::istream &  inStream,
bool  binary,
std::string &  message,
ModuleBackgroundTask task = nullptr 
)

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

Returns whether the operation was successful. A given message string is filled.

◆ loadFrom() [2/2]

bool ml::CSOList::loadFrom ( std::string &  filename,
std::string &  message,
ModuleBackgroundTask task = nullptr 
)

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

Returns whether the operation was successful. A given message string is filled.

◆ merge() [1/2]

void ml::CSOList::merge ( const CSOList csoList,
bool  mergeGroupWithSameLabel,
CSOIdToCSOIdMap origToThisGroupIdMap,
CSOIdToCSOIdMap origToThisCSOIdMap,
bool  useUndoRedo = false 
)

Merges the internal CSOs and CSOGroups of the given CSOList to this one.

◆ merge() [2/2]

void ml::CSOList::merge ( const CSOList csoList,
const CSOGroupMergeHandling  mergeMode,
CSOIdToCSOIdMap origToThisGroupIdMap,
CSOIdToCSOIdMap origToThisCSOIdMap,
bool  useUndoRedo = false 
)

Merges the internal CSOs and CSOGroups of the given CSOList to this one with the given merge mode.

◆ ML_SET_ADDSTATE_VERSION()

ml::CSOList::ML_SET_ADDSTATE_VERSION ( )

◆ muteEvents()

void ml::CSOList::muteEvents ( )

Prevent the CSOList from sending any CSOEvents until unmuteEvents is called.

◆ notifyObservers()

void ml::CSOList::notifyObservers ( int  notificationFlag)

Notifies all observers.

◆ numCSOs()

unsigned int ml::CSOList::numCSOs ( ) const

Returns the number of CSOs in the list.

◆ numGroups()

unsigned int ml::CSOList::numGroups ( ) const

Returns the number of CSOGroups.

◆ numSelectedCSOs()

unsigned int ml::CSOList::numSelectedCSOs ( ) const
inline

Returns the number of selected CSOs.

Definition at line 217 of file CSOList.h.

◆ numSelectedGroups()

unsigned int ml::CSOList::numSelectedGroups ( ) const
inline

Returns the number of selected CSOGroups.

Definition at line 219 of file CSOList.h.

◆ openUndoRedoGroup()

void ml::CSOList::openUndoRedoGroup ( const std::string &  description = "Contour Operation")

Opens a undo/redo group. All undoable commands after this are grouped together.

◆ readStateFromTree()

void ml::CSOList::readStateFromTree ( TreeNode )
overridevirtual

Reads the object state from the children of the given parent node.

Reimplemented from ml::Base.

◆ redo()

void ml::CSOList::redo ( )

Performs a redo of the last undone modification.

◆ registerCSOListForNotificationObservers()

void ml::CSOList::registerCSOListForNotificationObservers ( )

Registers this CSOList in the static list of CSOLists for handling observers.

◆ removeAll()

bool ml::CSOList::removeAll ( bool  useUndoRedo = true)

Removes all CSOs and Groups and resets all else.

Returns whether the operation was successful.

◆ removeAllCSO()

bool ml::CSOList::removeAllCSO ( bool  useUndoRedo = true)

Removes all CSOs from the list and from all Groups they are in.

Returns whether the operation was successful.

◆ removeAllGroups()

bool ml::CSOList::removeAllGroups ( bool  useUndoRedo)

Removes all Groups and all groups from all CSOs.

Returns whether the operation was successful.

◆ removeCSO() [1/2]

bool ml::CSOList::removeCSO ( CSO cso,
bool  useUndoRedo = true 
)

Removes a given CSO from the list and from Groups it is in.

Returns whether a CSO has been removed.

◆ removeCSO() [2/2]

bool ml::CSOList::removeCSO ( unsigned int  id,
bool  useUndoRedo = true 
)

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

Returns whether a CSO has been removed.

◆ removeFromSelection() [1/4]

void ml::CSOList::removeFromSelection ( const std::vector< CSO * > &  csos)

Removes the given CSOs from the list of selected CSOs.

◆ removeFromSelection() [2/4]

void ml::CSOList::removeFromSelection ( const std::vector< CSOGroup * > &  groups)

Removes the given CSOGroups from the list of selected CSOGroups.

◆ removeFromSelection() [3/4]

void ml::CSOList::removeFromSelection ( CSO cso)

Removes the given CSO from the list of selected CSOs.

◆ removeFromSelection() [4/4]

void ml::CSOList::removeFromSelection ( CSOGroup group)

Removes the given CSOGroup from the list of selected CSOGroups.

◆ removeGroup() [1/2]

bool ml::CSOList::removeGroup ( CSOGroup group,
bool  useUndoRedo = true 
)

Removes the given Group and removes the group from all CSOs.

Returns whether the CSOGroup has been removed.

◆ removeGroup() [2/2]

bool ml::CSOList::removeGroup ( unsigned int  id,
bool  useUndoRedo = true 
)

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

Returns whether the group has been removed.

◆ removeGroups()

bool ml::CSOList::removeGroups ( const std::vector< CSOGroup * > &  groupsToRemove,
bool  useUndoRedo = true 
)

Removes all Groups with given ids and removes them from CSOs Returns whether the operation was successful.

◆ removeNotificationObserver()

void ml::CSOList::removeNotificationObserver ( csoNotificationCB callback,
void *  userData 
)

Removes a notification observer from this CSOList.

◆ removeNotificationObserverFromAllCSOLists()

static void ml::CSOList::removeNotificationObserverFromAllCSOLists ( csoNotificationCB callback,
void *  userData 
)
static

Removes a certain notification observer from all CSOLists.

◆ resetUniqueCSOLabelIdMap()

void ml::CSOList::resetUniqueCSOLabelIdMap ( )
inline

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

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.

Definition at line 389 of file CSOList.h.

◆ resetUniqueGroupLabelIdMap()

void ml::CSOList::resetUniqueGroupLabelIdMap ( )
inline

Resets the data structure that is used to determine unique ids for getUniqueCSOLabel 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.

Definition at line 395 of file CSOList.h.

◆ saveTo() [1/2]

bool ml::CSOList::saveTo ( std::ostream &  outStream,
bool  binary,
ModuleBackgroundTask task = nullptr 
) const

Pipes the internal structure of a this list (CSOs and Groups) into the given stream.

Returns whether the operation was successful.

◆ saveTo() [2/2]

bool ml::CSOList::saveTo ( std::string &  filename,
bool  binary,
std::string &  message,
ModuleBackgroundTask task = nullptr 
) const

Pipes the internal structure of a this list (CSOs and Groups) into the given file.

Returns whether the operation was successful.

◆ sendCloseEventGroup()

void ml::CSOList::sendCloseEventGroup ( )

Sends a CSOLIST_EVENT_GROUP_CLOSE event to let listeners combine preceding events..

◆ sendModuleEventGroup()

void ml::CSOList::sendModuleEventGroup ( CSOEvent event)

Sends a module group event.

◆ sendOpenEventGroup()

void ml::CSOList::sendOpenEventGroup ( )

Sends a CSOLIST_EVENT_GROUP_OPEN event to let listeners combine following events.

◆ sendPostEvent() [1/6]

void ml::CSOList::sendPostEvent ( CSOEvent::CSOEventType  eventType)

Sends a post-event with the given event type.

◆ sendPostEvent() [2/6]

void ml::CSOList::sendPostEvent ( CSOEvent::CSOEventType  eventType,
const CSOIdVector csoIds 
)

Sends a post-event with the given type and CSO ids.

◆ sendPostEvent() [3/6]

void ml::CSOList::sendPostEvent ( CSOEvent::CSOEventType  eventType,
const CSOIdVector csoIds,
const CSOIdVector groupIds 
)

Sends a post-event with the given type, CSO ids, and Group ids.

◆ sendPostEvent() [4/6]

void ml::CSOList::sendPostEvent ( CSOEvent::CSOEventType  eventType,
unsigned int  csoId 
)

Sends a post-event with the given type and CSO id.

◆ sendPostEvent() [5/6]

void ml::CSOList::sendPostEvent ( CSOEvent::CSOEventType  eventType,
unsigned int  csoId,
const CSOIdVector groupIds 
)

Sends a post-event with the given type, CSO id, and Group ids.

If the CSO id does not matter, just set it to INVALID_CSO_ID.

◆ sendPostEvent() [6/6]

void ml::CSOList::sendPostEvent ( CSOEvent::CSOEventType  eventType,
unsigned int  csoId,
unsigned int  groupId 
)

Sends a post-event with the given type, CSO id, and Group id.

If the CSO id does not matter, just set it to INVALID_CSO_ID.

◆ sendPreEvent() [1/6]

void ml::CSOList::sendPreEvent ( CSOEvent::CSOEventType  eventType)

Sends a pre-event with the given event type.

◆ sendPreEvent() [2/6]

void ml::CSOList::sendPreEvent ( CSOEvent::CSOEventType  eventType,
const CSOIdVector csoIds 
)

Sends a pre-event with the given event type and the CSO ids.

◆ sendPreEvent() [3/6]

void ml::CSOList::sendPreEvent ( CSOEvent::CSOEventType  eventType,
const CSOIdVector csoIds,
const CSOIdVector groupIds 
)

Sends a pre-event with the given event type, CSO ids, and Group ids.

◆ sendPreEvent() [4/6]

void ml::CSOList::sendPreEvent ( CSOEvent::CSOEventType  eventType,
unsigned int  csoId 
)

Sends a pre-event with the given event type and the CSO id.

◆ sendPreEvent() [5/6]

void ml::CSOList::sendPreEvent ( CSOEvent::CSOEventType  eventType,
unsigned int  csoId,
const CSOIdVector groupIds 
)

Sends a post-event with the given type, CSO id, and Group ids.

If the CSO id does not matter, just set it to INVALID_CSO_ID.

◆ sendPreEvent() [6/6]

void ml::CSOList::sendPreEvent ( CSOEvent::CSOEventType  eventType,
unsigned int  csoId,
unsigned int  groupId 
)

Sends a pre-event with the given type, CSO id, and Group id.

If the CSO id does not matter, just set it to INVALID_CSO_ID.

◆ setCSOCurrentlyUnderMouse()

void ml::CSOList::setCSOCurrentlyUnderMouse ( CSO csoUnderMouse)

Sets the pointer to the CSO currently under the mouse cursor.

At the moment, only the SoView2DCSOEditor sets this pointer. You might break networks if you fool around with this.

◆ setCurrentCSOId()

void ml::CSOList::setCurrentCSOId ( unsigned int  id)
inline

Sets the current last id for CSOs. Do not mess with it.

Definition at line 169 of file CSOList.h.

◆ setCurrentGroupId()

void ml::CSOList::setCurrentGroupId ( unsigned int  id)
inline

Sets the current last id for Groups. Do not mess with it.

Definition at line 171 of file CSOList.h.

◆ setManager()

void ml::CSOList::setManager ( CSOManager manager)

Sets the pointer to the internal manager and sets the group default rules.

◆ setSelected() [1/2]

bool ml::CSOList::setSelected ( CSO cso)

Sets the given CSO as being selected and deselects all other CSOs.

This is done by first clearing the selection and then setting the given CSO as being selected. Returns 'true' if the selection has actually been changed, 'false' otherwise.

◆ setSelected() [2/2]

bool ml::CSOList::setSelected ( CSOGroup group)

Set the given CSOGroup as being selected and deselects all other Groups.

This is done by first clearing the selection and then setting the given CSOGroup as being selected. Returns 'true' if the selection has actually been changed, 'false' otherwise.

◆ setUndoRedoManager()

void ml::CSOList::setUndoRedoManager ( CSOUndoRedoManager undoRedoManager)
inline

Sets the internal undo/redo manager.

Definition at line 152 of file CSOList.h.

◆ setupCSOList()

void ml::CSOList::setupCSOList ( )
protected

◆ undo()

void ml::CSOList::undo ( )

Performs an undo of the last modification.

◆ unmuteEvents()

void ml::CSOList::unmuteEvents ( )

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.

◆ updateCurrentCSOId()

void ml::CSOList::updateCurrentCSOId ( unsigned int  newId)

Updates the current id if the new id is bigger than the current id.

◆ updateCurrentGroupId()

void ml::CSOList::updateCurrentGroupId ( const unsigned int  newId)

Updates the current group id if the new id is bigger than the current id.

◆ updateDisplays()

void ml::CSOList::updateDisplays ( )

Updates all connected information/managing modules (not the renderers!).

Friends And Related Function Documentation

◆ CSOLoad

friend class CSOLoad
friend

Definition at line 792 of file CSOList.h.


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