MeVisLab Toolbox Reference
ml::CSOEvent Class Reference

#include <CSOEvent.h>

Inheritance diagram for ml::CSOEvent:
ml::BaseEvent

Public Types

enum  CSOEventType {
  NONE = 0 , MODULE_EVENT , CSOLIST_EVENT_GROUP_OPEN , CSOLIST_EVENT_GROUP_CLOSE ,
  CSOLIST_CLEAR , CSOLIST_CLONE , CSOLIST_MERGE , CSOLIST_LOAD ,
  CSO_ADD , CSO_REMOVE , CSO_MODIFICATION , CSO_COPY ,
  CSO_CLOSING , CSO_OPENING , CSO_GEOMETRY_CHANGE , CSO_DELETE_SEEDPOINT ,
  CSO_MOUSE_OVER_CHANGE , CSO_SELECTION_CHANGE , CSO_USER_DATA_CHANGE , CSO_VISUAL_ATTRIBUTE_CHANGE ,
  CSO_LABEL , CSO_DESCRIPTION , CSO_TIMEPOINT_INDEX , CSO_SHOW_STATE ,
  CSO_EDITABLE_STATE , CSO_VOXELIZE_STATE , CSO_VOXEL_WRITE_MODE , CSO_VOXEL_WRITE_VALUE ,
  GROUP_ADD , GROUP_REMOVE , GROUP_CLEAR , GROUP_COPY ,
  CSO_ADD_TO_GROUP , CSO_REMOVE_FROM_GROUP , GROUP_SELECTION_CHANGE , GROUP_USER_DATA_CHANGE ,
  GROUP_VISUAL_ATTRIBUTE_CHANGE , GROUP_LABEL , GROUP_DESCRIPTION , GROUP_TIMEPOINT_INDEX ,
  GROUP_SHOW_STATE , GROUP_EDITABLE_STATE , GROUP_VOXELIZE_STATE , GROUP_VOXEL_WRITE_MODE ,
  GROUP_VOXEL_WRITE_VALUE , CSO_INTERACTION , CSO_CREATION , NUM_CSO_EVENTS
}
 Enumeration for specifying the exact type of event. More...

Public Member Functions

 CSOEvent ()
 Standard constructor.
 CSOEvent (CSOEventType eventTypeArg, bool isPostCommandArg=true)
 Constructor taking an event type and whether it is a pre/post command.
CSOEventoperator= (const CSOEvent &event)
 Assignment operator.
bool hasCSOIds () const
 Returns whether CSO IDs are registered with this event.
bool hasGroupIds () const
 Returns whether CSOGroup IDs are registered with this event.
void addCSOId (unsigned int id)
 Adds a CSO ID if id is not INVALID_CSO_ID.
void addGroupId (unsigned int id)
 Adds a CSOGroup ID if id is not INVALID_CSO_ID.
void addCSOIds (const CSOIdVector &csoIds)
 Adds all given CSO IDs if an ID is not INVALID_CSO_ID.
void addGroupIds (const CSOIdVector &groupIds)
 Adds all given CSOGroup IDs if an ID is not INVALID_CSO_ID.
const CSOIdVectorcsoIds () const
 Returns the vector with CSO IDs.
const CSOIdVectorgroupIds () const
 Returns the vector with CSOGroup IDs.
CSOEventType eventType () const
 Returns the event type.
void setEventType (CSOEventType eventTypeArg)
 Sets the event type.
bool isPostCommand () const
 Returns whether the event is a post command.
bool isPreCommand () const
 Returns whether the event is a pre command.
void setIsPostCommand (bool flag)
 Sets whether the event is a pre or post command.
void setSenderType (const std::string &senderTypeArg)
 Sets the sender type string. This is typically the module type from where the event is sent.
std::string senderType () const
 Returns the sender type string. This is typically the module type from where the event is sent.
void setSenderName (const std::string &senderNameArg)
 Sets the sender name string. This is typically the module instance name from where the event is sent.
