Salome HOME
Making compilable all non-GUI classes
authormpv <mikhail.ponikarov@opencascade.com>
Fri, 11 Jul 2014 13:37:49 +0000 (17:37 +0400)
committermpv <mikhail.ponikarov@opencascade.com>
Fri, 11 Jul 2014 13:37:49 +0000 (17:37 +0400)
23 files changed:
src/ConstructionPlugin/ConstructionPlugin_Point.cpp
src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp
src/FeaturesPlugin/FeaturesPlugin_Extrusion.h
src/Model/Model_Document.cpp
src/Model/Model_Document.h
src/Model/Model_ResultBody.cpp
src/Model/Model_ResultBody.h
src/Model/Model_ResultConstruction.h
src/Model/Model_ResultPart.cpp
src/Model/Model_ResultPart.h
src/ModelAPI/ModelAPI.i
src/ModelAPI/ModelAPI_Document.h
src/ModelAPI/ModelAPI_Feature.h
src/ModelAPI/ModelAPI_ResultConstruction.h
src/ModelAPI/ModelAPI_ResultPart.h
src/PartSetPlugin/PartSetPlugin_Duplicate.cpp
src/PartSetPlugin/PartSetPlugin_Part.cpp
src/PartSetPlugin/PartSetPlugin_Remove.cpp
src/SketchPlugin/SketchPlugin_Circle.cpp
src/SketchPlugin/SketchPlugin_Line.cpp
src/SketchPlugin/SketchPlugin_Point.cpp
src/SketchPlugin/SketchPlugin_Sketch.cpp
src/SketchSolver/SketchSolver_ConstraintManager.cpp

index aaa697dd5684f8c58d26b222f5e798a932ce3357..66dfdfdf1dab7c482058eb6b50bf3bb3bbb73016 100644 (file)
@@ -7,6 +7,7 @@
 #include "ModelAPI_Document.h"
 #include "ModelAPI_Data.h"
 #include "ModelAPI_AttributeDouble.h"
+#include <ModelAPI_ResultConstruction.h>
 #include <GeomAlgoAPI_PointBuilder.h>
 #include <GeomAPI_Pnt.h>
 
@@ -28,5 +29,7 @@ void ConstructionPlugin_Point::execute()
   boost::shared_ptr<GeomAPI_Pnt> aPnt(new GeomAPI_Pnt(
     data()->real(POINT_ATTR_X)->value(), data()->real(POINT_ATTR_Y)->value(), data()->real(POINT_ATTR_Z)->value()));
 
-  data()->store(GeomAlgoAPI_PointBuilder::point(aPnt));
+  boost::shared_ptr<ModelAPI_ResultConstruction> aConstr = document()->createConstruction();
+  aConstr->setShape(GeomAlgoAPI_PointBuilder::point(aPnt));
+  results().push_back(aConstr);
 }
index 328dde5f0e5f85aa35807be05e49c2fc86d5b460..e89d503521a97bcde385000421af90f9303c906a 100644 (file)
@@ -6,6 +6,8 @@
 #include <ModelAPI_PluginManager.h>
 #include <ModelAPI_Document.h>
 #include <ModelAPI_Data.h>
+#include <ModelAPI_ResultConstruction.h>
+#include <ModelAPI_ResultBody.h>
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeReference.h>
 #include <ModelAPI_AttributeBoolean.h>
@@ -34,12 +36,19 @@ void FeaturesPlugin_Extrusion::execute()
   FeaturePtr aFaceFeature = aFaceRef->value();
   if (!aFaceFeature)
     return;
-  boost::shared_ptr<GeomAPI_Shape> aFace = aFaceFeature->data()->shape();
+  boost::shared_ptr<ModelAPI_ResultConstruction> aConstr =
+    boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aFaceFeature->firstResult());
+  if (!aConstr) 
+    return;
+  boost::shared_ptr<GeomAPI_Shape> aFace = aConstr->shape();
   if (!aFace)
     return;
 
   double aSize = data()->real(EXTRUSION_SIZE)->value();
   if (data()->boolean(EXTRUSION_REVERSE)->value())
     aSize = -aSize;
