45#define ML_CSOLIST_REFCOUNTED 1
91 notificationCB =
nullptr;
92 notificationCBData =
nullptr;
93 notificationFlag = NOTIFICATION_NONE;
217 inline unsigned int numSelectedCSOs()
const {
return static_cast<unsigned int>(_selectedCSOs.size()); }
219 inline unsigned int numSelectedGroups()
const {
return static_cast<unsigned int>(_selectedGroups.size()); }
224 if (_selectedCSOs.size() > 0) {
225 return _selectedCSOs[index];
233 if (_selectedGroups.size() > 0) {
234 return _selectedGroups[index];
262 CSO_DEBUG(
"Using the deprecated method 'CSOList::getCenterOfSelectedCSOs()'; use 'CSOList::getCenterOfSelectedCSOs(bool& resultIsValid)' instead!");
264 return getCenterOfSelectedCSOs(
dummy);
270 CSO_DEBUG(
"Using the deprecated method 'CSOList::getCenterOfSelectedGroups()'; use 'CSOList::getCenterOfSelectedGroups(bool& resultIsValid)' instead!");
272 return getCenterOfSelectedGroups(
dummy);
575 NOTIFICATION_NONE = 0,
577 NOTIFICATION_CSO_SELECTION = 1,
579 NOTIFICATION_GROUP_SELECTION = 2,
581 NOTIFICATION_CSO_FINISHED = 4,
583 NOTIFICATION_GROUP_FINISHED = 8,
585 NOTIFICATION_REPAINT = 16,
587 NOTIFICATION_INTERACTION_INIT = 32,
589 NOTIFICATION_START_NEW_CSO = 64,
591 NOTIFICATION_CSO_MOVED = 128,
593 NOTIFICATION_CSO_UNDER_MOUSE_CHANGED = 256,
595 NOTIFICATION_UNDO_REDO_STATE_CHANGED = 512
626 index0 = index1 = -1;
638 std::vector<CSO*>_csoList;
640 std::vector<CSOGroup*>_groupList;
643 std::vector<CSO*>_selectedCSOs;
645 std::vector<CSOGroup*>_selectedGroups;
648 CSO* _currentlyUnderMouseCSO;
651 bool _csoUndoRedoManagerEnabled;
653 CSOUndoRedoManager* _csoUndoRedoManager;
655 CSOManager* _csoManager;
660 unsigned int _currentLastCSOId;
663 unsigned int _currentLastGroupId;
667 static std::vector<CSOList*> _registeredCSOLists;
670 std::vector<CSONotificationCBData>_notificationObservers;
673 std::map<std::string, int>_csoLabelUniqueIdMap;
676 std::map<std::string, int>_groupLabelUniqueIdMap;
680 static MLuint64 _uniqueListChangeId;
683 bool _enableRepaintObserver;
685 bool _enableFinishedObserver;
687 bool _enableInteractionObserver;
689 bool _enableSelectionObserver;
691 bool _enableStartNewCSOObserver;
693 bool _enableCSOMovedObserver;
695 bool _enableCSOCurrentlyUnderMouseObserver;
698 int _numberOfEventMuteRequests;
704 inline bool _canUseUndoRedo(
bool shouldUseUndoRedo)
const {
return shouldUseUndoRedo && _csoUndoRedoManagerEnabled && _csoUndoRedoManager; }
706 void _setDefaultValues(CSO* cso);
708 void _setDefaultValues(CSOGroup* group);
710 void _setDefaultRules(CSOGroup* group);
713 void _emptyInternalListOfCSOs();
715 void _emptyInternalListOfGroups();
722 bool pathPointListIndexIsInRange(CSO* cso,
int index)
const;
724 bool seedPointIndexIsRange(CSO* cso,
int index)
const;
731 bool _fromStreamV1(std::istream&
inStream, std::string& message);
734 bool _fromStreamV3(std::istream&
inStream, std::string& message);
737 bool _fromStreamV4(std::istream&
inStream, std::string& message);
740 bool _fromStreamV5(std::istream&
inStream,
bool asBinary, std::string& message);
742 bool loadFromVersionBefore5(std::istream&
inStream,
bool binary,
short version,
bool swapBytes, std::string& message);
745 bool _fromStreamV6(std::istream&
inStream,
bool asBinary, std::string& message, ModuleBackgroundTask*
task=
nullptr);
748 void reconstructPathPointListToSeedPointLinks( CSO* cso, std::vector<IndexPair>&
pathIndexPairs, std::vector<IndexPair>&
seedIndexPairs,
const std::string& version, std::string& message);
752 bool _checkLine(
const std::string& line,
const std::string& name, std::string&
errorMessage);
755 inline std::string spaces(
unsigned int numSpaces)
const
766 std::string buildLabel(std::string label, std::string format,
int id)
769 size_t p = format.find(
"%i");
770 if (p == std::string::npos)
773 p = format.find(
"%i");
775 std::stringstream
ss;
777 std::string
tmp = format.replace(p, 2,
ss.str());
778 return label.append(
tmp);
782 static void registerCSOList(CSOList* csoList);
784 static void deregisterCSOList(CSOList* csoList);
786 friend class CSOLoad;
#define CSO_DEBUG(msg)
Output macro for debug output.
std::map< unsigned int, unsigned int > CSOIdToCSOIdMap
Defines a map type to map old CSOIds to new CSOIds when merging CSOLists.
const unsigned int INVALID_CSO_ID
Defines a CSO/CSOGroup id that is invalid.
std::vector< unsigned int > CSOIdVector
Defines a vector to hold CSO and CSOGroup ids.
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
Class for all CSO events.
CSOEventType
Enumeration for specifying the exact type of event.
A CSOGroup comprises a number of CSOs, which themselves can be in a number of different CSOGroups.
The CSOListRules class controls how the CSOList should treat CSOGroups if their CSOs are removed.
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
void updateCurrentGroupId(const unsigned int newId)
Updates the current group id if the new id is bigger than the current id.
~CSOList() override
The CSOList destructor is protected since the CSOList ownership is managed by the CSOListPtr intrusiv...
CSO * addCSO(const std::vector< Vector3 > &seedPositions, bool closed, bool useUndoRedo)
Adds a new CSO to the list and returns its pointer.
void sendModuleEventGroup(CSOEvent *event)
Sends a module group event.
void enableFinishedObserver()
Enables the finished observer mechanism.
Vector3 getCenterOfSelectedCSOs(bool &resultIsValid) const
Returns the center position of all bounding boxes of all selected CSOs.
MLuint64 getListChangeId() const
Get the list change id, which changes whenever a CSO is added or removed (unique accross all CSOLists...
unsigned int getCSOIndex(CSO *cso) const
Returns the index of the given CSO in its list.
CSO * addCSO(unsigned int numSeedPoints, bool closed, bool useUndoRedo)
Adds a new CSO to the list and returns its pointer.
CSOGroup * addGroup(const std::string &label, bool useUndoRedo=true)
Adds a new Group with given label to the list and returns a pointer to it.
bool isStartNewCSONotificationEnabled() const
Returns whether the 'start new CSO' notification is enabled.
void breakCSOfromAllGroups(CSO *cso, bool useUndoRedo=true)
Breaks all combinations of the given CSO and any Group.
CSOIdVector getSelectedCSOIds()
Returns a vector with ids of the selected CSOs.
unsigned int getGroupIndex(unsigned int id) const
Returns the index of the Group with the given id in its list.
void disableCSOMovedObserver()
Disables the 'CSO moved' observer mechanism.
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.
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 * 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.
bool setSelected(CSO *cso)
Sets the given CSO as being selected and deselects all other CSOs.
CSOList(const CSOList &csoList)
Copy constructor.
CSOList * deepCopy() const override
Create a deep copy of the CSOList.
void sendPreEvent(CSOEvent::CSOEventType eventType, unsigned int csoId, unsigned int groupId)
Sends a pre-event with the given type, CSO id, and Group id.
void enableInteractionObserver()
Enables the interaction observer mechanism.
CSO * 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.
bool isSelected(const CSOGroup *group) const
Returns whether the given CSOGroup is currently selected.
void resetUniqueGroupLabelIdMap()
Resets the data structure that is used to determine unique ids for getUniqueCSOLabel Afterwards,...
CSOGroup * getGroupById(unsigned int id) const
Returns a pointer to a Group with the given id.
CSOUndoRedoManager * getUndoRedoManager()
Returns a pointer to the undo/redo manager of this CSOList.
CSOList(bool shouldRegisterCSOList)
void sendPreEvent(CSOEvent::CSOEventType eventType, const CSOIdVector &csoIds)
Sends a pre-event with the given event type and the CSO ids.
bool hasCSO(CSO *cso) const
Returns whether there is the given CSO in the list.
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 succes...
bool removeCSO(unsigned int id, bool useUndoRedo=true)
Removes a CSO by its id and removes it from all Groups.
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 g...
unsigned int getCurrentGroupId()
Returns the current last id (incremented each call) for CSOGroups.
CSOGroup * addGroup(bool useUndoRedo=true)
Adds a new Group to the list and returns a pointer to it.
unsigned int numCSOs() const
Returns the number of CSOs in the list.
void disableFinishedObserver()
Disables the finished observer mechanism.
void listChanged()
Called whenever the list has changed to generate a new id. This also changes the geometry id.
CSOIdVector getAllCSOIds() const
Returns a vector with the ids of the CSOs contained in the list.
void removeFromSelection(CSO *cso)
Removes the given CSO from the list of selected CSOs.
void addSelected(CSOGroup *group)
Adds the given CSOGroup to the list of selected CSOGroups (no double entry).
void addSelected(CSO *cso)
Adds the given CSO to the list of selected CSOs (no double entry).
CSOGroup * getGroupAt(unsigned int index) const
Returns Group at the given index position.
void breakAllCSOsFromGroup(CSOGroup *group, bool useUndoRedo=true)
Breaks all combinations of the given Group and any CSO.
void sendPostEvent(CSOEvent::CSOEventType eventType, unsigned int csoId, const CSOIdVector &groupIds)
Sends a post-event with the given type, CSO id, and Group ids.
void sendPostEvent(CSOEvent::CSOEventType eventType, const CSOIdVector &csoIds, const CSOIdVector &groupIds)
Sends a post-event with the given type, CSO ids, and Group ids.
void registerCSOListForNotificationObservers()
Registers this CSOList in the static list of CSOLists for handling observers.
void sendPostEvent(CSOEvent::CSOEventType eventType, const CSOIdVector &csoIds)
Sends a post-event with the given type and CSO ids.
CSO * addCSO(bool useUndoRedo=true)
Adds a new CSO to the list and returns its pointer.
void setManager(CSOManager *manager)
Sets the pointer to the internal manager and sets the group default rules.
void undo()
Performs an undo of the last modification.
void setCurrentCSOId(unsigned int id)
Sets the current last id for CSOs. Do not mess with it.
void removeNotificationObserver(csoNotificationCB *callback, void *userData)
Removes a notification observer from this CSOList.
bool isNotMutingEvents()
whether CSOEvents are currently emitted
CSO * getCSOById(unsigned int id) const
Returns a pointer to the CSO with the given unique id.
CSOGroup * getGroupByLabel(const std::string &label) const
Returns a pointer to a Group with the given label.
void sendCloseEventGroup()
Sends a CSOLIST_EVENT_GROUP_CLOSE event to let listeners combine preceding events....
void clearSelectedCSOs()
Clears all selected CSOs.
void enableSelectionObserver()
Enables the selection observer mechanism.
CSOList()
Standard constructor.
bool removeGroup(CSOGroup *group, bool useUndoRedo=true)
Removes the given Group and removes the group from all CSOs.
CSOIdVector getAllGroupIds() const
Returns a vector with the ids of the groups contained in the list.
void enableStartNewCSOObserver()
Enables the 'start new CSO' observer mechanism.
void enableUndoRedoManager()
Enables the undo/redo mechanism.
bool removeAll(bool useUndoRedo=true)
Removes all CSOs and Groups and resets all else.
void clone(const CSOList &csoList, bool useUndoRedo=false)
Clones the internal CSOs and CSOGroups of the given CSOList to this one.
void notifyObservers(int notificationFlag)
Notifies all observers.
bool isInteractionInitNotificationEnabled() const
Returns whether the interaction init notification is enabled.
unsigned int numSelectedCSOs() const
Returns the number of selected CSOs.
CSO * 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.
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.
void updateCurrentCSOId(unsigned int newId)
Updates the current id if the new id is bigger than the current id.
bool isFinishedNotificationEnabled() const
Returns whether the finished notification is enabled.
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.
bool removeCSO(CSO *cso, bool useUndoRedo=true)
Removes a given CSO from the list and from Groups it is in.
bool isSelectionNotificationEnabled() const
Returns whether the selection notification is enabled.
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.
MLuint64 getGeometryChangeId() const
Get the geometry change id, which changes on any CSO geometry change or list change (unique accross a...
CSOGroup * 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.
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.
static EnumValues< CSOPathPointsStyle > getLineStyleModes()
void sendOpenEventGroup()
Sends a CSOLIST_EVENT_GROUP_OPEN event to let listeners combine following events.
unsigned int numSelectedGroups() const
Returns the number of selected CSOGroups.
void removeFromSelection(const std::vector< CSO * > &csos)
Removes the given CSOs from the list of selected CSOs.
CSO * getSelectedCSOAt(unsigned int index) const
Returns a pointer to the selected CSO at the given index; no checking!
unsigned int getCSOIndex(unsigned int id) const
Returns the index of the CSO with the given id in its list.
bool isUndoRedoManagerEnabled() const
Returns 'true' if the undo/redo mechanism is enabled, 'false' otherwise.
void sendPreEvent(CSOEvent::CSOEventType eventType, unsigned int csoId)
Sends a pre-event with the given event type and the CSO id.
CSO * getCSOByLabel(const std::string &label) const
Returns a pointer to the first CSO with the given label.
ML_SET_ADDSTATE_VERSION(1)
void addStateToTree(TreeNode *) const override
Attaches the object state as children of the given parent node.
bool isCSOMovedNotificationEnabled() const
Returns whether the 'CSO moved' notification is enabled.
bool removeAllCSO(bool useUndoRedo=true)
Removes all CSOs from the list and from all Groups they are in.
void resetUniqueCSOLabelIdMap()
Resets the data structure that is used to determine unique ids for getUniqueCSOLabel.
CSO * getCSOCurrentlyUnderMouse() const
Returns the pointer to the CSO currently under the mouse cursor.
void disableSelectionObserver()
Disables the selection observer mechanism.
void removeFromSelection(const std::vector< CSOGroup * > &groups)
Removes the given CSOGroups from the list of selected CSOGroups.
void sendPostEvent(CSOEvent::CSOEventType eventType, unsigned int csoId, unsigned int groupId)
Sends a post-event with the given type, CSO id, and Group id.
CSO * addPoint(const Vector3 &position, const std::string &subtype="point")
Adds a point CSO at the given position.
void setCurrentGroupId(unsigned int id)
Sets the current last id for Groups. Do not mess with it.
CSO * 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.
void muteEvents()
Prevent the CSOList from sending any CSOEvents until unmuteEvents is called.
unsigned int getCurrentCSOId()
Returns the current last id (incremented each call) for CSOs.
CSO * 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.
CSO * addCSONoEvent(bool useUndoRedo=true)
Adds a new CSO to the list and returns its pointer. (Without sending any events).
void sendPostEvent(CSOEvent::CSOEventType eventType, unsigned int csoId)
Sends a post-event with the given type and CSO id.
void _addGroupRelationCommand(CSO *cso, CSOGroup *group)
helper method to be used only inside MLCSO
bool isRepaintNotificationEnabled() const
Returns whether the repaint notification is enabled.
void setUndoRedoManager(CSOUndoRedoManager *undoRedoManager)
Sets the internal undo/redo manager.
void addNotificationObserver(csoNotificationCB *callback, void *userData)
Adds a notification observer to this CSOList.
void closeUndoRedoGroup()
Closes a undo/redo group. All undoable commands before this are grouped together.
void disableUndoRedoManager()
Enables the undo/redo mechanism.
bool isCSOCurrentlyUnderMouseNotificationEnabled() const
Returns whether the 'CSO currently under mouse' notification is enabled.
static EnumValues< CSOVoxelWriteModes > getVoxelWriteModes()
Vector3 getCenterOfSelectedGroups(bool &resultIsValid) const
Returns the center position of all bounding boxes of all CSOs of all selected CSOGroups.
void enableCSOCurrentlyUnderMouseObserver()
Enables the 'CSO currently under mouse' observer mechanism.
void clearSelectedGroups()
Clears all selected CSOGroups.
Vector3 getCenterOfSelectedCSOs() const
/deprecated Returns the center position of all bounding boxes of all selected CSOs.
void unmuteEvents()
Revokes a mute request.
void sendPreEvent(CSOEvent::CSOEventType eventType, unsigned int csoId, const CSOIdVector &groupIds)
Sends a post-event with the given type, CSO id, and Group ids.
bool isSelected(const CSO *cso) const
Returns whether the given CSO is currently selected.
void disableCSOCurrentlyUnderMouseObserver()
Disables the 'CSO currently under mouse' observer mechanism.
void disableRepaintObserver()
Disables the repaint observer mechanism.
bool setSelected(CSOGroup *group)
Set the given CSOGroup as being selected and deselects all other Groups.
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.
void disableStartNewCSOObserver()
Disables the 'start new CSO' observer mechanism.
static void removeNotificationObserverFromAllCSOLists(csoNotificationCB *callback, void *userData)
Removes a certain notification observer from all CSOLists.
void removeFromSelection(CSOGroup *group)
Removes the given CSOGroup from the list of selected CSOGroups.
CSOGroup * getSelectedGroupAt(unsigned int index) const
Returns a pointer to the selected CSOGroup at the given index; no checking!
void enableRepaintObserver()
Enables the repaint observer mechanism.
bool removeGroup(unsigned int id, bool useUndoRedo=true)
Removes a Group by its id and removes it from all CSOs.
void setCSOCurrentlyUnderMouse(CSO *csoUnderMouse)
Sets the pointer to the CSO currently under the mouse cursor.
void updateDisplays()
Updates all connected information/managing modules (not the renderers!).
void openUndoRedoGroup(const std::string &description="Contour Operation")
Opens a undo/redo group. All undoable commands after this are grouped together.
void geometryChanged()
Called whenever the geometry of a CSO has changed.
CSOManager * getManager()
Returns a pointer to the manager of this CSOList.
void readStateFromTree(TreeNode *) override
Reads the object state from the children of the given parent node.
CSOIdVector getSelectedGroupIds()
Returns a vector with ids of the selected groups.
void disableInteractionObserver()
Disables the interaction observer mechanism.
Vector3 getCenterOfSelectedGroups() const
/deprecated Returns the center position of all bounding boxes of all CSOs of all selected CSOGroups.
unsigned int getGroupIndex(CSOGroup *group) const
Returns the index of the given Group in its list.
static EnumValues< CSOSeedPointStyle > getSeedPointStyles()
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.
bool hasGroup(CSOGroup *group) const
Returns whether there is the given CSOGroup in the list.
static void alignSeedPathLinks(CSO *cso)
Aligns seed point positions with path point lists of a given CSO by a squared distance sum criterion.
CSO * 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.
void redo()
Performs a redo of the last undone modification.
void enableCSOMovedObserver()
Enables the 'CSO moved' observer mechanism.
bool combineCSOandGroup(CSO *cso, CSOGroup *group, bool useUndoRedo=true)
Combines the given CSO with the given Group.
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...
void sendPreEvent(CSOEvent::CSOEventType eventType)
Sends a pre-event with the given event type.
bool removeAllGroups(bool useUndoRedo)
Removes all Groups and all groups from all CSOs.
void breakCSOandGroup(CSO *cso, CSOGroup *group, bool useUndoRedo=true)
Breaks the combination of the given CSO and the given Group.
CSO * getCSOAt(unsigned int index) const
Returns a pointer to the CSO at the given position in the internal list.
void sendPostEvent(CSOEvent::CSOEventType eventType)
Sends a post-event with the given event type.
void clearSelectedSeedPoints()
Clears all selected seed points in all CSOs.
unsigned int numGroups() const
Returns the number of CSOGroups.
CSOListRules & getRules()
Return the rules for this CSOList.
The CSOManager allows for storing and iterating CSOs, and implements an undo/redo mechanism.
Manager class for maintaining the undo and the redo stacks.
The CSO represents a contour segmentation object.
Helper class that stores a list of typed enum values and their string names.
ModuleBackgroundTask extends the ImagingBackgroundTask with a number of useful methods that allow asy...
RefCountedBase class adds intrusive reference counting support to the Base class.
The class TreeNode is the abstract base class for the import/export of ML objects.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#define ML_REFCOUNTED_PTR(CLASSNAME)
Macro that defines convenience Ptr/ConstPtr typedefs to be used instead of intrusive_ptr templates.
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.
UINT64 MLuint64
Introduce platform independent 64 bit unsigned integer type.
void csoNotificationCB(void *data, int notificationFlag)
Defines the function signature for the callback methods that is to be touched by a CSOList notificati...
This struct combines a function pointer, a user data pointer and a flag for the notification observer...
int notificationFlag
The notification flag encodes which notifications are sent.
csoNotificationCB * notificationCB
The callback function that is triggered by the notification.
void * notificationCBData
The callback data that is a pointer to the observer object.