std::string senderName () const
 Returns the sender name string. This is typically the module instance name from where the event is sent.
void setCustomMessage (const std::string &customMessageArg)
 Sets the custom message string. This can be used to identify the method or the subroutine from where the event is sent.
std::string customMessage () const
 Returns the custom message string. This can be used to identify the method or the subroutine from where the event is sent.
void setModuleEventGroupId (MLuint64 id)
 Sets a unique event ID. This is done by the module CSOGroup scope class. No need to temper with it.
MLuint64 moduleEventGroupId () const
 Returns a unique module CSOGroup event ID.
 ML_CLASS_HEADER (CSOEvent)
Public Member Functions inherited from ml::BaseEvent
 BaseEvent ()
virtual ~BaseEvent ()
EventSourcesource () const
 Returns the Base object emitting this event.

Static Public Member Functions

static std::string getEventTypeName (CSOEventType eventType)
 Maps event types to strings with their name.

Protected Attributes

CSOIdVector _csoIds
 Vector of CSO IDs.
CSOIdVector _groupIds
 Vector of CSOGroup IDs.
CSOEventType _eventType
 The event type.
bool _isPostCommand
 Whether it is a pre or post command.
std::string _senderType
std::string _senderName
std::string _customMessage
MLuint64 _moduleEventGroupId

Detailed Description

Class for all CSO events. An event carries an event type, information about CSO / CSOGroup IDs (if available), as well as a number of strings to identify the event source. Those strings are set only by modules, if the event is sent by a basic method in CSOList, CSO, or CSOGroup, those strings are left empty. If the event is sent by a module, it also has a unique identifier to make it easy to match open/close event pairs. Application events are once send before something happens, and after something has happened. So there is a pre-event and a post-event, distinguishable by the 'isPostCommand' flag.

Definition at line 38 of file CSOEvent.h.

Member Enumeration Documentation

◆ CSOEventType

Enumeration for specifying the exact type of event.

Enumerator
NONE 
MODULE_EVENT 
CSOLIST_EVENT_GROUP_OPEN 
CSOLIST_EVENT_GROUP_CLOSE 
CSOLIST_CLEAR 
CSOLIST_CLONE 
CSOLIST_MERGE 
CSOLIST_LOAD 
CSO_ADD 
CSO_REMOVE 
CSO_MODIFICATION 
CSO_COPY 
CSO_CLOSING 
CSO_OPENING 
CSO_GEOMETRY_CHANGE 
CSO_DELETE_SEEDPOINT 
CSO_MOUSE_OVER_CHANGE 
CSO_SELECTION_CHANGE 
CSO_USER_DATA_CHANGE 
CSO_VISUAL_ATTRIBUTE_CHANGE 
CSO_LABEL 
CSO_DESCRIPTION 
CSO_TIMEPOINT_INDEX 
CSO_SHOW_STATE 
CSO_EDITABLE_STATE 
CSO_VOXELIZE_STATE 
CSO_VOXEL_WRITE_MODE 
CSO_VOXEL_WRITE_VALUE 
GROUP_ADD 
GROUP_REMOVE 
GROUP_CLEAR 
GROUP_COPY 
CSO_ADD_TO_GROUP 
CSO_REMOVE_FROM_GROUP 
GROUP_SELECTION_CHANGE 
GROUP_USER_DATA_CHANGE 
GROUP_VISUAL_ATTRIBUTE_CHANGE 
GROUP_LABEL 
GROUP_DESCRIPTION 
GROUP_TIMEPOINT_INDEX 
GROUP_SHOW_STATE 
GROUP_EDITABLE_STATE 
GROUP_VOXELIZE_STATE 
GROUP_VOXEL_WRITE_MODE 
GROUP_VOXEL_WRITE_VALUE 
CSO_INTERACTION 
CSO_CREATION 
NUM_CSO_EVENTS 

Definition at line 48 of file CSOEvent.h.