-  data()->store(GeomAlgoAPI_Extrusion::makeExtrusion(aFace, aSize));
+  boost::shared_ptr<ModelAPI_ResultBody> aResult = document()->createBody();
+  aResult->store(GeomAlgoAPI_Extrusion::makeExtrusion(aFace, aSize));
+  document()->storeResult(data(), aResult);
+  setResult(aResult);
 }
index 95c8f98ae844b07233b136ac88f02c6fa9c2c292..01cb4fe3a10a0ed63f7703c67759f975995d6aa7 100644 (file)
@@ -28,10 +28,6 @@ public:
   FEATURESPLUGIN_EXPORT virtual const std::string& getKind() 
   { static std::string MY_KIND = FEATURES_EXTRUSION_KIND; return MY_KIND; }
 
-  /// Returns to which group in the document must be added feature
-  FEATURESPLUGIN_EXPORT virtual const std::string& getGroup() 
-  { static std::string MY_GROUP = "Construction";  return MY_GROUP; }
-
   /// Creates a new part document if needed
   FEATURESPLUGIN_EXPORT virtual void execute();
 
index d949574948d19d6f6c4b632730821a2001703d78..241ac68c4cde407f2a26ee98d97f3259ec125d8b 100644 (file)
@@ -372,10 +372,10 @@ FeaturePtr Model_Document::addFeature(string theID)
   return aFeature;
 }
 
-void Model_Document::storeResult(boost::shared_ptr<ModelAPI_Feature> theFeature,
+void Model_Document::storeResult(boost::shared_ptr<ModelAPI_Data> theFeatureData,
   boost::shared_ptr<ModelAPI_Result> theResult, const int theResultIndex)
 {
-  initData(theResult, boost::dynamic_pointer_cast<Model_Data>(theFeature->data())->
+  initData(theResult, boost::dynamic_pointer_cast<Model_Data>(theFeatureData)->
     label().Father().FindChild(TAG_FEATURE_RESULTS), theResultIndex);
 }
 
@@ -589,7 +589,7 @@ void Model_Document::initData(ObjectPtr theObj, TDF_Label& theLab, const int the
   boost::shared_ptr<ModelAPI_Document> aThis = 
     Model_Application::getApplication()->getDocument(myID);
   boost::shared_ptr<Model_Data> aData(new Model_Data);
-  aData->setLabel(theLab.FindChild(theTag));
+  aData->setLabel(theLab.FindChild(theTag + 1));
   aData->setObject(theObj);
   theObj->setDoc(aThis);
   theObj->setData(aData);
@@ -675,3 +675,15 @@ boost::shared_ptr<ModelAPI_ResultConstruction> Model_Document::createConstructio
   boost::shared_ptr<ModelAPI_ResultConstruction> aResult(new Model_ResultConstruction());
   return aResult;
 }
+
+boost::shared_ptr<ModelAPI_ResultBody> Model_Document::createBody()
+{
+  boost::shared_ptr<ModelAPI_ResultBody> aResult(new Model_ResultBody());
+  return aResult;
+}
+
+boost::shared_ptr<ModelAPI_ResultPart> Model_Document::createPart()
+{
+  boost::shared_ptr<ModelAPI_ResultPart> aResult(new Model_ResultPart());
+  return aResult;
+}
index ec69667b70f37d928a4c46fa1daae25f07ab7b92..f0bc738451488ad11bfb24feba474990054ce24a 100644 (file)
@@ -88,11 +88,15 @@ public:
   MODEL_EXPORT virtual int size(const std::string& theGroupID);
 
   //! Allows to store the result in the data tree of the document (attaches 'data' of result to tree)
-  MODEL_EXPORT virtual void storeResult(boost::shared_ptr<ModelAPI_Feature> theFeature,
-    boost::shared_ptr<ModelAPI_Result> theResult, const int theResultIndex);
+  MODEL_EXPORT virtual void storeResult(boost::shared_ptr<ModelAPI_Data> theFeatureData,
+    boost::shared_ptr<ModelAPI_Result> theResult, const int theResultIndex = 0);
 
   /// Creates a construction cresults
   MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_ResultConstruction> createConstruction();
+  /// Creates a body results
+  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_ResultBody> createBody();
+  /// Creates a part results
+  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_ResultPart> createPart();
 
 protected:
 
index 687bc112cfee968aaaf3379fd97722472c8e9742..fda4b4d8b5affe80cf677bde7bf6559b41f38415 100644 (file)
@@ -9,8 +9,7 @@
 #include <TopoDS_Shape.hxx>
 #include <GeomAPI_Shape.h>
 
-Model_ResultBody::Model_ResultBody(const boost::shared_ptr<ModelAPI_Feature>& theFeature)
-  : myOwner(theFeature)
+Model_ResultBody::Model_ResultBody()
 {
 }
 
index 3757e5d1ff846061a26bacb5513d70dd54ac314d..13402b2b6c12bfc144041162a34cb40affd0ffa2 100644 (file)
@@ -29,7 +29,7 @@ public:
 
 protected:
   /// Makes a body on the given feature
-  Model_ResultBody(const boost::shared_ptr<ModelAPI_Feature>& theFeature);
+  Model_ResultBody();
 
   friend class Model_Document;
 };
index b24c2f31076d8febe821b74c5e461ea6ebad43f2..e312f6fdab9e4bed0c14aeadbdcbef63fab614a1 100644 (file)
@@ -20,9 +20,6 @@ class Model_ResultConstruction : public ModelAPI_ResultConstruction
   boost::shared_ptr<ModelAPI_Feature> myOwner; ///< owner of this result
   boost::shared_ptr<GeomAPI_Shape> myShape; ///< shape of this result created "on the fly"
 public:
-  /// Returns the group identifier of this result
-  virtual std::string group()
-    {static std::string MY_GROUP = "Construction"; return MY_GROUP;}
   /// Sets the result
   MODEL_EXPORT virtual void setShape(boost::shared_ptr<GeomAPI_Shape> theShape);
   /// Returns the shape-result produced by this feature
index 38b72fad98b2c268f8724a80b14fb22c4673757f..b3602c0b5301b46aa729a97571d5e546da0e8607 100644 (file)
@@ -16,7 +16,6 @@ boost::shared_ptr<ModelAPI_Feature> Model_ResultPart::owner()
   return boost::shared_ptr<ModelAPI_Feature>(); // return empty pointer
 }
 
