SHAPER  9.12.0
PartSet_CustomPrs Class Reference

This is the module custom presentation, which manage an AIS presentation, that can be filled by a feature and visualized in the viewer additionally to usual workshop objects. More...

Inheritance diagram for PartSet_CustomPrs:
Inheritance graph

Public Member Functions

 PartSet_CustomPrs (ModuleBase_IWorkshop *theWorkshop)
 Constructor. More...
 
bool isActive (const ModuleBase_IModule::ModuleBase_CustomizeFlag &theFlag)
 Returns true if the presentation is active. More...
 
bool activate (const FeaturePtr &theObject, const ModuleBase_IModule::ModuleBase_CustomizeFlag &theFlag, const bool theUpdateViewer)
 Initializes the operation presentation by the parameter object and display the presentation. More...
 
bool deactivate (const ModuleBase_IModule::ModuleBase_CustomizeFlag &theFlag, const bool theUpdateViewer)
 Initializes the operation presentation by empty object and erase the presentation. More...
 
bool redisplay (const ObjectPtr &theObject, const ModuleBase_IModule::ModuleBase_CustomizeFlag &theFlag, const bool theUpdateViewer)
 If the presentation is active[displayed], the shapes of the presentation is recomputed and the presentation is redisplayed. More...
 
void clearPrs ()
 Nullify all internal presentations. More...
 
void disableCustomMode (ModuleBase_IModule::ModuleBase_CustomizeFlag theMode)
 Disable displaying of custom mode. More...
 
void enableCustomModes ()
 Enables disabled custom mode. More...
 
virtual void processEvent (const std::shared_ptr< Events_Message > &theMessage)
 Redefinition of Events_Listener method to listen a moment that the presentation becomes empty. More...
 
virtual EVENTS_EXPORT bool groupMessages ()
 Listener that needs mostly grouped messages received returns true in this method. More...
 

Static Public Member Functions

static const std::string OPERATION_PARAMETER_COLOR ()
 Returns yellow color. More...
 
static const std::string OPERATION_RESULT_COLOR ()
 Returns green color. More...
 
static const std::string OPERATION_HIGHLIGHT_COLOR ()
 Returns color between white and color of highlight. More...
 
static const std::string OPERATION_REMOVE_FEATURE_COLOR ()
 Returns color lighter than sketch feature entity : pink. More...
 
static const std::string OPERATION_SKETCH_PLANE ()
 Returns color equal to default color of construction plugin : green. More...
 

Protected Member Functions

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

This is the module custom presentation, which manage an AIS presentation, that can be filled by a feature and visualized in the viewer additionally to usual workshop objects.

Constructor & Destructor Documentation

◆ PartSet_CustomPrs()

PartSet_CustomPrs::PartSet_CustomPrs ( ModuleBase_IWorkshop theWorkshop)

Constructor.

Parameters
theWorkshopa reference to workshop

Member Function Documentation

◆ OPERATION_PARAMETER_COLOR()

static const std::string PartSet_CustomPrs::OPERATION_PARAMETER_COLOR ( )
inlinestatic

Returns yellow color.

◆ OPERATION_RESULT_COLOR()

static const std::string PartSet_CustomPrs::OPERATION_RESULT_COLOR ( )
inlinestatic

Returns green color.

◆ OPERATION_HIGHLIGHT_COLOR()

static const std::string PartSet_CustomPrs::OPERATION_HIGHLIGHT_COLOR ( )
inlinestatic

Returns color between white and color of highlight.

◆ OPERATION_REMOVE_FEATURE_COLOR()

static const std::string PartSet_CustomPrs::OPERATION_REMOVE_FEATURE_COLOR ( )
inlinestatic

Returns color lighter than sketch feature entity : pink.

◆ OPERATION_SKETCH_PLANE()

static const std::string PartSet_CustomPrs::OPERATION_SKETCH_PLANE ( )
inlinestatic

Returns color equal to default color of construction plugin : green.

◆ isActive()

bool PartSet_CustomPrs::isActive ( const ModuleBase_IModule::ModuleBase_CustomizeFlag theFlag)

Returns true if the presentation is active.

Parameters
theFlagan object AIS presentation type

◆ activate()

bool PartSet_CustomPrs::activate ( const FeaturePtr &  theObject,
const ModuleBase_IModule::ModuleBase_CustomizeFlag theFlag,
const bool  theUpdateViewer 
)

Initializes the operation presentation by the parameter object and display the presentation.

Parameters
theObjectan operation feature source to fill the presentation
theFlagan object AIS presentation type
theUpdateViewerthe parameter whether the viewer should be update immediatelly
Returns
true if the presentation is displayed

◆ deactivate()

bool PartSet_CustomPrs::deactivate ( const ModuleBase_IModule::ModuleBase_CustomizeFlag theFlag,
const bool  theUpdateViewer 
)

Initializes the operation presentation by empty object and erase the presentation.

Parameters
theUpdateViewerthe parameter whether the viewer should be update immediatelly
theFlagan object AIS presentation type
Returns
true if the presentation has been displayed and now it is erased

◆ redisplay()

bool PartSet_CustomPrs::redisplay ( const ObjectPtr &  theObject,
const ModuleBase_IModule::ModuleBase_CustomizeFlag theFlag,
const bool  theUpdateViewer 
)

If the presentation is active[displayed], the shapes of the presentation is recomputed and the presentation is redisplayed.

Parameters
theObjectan object to redisplay
theFlagan object AIS presentation type
theUpdateViewerthe parameter whether the viewer should be update immediatelly
Returns
true if the presentation is redisplayed

◆ clearPrs()

void PartSet_CustomPrs::clearPrs ( )

Nullify all internal presentations.

For example, it can be useful when the viewer/context is closed. If this is not performed and the presentation is assigned in another context, it caused erroneus case because the presentation has linkage to the previous context.

◆ disableCustomMode()

void PartSet_CustomPrs::disableCustomMode ( ModuleBase_IModule::ModuleBase_CustomizeFlag  theMode)
inline

Disable displaying of custom mode.

Parameters
theModea mode to disable

◆ enableCustomModes()

void PartSet_CustomPrs::enableCustomModes ( )
inline

Enables disabled custom mode.

◆ processEvent()

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

Redefinition of Events_Listener method to listen a moment that the presentation becomes empty.

store state to analize it after display/erase is finished

Implements Events_Listener.

◆ 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.