SHAPER  9.12.0
PartSet_OverconstraintListener Class Reference

A class for processing overconstraint situation. More...

Inheritance diagram for PartSet_OverconstraintListener:
Inheritance graph

Public Member Functions

 PartSet_OverconstraintListener (ModuleBase_IWorkshop *theWorkshop)
 Constructor. More...
 
void setActive (const bool &theActive)
 If active state is changed, update fully defined state and sketch sub-entities color. More...
 
void getCustomColor (const ObjectPtr &theObject, std::vector< int > &theColor)
 Returns true if the object belongs to internal container of conflicting objects. More...
 
virtual void processEvent (const std::shared_ptr< Events_Message > &theMessage)
 Redefinition of Events_Listener method. More...
 
bool isConflictingObject (const ObjectPtr &theObject) const
 
const std::set< ObjectPtr > & conflictingObjects () const
 
const std::set< ObjectPtr > & objectsToRemove () const
 
bool isFullyConstrained () const
 
virtual EVENTS_EXPORT bool groupMessages ()
 Listener that needs mostly grouped messages received returns true in this method. More...
 

Protected Member Functions

bool appendConflictingObjects (const std::set< ObjectPtr > &theObjects)
 Append objects to the internal container of conflicting object, redisplay necessary objects. More...
 
bool repairConflictingObjects (const std::set< ObjectPtr > &theObjects)
 Removes objects from internal container of conflicting object, redisplay necessary objects. More...
 
void redisplayObjects (const std::set< ObjectPtr > &theObjects)
 Sends update object signal for each object in the container and flush it. 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

A class for processing overconstraint situation.

It contains is a list of sketch constraints with conflicts.

Constructor & Destructor Documentation

◆ PartSet_OverconstraintListener()

PartSet_OverconstraintListener::PartSet_OverconstraintListener ( ModuleBase_IWorkshop theWorkshop)

Constructor.

Parameters
theWorkshopa current workshop to obtain AIS presentation from displayer

Member Function Documentation

◆ setActive()

void PartSet_OverconstraintListener::setActive ( const bool &  theActive)

If active state is changed, update fully defined state and sketch sub-entities color.

Parameters
theActivea state

returned to default state, no custom color for it

◆ getCustomColor()

void PartSet_OverconstraintListener::getCustomColor ( const ObjectPtr &  theObject,
std::vector< int > &  theColor 
)

Returns true if the object belongs to internal container of conflicting objects.

Parameters
theObjectan object to be checked
theColorthe output container to be filled in [red, green, blue] values
Returns
boolean result

◆ processEvent()

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

Redefinition of Events_Listener method.

Implements Events_Listener.

◆ appendConflictingObjects()

bool PartSet_OverconstraintListener::appendConflictingObjects ( const std::set< ObjectPtr > &  theObjects)
protected

Append objects to the internal container of conflicting object, redisplay necessary objects.

Parameters
theObjectsa list of new conflicting objects
Returns
boolean value whether the list differs from the internal list

◆ repairConflictingObjects()

bool PartSet_OverconstraintListener::repairConflictingObjects ( const std::set< ObjectPtr > &  theObjects)
protected

Removes objects from internal container of conflicting object, redisplay necessary objects.

Parameters
theObjectsa list of repaired objects
Returns
boolean value whether the list differs from the internal list

◆ redisplayObjects()

void PartSet_OverconstraintListener::redisplayObjects ( const std::set< ObjectPtr > &  theObjects)
protected

Sends update object signal for each object in the container and flush it.

Parameters
theObjectsa list of object to be redisplayed

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