-Model_ResultPart::Model_ResultPart(
-const boost::shared_ptr<ModelAPI_Feature>& theFeature)
+Model_ResultPart::Model_ResultPart()
 {
 }
index b2daa5dfe961f9fd24c70e60dadb2ff32794da81..26c19fc0cc708099e9aed96cc03da3e5ab1680b0 100644 (file)
@@ -18,9 +18,6 @@
 class Model_ResultPart : public ModelAPI_ResultPart
 {
 public:
-  /// Returns the group identifier of this result
-  virtual std::string group()
-    {static std::string MY_GROUP = "Parts"; return MY_GROUP;}
   /// Returns the part-document of this result
   MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Document> partDoc();
   /// Part has no stored feature: this method returns NULL
@@ -28,7 +25,7 @@ public:
 
 protected:
   /// makes a result on a temporary feature (an action)
-  Model_ResultPart(const boost::shared_ptr<ModelAPI_Feature>& theFeature);
+  Model_ResultPart();
 
   friend class Model_Document;
 };
index 8fd391b2613e5d855528028001d09674cdd14d72..44e9dd81ea4a7c424c5384a3c9033351267082b2 100644 (file)
@@ -4,9 +4,9 @@
   #include "ModelAPI.h"
   #include "ModelAPI_Document.h"
   #include "ModelAPI_PluginManager.h"
+  #include "ModelAPI_Object.h"
   #include "ModelAPI_Feature.h"
   #include "ModelAPI_Data.h"
-  #include "ModelAPI_Object.h"
   #include "ModelAPI_Attribute.h"
   #include "ModelAPI_AttributeDocRef.h"
   #include "ModelAPI_AttributeDouble.h"
@@ -27,9 +27,9 @@
 %include <boost_shared_ptr.i>
 %shared_ptr(ModelAPI_Document)
 %shared_ptr(ModelAPI_PluginManager)
+%shared_ptr(ModelAPI_Object)
 %shared_ptr(ModelAPI_Feature)
 %shared_ptr(ModelAPI_Data)
-%shared_ptr(ModelAPI_Object)
 %shared_ptr(ModelAPI_Attribute)
 %shared_ptr(ModelAPI_AttributeDocRef)
 %shared_ptr(ModelAPI_AttributeDouble)
