SHAPER  9.12.0
XGUI_WorkshopListener Class Reference

Class which process the events from the event loop. More...

Inheritance diagram for XGUI_WorkshopListener:
Inheritance graph

Signals

void errorOccurred (std::shared_ptr< Events_InfoMessage > theMsg)
 Emitted when error in applivation happens. More...
 

Public Member Functions

 XGUI_WorkshopListener (XGUI_Workshop *theWorkshop)
 Constructor. More...
 
void initializeEventListening ()
 Register this class in the events loop for several types of events. More...
 
virtual void processEvent (const std::shared_ptr< Events_Message > &theMessage)
 Redefinition of Events_Listener method. More...
 
virtual EVENTS_EXPORT bool groupMessages ()
 Listener that needs mostly grouped messages received returns true in this method. More...
 

Protected Member Functions

bool event (QEvent *theEvent)
 Procedure to process postponed events. More...
 
void onFeatureUpdatedMsg (const std::shared_ptr< ModelAPI_ObjectUpdatedMessage > &theMsg)
 Process feature update message. More...
 
void onFeatureCreatedMsg (const std::shared_ptr< ModelAPI_ObjectUpdatedMessage > &theMsg)
 Process feature created message. More...
 
void onFeatureRedisplayMsg (const std::shared_ptr< ModelAPI_ObjectUpdatedMessage > &theMsg)
 Process feature redisplay message. More...
 
void onFeatureEmptyPresentationMsg (const std::shared_ptr< ModelAPI_ObjectUpdatedMessage > &theMsg)
 Process clearing of presentation. More...
 
bool displayObject (ObjectPtr theObj)
 Displaus object and fit all viewer if the object is first (update viewer will not be called) Asks the module whether the object can be displayed. More...
 
bool customizeFeature (const std::set< ObjectPtr > &theObjects, bool theForceRedisplay)
 Calls the module method of cusomize object for the feature of the current operation Perform cusomize if the force redisplay flag is true or the list of objects contains the current operation feature. More...
 
XGUI_Workshopworkshop () const
 Returns the workshop. More...
 
void groupWhileFlush (const std::shared_ptr< Events_Message > &theMessage)
 Allows to group messages while they are flushed (for flush for groupMessages=true listeners) More...
 
EVENTS_EXPORT void flushGrouped (const Events_ID &theID)
 Sends myGroups on flush finish. More...
 

Detailed Description

Class which process the events from the event loop.

Constructor & Destructor Documentation

◆ XGUI_WorkshopListener()

XGUI_WorkshopListener::XGUI_WorkshopListener ( XGUI_Workshop theWorkshop)

Constructor.

Used only if the workshop is launched in Salome environment

Parameters
theWorkshopa reference to workshop.

Member Function Documentation

◆ initializeEventListening()

void XGUI_WorkshopListener::initializeEventListening ( )

Register this class in the events loop for several types of events.

< Listening application errors.

◆ processEvent()

void XGUI_WorkshopListener::processEvent ( const std::shared_ptr< Events_Message > &  theMessage)
virtual

Redefinition of Events_Listener method.

Implements Events_Listener.

◆ errorOccurred

void XGUI_WorkshopListener::errorOccurred ( std::shared_ptr< Events_InfoMessage theMsg)
signal

Emitted when error in applivation happens.

◆ event()

bool XGUI_WorkshopListener::event ( QEvent theEvent)
protected

Procedure to process postponed events.

◆ onFeatureUpdatedMsg()

void XGUI_WorkshopListener::onFeatureUpdatedMsg ( const std::shared_ptr< ModelAPI_ObjectUpdatedMessage > &  theMsg)
protected

Process feature update message.

Parameters
theMsga message with a container of objects

◆ onFeatureCreatedMsg()

void XGUI_WorkshopListener::onFeatureCreatedMsg ( const std::shared_ptr< ModelAPI_ObjectUpdatedMessage > &  theMsg)
protected

Process feature created message.

Parameters
theMsga message with a container of objects

◆ onFeatureRedisplayMsg()

void XGUI_WorkshopListener::onFeatureRedisplayMsg ( const std::shared_ptr< ModelAPI_ObjectUpdatedMessage > &  theMsg)
protected

Process feature redisplay message.

Parameters
theMsga message with a container of objects

◆ onFeatureEmptyPresentationMsg()

void XGUI_WorkshopListener::onFeatureEmptyPresentationMsg ( const std::shared_ptr< ModelAPI_ObjectUpdatedMessage > &  theMsg)
protected

Process clearing of presentation.

Parameters
theMsgan event message

◆ displayObject()

bool XGUI_WorkshopListener::displayObject ( ObjectPtr  theObj)
protected

Displaus object and fit all viewer if the object is first (update viewer will not be called) Asks the module whether the object can be displayed.

Parameters
theObjan object
theFirstVisualizedBodyan output state whether there are not object displayed in the view and the displayed object is a body
Returns
true if the object is displayed

◆ customizeFeature()

bool XGUI_WorkshopListener::customizeFeature ( const std::set< ObjectPtr > &  theObjects,
bool  theForceRedisplay 
)
protected

Calls the module method of cusomize object for the feature of the current operation Perform cusomize if the force redisplay flag is true or the list of objects contains the current operation feature.

Parameters
theObjectsa list of objects to find current operation feature if forced redisplay is false
theForceRedisplaya flag to customize object even always
Returns
true if the object is modified

◆ workshop()

XGUI_Workshop * XGUI_WorkshopListener::workshop ( ) const
protected

Returns the workshop.

◆ groupMessages()

virtual EVENTS_EXPORT bool Events_Listener::groupMessages ( )
inlinevirtualinherited

Listener that needs mostly grouped messages received returns true in this method.

In this case during the message is flushed, all the new messages are grouped, not sended immideately and then sent in the end of flush.

Reimplemented in SketchSolver_Manager, and SketchPlugin_OverConstraintsResolver.

◆ groupWhileFlush()

void Events_Listener::groupWhileFlush ( const std::shared_ptr< Events_Message > &  theMessage)
protectedinherited

Allows to group messages while they are flushed (for flush for groupMessages=true listeners)

◆ flushGrouped()

void Events_Listener::flushGrouped ( const Events_ID theID)
protectedinherited

Sends myGroups on flush finish.