|
MeVisLab Toolbox Reference
|
#include <CSOList.h>
Classes | |
| struct | CSONotificationCBData |
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. | |
| CSOList (bool shouldRegisterCSOList) | |
| CSOList (const CSOList &csoList) | |
| Copy constructor. | |
| void | clone (const CSOList &csoList, bool useUndoRedo=false) |
| Clones the internal CSOs and CSOGroups of the specified CSOList to this one. | |
| void | merge (const CSOList &csoList, bool mergeGroupWithSameLabel, CSOIdToCSOIdMap &origToThisGroupIdMap, CSOIdToCSOIdMap &origToThisCSOIdMap, bool useUndoRedo=false) |
| Merges the internal CSOs and CSOGroups of the specified CSOList to this one. | |
| void | merge (const CSOList &csoList, const CSOGroupMergeHandling mergeMode, CSOIdToCSOIdMap &origToThisGroupIdMap, CSOIdToCSOIdMap &origToThisCSOIdMap, bool useUndoRedo=false) |
| Merges the internal CSOs and CSOGroups of the specified CSOList to this one with the specified merge mode. | |
| bool | saveTo (std::string &filename, bool binary, std::string &message, ModuleBackgroundTask *task=nullptr) const |
| bool | saveTo (std::ostream &outStream, bool binary, ModuleBackgroundTask *task=nullptr) const |
| bool | loadFrom (std::string &filename, std::string &message, ModuleBackgroundTask *task=nullptr) |
| bool | loadFrom (std::istream &inStream, bool binary, std::string &message, ModuleBackgroundTask *task=nullptr) |
| void | addNotificationObserver (csoNotificationCB *callback, void *userData) |
| Adds a notification observer to this CSOList. | |
| void | removeNotificationObserver (csoNotificationCB *callback, void *userData) |
| Removes a notification observer from this CSOList. | |
| void | notifyObservers (int notificationFlag) |
| Notifies all observers. | |
| void | registerCSOListForNotificationObservers () |
| Registers this CSOList in the static list of CSOLists for handling observers. | |
| void | updateDisplays () |
| Updates all connected information/managing modules (not the renderers!). | |
| CSOUndoRedoManager * | getUndoRedoManager () |
| Returns a pointer to the undo/redo manager of this CSOList. | |
| CSOManager * | getManager () |
| Returns a pointer to the manager of this CSOList. | |
| void | setUndoRedoManager (CSOUndoRedoManager *undoRedoManager) |
| Sets the internal undo/redo manager. | |
| void | setManager (CSOManager *manager) |
| Sets the pointer to the internal manager and sets the CSOGroup default rules. | |
| unsigned int | getCurrentCSOId () |
| void | updateCurrentCSOId (unsigned int newId) |
| Updates the current ID if the new ID is larger than the current ID. | |
| unsigned int | getCurrentGroupId () |
| void | setCurrentCSOId (unsigned int id) |
| Sets the current last ID for CSOs. Do not tamper with it. | |
| void | setCurrentGroupId (unsigned int id) |
| Sets the current last ID for CSOGroups. Do not tamper with it. | |
| void | updateCurrentGroupId (const unsigned int newId) |
| Updates the current CSOGroup ID if the new ID is larger than the current ID. | |
| bool | isSelected (const CSO *cso) const |
| bool | isSelected (const CSOGroup *group) const |
| Returns whether the specified CSOGroup is currently selected. | |
| void | addSelected (CSO *cso) |
| Adds the specified CSO to the list of selected CSOs (no double entry). | |
| void | addSelected (CSOGroup *group) |
| Adds the specified CSOGroup to the list of selected CSOGroups (no double entry). | |
| bool | setSelected (CSO *cso) |
| bool | setSelected (CSOGroup *group) |
| void | clearSelectedCSOs () |
| Clears all selected CSOs. | |
| void | clearSelectedGroups () |
| Clears all selected CSOGroups. | |
| void | clearSelectedSeedPoints () |
| Clears all selected seed points in all CSOs. | |
| void | removeFromSelection (CSO *cso) |
| Removes the specified CSO from the list of selected CSOs. | |
| void | removeFromSelection (const std::vector< CSO * > &csos) |
| Removes the specified CSOs from the list of selected CSOs. | |
| void | removeFromSelection (CSOGroup *group) |
| Removes the specified CSOGroup from the list of selected CSOGroups. | |
| void | removeFromSelection (const std::vector< CSOGroup * > &groups) |
| Removes the specified CSOGroups from the list of selected CSOGroups. | |
| unsigned int | numSelectedCSOs () const |
| Returns the number of selected CSOs. | |
| unsigned int | numSelectedGroups () const |
| Returns the number of selected CSOGroups. | |
| CSO * | getSelectedCSOAt (unsigned int index) const |
| Returns a pointer to the selected CSO at the specified index; no checking! | |
| CSOGroup * | getSelectedGroupAt (unsigned int index) const |
| Returns a pointer to the selected CSOGroup at the specified index; no checking! | |
| CSOIdVector | getSelectedCSOIds () |
| Returns a vector with IDs of the selected CSOs. | |
| CSOIdVector | getSelectedGroupIds () |
| Returns a vector with IDs of the selected CSOGroups. | |
| Vector3 | getCenterOfSelectedCSOs (bool &resultIsValid) const |
| Vector3 | getCenterOfSelectedGroups (bool &resultIsValid) const |
| CSO * | getCSOCurrentlyUnderMouse () const |
| Returns the pointer to the CSO currently under the mouse cursor. | |
| void | setCSOCurrentlyUnderMouse (CSO *csoUnderMouse) |
| Vector3 | getCenterOfSelectedCSOs () const |
| Vector3 | getCenterOfSelectedGroups () const |
| CSO * | addCSO (bool useUndoRedo=true) |
| Adds a new CSO to the list and returns its pointer. | |
| CSO * | addCSONoEvent (bool useUndoRedo=true) |
| Adds a new CSO to the list and returns its pointer. (Without sending any events). | |
| CSO * | addCSO (const std::vector< Vector3 > &seedPositions, bool closed, bool useUndoRedo) |
| CSO * | addCSO (unsigned int numSeedPoints, bool closed, bool useUndoRedo) |
| CSO * | addCSOCopy (CSO *cso, bool useUndoRedo=true, unsigned int csoId=INVALID_CSO_ID) |
| Adds a copy of the specified CSO to the list and returns a pointer to it. | |
| CSOGroup * | addGroup (bool useUndoRedo=true) |
| Adds a new CSOGroup to the list and returns a pointer to it. | |
| CSOGroup * | addGroup (const std::string &label, bool useUndoRedo=true) |
| Adds a new CSOGroup with specified label to the list and returns a pointer to it. | |
| CSOGroup * | addGroupCopy (CSOGroup *group, bool useUndoRedo=true, unsigned int groupId=INVALID_CSO_ID) |
| CSO * | addPoint (const Vector3 &position, const std::string &subtype="point") |
| Adds a point CSO at the specified position. | |
| CSO * | addCircle (const Vector3 &midPoint, const Vector3 &normal, double radius, double pointDistanceInMM=1., const std::string &subtype="circle") |
| CSO * | 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. | |
| CSO * | addPolygon (const std::vector< Vector3 > &points, double pointDistanceInMM=1., const std::string &subtype="polygon") |
| Adds a linearly interpolated closed polygon with the specified points as seed points. | |
| CSO * | addPolyline (const std::vector< Vector3 > &points, double pointDistanceInMM=1., const std::string &subtype="polyline") |
| Adds a linearly interpolated open polyline with the specified points as seed points. | |
| CSO * | addClosedSpline (const std::vector< Vector3 > &points, bool useInterpolation=true, double pointDistanceInMM=1., const std::string &subtype="spline") |
| CSO * | addOpenSpline (const std::vector< Vector3 > &points, bool useInterpolation=true, double pointDistanceInMM=1., const std::string &subtype="spline") |
| CSO * | addRectangle (const Vector3 &midPoint, const Vector3 &uVector, const Vector3 &vVector, double angleInRadian=.0, double pointDistanceInMM=1., const std::string &subtype="rectangle") |
| CSO * | addEllipse (const Vector3 &midPoint, const Vector3 &uVector, const Vector3 &vVector, double angleInRadian=.0, double pointDistanceInMM=1., const std::string &subtype="ellipse") |
| bool | removeCSO (CSO *cso, bool useUndoRedo=true) |
| bool | removeCSO (unsigned int id, bool useUndoRedo=true) |
| bool | removeAllCSO (bool useUndoRedo=true) |
| bool | removeGroup (CSOGroup *group, bool useUndoRedo=true) |
| bool | removeGroup (unsigned int id, bool useUndoRedo=true) |
| bool | removeAllGroups (bool useUndoRedo) |
| bool | removeGroups (const std::vector< CSOGroup * > &groupsToRemove, bool useUndoRedo=true) |
| bool | removeAll (bool useUndoRedo=true) |
| CSO * | getCSOAt (unsigned int index) const |
| Returns a pointer to the CSO at the specified position in the internal list. | |
| CSO * | getCSOById (unsigned int id) const |
| CSO * | getCSOByLabel (const std::string &label) const |
| unsigned int | getCSOIndex (CSO *cso) const |
| Returns the index of the specified CSO in its list. | |
| unsigned int | getCSOIndex (unsigned int id) const |
| Returns the index of the CSO with the specified ID in its list. | |
| bool | hasCSO (CSO *cso) const |
| Returns whether there is the specified CSO in the list. | |
| CSOGroup * | getGroupById (unsigned int id) const |
| Returns a pointer to a CSOGroup with the specified ID. | |
| CSOGroup * | getGroupByLabel (const std::string &label) const |
| Returns a pointer to a CSOGroup with the specified label. | |
| CSOGroup * | getGroupAt (unsigned int index) const |
| Returns the CSOGroup at the specified index position. | |
| unsigned int | getGroupIndex (CSOGroup *group) const |
| Returns the index of the specified CSOGroup in its list. | |
| unsigned int | getGroupIndex (unsigned int id) const |
| Returns the index of the CSOGroup with the specified ID in its list. | |
| bool | hasGroup (CSOGroup *group) const |
| Returns whether there is the specified CSOGroup in the list. | |
| std::string | getUniqueCSOLabel (std::string label, std::string format, bool addIdAlways) |
| std::string | getUniqueGroupLabel (std::string label, std::string format, bool addIdAlways) |
| void | resetUniqueCSOLabelIdMap () |
| void | resetUniqueGroupLabelIdMap () |
| bool | combineCSOandGroup (CSO *cso, CSOGroup *group, bool useUndoRedo=true) |
| Combines the specified CSO with the specified CSOGroup. | |
| void | breakCSOandGroup (CSO *cso, CSOGroup *group, bool useUndoRedo=true) |
| Breaks the combination of the specified CSO and the specified CSOGroup. | |
| void | breakCSOfromAllGroups (CSO *cso, bool useUndoRedo=true) |
| Breaks all combinations of the specified CSO and any CSOGroup. | |
| void | breakAllCSOsFromGroup (CSOGroup *group, bool useUndoRedo=true) |
| Breaks all combinations of the specified CSOGroup and any CSO. | |
| void | _addGroupRelationCommand (CSO *cso, CSOGroup *group) |
| Helper method to be used only inside MLCSO. | |
| unsigned int | numCSOs () const |
| Returns the number of CSOs in the list. | |
| unsigned int | numGroups () const |
| Returns the number of CSOGroups. | |
| CSOIdVector | getAllCSOIds () const |
| Returns a vector with the IDs of the CSOs contained in the list. | |
| CSOIdVector | getAllGroupIds () const |
| Returns a vector with the IDs of the CSOGroups contained in the list. | |
| void | undo () |
| Performs an undo of the last modification. | |
| void | redo () |
| Performs a redo of the last undo modification. | |
| void | enableUndoRedoManager () |
| Enables the undo/redo mechanism. | |
| void | disableUndoRedoManager () |
| Enables the undo/redo mechanism. | |
| void | sendOpenEventGroup () |
| Sends a CSOLIST_EVENT_GROUP_OPEN event to let listeners combine following events. | |
| void | sendCloseEventGroup () |
| Sends a CSOLIST_EVENT_GROUP_CLOSE event to let listeners combine preceding events.. | |
| void | sendModuleEventGroup (CSOEvent *event) |
| Sends a module CSOGroup event. | |
| void | sendPreEvent (CSOEvent::CSOEventType eventType) |
| Sends a pre-event with the specified event type. | |
| void | sendPreEvent (CSOEvent::CSOEventType eventType, unsigned int csoId) |
| Sends a pre-event with the specified event type and the CSO ID. | |
| void | sendPreEvent (CSOEvent::CSOEventType eventType, unsigned int csoId, const CSOIdVector &groupIds) |
| void | sendPreEvent (CSOEvent::CSOEventType eventType, unsigned int csoId, unsigned int groupId) |
| void | sendPreEvent (CSOEvent::CSOEventType eventType, const CSOIdVector &csoIds) |
| Sends a pre-event with the specified event type and the CSO IDs. | |
| void | sendPreEvent (CSOEvent::CSOEventType eventType, const CSOIdVector &csoIds, const CSOIdVector &groupIds) |
| Sends a pre-event with the specified event type, CSO IDs, and CSOGroup IDs. | |
| void | sendPostEvent (CSOEvent::CSOEventType eventType) |
| Sends a post-event with the specified event type. | |
| void | sendPostEvent (CSOEvent::CSOEventType eventType, unsigned int csoId) |
| Sends a post-event with the specified type and CSO ID. | |
| void | sendPostEvent (CSOEvent::CSOEventType eventType, unsigned int csoId, unsigned int groupId) |
| void | sendPostEvent (CSOEvent::CSOEventType eventType, const CSOIdVector &csoIds) |
| Sends a post-event with the specified type and CSO IDs. | |
| void | sendPostEvent (CSOEvent::CSOEventType eventType, unsigned int csoId, const CSOIdVector &groupIds) |
| void | sendPostEvent (CSOEvent::CSOEventType eventType, const CSOIdVector &csoIds, const CSOIdVector &groupIds) |
| Sends a post-event with the specified type, CSO IDs, and CSOGroup IDs. | |
| void | muteEvents () |
| Prevents the CSOList from sending any CSOEvents until unmuteEvents is called. | |
| void | unmuteEvents () |
| bool | isNotMutingEvents () |
| Returns whether CSOEvents are currently emitted. | |
| MLuint64 | getListChangeId () const |
| Returns the list change ID that changes whenever a CSO is added or removed (unique accross all CSOLists). | |
| MLuint64 | getGeometryChangeId () const |
| Returns the geometry change ID that changes on any CSO geometry change or list change (unique accross all CSOLists). | |
| void | listChanged () |
| Called whenever the list has changed to generate a new ID. This also changes the geometry ID. | |
| void | geometryChanged () |
| Called whenever the geometry of a CSO has changed. | |
| void | enableRepaintObserver () |
| Enables the repaint observer mechanism. | |
| void | disableRepaintObserver () |
| Disables the repaint observer mechanism. | |
| void | enableFinishedObserver () |
| Enables the finished observer mechanism. | |
| void | disableFinishedObserver () |
| Disables the finished observer mechanism. | |
| void | enableInteractionObserver () |
| Enables the interaction observer mechanism. | |
| void | disableInteractionObserver () |
| Disables the interaction observer mechanism. | |
| void | enableSelectionObserver () |
| Enables the selection observer mechanism. | |
| void | disableSelectionObserver () |
| Disables the selection observer mechanism. | |
| void | enableStartNewCSOObserver () |
| Enables the 'start new CSO' observer mechanism. | |
| void | disableStartNewCSOObserver () |
| Disables the 'start new CSO' observer mechanism. | |
| void | enableCSOMovedObserver () |
| Enables the 'CSO moved' observer mechanism. | |
| void | disableCSOMovedObserver () |
| Disables the 'CSO moved' observer mechanism. | |
| void | enableCSOCurrentlyUnderMouseObserver () |
| Enables the 'CSO currently under mouse' observer mechanism. | |
| void | disableCSOCurrentlyUnderMouseObserver () |
| Disables the 'CSO currently under mouse' observer mechanism. | |
| bool | isUndoRedoManagerEnabled () const |
| Returns 'true' if the undo/redo mechanism is enabled, 'false' otherwise. | |
| void | openUndoRedoGroup (const std::string &description="Contour Operation") |
| Opens a undo/redo group. All undoable commands after this are grouped together. | |
| void | closeUndoRedoGroup () |
| Closes a undo/redo group. All undoable commands before this are grouped together. | |
| bool | isRepaintNotificationEnabled () const |
| Returns whether the repaint notification is enabled. | |
| bool | isFinishedNotificationEnabled () const |
| Returns whether the finished notification is enabled. | |
| bool | isInteractionInitNotificationEnabled () const |
| Returns whether the interaction init notification is enabled. | |
| bool | isSelectionNotificationEnabled () const |
| Returns whether the selection notification is enabled. | |
| bool | isStartNewCSONotificationEnabled () const |
| Returns whether the 'start new CSO' notification is enabled. | |
| bool | isCSOMovedNotificationEnabled () const |
| Returns whether the 'CSO moved' notification is enabled. | |
| bool | isCSOCurrentlyUnderMouseNotificationEnabled () const |
| Returns whether the 'CSO currently under mouse' notification is enabled. | |
| CSOListRules & | getRules () |
| Returns the rules for this CSOList. | |
| void | addStateToTree (TreeNode *) const override |
| Attaches the object state as children of the specified parent node. | |
| void | readStateFromTree (TreeNode *) override |
| Reads the object state from the children of the specified parent node. | |
| ML_SET_ADDSTATE_VERSION (1) | |
| CSOList * | deepCopy () const override |
| Creates a deep copy of the CSOList. | |
| Public Member Functions inherited from ml::RefCountedBase | |
| RefCountedBase () | |
| Constructor. | |
| RefCountedBase (const RefCountedBase &) | |
| Explicit copy constructor. | |
| virtual void | incRefCount () const |
| Increases the reference count. | |
| virtual void | decRefCount () const |
| Decreases the reference count (object will be deleted if the reference count is decremented to 0). | |
| bool | isRefCountedBase () const override |
| Returns whether the instance is derived from RefCountedBase. | |
| Public Member Functions inherited from ml::EventSource | |
| EventSource () | |
| EventSource (const EventSource &evSource) | |
| ~EventSource () override | |
| void | addEventListener (BaseEventCallback *cb, void *userData) |
| void | removeEventListener (BaseEventCallback *cb, void *userData) |
| bool | hasEventListeners () const |
| Public Member Functions inherited from ml::Base | |
| Base () | |
| Constructor. | |
| virtual | ~Base () |
| Destructor. | |
| bool | isOfAllowedType (const std::vector< const RuntimeType * > &types) const |
| virtual std::string | detailString () const |
| virtual bool | implementsPersistence (PersistenceInterface) const |
| virtual std::string | persistentState () const |
| Returns a string describing the object's internal state. | |
| virtual void | setPersistentState (const std::string &state) |
| virtual void | writeTo (AbstractPersistenceOutputStream *) const |
| virtual void | readFrom (AbstractPersistenceInputStream *, int) |
Static Public Member Functions | |
| static void | removeNotificationObserverFromAllCSOLists (csoNotificationCB *callback, void *userData) |
| Removes a certain notification observer from all CSOLists. | |
| static void | alignSeedPathLinks (CSO *cso) |
| Aligns seed point positions with path point lists of a specified CSO by a squared distance-sum criterion. | |
| static EnumValues< CSOPathPointsStyle > | getLineStyleModes () |
| static EnumValues< CSOSeedPointStyle > | getSeedPointStyles () |
| static EnumValues< CSOVoxelWriteModes > | getVoxelWriteModes () |
| Static Public Member Functions inherited from ml::RefCountedBase | |
| static void | updateReferenceCountingIfSupported (Base *oldValue, Base *newValue, bool &isRefCountedBase) |
Protected Member Functions | |
| ~CSOList () override | |
| void | setupCSOList () |
| Protected Member Functions inherited from ml::RefCountedBase | |
| ~RefCountedBase () override | |
| Destructor. | |
| Protected Member Functions inherited from ml::EventSource | |
| void | sendEvent (BaseEvent *event, void *skipListener=nullptr) |
Friends | |
| class | CSOLoad |
Additional Inherited Members | |
| Protected Attributes inherited from ml::RefCountedBase | |
| std::atomic_int_least32_t | _refCount |
| Reference count. | |
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 to manage newly created CSOList objects.
| 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. |
| ml::CSOList::CSOList | ( | ) |
| ml::CSOList::CSOList | ( | bool | shouldRegisterCSOList | ) |
| ml::CSOList::CSOList | ( | const CSOList & | csoList | ) |
Copy constructor.
References 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 nullptr assignment.
Helper method to be used only inside MLCSO.
| 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.
| 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 specified points as seed points. If useInterpolation is set to 'false', spline approximation is used.
| CSO * ml::CSOList::addCSO | ( | bool | useUndoRedo = true | ) |
Adds a new CSO to the list and returns its pointer.
| 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 specified positions are used as seed point positions.
| CSO * ml::CSOList::addCSO | ( | unsigned int | numSeedPoints, |
| bool | closed, | ||
| bool | useUndoRedo ) |
| CSO * ml::CSOList::addCSOCopy | ( | CSO * | cso, |
| bool | useUndoRedo = true, | ||
| unsigned int | csoId = INVALID_CSO_ID ) |
Adds a copy of the specified CSO to the list and returns a pointer to it.
References INVALID_CSO_ID.
| CSO * ml::CSOList::addCSONoEvent | ( | bool | useUndoRedo = true | ) |
Adds a new CSO to the list and returns its pointer. (Without sending any events).
| CSO * ml::CSOList::addEllipse | ( | const Vector3 & | midPoint, |
| const Vector3 & | uVector, | ||
| const Vector3 & | vVector, | ||
| double | angleInRadian = .0, | ||
| double | pointDistanceInMM = 1., | ||
| const std::string & | subtype = "ellipse" ) |
Adds an ellipse with a specified midPoint, uVector, and vVector. angleInRadian specifies an initial rotation around the midPoint. uVector and vVector should be perpendicular to each other. If not rotated, the resulting ellipse's horizontal diameter is 2 * length(uVector) and its vertical diameter is 2 * length(vVector). uVector and vVector must not be collinear or too short; otherwise, the method prints an error and returns nullptr.
| CSOGroup * ml::CSOList::addGroup | ( | bool | useUndoRedo = true | ) |
Adds a new CSOGroup to the list and returns a pointer to it.
| CSOGroup * ml::CSOList::addGroup | ( | const std::string & | label, |
| bool | useUndoRedo = true ) |
Adds a new CSOGroup with specified label to the list and returns a pointer to it.
| CSOGroup * ml::CSOList::addGroupCopy | ( | CSOGroup * | group, |
| bool | useUndoRedo = true, | ||
| unsigned int | groupId = INVALID_CSO_ID ) |
Adds a copy of the specified CSOGroup to this list and returns a pointer to it. Note that this method does not set the 'this' pointer as a new CSOList.
References INVALID_CSO_ID.
| void ml::CSOList::addNotificationObserver | ( | csoNotificationCB * | callback, |
| void * | userData ) |
Adds a notification observer to this CSOList.
| 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 specified points as seed points. If useInterpolation is set to 'false', spline approximation is used.
Adds a point CSO at the specified position.
| 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 specified points as seed points.
| 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 specified points as seed points.
| CSO * ml::CSOList::addRectangle | ( | const Vector3 & | midPoint, |
| const Vector3 & | uVector, | ||
| const Vector3 & | vVector, | ||
| double | angleInRadian = .0, | ||
| double | pointDistanceInMM = 1., | ||
| const std::string & | subtype = "rectangle" ) |
Adds a rectangle with a specified midPoint, uVector, and vVector. angleInRadian specifies an initial rotation around the midPoint. uVector and vVector should be perpendicular to each other. If not rotated, the resulting rectangle's width is 2 * length(uVector) and its height is 2 * length(vVector). uVector and vVector must not be collinear or too short; otherwise, the method prints an error and returns nullptr.
| void ml::CSOList::addSelected | ( | CSO * | cso | ) |
Adds the specified CSO to the list of selected CSOs (no double entry).
| void ml::CSOList::addSelected | ( | CSOGroup * | group | ) |
Adds the specified CSOGroup to the list of selected CSOGroups (no double entry).
|
overridevirtual |
Attaches the object state as children of the specified parent node.
Reimplemented from ml::Base.
|
static |
Aligns seed point positions with path point lists of a specified CSO by a squared distance-sum criterion.
| void ml::CSOList::breakAllCSOsFromGroup | ( | CSOGroup * | group, |
| bool | useUndoRedo = true ) |
| void ml::CSOList::breakCSOfromAllGroups | ( | CSO * | cso, |
| bool | useUndoRedo = true ) |
| void ml::CSOList::clearSelectedCSOs | ( | ) |
Clears all selected CSOs.
| void ml::CSOList::clearSelectedGroups | ( | ) |
Clears all selected CSOGroups.
| void ml::CSOList::clearSelectedSeedPoints | ( | ) |
Clears all selected seed points in all CSOs.
| void ml::CSOList::clone | ( | const CSOList & | csoList, |
| bool | useUndoRedo = false ) |
| void ml::CSOList::closeUndoRedoGroup | ( | ) |
Closes a undo/redo group. All undoable commands before this are grouped together.
|
inlineoverridevirtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void ml::CSOList::disableUndoRedoManager | ( | ) |
Enables the undo/redo mechanism.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void ml::CSOList::geometryChanged | ( | ) |
Called whenever the geometry of a CSO has changed.
| CSOIdVector ml::CSOList::getAllCSOIds | ( | ) | const |
Returns a vector with the IDs of the CSOs contained in the list.
| CSOIdVector ml::CSOList::getAllGroupIds | ( | ) | const |
Returns a vector with the IDs of the CSOGroups contained in the list.
|
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, and getCenterOfSelectedCSOs().
| 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.
Referenced by getCenterOfSelectedCSOs().
|
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, and getCenterOfSelectedGroups().
| 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 CSOGroups available.
Referenced by getCenterOfSelectedGroups().
| CSO * ml::CSOList::getCSOAt | ( | unsigned int | index | ) | const |
Returns a pointer to the CSO at the specified position in the internal list.
| CSO * ml::CSOList::getCSOById | ( | unsigned int | id | ) | const |
| CSO * ml::CSOList::getCSOByLabel | ( | const std::string & | label | ) | const |
|
inline |
| unsigned int ml::CSOList::getCSOIndex | ( | CSO * | cso | ) | const |
Returns the index of the specified CSO in its list.
| unsigned int ml::CSOList::getCSOIndex | ( | unsigned int | id | ) | const |
Returns the index of the CSO with the specified ID in its list.
| 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.
| 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.
|
inline |
| CSOGroup * ml::CSOList::getGroupAt | ( | unsigned int | index | ) | const |
Returns the CSOGroup at the specified index position.
| CSOGroup * ml::CSOList::getGroupById | ( | unsigned int | id | ) | const |
Returns a pointer to a CSOGroup with the specified ID.
| CSOGroup * ml::CSOList::getGroupByLabel | ( | const std::string & | label | ) | const |
Returns a pointer to a CSOGroup with the specified label.
| unsigned int ml::CSOList::getGroupIndex | ( | CSOGroup * | group | ) | const |
Returns the index of the specified CSOGroup in its list.
| unsigned int ml::CSOList::getGroupIndex | ( | unsigned int | id | ) | const |
Returns the index of the CSOGroup with the specified ID in its list.
|
static |
|
inline |
|
inline |
|
inline |
|
static |
|
inline |
| CSOIdVector ml::CSOList::getSelectedCSOIds | ( | ) |
Returns a vector with IDs of the selected CSOs.
|
inline |
| CSOIdVector ml::CSOList::getSelectedGroupIds | ( | ) |
Returns a vector with IDs of the selected CSOGroups.
|
inline |
| std::string ml::CSOList::getUniqueCSOLabel | ( | std::string | label, |
| std::string | format, | ||
| bool | addIdAlways ) |
Returns a unique CSO label that includes the specified label and combines it with a unique ID using the specified format. If the specified label itself is unique, an ID is only added if addIdAlways is true.
| std::string ml::CSOList::getUniqueGroupLabel | ( | std::string | label, |
| std::string | format, | ||
| bool | addIdAlways ) |
Returns a unique CSOGroup label that includes the specified label and combines it with a unique ID using the specified format. If the specified label itself is unique, an ID is only added if addIdAlways is true.
|
static |
| bool ml::CSOList::hasGroup | ( | CSOGroup * | group | ) | const |
Returns whether there is the specified CSOGroup in the list.
|
inline |
|
inline |
|
inline |
|
inline |
| bool ml::CSOList::isNotMutingEvents | ( | ) |
Returns whether CSOEvents are currently emitted.
|
inline |
| bool ml::CSOList::isSelected | ( | const CSO * | cso | ) | const |
| bool ml::CSOList::isSelected | ( | const CSOGroup * | group | ) | const |
Returns whether the specified CSOGroup is currently selected.
|
inline |
|
inline |
|
inline |
| void ml::CSOList::listChanged | ( | ) |
Called whenever the list has changed to generate a new ID. This also changes the geometry ID.
| 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 CSOGroups) from the specified stream. Returns whether the operation was successful. A specified message string is filled.
| bool ml::CSOList::loadFrom | ( | std::string & | filename, |
| std::string & | message, | ||
| ModuleBackgroundTask * | task = nullptr ) |
Reads out the internal structure for this list (CSOs and CSOGroups) from the specified file. Returns whether the operation was successful. A specified message string is filled.
| void ml::CSOList::merge | ( | const CSOList & | csoList, |
| bool | mergeGroupWithSameLabel, | ||
| CSOIdToCSOIdMap & | origToThisGroupIdMap, | ||
| CSOIdToCSOIdMap & | origToThisCSOIdMap, | ||
| bool | useUndoRedo = false ) |
| void ml::CSOList::merge | ( | const CSOList & | csoList, |
| const CSOGroupMergeHandling | mergeMode, | ||
| CSOIdToCSOIdMap & | origToThisGroupIdMap, | ||
| CSOIdToCSOIdMap & | origToThisCSOIdMap, | ||
| bool | useUndoRedo = false ) |
| ml::CSOList::ML_SET_ADDSTATE_VERSION | ( | 1 | ) |
| void ml::CSOList::muteEvents | ( | ) |
Prevents the CSOList from sending any CSOEvents until unmuteEvents is called.
| void ml::CSOList::notifyObservers | ( | int | notificationFlag | ) |
Notifies all observers.
| unsigned int ml::CSOList::numCSOs | ( | ) | const |
Returns the number of CSOs in the list.
| unsigned int ml::CSOList::numGroups | ( | ) | const |
Returns the number of CSOGroups.
|
inline |
|
inline |
| void ml::CSOList::openUndoRedoGroup | ( | const std::string & | description = "Contour Operation" | ) |
Opens a undo/redo group. All undoable commands after this are grouped together.
|
overridevirtual |
Reads the object state from the children of the specified parent node.
Reimplemented from ml::Base.
| void ml::CSOList::redo | ( | ) |
Performs a redo of the last undo modification.
| void ml::CSOList::registerCSOListForNotificationObservers | ( | ) |
Registers this CSOList in the static list of CSOLists for handling observers.
| bool ml::CSOList::removeAll | ( | bool | useUndoRedo = true | ) |
Removes all CSOs and CSOGroups and resets all else. Returns whether the operation was successful.
| bool ml::CSOList::removeAllCSO | ( | bool | useUndoRedo = true | ) |
Removes all CSOs from the list and from all CSOGroups they are in. Returns whether the operation was successful.
| bool ml::CSOList::removeAllGroups | ( | bool | useUndoRedo | ) |
Removes all CSOGroups and all CSOGroups from all CSOs. Returns whether the operation was successful.
| bool ml::CSOList::removeCSO | ( | CSO * | cso, |
| bool | useUndoRedo = true ) |
| bool ml::CSOList::removeCSO | ( | unsigned int | id, |
| bool | useUndoRedo = true ) |
| void ml::CSOList::removeFromSelection | ( | const std::vector< CSO * > & | csos | ) |
Removes the specified CSOs from the list of selected CSOs.
| void ml::CSOList::removeFromSelection | ( | const std::vector< CSOGroup * > & | groups | ) |
Removes the specified CSOGroups from the list of selected CSOGroups.
| void ml::CSOList::removeFromSelection | ( | CSO * | cso | ) |
Removes the specified CSO from the list of selected CSOs.
| void ml::CSOList::removeFromSelection | ( | CSOGroup * | group | ) |
Removes the specified CSOGroup from the list of selected CSOGroups.
| bool ml::CSOList::removeGroup | ( | CSOGroup * | group, |
| bool | useUndoRedo = true ) |
| bool ml::CSOList::removeGroup | ( | unsigned int | id, |
| bool | useUndoRedo = true ) |
| bool ml::CSOList::removeGroups | ( | const std::vector< CSOGroup * > & | groupsToRemove, |
| bool | useUndoRedo = true ) |
Removes all CSOGroups with specified IDs and removes them from CSOs Returns whether the operation was successful.
| void ml::CSOList::removeNotificationObserver | ( | csoNotificationCB * | callback, |
| void * | userData ) |
Removes a notification observer from this CSOList.
|
static |
Removes a certain notification observer from all CSOLists.
|
inline |
Resets the data structure that is used to determine unique IDs for getUniqueCSOLabel. Afterward, 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.
|
inline |
Resets the data structure that is used to determine unique IDs for getUniqueCSOLabel Afterward, 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.
| bool ml::CSOList::saveTo | ( | std::ostream & | outStream, |
| bool | binary, | ||
| ModuleBackgroundTask * | task = nullptr ) const |
Pipes the internal structure of a this list (CSOs and CSOGroups) into the specified stream. Returns whether the operation was successful.
| 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 CSOGroups) into the specified file. Returns whether the operation was successful.
| void ml::CSOList::sendCloseEventGroup | ( | ) |
Sends a CSOLIST_EVENT_GROUP_CLOSE event to let listeners combine preceding events..
| void ml::CSOList::sendOpenEventGroup | ( | ) |
Sends a CSOLIST_EVENT_GROUP_OPEN event to let listeners combine following events.
| void ml::CSOList::sendPostEvent | ( | CSOEvent::CSOEventType | eventType | ) |
Sends a post-event with the specified event type.
| void ml::CSOList::sendPostEvent | ( | CSOEvent::CSOEventType | eventType, |
| const CSOIdVector & | csoIds ) |
Sends a post-event with the specified type and CSO IDs.
| void ml::CSOList::sendPostEvent | ( | CSOEvent::CSOEventType | eventType, |
| const CSOIdVector & | csoIds, | ||
| const CSOIdVector & | groupIds ) |
| void ml::CSOList::sendPostEvent | ( | CSOEvent::CSOEventType | eventType, |
| unsigned int | csoId ) |
Sends a post-event with the specified type and CSO ID.
| void ml::CSOList::sendPostEvent | ( | CSOEvent::CSOEventType | eventType, |
| unsigned int | csoId, | ||
| const CSOIdVector & | groupIds ) |
| void ml::CSOList::sendPostEvent | ( | CSOEvent::CSOEventType | eventType, |
| unsigned int | csoId, | ||
| unsigned int | groupId ) |
| void ml::CSOList::sendPreEvent | ( | CSOEvent::CSOEventType | eventType | ) |
Sends a pre-event with the specified event type.
| void ml::CSOList::sendPreEvent | ( | CSOEvent::CSOEventType | eventType, |
| const CSOIdVector & | csoIds ) |
Sends a pre-event with the specified event type and the CSO IDs.
| void ml::CSOList::sendPreEvent | ( | CSOEvent::CSOEventType | eventType, |
| const CSOIdVector & | csoIds, | ||
| const CSOIdVector & | groupIds ) |
| void ml::CSOList::sendPreEvent | ( | CSOEvent::CSOEventType | eventType, |
| unsigned int | csoId ) |
Sends a pre-event with the specified event type and the CSO ID.
| void ml::CSOList::sendPreEvent | ( | CSOEvent::CSOEventType | eventType, |
| unsigned int | csoId, | ||
| const CSOIdVector & | groupIds ) |
| void ml::CSOList::sendPreEvent | ( | CSOEvent::CSOEventType | eventType, |
| unsigned int | csoId, | ||
| unsigned int | groupId ) |
| void ml::CSOList::setCSOCurrentlyUnderMouse | ( | CSO * | csoUnderMouse | ) |
Sets the pointer to the CSO currently under the mouse cursor. At the moment, only the SoView2DCSOExtensibleEditor sets this pointer. You might break networks if you fool around with this.
|
inline |
|
inline |
| void ml::CSOList::setManager | ( | CSOManager * | manager | ) |
Sets the pointer to the internal manager and sets the CSOGroup default rules.
| bool ml::CSOList::setSelected | ( | CSO * | cso | ) |
| bool ml::CSOList::setSelected | ( | CSOGroup * | group | ) |
|
inline |
|
protected |
| void ml::CSOList::undo | ( | ) |
Performs an undo of the last modification.
| 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.
| void ml::CSOList::updateCurrentCSOId | ( | unsigned int | newId | ) |
Updates the current ID if the new ID is larger than the current ID.
| void ml::CSOList::updateCurrentGroupId | ( | const unsigned int | newId | ) |
Updates the current CSOGroup ID if the new ID is larger than the current ID.
| void ml::CSOList::updateDisplays | ( | ) |
Updates all connected information/managing modules (not the renderers!).
|
friend |