@@ -39,9 +39,9 @@
 // all supported interfaces
 %include "ModelAPI_Document.h"
 %include "ModelAPI_PluginManager.h"
+%include "ModelAPI_Object.h"
 %include "ModelAPI_Feature.h"
 %include "ModelAPI_Data.h"
-%include "ModelAPI_Object.h"
 %include "ModelAPI_Attribute.h"
 %include "ModelAPI_AttributeDocRef.h"
 %include "ModelAPI_AttributeDouble.h"
index 740a4545e9eb27297c495ba54f697457bfdf9c81..5e7c921ba55c7cd6ed177c1b0e581cd4ebb9442b 100644 (file)
@@ -14,6 +14,9 @@ class ModelAPI_Feature;
 class ModelAPI_Object;
 class ModelAPI_Result;
 class ModelAPI_ResultConstruction;
+class ModelAPI_ResultBody;
+class ModelAPI_ResultPart;
+class ModelAPI_Data;
 
 /**\class Model_Document
  * \ingroup DataModel
@@ -86,6 +89,15 @@ public:
 
   /// Creates a construction cresults
   virtual boost::shared_ptr<ModelAPI_ResultConstruction> createConstruction() = 0;
+  /// Creates a body results
+  virtual boost::shared_ptr<ModelAPI_ResultBody> createBody() = 0;
+  /// Creates a part results
+  virtual boost::shared_ptr<ModelAPI_ResultPart> createPart() = 0;
+
+  //! Allows to store the result in the data tree of the document (attaches 'data' of result to tree)
+  virtual void storeResult(boost::shared_ptr<ModelAPI_Data> theFeatureData,
+    boost::shared_ptr<ModelAPI_Result> theResult, const int theResultIndex = 0) = 0;
+
 
 protected:
   /// Only for SWIG wrapping it is here
index daa59c05ca89f93762f514ff06d48b33f430af0d..1fd59452594c3eb8036027ee4dd9648a307b353a 100644 (file)
@@ -39,11 +39,14 @@ public:
   /// Computes or recomputes the results
   virtual void execute() = 0;
 
-  // returns the current results of the feature
+  /// returns the current results of the feature
   std::list<boost::shared_ptr<ModelAPI_Result> >& results() {return myResults;}
-  // returns the first result in the list or NULL reference
+  /// returns the first result in the list or NULL reference
   boost::shared_ptr<ModelAPI_Result> firstResult() 
   {return myResults.size() ? *(myResults.begin()) : boost::shared_ptr<ModelAPI_Result>();}
+  /// sets the alone result
+  void setResult(const boost::shared_ptr<ModelAPI_Result>& theResult) 
+  {myResults.clear(); myResults.push_back(theResult);}
 
   /// Returns true if this feature must not be created: this is just an action
   /// that is not stored in the features history and data model (like "delete part").
index ede2f73a45c14a5a941e6378f936180bcfc03b7e..3c12f482c42dbd2ba5cbfba43dc9d2f690158d1f 100644 (file)
 class ModelAPI_ResultConstruction : public ModelAPI_Result
 {
 public:
+  /// Returns the group identifier of this result
+  virtual std::string group()
+    {static std::string MY_GROUP = "Construction"; return MY_GROUP;}
+
   /// Returns the shape-result produced by this feature
   virtual boost::shared_ptr<GeomAPI_Shape>& shape() = 0;
 
index 575328b6ae3dad4d7721092df1a929aa9f600b6a..60328906c7c8f225093a008f879708e00ecb3990 100644 (file)
 class ModelAPI_ResultPart : public ModelAPI_Result
 {
 public:
+  /// Returns the group identifier of this result
+  virtual std::string group()
+    {static std::string MY_GROUP = "Parts"; return MY_GROUP;}
+
   /// Returns the part-document of this result
   virtual boost::shared_ptr<ModelAPI_Document> partDoc() = 0;
 };
index 9b6a47e162bf23a009d2b01782f5de71d035678c..68f34b00b2f6582cce4ba5b9c59237e1d0bcaff9 100644 (file)
@@ -26,14 +26,14 @@ void PartSetPlugin_Duplicate::initAttributes()
     boost::shared_ptr<PartSetPlugin_Part> aSource; // searching for source document attribute
     for(int a = aRoot->size(getGroup()) - 1; a >= 0; a--) {
       aSource = boost::dynamic_pointer_cast<PartSetPlugin_Part>(
-        aRoot->feature(getGroup(), a, true));
+        aRoot->object(ModelAPI_Feature::group(), a));
       if (aSource->data()->docRef(PART_ATTR_DOC_REF)->value() == aPManager->currentDocument())
         break;
       aSource.reset();
     }
     if (aSource) {
       boost::shared_ptr<ModelAPI_Document> aCopy = 
-        aPManager->copy(aSource->data()->docRef(PART_ATTR_DOC_REF)->value(), data()->getName());
+        aPManager->copy(aSource->data()->docRef(PART_ATTR_DOC_REF)->value(), data()->name());
       aRef->setFeature(aSource);
     }
   }
index 628435a95aa198edd6fa76fe20186162afef5880..ebd970ca510786a3f23567e91de0546c23bcfaf3 100644 (file)
@@ -7,6 +7,7 @@
 #include "ModelAPI_Document.h"
 #include "ModelAPI_Data.h"
 #include "ModelAPI_AttributeDocRef.h"
+#include <ModelAPI_ResultPart.h>
 
 using namespace std;
 
@@ -25,7 +26,14 @@ void PartSetPlugin_Part::execute()
   if (!aDocRef->value()) { // create a document if not yet created
     boost::shared_ptr<ModelAPI_Document> aPartSetDoc = 
       ModelAPI_PluginManager::get()->rootDocument();
-    aDocRef->setValue(aPartSetDoc->subDocument(data()->getName()));
+    aDocRef->setValue(aPartSetDoc->subDocument(data()->name()));
+  }
+  // create a result only once
+  if (results().empty()) {
+    boost::shared_ptr<ModelAPI_ResultPart> aResult = document()->createPart();
+    document()->storeResult(data(), aResult);
+    if (aResult->data()->name().empty())
+      aResult->data()->setName(data()->name());
   }
 }
 
index 0e09f3a607b7e440cbfe3a49fbfffd25cdbf440a..d6f2bb23b92009610bd83b03cf35ae68130033be 100644 (file)
@@ -15,7 +15,8 @@ void PartSetPlugin_Remove::execute()
   boost::shared_ptr<ModelAPI_Document> aCurrent;
   boost::shared_ptr<PartSetPlugin_Part> a;
   for(int a = aRoot->size(getGroup()) - 1; a >= 0; a--) {
-    FeaturePtr aFeature = aRoot->feature(getGroup(), a, true);
+    FeaturePtr aFeature = 
+      boost::dynamic_pointer_cast<ModelAPI_Feature>(aRoot->object(ModelAPI_Feature::group(), a));
     if (aFeature->getKind() == PARTSET_PART_KIND) {
       boost::shared_ptr<PartSetPlugin_Part> aPart = 
         boost::static_pointer_cast<PartSetPlugin_Part>(aFeature);
index 1fec7a86a0a2c83866c58f45b84a973b260525a0..a99677bf870d14cbb594bafd482c1e38e69eb01b 100644 (file)
@@ -61,7 +61,7 @@ void SketchPlugin_Circle::execute()
       // store the result
       boost::shared_ptr<ModelAPI_ResultConstruction> aConstr = document()->createConstruction();
       aConstr->setShape(aCompound);
-      results().push_back(aConstr);
+      setResult(aConstr);
   }
 }
 
index f61f24c0ea28a44779170b10955270b09a45d069..aaad3a61fe0877b4ea85b6da805e3f507cfe22ce 100644 (file)
@@ -48,7 +48,7 @@ void SketchPlugin_Line::execute()
       // store the result
       boost::shared_ptr<ModelAPI_ResultConstruction> aConstr = document()->createConstruction();
       aConstr->setShape(anEdge);
-      results().push_back(aConstr);
+      setResult(aConstr);
     }
   }
 }
index c910c6522bf24efed80834738ef8e0ae7b91e6ce..87a3ac08f654ea0b030a1d16d0c598a68191d69a 100644 (file)
@@ -36,7 +36,7 @@ void SketchPlugin_Point::execute()
     boost::shared_ptr<GeomAPI_Shape> aPointShape = GeomAlgoAPI_PointBuilder::point(aPoint3D);
     boost::shared_ptr<ModelAPI_ResultConstruction> aConstr = document()->createConstruction();
     aConstr->setShape(aPointShape);
-    results().push_back(aConstr);
+    setResult(aConstr);
   }
 }
 
index 813271dfaa644d7f1f30d31c9d966a32daa0fc08..0189bf561d443750adeb8b0746b4857b58db3876 100644 (file)
@@ -47,7 +47,7 @@ void SketchPlugin_Sketch::execute()
     boost::shared_ptr<GeomAPI_Shape> aCompound = GeomAlgoAPI_CompoundBuilder::compound(aFaces);
     boost::shared_ptr<ModelAPI_ResultConstruction> aConstr = document()->createConstruction();
     aConstr->setShape(aCompound);
-    results().push_back(aConstr);
+    setResult(aConstr);
     return;
   }
   if (!data()->isValid())
@@ -95,7 +95,7 @@ void SketchPlugin_Sketch::execute()
   boost::shared_ptr<GeomAPI_Shape> aCompound = GeomAlgoAPI_CompoundBuilder::compound(aLoops);
   boost::shared_ptr<ModelAPI_ResultConstruction> aConstr = document()->createConstruction();
   aConstr->setShape(aCompound);
-  results().push_back(aConstr);
+  setResult(aConstr);
 }
 
 boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_Sketch::getAISObject(
index 985688043d769f986fb747334a829574ce0bc866..41de682cb5f7b27f40d08449843be79b0d8f7b42 100644 (file)
@@ -65,34 +65,35 @@ void SketchSolver_ConstraintManager::processEvent(const Events_Message* theMessa
   {
     const ModelAPI_ObjectUpdatedMessage* anUpdateMsg = 
       dynamic_cast<const ModelAPI_ObjectUpdatedMessage*>(theMessage);
-    std::set< FeaturePtr > aFeatures = anUpdateMsg->features();
+    std::set< ObjectPtr > aFeatures = anUpdateMsg->features();
 
     bool isModifiedEvt = 
       theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_MOVED);
     if (!isModifiedEvt)
     {
-      std::set< FeaturePtr >::iterator aFeatIter;
+      std::set< ObjectPtr >::iterator aFeatIter;
       for (aFeatIter = aFeatures.begin(); aFeatIter != aFeatures.end(); aFeatIter++)
       {
+        FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(*aFeatIter);
         // Only sketches and constraints can be added by Create event
-        const std::string& aFeatureKind = (*aFeatIter)->getKind();
+        const std::string& aFeatureKind = aFeature->getKind();
         if (aFeatureKind.compare(SKETCH_KIND) == 0)
         {
           boost::shared_ptr<SketchPlugin_Feature> aSketch =
-            boost::dynamic_pointer_cast<SketchPlugin_Feature>(*aFeatIter);
+            boost::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
           if (aSketch)
             changeWorkplane(aSketch);
           continue;
         }
         boost::shared_ptr<SketchPlugin_Constraint> aConstraint =
-          boost::dynamic_pointer_cast<SketchPlugin_Constraint>(*aFeatIter);
+          boost::dynamic_pointer_cast<SketchPlugin_Constraint>(aFeature);
         if (aConstraint)
           changeConstraint(aConstraint);
         else
         {
           // Sketch plugin features can be only updated
           boost::shared_ptr<SketchPlugin_Feature> aFeature =
-            boost::dynamic_pointer_cast<SketchPlugin_Feature>(*aFeatIter);
+            boost::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
           if (aFeature)
             updateEntity(aFeature);
         }
@@ -104,8 +105,8 @@ void SketchSolver_ConstraintManager::processEvent(const Events_Message* theMessa
   }
   else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_DELETED))
   {
-    const ModelAPI_FeatureDeletedMessage* aDeleteMsg = 
-      dynamic_cast<const ModelAPI_FeatureDeletedMessage*>(theMessage);
+    const ModelAPI_ObjectDeletedMessage* aDeleteMsg = 
+      dynamic_cast<const ModelAPI_ObjectDeletedMessage*>(theMessage);
     const std::set<std::string>& aFeatureGroups = aDeleteMsg->groups();
 
     // Find SKETCH_KIND in groups. The constraint groups should be updated when an object removed from Sketch