SHAPER  9.12.0
Model_Update Class Reference

Updates the results of features when it is needed. More...

Inheritance diagram for Model_Update:
Inheritance graph

Public Member Functions

 Model_Update ()
 Is called only once, on startup of the application. More...
 
virtual void processEvent (const std::shared_ptr< Events_Message > &theMessage)
 Processes the feature argument update: executes the results. More...
 
virtual EVENTS_EXPORT bool groupMessages ()
 Listener that needs mostly grouped messages received returns true in this method. More...
 

Protected Member Functions

bool addModified (std::shared_ptr< ModelAPI_Feature > theFeature, std::shared_ptr< ModelAPI_Feature > theReason)
 Appends the new modified feature to the myModified, clears myProcessed if needed Returns true if some feature really was marked as modified theReason is the object that causes modification of this feature returns true if something reallsy was added to the modified and must be processed. More...
 
bool processFeature (std::shared_ptr< ModelAPI_Feature > theFeature)
 Recoursively checks and updates features if needed (calls the execute method) Returns true if feature was updated. More...
 
void updateArguments (std::shared_ptr< ModelAPI_Feature > theFeature)
 Updates the selection and parametrical arguments before the later feature analysis Returns true if something really was updated. More...
 
void redisplayWithResults (std::shared_ptr< ModelAPI_Feature > theFeature, const ModelAPI_ExecState theState, bool theUpdateState=true)
 Sends the redisplay events for feature and results, updates the updated status. More...
 
void processFeatures (const bool theFlushRedisplay=true)
 On operation start/end/abort the "Just" fileds must be cleared and processed in the right way. More...
 
void executeFeature (std::shared_ptr< ModelAPI_Feature > theFeature)
 Performs the feature execution. More...
 
void updateStability (void *theSender)
 Updates the properties of object because of stability state changes. More...
 
bool isReason (std::shared_ptr< ModelAPI_Feature > &theFeature, std::shared_ptr< ModelAPI_Object > theReason)
 Returns true if theFeature modification was caused by theReason (may be feature of result of this feature) More...
 
void updateSelection (const std::set< std::shared_ptr< ModelAPI_Object > > &theObjects)
 Updates a selection attributes for the features that possible were affected by creation or reorder of features upper in the history line (issue #1757) 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

Updates the results of features when it is needed.

Constructor & Destructor Documentation

◆ Model_Update()

Model_Update::Model_Update ( )

Is called only once, on startup of the application.

the only one instance initialized on load of the library

Member Function Documentation

◆ processEvent()

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

Processes the feature argument update: executes the results.

Implements Events_Listener.

◆ addModified()

bool Model_Update::addModified ( std::shared_ptr< ModelAPI_Feature theFeature,
std::shared_ptr< ModelAPI_Feature theReason 
)
protected

Appends the new modified feature to the myModified, clears myProcessed if needed Returns true if some feature really was marked as modified theReason is the object that causes modification of this feature returns true if something reallsy was added to the modified and must be processed.

◆ processFeature()

bool Model_Update::processFeature ( std::shared_ptr< ModelAPI_Feature theFeature)
protected

Recoursively checks and updates features if needed (calls the execute method) Returns true if feature was updated.

◆ updateArguments()

void Model_Update::updateArguments ( std::shared_ptr< ModelAPI_Feature theFeature)
protected

Updates the selection and parametrical arguments before the later feature analysis Returns true if something really was updated.

◆ redisplayWithResults()

void Model_Update::redisplayWithResults ( std::shared_ptr< ModelAPI_Feature theFeature,
const ModelAPI_ExecState  theState,
bool  theUpdateState = true 
)
protected

Sends the redisplay events for feature and results, updates the updated status.

◆ processFeatures()

void Model_Update::processFeatures ( const bool  theFlushRedisplay = true)
protected

On operation start/end/abort the "Just" fileds must be cleared and processed in the right way.

Parameters
theFlushRedisplaya boolean value if the redisplay signal should be flushed

◆ executeFeature()

void Model_Update::executeFeature ( std::shared_ptr< ModelAPI_Feature theFeature)
protected

Performs the feature execution.

Returns
the status of execution

◆ updateStability()

void Model_Update::updateStability ( void *  theSender)
protected

Updates the properties of object because of stability state changes.

◆ isReason()

bool Model_Update::isReason ( std::shared_ptr< ModelAPI_Feature > &  theFeature,
std::shared_ptr< ModelAPI_Object theReason 
)
protected

Returns true if theFeature modification was caused by theReason (may be feature of result of this feature)

◆ updateSelection()

void Model_Update::updateSelection ( const std::set< std::shared_ptr< ModelAPI_Object > > &  theObjects)
protected

Updates a selection attributes for the features that possible were affected by creation or reorder of features upper in the history line (issue #1757)

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