Constructor & Destructor Documentation

◆ CSOEvent() [1/2]

ml::CSOEvent::CSOEvent ( )
inline

Standard constructor.

Definition at line 110 of file CSOEvent.h.

References _eventType, _isPostCommand, _moduleEventGroupId, and NONE.

Referenced by ML_CLASS_HEADER(), and operator=().

◆ CSOEvent() [2/2]

ml::CSOEvent::CSOEvent ( CSOEventType eventTypeArg,
bool isPostCommandArg = true )
inline

Constructor taking an event type and whether it is a pre/post command.

Definition at line 118 of file CSOEvent.h.

References _eventType, _isPostCommand, and _moduleEventGroupId.

Member Function Documentation

◆ addCSOId()

void ml::CSOEvent::addCSOId ( unsigned int id)

Adds a CSO ID if id is not INVALID_CSO_ID.

◆ addCSOIds()

void ml::CSOEvent::addCSOIds ( const CSOIdVector & csoIds)

Adds all given CSO IDs if an ID is not INVALID_CSO_ID.

References csoIds().

◆ addGroupId()

void ml::CSOEvent::addGroupId ( unsigned int id)

Adds a CSOGroup ID if id is not INVALID_CSO_ID.

◆ addGroupIds()

void ml::CSOEvent::addGroupIds ( const CSOIdVector & groupIds)

Adds all given CSOGroup IDs if an ID is not INVALID_CSO_ID.

References groupIds().

◆ csoIds()

const CSOIdVector & ml::CSOEvent::csoIds ( ) const
inline

Returns the vector with CSO IDs.

Definition at line 144 of file CSOEvent.h.

References _csoIds.

Referenced by addCSOIds().

◆ customMessage()

std::string ml::CSOEvent::customMessage ( ) const
inline

Returns the custom message string. This can be used to identify the method or the subroutine from where the event is sent.

Definition at line 177 of file CSOEvent.h.

References _customMessage.

◆ eventType()

CSOEventType ml::CSOEvent::eventType ( ) const
inline

Returns the event type.

Definition at line 149 of file CSOEvent.h.

References _eventType.

Referenced by getEventTypeName().

◆ getEventTypeName()

std::string ml::CSOEvent::getEventTypeName ( CSOEventType eventType)
static

Maps event types to strings with their name.

References eventType().

◆ groupIds()

const CSOIdVector & ml::CSOEvent::groupIds ( ) const
inline

Returns the vector with CSOGroup IDs.

Definition at line 146 of file CSOEvent.h.

References _groupIds.

Referenced by addGroupIds().

◆ hasCSOIds()

bool ml::CSOEvent::hasCSOIds ( ) const
inline

Returns whether CSO IDs are registered with this event.

Definition at line 129 of file CSOEvent.h.

References _csoIds.

◆ hasGroupIds()

bool ml::CSOEvent::hasGroupIds ( ) const
inline

Returns whether CSOGroup IDs are registered with this event.

Definition at line 131 of file CSOEvent.h.

References _groupIds.

◆ isPostCommand()

bool ml::CSOEvent::isPostCommand ( ) const
inline

Returns whether the event is a post command.

Definition at line 158 of file CSOEvent.h.

References _isPostCommand.

◆ isPreCommand()

bool ml::CSOEvent::isPreCommand ( ) const
inline

Returns whether the event is a pre command.

Definition at line 160 of file CSOEvent.h.

References _isPostCommand.

◆ ML_CLASS_HEADER()

ml::CSOEvent::ML_CLASS_HEADER ( CSOEvent )

References CSOEvent().

◆ moduleEventGroupId()

MLuint64 ml::CSOEvent::moduleEventGroupId ( ) const
inline

Returns a unique module CSOGroup event ID.

Definition at line 182 of file CSOEvent.h.

References _moduleEventGroupId.

◆ operator=()

CSOEvent & ml::CSOEvent::operator= ( const CSOEvent & event)

