From: mpv Date: Mon, 15 Sep 2014 08:24:54 +0000 (+0400) Subject: Move Events messages to boost pointers: SketchSolver X-Git-Tag: V_0.4.4~55 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c123bd018e25e5c9e7ea7081bb2ad7c57511a330;p=modules%2Fshaper.git Move Events messages to boost pointers: SketchSolver --- diff --git a/src/SketchSolver/SketchSolver_ConstraintManager.cpp b/src/SketchSolver/SketchSolver_ConstraintManager.cpp index 480fae603..45ead10f9 100644 --- a/src/SketchSolver/SketchSolver_ConstraintManager.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintManager.cpp @@ -59,13 +59,14 @@ SketchSolver_ConstraintManager::~SketchSolver_ConstraintManager() // Class: SketchSolver_Session // Purpose: listen the event loop and process the message // ============================================================================ -void SketchSolver_ConstraintManager::processEvent(const Events_Message* theMessage) +void SketchSolver_ConstraintManager::processEvent( + const boost::shared_ptr& theMessage) { if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_CREATED) || theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_UPDATED) || theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_MOVED)) { - const ModelAPI_ObjectUpdatedMessage* anUpdateMsg = - dynamic_cast(theMessage); + boost::shared_ptr anUpdateMsg = + boost::dynamic_pointer_cast(theMessage); std::set aFeatures = anUpdateMsg->objects(); bool isModifiedEvt = theMessage->eventID() @@ -102,8 +103,8 @@ void SketchSolver_ConstraintManager::processEvent(const Events_Message* theMessa // Solve the set of constraints resolveConstraints(); } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_DELETED)) { - const ModelAPI_ObjectDeletedMessage* aDeleteMsg = - dynamic_cast(theMessage); + boost::shared_ptr aDeleteMsg = + boost::dynamic_pointer_cast(theMessage); const std::set& aFeatureGroups = aDeleteMsg->groups(); // Find SketchPlugin_Sketch::ID() in groups. The constraint groups should be updated when an object removed from Sketch diff --git a/src/SketchSolver/SketchSolver_ConstraintManager.h b/src/SketchSolver/SketchSolver_ConstraintManager.h index 4101906ab..11e610b63 100644 --- a/src/SketchSolver/SketchSolver_ConstraintManager.h +++ b/src/SketchSolver/SketchSolver_ConstraintManager.h @@ -42,7 +42,7 @@ class SketchSolver_ConstraintManager : public Events_Listener /** \brief Implementation of Event Listener method * \param[in] theMessage the data of the event */ - virtual void processEvent(const Events_Message* theMessage); + virtual void processEvent(const boost::shared_ptr& theMessage); protected: SketchSolver_ConstraintManager();