Assignment operator.

References CSOEvent().

◆ senderName()

std::string ml::CSOEvent::senderName ( ) const
inline

Returns the sender name string. This is typically the module instance name from where the event is sent.

Definition at line 172 of file CSOEvent.h.

References _senderName.

◆ senderType()

std::string ml::CSOEvent::senderType ( ) const
inline

Returns the sender type string. This is typically the module type from where the event is sent.

Definition at line 167 of file CSOEvent.h.

References _senderType.

◆ setCustomMessage()

void ml::CSOEvent::setCustomMessage ( const std::string & customMessageArg)
inline

Sets the custom message string. This can be used to identify the method or the subroutine from where the event is sent.

Definition at line 175 of file CSOEvent.h.

References _customMessage.

◆ setEventType()

void ml::CSOEvent::setEventType ( CSOEventType eventTypeArg)
inline

Sets the event type.

Definition at line 155 of file CSOEvent.h.

References _eventType.

◆ setIsPostCommand()

void ml::CSOEvent::setIsPostCommand ( bool flag)
inline

Sets whether the event is a pre or post command.

Definition at line 162 of file CSOEvent.h.

References _isPostCommand.

◆ setModuleEventGroupId()

void ml::CSOEvent::setModuleEventGroupId ( MLuint64 id)
inline

Sets a unique event ID. This is done by the module CSOGroup scope class. No need to temper with it.

Definition at line 180 of file CSOEvent.h.

References _moduleEventGroupId.

◆ setSenderName()

void ml::CSOEvent::setSenderName ( const std::string & senderNameArg)
inline

Sets the sender name string. This is typically the module instance name from where the event is sent.

Definition at line 170 of file CSOEvent.h.

References _senderName.

◆ setSenderType()

void ml::CSOEvent::setSenderType ( const std::string & senderTypeArg)
inline

Sets the sender type string. This is typically the module type from where the event is sent.

Definition at line 165 of file CSOEvent.h.

References _senderType.

Member Data Documentation

◆ _csoIds

CSOIdVector ml::CSOEvent::_csoIds
protected

Vector of CSO IDs.

Definition at line 189 of file CSOEvent.h.

Referenced by csoIds(), and hasCSOIds().

◆ _customMessage

std::string ml::CSOEvent::_customMessage
protected

Definition at line 202 of file CSOEvent.h.

Referenced by customMessage(), and setCustomMessage().

◆ _eventType

CSOEventType ml::CSOEvent::_eventType
protected

The event type.

Definition at line 193 of file CSOEvent.h.

Referenced by CSOEvent(), CSOEvent(), eventType(), and setEventType().

◆ _groupIds

CSOIdVector ml::CSOEvent::_groupIds
protected

Vector of CSOGroup IDs.

Definition at line 191 of file CSOEvent.h.

Referenced by groupIds(), and hasGroupIds().

◆ _isPostCommand

bool ml::CSOEvent::_isPostCommand
protected

Whether it is a pre or post command.

Definition at line 195 of file CSOEvent.h.

Referenced by CSOEvent(), CSOEvent(), isPostCommand(), isPreCommand(), and setIsPostCommand().

◆ _moduleEventGroupId

MLuint64 ml::CSOEvent::_moduleEventGroupId
protected

Definition at line 204 of file CSOEvent.h.

Referenced by CSOEvent(), CSOEvent(), moduleEventGroupId(), and setModuleEventGroupId().

◆ _senderName

std::string ml::CSOEvent::_senderName
protected

Definition at line 200 of file CSOEvent.h.

Referenced by senderName(), and setSenderName().

◆ _senderType

std::string ml::CSOEvent::_senderType
protected

Definition at line 198 of file CSOEvent.h.

Referenced by senderType(), and setSenderType().


The documentation for this class was generated from the following file:
  • MeVisLab/Standard/Sources/ML/MLCSO/CSOBase/CSOEvent.h