]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'master' of newgeom:newgeom.git
authorsbh <sergey.belash@opencascade.com>
Tue, 15 Jul 2014 13:17:22 +0000 (17:17 +0400)
committersbh <sergey.belash@opencascade.com>
Tue, 15 Jul 2014 13:17:22 +0000 (17:17 +0400)
Conflicts:
src/Model/Model_Document.cpp
src/Model/Model_Object.h
src/Model/Model_Update.cpp
src/ModelAPI/ModelAPI_Document.h
src/PartSet/PartSet_Listener.cpp
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_TestOCC.cpp
src/PartSetPlugin/PartSetPlugin_Duplicate.cpp
src/PartSetPlugin/PartSetPlugin_Remove.cpp
src/SketchPlugin/SketchPlugin_Arc.h
src/SketchPlugin/SketchPlugin_Circle.h
src/SketchPlugin/SketchPlugin_Constraint.h
src/SketchPlugin/SketchPlugin_ConstraintCoincidence.h
src/SketchPlugin/SketchPlugin_ConstraintDistance.h
src/SketchPlugin/SketchPlugin_ConstraintLength.cpp
src/SketchPlugin/SketchPlugin_ConstraintLength.h
src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp
src/SketchPlugin/SketchPlugin_ConstraintParallel.h
src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp
src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.h
src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp
src/SketchPlugin/SketchPlugin_ConstraintRadius.h
src/SketchPlugin/SketchPlugin_Feature.cpp
src/SketchPlugin/SketchPlugin_Line.h
src/SketchPlugin/SketchPlugin_Point.h
src/SketchSolver/SketchSolver_Constraint.cpp
src/SketchSolver/SketchSolver_ConstraintGroup.cpp
src/SketchSolver/SketchSolver_ConstraintManager.cpp
src/XGUI/XGUI_ContextMenuMgr.cpp
src/XGUI/XGUI_DocumentDataModel.cpp
src/XGUI/XGUI_PartDataModel.cpp
src/XGUI/XGUI_Workshop.cpp

40 files changed:
1  2 
src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp
src/FeaturesPlugin/FeaturesPlugin_Extrusion.h
src/Model/Model_Document.cpp
src/PartSet/PartSet_Listener.cpp
src/PartSet/PartSet_OperationFeatureCreate.cpp
src/PartSet/PartSet_OperationFeatureEdit.cpp
src/PartSet/PartSet_OperationSketch.cpp
src/PartSet/PartSet_TestOCC.cpp
src/PartSet/PartSet_Tools.cpp
src/PartSetPlugin/PartSetPlugin_Duplicate.cpp
src/PartSetPlugin/PartSetPlugin_Part.cpp
src/PartSetPlugin/PartSetPlugin_Remove.cpp
src/SketchPlugin/SketchPlugin_Arc.cpp
src/SketchPlugin/SketchPlugin_Arc.h
src/SketchPlugin/SketchPlugin_Circle.cpp
src/SketchPlugin/SketchPlugin_Circle.h
src/SketchPlugin/SketchPlugin_Constraint.h
src/SketchPlugin/SketchPlugin_ConstraintCoincidence.h
src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp
src/SketchPlugin/SketchPlugin_ConstraintDistance.h
src/SketchPlugin/SketchPlugin_ConstraintLength.cpp
src/SketchPlugin/SketchPlugin_ConstraintLength.h
src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp
src/SketchPlugin/SketchPlugin_ConstraintParallel.h
src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp
src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.h
src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp
src/SketchPlugin/SketchPlugin_ConstraintRadius.h
src/SketchPlugin/SketchPlugin_Feature.cpp
src/SketchPlugin/SketchPlugin_Line.cpp
src/SketchPlugin/SketchPlugin_Line.h
src/SketchPlugin/SketchPlugin_Point.cpp
src/SketchPlugin/SketchPlugin_Point.h
src/SketchPlugin/SketchPlugin_Sketch.cpp
src/SketchPlugin/SketchPlugin_Sketch.h
src/SketchSolver/SketchSolver_Constraint.cpp
src/SketchSolver/SketchSolver_ConstraintGroup.cpp
src/SketchSolver/SketchSolver_ConstraintManager.cpp
src/XGUI/XGUI_DocumentDataModel.cpp
src/XGUI/XGUI_PartDataModel.cpp

index 0e8fc0b13b19950298c51601d272d41ae547b4e3,0b2f2906b9c8892ebf607da60e03cad720c3c3c2..b232f18e7bd732b7f9d0fa8307654beb1b12e3c6
@@@ -28,18 -30,21 +30,21 @@@ void FeaturesPlugin_Extrusion::initAttr
  void FeaturesPlugin_Extrusion::execute()
  {
    boost::shared_ptr<ModelAPI_AttributeReference> aFaceRef = 
 -    boost::dynamic_pointer_cast<ModelAPI_AttributeReference>(data()->attribute(EXTRUSION_FACE));
 +    boost::dynamic_pointer_cast<ModelAPI_AttributeReference>(data()->attribute(FeaturesPlugin_Extrusion::FACE_ID()));
    if (!aFaceRef)
      return;
-   FeaturePtr aFaceFeature = aFaceRef->value();
-   if (!aFaceFeature)
+   boost::shared_ptr<ModelAPI_ResultConstruction> aConstr =
+     boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aFaceRef->value());
+   if (!aConstr) 
      return;
-   boost::shared_ptr<GeomAPI_Shape> aFace = aFaceFeature->data()->shape();
+   boost::shared_ptr<GeomAPI_Shape> aFace = aConstr->shape();
    if (!aFace)
      return;
  
 -  double aSize = data()->real(EXTRUSION_SIZE)->value();
 -  if (data()->boolean(EXTRUSION_REVERSE)->value())
 +  double aSize = data()->real(FeaturesPlugin_Extrusion::SIZE_ID())->value();
 +  if (data()->boolean(FeaturesPlugin_Extrusion::REVERSE_ID())->value())
      aSize = -aSize;
-   data()->store(GeomAlgoAPI_Extrusion::makeExtrusion(aFace, aSize));
+   boost::shared_ptr<ModelAPI_ResultBody> aResult = document()->createBody(data());
+   aResult->store(GeomAlgoAPI_Extrusion::makeExtrusion(aFace, aSize));
+   setResult(aResult);
  }
index cac857f15052ab652ee56ec593453286fca8519f,01cb4fe3a10a0ed63f7703c67759f975995d6aa7..c83bead92edebeb6d6bcdcbbdbb03ea4f46c31a5
  class FeaturesPlugin_Extrusion: public ModelAPI_Feature
  {
  public:
 +  /// Extrusion kind
 +  inline static const std::string& ID()
 +  {
 +    static const std::string MY_EXTRUSION_ID("Extrusion");
 +    return MY_EXTRUSION_ID;
 +  }
 +  /// attribute name of referenced face
 +  inline static const std::string& FACE_ID()
 +  {
 +    static const std::string MY_FACE_ID("FeaturesPlugin_Extrusion::FACE_ID()");
 +    return MY_FACE_ID;
 +  }
 +  /// attribute name of extrusion size
 +  inline static const std::string& SIZE_ID()
 +  {
 +    static const std::string MY_SIZE_ID("FeaturesPlugin_Extrusion::SIZE_ID()");
 +    return MY_SIZE_ID;
 +  }
 +    /// attribute name of reverse direction
 +  inline static const std::string& REVERSE_ID()
 +  {
 +    static const std::string MY_REVERSE_ID("FeaturesPlugin_Extrusion::REVERSE_ID()");
 +    return MY_REVERSE_ID;
 +  }
 +
    /// Returns the kind of a feature
    FEATURESPLUGIN_EXPORT virtual const std::string& getKind() 
 -  { static std::string MY_KIND = FEATURES_EXTRUSION_KIND; return MY_KIND; }
 +  { static std::string MY_KIND = FeaturesPlugin_Extrusion::ID(); 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 1c70153892a95e891c58a31590a38bc7f4556d7c,79406ba8cd6033bfa359da0c7c8c30aee3d01ddc..df5c06b23c880db1f6284de52ab2f5b87b783f9b
@@@ -348,45 -344,34 +344,33 @@@ static void AddToRefArray(TDF_Label& th
    }
  }
  
- void Model_Document::addFeature(const FeaturePtr theFeature)
 -
+ FeaturePtr Model_Document::addFeature(std::string theID)
  {
-   if (theFeature->isAction()) return; // do not add action to the data model
-   boost::shared_ptr<ModelAPI_Document> aThis = 
-     Model_Application::getApplication()->getDocument(myID);
-   TDF_Label aFeaturesLab = groupLabel(ModelAPI_Document::FEATURES_GROUP());
-   TDF_Label aFeatureLab = aFeaturesLab.NewChild();
-   // organize feature and data objects
-   boost::shared_ptr<Model_Data> aData(new Model_Data);
-   aData->setFeature(theFeature);
-   aData->setLabel(aFeatureLab);
-   theFeature->setDoc(aThis);
-   theFeature->setData(aData);
-   setUniqueName(theFeature);
-   theFeature->initAttributes();
-   // keep the feature ID to restore document later correctly
-   TDataStd_Comment::Set(aFeatureLab, theFeature->getKind().c_str());
-   myFeatures.push_back(theFeature);
-   // store feature in the history of features array
-   if (theFeature->isInHistory()) {
-     AddToRefArray(aFeaturesLab, aFeatureLab);
+   TDF_Label anEmptyLab;
+   FeaturePtr anEmptyFeature;
+   FeaturePtr aFeature = ModelAPI_PluginManager::get()->createFeature(theID);
+   if (aFeature) {
+     TDF_Label aFeatureLab;
+     if (!aFeature->isAction()) {// do not add action to the data model
+       TDF_Label aFeaturesLab = groupLabel(ModelAPI_Feature::group());
+       aFeatureLab = aFeaturesLab.NewChild();
+       initData(aFeature, aFeatureLab, TAG_FEATURE_ARGUMENTS);
+       // keep the feature ID to restore document later correctly
+       TDataStd_Comment::Set(aFeatureLab, aFeature->getKind().c_str());
+       setUniqueName(aFeature);
+       myObjs[ModelAPI_Feature::group()].push_back(aFeature);
+       // store feature in the history of features array
+       if (aFeature->isInHistory()) {
+         AddToRefArray(aFeaturesLab, aFeatureLab);
+       }
+     }
+     if (!aFeature->isAction()) {// do not add action to the data model
+       // event: feature is added
+       static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_CREATED);
+       ModelAPI_EventCreator::get()->sendUpdated(aFeature, anEvent);
+     }
    }
-   // add featue to the group
-   const std::string& aGroup = theFeature->getGroup();
-   TDF_Label aGroupLab = groupLabel(aGroup);
-   AddToRefArray(aGroupLab, aFeatureLab);
-   // new name of this feature object by default equal to name of feature
-   TDF_Label anObjLab = aGroupLab.NewChild();
-   TCollection_ExtendedString aName(theFeature->data()->getName().c_str());
-   TDataStd_Name::Set(anObjLab, aName);
-   TDF_Label aGrLabChild = aGroupLab.FindChild(1);
-   AddToRefArray(aGrLabChild, anObjLab); // reference to names is on the first sub
-   // event: feature is added
-   static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_CREATED);
-   ModelAPI_EventCreator::get()->sendUpdated(theFeature, anEvent);
+   return aFeature;
  }
  
  /// Appenad to the array of references a new referenced label.
index 7b642812d32b10da0fc42a46b29a67afc4fd7125,efbc1a706fc661971401aaef2e6a6abc997f6991..f94e6c24f45d7f0b1ac7e90db35ee94e807899e7
@@@ -65,8 -68,8 +68,8 @@@ void PartSet_Listener::processEvent(con
      std::set<std::string>::const_iterator anIt = aGroups.begin(), aLast = aGroups.end();
      for (; anIt != aLast; anIt++) {
        std::string aGroup = *anIt;
 -      if (aGroup.compare(SKETCH_KIND) == 0) { // Update only Sketch group
 +      if (aGroup.compare(SketchPlugin_Sketch::ID()) == 0) { // Update only Sketch group
-         myModule->workshop()->displayer()->eraseDeletedFeatures();
+         myModule->workshop()->displayer()->eraseDeletedResults();
          myModule->updateCurrentPreview(aGroup);
        }
      }
index df4408dd58f345353a3b325464e3aa1a8c1a150c,2cccb18a2fbecd5fa61d3b1ead427b7962009951..c3391efb91641d8bd248b15d0b24e16ba7f12c45
@@@ -143,9 -144,17 +144,17 @@@ std::list<FeaturePtr> PartSet_Operation
    if (!aData->isValid())
      return std::list<FeaturePtr>();
    boost::shared_ptr<ModelAPI_AttributeRefList> aRefList =
 -        boost::dynamic_pointer_cast<ModelAPI_AttributeRefList>(aData->attribute(SKETCH_ATTR_FEATURES));
 +        boost::dynamic_pointer_cast<ModelAPI_AttributeRefList>(aData->attribute(SketchPlugin_Sketch::FEATURES_ID()));
  
-   return aRefList->list();
+   std::list<ObjectPtr> aList = aRefList->list();
+   std::list<ObjectPtr>::iterator aIt;
+   std::list<FeaturePtr> aFeaList;
+   for (aIt = aList.begin(); aIt != aList.end(); ++aIt) {
+     FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(*aIt);
+     if (aFeature)
+       aFeaList.push_back(aFeature);
+   }
+   return aFeaList;
  }
  
  void PartSet_OperationSketch::stopOperation()
index aaa3c3c590a9b777ce65361c8e9571c080bf216e,c8b1e0186e08845add527191753c8a94badbf421..df5567aee9e6ffc55b1d4dd64b3d3cc4678ead72
@@@ -226,4 -227,4 +227,4 @@@ void PartSet_TestOCC::moveMouse(Handle(
  {
    theContext->MoveTo(10, 10, theView);
    theContext->Select();
--}
++}
index eb07e5baa11d0f0bd7e15eaaa5490e2726b058c1,e2c6d3cccf9ef89e77d1ecd7b09789733f5489b2..d0097bd4dedf3036aec6e942ef4894ea3175b513
@@@ -275,10 -275,10 +275,10 @@@ void PartSet_Tools::setConstraints(Feat
    // the constraint is created between the feature point and the found sketch point
    boost::shared_ptr<ModelAPI_Data> aData = theSketch->data();
    boost::shared_ptr<ModelAPI_AttributeRefList> aRefList =
 -        boost::dynamic_pointer_cast<ModelAPI_AttributeRefList>(aData->attribute(SKETCH_ATTR_FEATURES));
 +        boost::dynamic_pointer_cast<ModelAPI_AttributeRefList>(aData->attribute(SketchPlugin_Sketch::FEATURES_ID()));
  
-   std::list<FeaturePtr > aFeatures = aRefList->list();
-   std::list<FeaturePtr >::const_iterator anIt = aFeatures.begin(), aLast = aFeatures.end();
+   std::list<ObjectPtr > aFeatures = aRefList->list();
+   std::list<ObjectPtr >::const_iterator anIt = aFeatures.begin(), aLast = aFeatures.end();
    std::list<boost::shared_ptr<ModelAPI_Attribute> > anAttiributes;
    boost::shared_ptr<GeomAPI_Pnt2d> aClickedPoint = boost::shared_ptr<GeomAPI_Pnt2d>
                                                       (new GeomAPI_Pnt2d(theClickedX, theClickedY));
index 726f6487b7a1d8810b02219b4885fb3efd9669aa,3526f9db125b0f78fc45fd7dc6847071fdb76b9b..d1032abf8a29e9c792adbb9cb842f903923c093f
@@@ -26,15 -26,15 +26,15 @@@ void PartSetPlugin_Duplicate::initAttri
      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())
 +      if (aSource->data()->docRef(PartSetPlugin_Part::DOC_REF())->value() == aPManager->currentDocument())
          break;
        aSource.reset();
      }
      if (aSource) {
        boost::shared_ptr<ModelAPI_Document> aCopy = 
-         aPManager->copy(aSource->data()->docRef(PartSetPlugin_Part::DOC_REF())->value(), data()->getName());
-       aRef->setFeature(aSource);
 -        aPManager->copy(aSource->data()->docRef(PART_ATTR_DOC_REF)->value(), data()->name());
++        aPManager->copy(aSource->data()->docRef(PartSetPlugin_Part::DOC_REF())->value(), data()->name());
+       aRef->setObject(aSource);
      }
    }
  }
index 2aea700f2a61f4a3e0fdaad6f2d9e485f20dee29,d6f2bb23b92009610bd83b03cf35ae68130033be..ca31737285e7b2c7b83ad9342b57fe4a7d2db1c9
@@@ -15,13 -15,14 +15,14 @@@ 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) {
 +    if (aFeature->getKind() == PartSetPlugin_Part::ID()) {
        boost::shared_ptr<PartSetPlugin_Part> aPart = 
          boost::static_pointer_cast<PartSetPlugin_Part>(aFeature);
 -      if (aPart->data()->docRef(PART_ATTR_DOC_REF)->value() == aPManager->currentDocument()) {
 +      if (aPart->data()->docRef(PartSetPlugin_Part::DOC_REF())->value() == aPManager->currentDocument()) {
          // do remove
 -        aPart->data()->docRef(PART_ATTR_DOC_REF)->value()->close();
 +        aPart->data()->docRef(PartSetPlugin_Part::DOC_REF())->value()->close();
          aRoot->removeFeature(aPart);
        }
      }
Simple merge
index cf57516a598a2811b877a2a33ab9731223529524,4603dd922012eac6d05b427dedba5e20b748f84c..df87c1e3c2b616895a1ddcdaaa9acda36ba5fad4
  class SketchPlugin_Arc: public SketchPlugin_Feature
  {
  public:
 +  /// Arc feature kind
 +  inline static const std::string& ID()
 +  {
 +    static const std::string MY_SKETCH_ARC_ID("SketchArc");
 +    return MY_SKETCH_ARC_ID;
 +  }
 +
 +  /// Central 2D point of the circle which contains the arc
 +  inline static const std::string& CENTER_ID()
 +  {
 +    static const std::string MY_CENTER_ID = "ArcCenter";
 +    return MY_CENTER_ID;
 +  }
 +  /// Start 2D point of the arc
 +  inline static const std::string& START_ID()
 +  {
 +    static const std::string MY_START_ID = "ArcStartPoint";
 +    return MY_START_ID;
 +  }
 +  /// End 2D point of the arc
 +  inline static const std::string& END_ID()
 +  {
 +    static const std::string MY_END_ID = "ArcEndPoint";
 +    return MY_END_ID;
 +  }
 +
    /// Returns the kind of a feature
    SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
 -  {static std::string MY_KIND = SKETCH_ARC_KIND; return MY_KIND;}
 +  {static std::string MY_KIND = SketchPlugin_Arc::ID(); return MY_KIND;}
  
-   /// Returns to which group in the document must be added feature
-   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup()
-   {static std::string MY_GROUP = SketchPlugin_Sketch::ID(); return MY_GROUP;}
-   /// Creates a new part document if needed
+   /// Creates an arc-shape
    SKETCHPLUGIN_EXPORT virtual void execute();
  
    /// Request for initialization of data model of the feature: adding all attributes
index cf7de0330075a5167f17e752fba1ba1ba36ec4c6,c02c79e21941ce1838c581b9c9f69be80abd55bd..43c2c982acb95976e9aa555b4badfd9a173c9439
  class SketchPlugin_Circle: public SketchPlugin_Feature
  {
  public:
 +  /// Circle feature kind
 +  inline static const std::string& ID()
 +  {
 +    static const std::string MY_CIRCLE_ID("SketchCircle");
 +    return MY_CIRCLE_ID;
 +  }
 +
 +  /// 2D point - center of the circle
 +  inline static const std::string& CENTER_ID()
 +  {
 +    static const std::string MY_CIRCLE_CENTER_ID("CircleCenter");
 +    return MY_CIRCLE_CENTER_ID;
 +  }
 +
 +  /// Radius of the circle
 +  inline static const std::string& RADIUS_ID()
 +  {
 +    static const std::string MY_CIRCLE_RADIUS_ID("CircleRadius");
 +    return MY_CIRCLE_RADIUS_ID;
 +  }
 +
    /// Returns the kind of a feature
    SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
 -  {static std::string MY_KIND = SKETCH_CIRCLE_KIND; return MY_KIND;}
 +  {static std::string MY_KIND = SketchPlugin_Circle::ID(); return MY_KIND;}
  
-   /// Returns to which group in the document must be added feature
-   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
-   {static std::string MY_GROUP = SketchPlugin_Sketch::ID(); return MY_GROUP;}
    /// Creates a new part document if needed
    SKETCHPLUGIN_EXPORT virtual void execute();
  
index 3a5c2c31daecc9cee3a6005eaec32bc4aeb64855,3af35adfe9b8c3a6101ccde868025ab0bcee28e6..3670b45ed41c8e5858ea9bccaae22bce112528d3
  class SketchPlugin_ConstraintCoincidence: public SketchPlugin_Constraint
  {
  public:
 +  /// Parallel constraint kind
 +  inline static const std::string& ID()
 +  {
 +    static const std::string MY_CONSTRAINT_COINCIDENCE_ID("SketchConstraintCoincidence");
 +    return MY_CONSTRAINT_COINCIDENCE_ID;
 +  }
    /// \brief Returns the kind of a feature
    SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
 -  {static std::string MY_KIND = SKETCH_CONSTRAINT_COINCIDENCE_KIND; return MY_KIND;}
 +  {static std::string MY_KIND = SketchPlugin_ConstraintCoincidence::ID(); return MY_KIND;}
  
-   /// \brief Returns to which group in the document must be added feature
-   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
-   {static std::string MY_GROUP = SketchPlugin_Sketch::ID(); return MY_GROUP;}
    /// \brief Creates a new part document if needed
    SKETCHPLUGIN_EXPORT virtual void execute();
  
index 2896843c5a9a386bd773ef03cde6c43911b10fd1,fb5b37b4c448bd1ba7294f4e94633fe34274986f..4818f6608be77bf57e34471bd414b73c520edb16
@@@ -104,11 -104,11 +104,11 @@@ boost::shared_ptr<GeomDataAPI_Point2D> 
    boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = 
      boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theData->attribute(theAttribute));
    if (anAttr)
-     aFeature = anAttr->feature();
+     aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(anAttr->object());
  
 -  if (aFeature && aFeature->getKind() == SKETCH_POINT_KIND)
 +  if (aFeature && aFeature->getKind() == SketchPlugin_Point::ID())
      aPointAttr = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>
 -                                           (aFeature->data()->attribute(POINT_ATTR_COORD));
 +                                           (aFeature->data()->attribute(SketchPlugin_Point::COORD_ID()));
    else {
      if (anAttr->attr())
        aPointAttr = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(anAttr->attr());
index 9a538ab4a9f9619fe19e0cadd0cdbeb945bbcfd3,bb324f75b263707ac6b31827412b8189f65ea10d..456ff056943eebb5946a8277da84dd386d724a84
  class SketchPlugin_ConstraintDistance: public SketchPlugin_Constraint
  {
  public:
 +  /// Distance constraint kind
 +  inline static const std::string& ID()
 +  {
 +    static const std::string MY_CONSTRAINT_DISTANCE_ID("SketchConstraintDistance");
 +    return MY_CONSTRAINT_DISTANCE_ID;
 +  }
 +
    /// \brief Returns the kind of a feature
    SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
 -  {static std::string MY_KIND = SKETCH_CONSTRAINT_DISTANCE_KIND; return MY_KIND;}
 +  {static std::string MY_KIND = SketchPlugin_ConstraintDistance::ID(); return MY_KIND;}
  
-   /// \brief Returns to which group in the document must be added feature
-   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
-   {static std::string MY_GROUP = SketchPlugin_Sketch::ID(); return MY_GROUP;}
    /// \brief Creates a new part document if needed
    SKETCHPLUGIN_EXPORT virtual void execute();
  
index 1953add2b2477ddb974d8a800d5a8d954379fb44,a2f84ae1b9e0427db63d888428fe5cc106f65475..f21aa9979389169d7ad90477c555952b0cf1403a
@@@ -28,12 -28,12 +28,12 @@@ void SketchPlugin_ConstraintLength::ini
  
  void SketchPlugin_ConstraintLength::execute()
  {
 -  if (data()->attribute(CONSTRAINT_ATTR_ENTITY_A)->isInitialized() &&
 -      !data()->attribute(CONSTRAINT_ATTR_VALUE)->isInitialized()) {
 +  if (data()->attribute(SketchPlugin_Constraint::ENTITY_A())->isInitialized() &&
 +      !data()->attribute(SketchPlugin_Constraint::VALUE())->isInitialized()) {
  
      boost::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
 -      boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(data()->attribute(CONSTRAINT_ATTR_ENTITY_A));
 +      boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(data()->attribute(SketchPlugin_Constraint::ENTITY_A()));
-     FeaturePtr aFeature = aRef->feature();
+     ObjectPtr aFeature = aRef->object();
      if (aFeature) {
        // set length value
        boost::shared_ptr<GeomDataAPI_Point2D> aPoint1 =
@@@ -59,11 -59,11 +59,11 @@@ boost::shared_ptr<GeomAPI_AISObject> Sk
    boost::shared_ptr<GeomAPI_Pln> aPlane = sketch()->plane();
  
    boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = 
 -    boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(data()->attribute(CONSTRAINT_ATTR_ENTITY_A));
 +    boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(data()->attribute(SketchPlugin_Constraint::ENTITY_A()));
    if (!anAttr)
      return thePrevious;
-   FeaturePtr aFeature = anAttr->feature();
+   FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(anAttr->object());
 -  if (!aFeature || aFeature->getKind() != SKETCH_LINE_KIND)
 +  if (!aFeature || aFeature->getKind() != SketchPlugin_Line::ID())
      return thePrevious;
  
    boost::shared_ptr<GeomDataAPI_Point2D> aFlyOutAttr = 
index 237dc8e86c539e607a2bd163c0f924542da3a2f9,8e8cd5a478a16104a6a6687018e561031052ecd0..342bdf1f56e631da377950fb5800d14f02575bb0
  class SketchPlugin_ConstraintLength: public SketchPlugin_Constraint
  {
  public:
 +  /// Length constraint kind
 +  inline static const std::string& ID()
 +  {
 +    static const std::string MY_CONSTRAINT_LENGTH_ID("SketchConstraintLength");
 +    return MY_CONSTRAINT_LENGTH_ID;
 +  }
    /// \brief Returns the kind of a feature
    SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
 -  {static std::string MY_KIND = SKETCH_CONSTRAINT_LENGTH_KIND; return MY_KIND;}
 +  {static std::string MY_KIND = SketchPlugin_ConstraintLength::ID(); return MY_KIND;}
  
-   /// \brief Returns to which group in the document must be added feature
-   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
-   {static std::string MY_GROUP = SketchPlugin_Sketch::ID(); return MY_GROUP;}
    /// \brief Creates a new part document if needed
    SKETCHPLUGIN_EXPORT virtual void execute();
  
index 15cc861adfcdc6874905818d2d48d5b69926050d,450e0c6682f2ce6fde8f8bd6e6b695a18a6880d0..aba3df37071afd63ec6d27605cb2c4a730ac0351
@@@ -44,25 -38,30 +38,30 @@@ boost::shared_ptr<GeomAPI_AISObject> Sk
  
    boost::shared_ptr<ModelAPI_Data> aData = data();
    boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr1 = 
 -    boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(CONSTRAINT_ATTR_ENTITY_A));
 +    boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_A()));
    boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr2 = 
 -    boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(CONSTRAINT_ATTR_ENTITY_B));
 +    boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_B()));
-   if (!anAttr1 || !anAttr1->isFeature() || 
-       !anAttr2 || !anAttr2->isFeature())
+   if (!anAttr1 || !anAttr1->isObject() || 
+       !anAttr2 || !anAttr2->isObject())
      return thePrevious;
    boost::shared_ptr<SketchPlugin_Line> aLine1Feature = 
-     boost::dynamic_pointer_cast<SketchPlugin_Line>(anAttr1->feature());
+     boost::dynamic_pointer_cast<SketchPlugin_Line>(anAttr1->object());
    boost::shared_ptr<SketchPlugin_Line> aLine2Feature = 
-     boost::dynamic_pointer_cast<SketchPlugin_Line>(anAttr2->feature());
+     boost::dynamic_pointer_cast<SketchPlugin_Line>(anAttr2->object());
    if (!aLine1Feature || !aLine2Feature)
      return thePrevious;
  
    boost::shared_ptr<GeomAPI_Pln> aPlane = sketch()->plane();
-   boost::shared_ptr<GeomAPI_Shape> aLine1 = aLine1Feature->preview();
-   boost::shared_ptr<GeomAPI_Shape> aLine2 = aLine2Feature->preview();
+   boost::shared_ptr<GeomAPI_Shape> aLine1, aLine2;
+   boost::shared_ptr<ModelAPI_ResultConstruction> aConst1 = 
+     boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aLine1Feature->firstResult());
+   if (aConst1) aLine1 = aConst1->shape();
+   boost::shared_ptr<ModelAPI_ResultConstruction> aConst2 = 
+     boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aLine1Feature->firstResult());
+   if (aConst2) aLine2 = aConst2->shape();
  
    boost::shared_ptr<GeomDataAPI_Point2D> aFlyoutAttr = 
 -    boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(CONSTRAINT_ATTR_FLYOUT_VALUE_PNT));
 +    boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()));
    boost::shared_ptr<GeomAPI_Pnt> aFlyoutPnt = sketch()->to3D(aFlyoutAttr->x(), aFlyoutAttr->y());
  
    boost::shared_ptr<GeomAPI_AISObject> anAIS = thePrevious;
index 52e68fcd01cabea396019da5e03519f59aacd424,651016248b8d87aac9c164e6dd0cb847c640397b..acfab864f1c5d93aacbd95cb0aa6ac3318fe7bad
  class SketchPlugin_ConstraintParallel: public SketchPlugin_Constraint
  {
  public:
 +  /// Parallel constraint kind
 +  inline static const std::string& ID()
 +  {
 +    static const std::string MY_CONSTRAINT_PARALLEL_ID("SketchConstraintParallel");
 +    return MY_CONSTRAINT_PARALLEL_ID;
 +  }
    /// \brief Returns the kind of a feature
    SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
 -  {static std::string MY_KIND = SKETCH_CONSTRAINT_PARALLEL_KIND; return MY_KIND;}
 +  {static std::string MY_KIND = SketchPlugin_ConstraintParallel::ID(); return MY_KIND;}
  
-   /// \brief Returns to which group in the document must be added feature
-   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
-   {static std::string MY_GROUP = SketchPlugin_Sketch::ID(); return MY_GROUP;}
    /// \brief Creates a new part document if needed
    SKETCHPLUGIN_EXPORT virtual void execute();
  
index 0122202319de359e0ac029aece8f3ab9b5233b60,f9764c90bfc0b061a256af5dd3a01af9220f72ba..3f8281208ac998a224fcb6a31633ef40fe6262b1
@@@ -43,16 -38,16 +38,16 @@@ boost::shared_ptr<GeomAPI_AISObject> Sk
  
    boost::shared_ptr<ModelAPI_Data> aData = data();
    boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr1 = 
 -    boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(CONSTRAINT_ATTR_ENTITY_A));
 +    boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_A()));
    boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr2 = 
 -    boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(CONSTRAINT_ATTR_ENTITY_B));
 +    boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_B()));
-   if (!anAttr1 || !anAttr1->isFeature() || 
-       !anAttr2 || !anAttr2->isFeature())
+   if (!anAttr1 || !anAttr1->isObject() || 
+       !anAttr2 || !anAttr2->isObject())
      return thePrevious;
    boost::shared_ptr<SketchPlugin_Line> aLine1Feature = 
-     boost::dynamic_pointer_cast<SketchPlugin_Line>(anAttr1->feature());
+     boost::dynamic_pointer_cast<SketchPlugin_Line>(anAttr1->object());
    boost::shared_ptr<SketchPlugin_Line> aLine2Feature = 
-     boost::dynamic_pointer_cast<SketchPlugin_Line>(anAttr2->feature());
+     boost::dynamic_pointer_cast<SketchPlugin_Line>(anAttr2->object());
    if (!aLine1Feature || !aLine2Feature)
      return thePrevious;
  
index f6970a8952475241c9056875fe38b788fa29c252,231be46996814081d83328f8bb69a3412796e64f..eb82abd6fc700ebad7a4300b8e92c7786568585c
  class SketchPlugin_ConstraintPerpendicular: public SketchPlugin_Constraint
  {
  public:
 +  /// Perpendicular constraint kind
 +  inline static const std::string& ID()
 +  {
 +    static const std::string MY_CONSTRAINT_PERPENDICULAR_ID("SketchConstraintPerpendicular");
 +    return MY_CONSTRAINT_PERPENDICULAR_ID;
 +  }
    /// \brief Returns the kind of a feature
    SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
 -  {static std::string MY_KIND = SKETCH_CONSTRAINT_PERPENDICULAR_KIND; return MY_KIND;}
 +  {static std::string MY_KIND = SketchPlugin_ConstraintPerpendicular::ID(); return MY_KIND;}
  
-   /// \brief Returns to which group in the document must be added feature
-   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
-   {static std::string MY_GROUP = SketchPlugin_Sketch::ID(); return MY_GROUP;}
    /// \brief Creates a new part document if needed
    SKETCHPLUGIN_EXPORT virtual void execute();
  
index 0b4cd5a9b072899ebc69a792d9aeac7344906a27,8dcb9393b2770acf9da1749e7d42c0cdddd7d575..9b412d1c615e44c882f756f091e073903ad43c0a
@@@ -32,12 -32,12 +32,12 @@@ void SketchPlugin_ConstraintRadius::ini
  
  void SketchPlugin_ConstraintRadius::execute()
  {
 -  if (data()->attribute(CONSTRAINT_ATTR_ENTITY_A)->isInitialized() &&
 -      !data()->attribute(CONSTRAINT_ATTR_VALUE)->isInitialized()) {
 +  if (data()->attribute(SketchPlugin_Constraint::ENTITY_A())->isInitialized() &&
 +      !data()->attribute(SketchPlugin_Constraint::VALUE())->isInitialized()) {
  
      boost::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
 -      boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(data()->attribute(CONSTRAINT_ATTR_ENTITY_A));
 +      boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(data()->attribute(SketchPlugin_Constraint::ENTITY_A()));
-     FeaturePtr aFeature = aRef->feature();
+     FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(aRef->object());
      if (aFeature) {
        double aRadius = 0;
        boost::shared_ptr<ModelAPI_Data> aData = aFeature->data();
@@@ -70,12 -70,12 +70,12 @@@ boost::shared_ptr<GeomAPI_AISObject> Sk
  
    boost::shared_ptr<ModelAPI_Data> aData = data();
    boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = 
 -    boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(CONSTRAINT_ATTR_ENTITY_A));
 +    boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_A()));
    if (!anAttr)
      return thePrevious;
-   FeaturePtr aFeature = anAttr->feature();
+   FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(anAttr->object());
    std::string aKind = aFeature ? aFeature->getKind() : "";
 -  if (aKind != SKETCH_CIRCLE_KIND && aKind != SKETCH_ARC_KIND)
 +  if (aKind != SketchPlugin_Circle::ID() && aKind != SketchPlugin_Arc::ID())
      return thePrevious;
  
    // Flyout point
@@@ -129,8 -129,8 +129,8 @@@ void SketchPlugin_ConstraintRadius::mov
      return;
  
    boost::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
 -    boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(data()->attribute(CONSTRAINT_ATTR_ENTITY_A));
 +    boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(data()->attribute(SketchPlugin_Constraint::ENTITY_A()));
-   FeaturePtr aFeature = aRef->feature();
+   FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(aRef->object());
    if (!aFeature)
      return;
    std::string aCenterAttrName;
index a3a85d8782c3f92c1cbd50c206464ea803b9c99f,26642a49fd43178a50d1920687930565cfc35577..a604ef1202de0fae5442817ab734e7b9cb4f6321
  class SketchPlugin_ConstraintRadius: public SketchPlugin_Constraint
  {
  public:
 +  /// Radius constraint kind
 +  inline static const std::string& ID() {
 +    static const std::string MY_CONSTRAINT_RADIUS_ID("SketchConstraintRadius");
 +    return MY_CONSTRAINT_RADIUS_ID;
 +  }
    /// \brief Returns the kind of a feature
    SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
 -  {static std::string MY_KIND = SKETCH_CONSTRAINT_RADIUS_KIND; return MY_KIND;}
 +  {static std::string MY_KIND = SketchPlugin_ConstraintRadius::ID(); return MY_KIND;}
  
-   /// \brief Returns to which group in the document must be added feature
-   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
-   {static std::string MY_GROUP = SketchPlugin_Sketch::ID(); return MY_GROUP;}
    /// \brief Creates a new part document if needed
    SKETCHPLUGIN_EXPORT virtual void execute();
  
index d264007e3a6ff69b69530145a37b7c8fd73e5228,e00ffdd351c81b1aaeb9aba55ebced4d3ef57745..ee292a645dd5e1b5e6cd9d35cea28db66c262c2d
@@@ -27,11 -18,11 +18,11 @@@ SketchPlugin_Sketch* SketchPlugin_Featu
      int aSketches = document()->size("Construction");
      for(int a = 0; a < aSketches && !mySketch; a++) {
        boost::shared_ptr<SketchPlugin_Sketch> aSketch = boost::
-         dynamic_pointer_cast<SketchPlugin_Sketch>(document()->feature("Construction", a, true));
+         dynamic_pointer_cast<SketchPlugin_Sketch>(document()->object("Construction", a));
        if (aSketch) {
-         std::list<FeaturePtr > aList = 
 -        std::list<ObjectPtr> aList = 
 -          aSketch->data()->reflist(SKETCH_ATTR_FEATURES)->list();
++        std::list<ObjectPtr> aList =
 +          aSketch->data()->reflist(SketchPlugin_Sketch::FEATURES_ID())->list();
-         std::list<FeaturePtr >::iterator aSub = aList.begin();
+         std::list<ObjectPtr>::iterator aSub = aList.begin();
          for(; aSub != aList.end(); aSub++) {
            if ((*aSub)->data()->isEqual(data())) {
              mySketch = aSketch.get();
index 2adb9a83320140d9cecb62921a9c1160a05b2124,cce6a25eb781049a404f602b7a9b2ef560fefc32..ae301f82feb38f55a4fe3de2cfa27a8dac8d2f66
  class SketchPlugin_Line: public SketchPlugin_Feature
  {
  public:
 +  /// Arc feature kind
 +  inline static const std::string& ID()
 +  {
 +    static const std::string SKETCH_LINE_ID("SketchLine");
 +    return SKETCH_LINE_ID;
 +  }
 +  /// Start 2D point of the line
 +  inline static const std::string& START_ID()
 +  {
 +    static const std::string MY_START_ID("StartPoint");
 +    return MY_START_ID;
 +  }
 +    /// End 2D point of the line
 +  inline static const std::string& END_ID()
 +  {
 +    static const std::string MY_END_ID("EndPoint");
 +    return MY_END_ID;
 +  }
 +
    /// Returns the kind of a feature
    SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
 -  {static std::string MY_KIND = SKETCH_LINE_KIND; return MY_KIND;}
 +  {static std::string MY_KIND = SketchPlugin_Line::ID(); return MY_KIND;}
  
-   /// Returns to which group in the document must be added feature
-   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
-   {static std::string MY_GROUP = SketchPlugin_Sketch::ID(); return MY_GROUP;}
    /// Creates a new part document if needed
    SKETCHPLUGIN_EXPORT virtual void execute();
  
index f4bf4f6a7d93c79723f8769ff5a77783ea363dc1,4efb76d7c7d980cad1f7b58690feb4899ee9478c..33ec0467e244f3ceabf491f40194f3dceed103ca
  class SketchPlugin_Point: public SketchPlugin_Feature
  {
  public:
 +  /// Point feature kind
 +  inline static const std::string& ID()
 +  {
 +    static const std::string MY_POINT_ID("SketchPoint");
 +    return MY_POINT_ID;
 +  }
 +  /// Coordinates of the point
 +  inline static const std::string& COORD_ID()
 +  {
 +    static const std::string MY_COORD_ID("PointCoordindates");
 +    return MY_COORD_ID;
 +  }
    /// Returns the kind of a feature
    SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
 -  {static std::string MY_KIND = SKETCH_POINT_KIND; return MY_KIND;}
 +  {static std::string MY_KIND = SketchPlugin_Point::ID(); return MY_KIND;}
  
-   /// Returns to which group in the document must be added feature
-   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
-   {static std::string MY_GROUP = SketchPlugin_Sketch::ID(); return MY_GROUP;}
    /// Creates a new part document if needed
    SKETCHPLUGIN_EXPORT virtual void execute();
  
index b0bf6e9f6f9f75fe3d8572f2312045263c2fdd80,d5e208d5ffbff72e01cfa9500b3d584737c9912f..dbfb247824c0f6c6fed9a1ab6e5cb5edd8fe1721
@@@ -40,18 -54,18 +54,18 @@@ void SketchPlugin_Sketch::execute(
    if (!data()->isValid())
      return ;
    boost::shared_ptr<ModelAPI_AttributeRefList> aRefList =
 -    boost::dynamic_pointer_cast<ModelAPI_AttributeRefList>(data()->attribute(SKETCH_ATTR_FEATURES));
 +    boost::dynamic_pointer_cast<ModelAPI_AttributeRefList>(data()->attribute(SketchPlugin_Sketch::FEATURES_ID()));
  
    boost::shared_ptr<GeomDataAPI_Point> anOrigin = 
 -    boost::dynamic_pointer_cast<GeomDataAPI_Point>(data()->attribute(SKETCH_ATTR_ORIGIN));
 +    boost::dynamic_pointer_cast<GeomDataAPI_Point>(data()->attribute(SketchPlugin_Sketch::ORIGIN_ID()));
    boost::shared_ptr<GeomDataAPI_Dir> aDirX = 
 -    boost::dynamic_pointer_cast<GeomDataAPI_Dir>(data()->attribute(SKETCH_ATTR_DIRX));
 +    boost::dynamic_pointer_cast<GeomDataAPI_Dir>(data()->attribute(SketchPlugin_Sketch::DIRX_ID()));
    boost::shared_ptr<GeomDataAPI_Dir> aDirY = 
 -    boost::dynamic_pointer_cast<GeomDataAPI_Dir>(data()->attribute(SKETCH_ATTR_DIRY));
 +    boost::dynamic_pointer_cast<GeomDataAPI_Dir>(data()->attribute(SketchPlugin_Sketch::DIRY_ID()));
    boost::shared_ptr<GeomDataAPI_Dir> aNorm = 
 -    boost::dynamic_pointer_cast<GeomDataAPI_Dir>(data()->attribute(SKETCH_ATTR_NORM));
 +    boost::dynamic_pointer_cast<GeomDataAPI_Dir>(data()->attribute(SketchPlugin_Sketch::NORM_ID()));
  
-   std::list<boost::shared_ptr<ModelAPI_Feature> > aFeatures = aRefList->list();
+   std::list<ObjectPtr> aFeatures = aRefList->list();
    if (aFeatures.empty())
      return ;
  
index 5cde6adadcb174fe0b8541fd21655b02262c615e,c1dd3ecc1489fb78cb83a6fab472a924589c87d3..5fcab3c8b826ab83255979e70b7f4028acbf0124
  class SketchPlugin_Sketch: public SketchPlugin_Feature
  {
  public:
 +  /// Sketch feature kind
 +  inline static const std::string& ID()
 +  {
 +    static const std::string MY_SKETCH_ID("Sketch");
 +    return MY_SKETCH_ID;
 +  }
 +  /// Origin point of the sketcher in 3D space
 +  inline static const std::string& ORIGIN_ID()
 +  {
 +    static const std::string MY_ORIGIN_ID("Origin");
 +    return MY_ORIGIN_ID;
 +  }
 +  /// Vector X inside of the sketch plane
 +  inline static const std::string& DIRX_ID()
 +  {
 +    static const std::string MY_DIRX_ID("DirX");
 +    return MY_DIRX_ID;
 +  }
 +  /// Vector Y inside of the sketch plane
 +  inline static const std::string& DIRY_ID()
 +  {
 +    static const std::string MY_DIRY_ID("DirY");
 +    return MY_DIRY_ID;
 +  }
 +  /// Vector Z, normal to the sketch plane
 +  inline static const std::string& NORM_ID()
 +  {
 +    static const std::string MY_NORM_ID("Norm");
 +    return MY_NORM_ID;
 +  }
 +  /// All features of this sketch (list of references)
 +  inline static const std::string& FEATURES_ID()
 +  {
 +    static const std::string MY_FEATURES_ID("Features");
 +    return MY_FEATURES_ID;
 +  }
 +
    /// Returns the kind of a feature
    SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
 -  {static std::string MY_KIND = SKETCH_KIND; return MY_KIND;}
 +  {static std::string MY_KIND = SketchPlugin_Sketch::ID(); return MY_KIND;}
  
-   /// Returns to which group in the document must be added feature
-   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
-   {static std::string MY_GROUP = "Construction"; return MY_GROUP;}
    /// Creates a new part document if needed
    SKETCHPLUGIN_EXPORT virtual void execute();
  
index 18bd68e2b4bffc73bdd0cc0264d44c91f3364619,1490a091cc6403b7bde5b41d86ca58c4666fc316..05f261a69f11f1033e8773ceb0b81b496260f8cd
@@@ -101,21 -101,22 +101,22 @@@ const int& SketchSolver_Constraint::get
      {
        boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr =
          boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
 -          theConstraint->data()->attribute(CONSTRAINT_ATTRIBUTES[indAttr])
 +          theConstraint->data()->attribute(SketchPlugin_Constraint::ATTRIBUTE(indAttr))
          );
        if (!anAttr) continue;
-       if (anAttr->isFeature() && anAttr->feature())
+       if (anAttr->isObject() && anAttr->object())
        { // verify posiible entities
-         const std::string& aKind = anAttr->feature()->getKind();
+         const std::string& aKind = boost::dynamic_pointer_cast<ModelAPI_Feature>
+           (anAttr->object())->getKind();
 -        if (aKind.compare(SKETCH_POINT_KIND) == 0)
 +        if (aKind.compare(SketchPlugin_Point::ID()) == 0)
          {
 -          myAttributesList[aNbPoints++] = CONSTRAINT_ATTRIBUTES[indAttr];
 +          myAttributesList[aNbPoints++] = SketchPlugin_Constraint::ATTRIBUTE(indAttr);
            continue;
          }
 -        else if(aKind.compare(SKETCH_LINE_KIND) == 0)
 +        else if(aKind.compare(SketchPlugin_Line::ID()) == 0)
          {
 -          // entities are placed starting from CONSTRAINT_ATTR_ENTITY_C attribute
 -          myAttributesList[2 + aNbEntities++] = CONSTRAINT_ATTRIBUTES[indAttr];
 +          // entities are placed starting from SketchPlugin_Constraint::ENTITY_C() attribute
 +          myAttributesList[2 + aNbEntities++] = SketchPlugin_Constraint::ATTRIBUTE(indAttr);
            myType = SLVS_C_PT_LINE_DISTANCE;
            continue;
          }
      {
        boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr =
          boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
 -          theConstraint->data()->attribute(CONSTRAINT_ATTRIBUTES[indAttr])
 +          theConstraint->data()->attribute(SketchPlugin_Constraint::ATTRIBUTE(indAttr))
          );
        if (!anAttr) continue;
-       if (anAttr->isFeature() && anAttr->feature() &&
-           anAttr->feature()->getKind().compare(SketchPlugin_Line::ID()) == 0)
+       if (anAttr->isObject() && anAttr->object() &&
+         boost::dynamic_pointer_cast<ModelAPI_Feature>(anAttr->object())->getKind().
 -        compare(SKETCH_LINE_KIND) == 0)
++        compare(SketchPlugin_Line::ID()) == 0)
        {
 -        myAttributesList[aNbLines++] = CONSTRAINT_ATTRIBUTES[indAttr];
 +        myAttributesList[aNbLines++] = SketchPlugin_Constraint::ATTRIBUTE(indAttr);
          break;
        }
      }
      {
        boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr =
          boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
 -          theConstraint->data()->attribute(CONSTRAINT_ATTRIBUTES[indAttr])
 +          theConstraint->data()->attribute(SketchPlugin_Constraint::ATTRIBUTE(indAttr))
          );
-       if (!anAttr || !anAttr->isFeature() || !anAttr->feature()) continue;
-       const std::string& aKind = anAttr->feature()->getKind();
+       if (!anAttr || !anAttr->isObject() || !anAttr->object()) continue;
+       const std::string& aKind = boost::dynamic_pointer_cast<ModelAPI_Feature>
+         (anAttr->object())->getKind();
 -      if (aKind.compare(SKETCH_LINE_KIND) == 0)
 +      if (aKind.compare(SketchPlugin_Line::ID()) == 0)
        {
 -        myAttributesList[aNbEntities++] = CONSTRAINT_ATTRIBUTES[indAttr];
 +        myAttributesList[aNbEntities++] = SketchPlugin_Constraint::ATTRIBUTE(indAttr);
          continue;
        }
      }
      {
        boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr =
          boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
 -          theConstraint->data()->attribute(CONSTRAINT_ATTRIBUTES[indAttr])
 +          theConstraint->data()->attribute(SketchPlugin_Constraint::ATTRIBUTE(indAttr))
          );
-       if (!anAttr || !anAttr->isFeature() || !anAttr->feature()) continue;
-       const std::string& aKind = anAttr->feature()->getKind();
+       if (!anAttr || !anAttr->isObject() || !anAttr->object()) continue;
+       const std::string& aKind = boost::dynamic_pointer_cast<ModelAPI_Feature>
+         (anAttr->object())->getKind();
 -      if (aKind.compare(SKETCH_CIRCLE_KIND) == 0 || aKind.compare(SKETCH_ARC_KIND) == 0)
 +      if (aKind.compare(SketchPlugin_Circle::ID()) == 0 || aKind.compare(SketchPlugin_Arc::ID()) == 0)
        {
 -        myAttributesList[aNbEntities++] = CONSTRAINT_ATTRIBUTES[indAttr];
 +        myAttributesList[aNbEntities++] = SketchPlugin_Constraint::ATTRIBUTE(indAttr);
          continue;
        }
      }
index d2f1dcc424774f93882a28074cf94c6ad11294b9,954c6c5963fb779fba5116bbe9132eab4e6cba89..7a06355f46a8675171b9cfe72d6652bf602b2cb4
@@@ -131,14 -118,15 +131,15 @@@ bool SketchSolver_ConstraintGroup::isIn
    {
      boost::shared_ptr<ModelAPI_AttributeRefAttr> aCAttrRef =
        boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
 -        theConstraint->data()->attribute(CONSTRAINT_ATTRIBUTES[i])
 +        theConstraint->data()->attribute(SketchPlugin_Constraint::ATTRIBUTE(i))
        );
      if (!aCAttrRef) continue;
-     if (!aCAttrRef->isFeature() && 
+     if (!aCAttrRef->isObject() && 
          myEntityAttrMap.find(aCAttrRef->attr()) != myEntityAttrMap.end())
        return true;
-     if (aCAttrRef->isFeature() && 
-         myEntityFeatMap.find(aCAttrRef->feature()) != myEntityFeatMap.end())
+     if (aCAttrRef->isObject() && 
+         myEntityFeatMap.find(boost::dynamic_pointer_cast<ModelAPI_Feature>(aCAttrRef->object())) 
+         != myEntityFeatMap.end())
        return true;
    }
  
@@@ -204,16 -192,17 +205,17 @@@ bool SketchSolver_ConstraintGroup::chan
      if (!aConstrAttr) continue;
  
      // For the length constraint the start and end points of the line should be added to the entities list instead of line
 -    if (aConstrType == SLVS_C_PT_PT_DISTANCE && theConstraint->getKind().compare(SKETCH_CONSTRAINT_LENGTH_KIND) == 0)
 +    if (aConstrType == SLVS_C_PT_PT_DISTANCE && theConstraint->getKind().compare(SketchPlugin_ConstraintLength::ID()) == 0)
      {
-       boost::shared_ptr<ModelAPI_Data> aData = aConstrAttr->feature()->data();
+       boost::shared_ptr<ModelAPI_Data> aData = aConstrAttr->object()->data();
 -      aConstrEnt[indAttr]   = changeEntity(aData->attribute(LINE_ATTR_START));
 -      aConstrEnt[indAttr+1] = changeEntity(aData->attribute(LINE_ATTR_END));
 +      aConstrEnt[indAttr]   = changeEntity(aData->attribute(SketchPlugin_Line::START_ID()));
 +      aConstrEnt[indAttr+1] = changeEntity(aData->attribute(SketchPlugin_Line::END_ID()));
-       myEntityFeatMap[aConstrAttr->feature()] = 0; // measured object is added into the map of objects to avoid problems with interaction betwee constraint and group
+        // measured object is added into the map of objects to avoid problems with interaction betwee constraint and group
+       myEntityFeatMap[boost::dynamic_pointer_cast<ModelAPI_Feature>(aConstrAttr->object())] = 0;
        break; // there should be no other entities
      }
-     else if (aConstrAttr->isFeature())
-       aConstrEnt[indAttr] = changeEntity(aConstrAttr->feature());
+     else if (aConstrAttr->isObject())
+       aConstrEnt[indAttr] = changeEntity(boost::dynamic_pointer_cast<ModelAPI_Feature>(aConstrAttr->object()));
      else
        aConstrEnt[indAttr] = changeEntity(aConstrAttr->attr());
    }
index 2976eca8f3ea7a35745adef7d4520c763fc0cb74,3bc8bb0859573ddd7bb96c1905b0533fa1dc52d8..dbdc7b92791f83a88e3cc7484a2395c8eac8b4fe
@@@ -59,27 -59,29 +59,29 @@@ SketchSolver_ConstraintManager::~Sketch
  // ============================================================================
  void SketchSolver_ConstraintManager::processEvent(const Events_Message* theMessage)
  {
-   if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_CREATED) ||
-       theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_UPDATED) || 
-       theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_MOVED))
+   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_FeatureUpdatedMessage* anUpdateMsg = 
-       dynamic_cast<const ModelAPI_FeatureUpdatedMessage*>(theMessage);
-     std::set< FeaturePtr > aFeatures = anUpdateMsg->features();
+     const ModelAPI_ObjectUpdatedMessage* anUpdateMsg = 
+       dynamic_cast<const ModelAPI_ObjectUpdatedMessage*>(theMessage);
+     std::set< ObjectPtr > aFeatures = anUpdateMsg->features();
  
      bool isModifiedEvt = 
-       theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_MOVED);
+       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);
+         if (!aFeature) continue;
          // 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)
 +        if (aFeatureKind.compare(SketchPlugin_Sketch::ID()) == 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;
      // Solve the set of constraints
      resolveConstraints();
    }
-   else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_DELETED))
+   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
 +    // Find SketchPlugin_Sketch::ID() in groups. The constraint groups should be updated when an object removed from Sketch
      std::set<std::string>::const_iterator aFGrIter;
      for (aFGrIter = aFeatureGroups.begin(); aFGrIter != aFeatureGroups.end(); aFGrIter++)
 -      if (aFGrIter->compare(SKETCH_KIND) == 0)
 +      if (aFGrIter->compare(SketchPlugin_Sketch::ID()) == 0)
          break;
      
      if (aFGrIter != aFeatureGroups.end())
@@@ -350,9 -352,9 +352,9 @@@ boost::shared_ptr<SketchPlugin_Feature
        continue;
  
      boost::shared_ptr<ModelAPI_AttributeRefList> aWPFeatures =
 -      boost::dynamic_pointer_cast<ModelAPI_AttributeRefList>(aWP->data()->attribute(SKETCH_ATTR_FEATURES));
 +      boost::dynamic_pointer_cast<ModelAPI_AttributeRefList>(aWP->data()->attribute(SketchPlugin_Sketch::FEATURES_ID()));
-     std::list< FeaturePtr > aFeaturesList = aWPFeatures->list();
-     std::list< FeaturePtr >::const_iterator anIter;
+     std::list< ObjectPtr >& aFeaturesList = aWPFeatures->list();
+     std::list< ObjectPtr >::const_iterator anIter;
      for (anIter = aFeaturesList.begin(); anIter != aFeaturesList.end(); anIter++)
        if (*anIter == theConstraint)
          return aWP; // workplane is found
Simple merge
index 82dcc853209a70dcd63ecdac56af5df14c182336,b77297f54b6e8690c8b3e6e2cd83ae50a8387ebb..521e193c21e966ab5ff64ba9049d996fe981535f
@@@ -97,11 -102,11 +102,10 @@@ int XGUI_TopDataModel::rowCount(const Q
  
    DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
    if (theParent.internalId() == ParamsFolder)
-     return aRootDoc->size(ModelAPI_Document::PARAMETERS_GROUP());
+     return aRootDoc->size(ModelAPI_ResultParameters::group());
  
    if (theParent.internalId() == ConstructFolder)
-     return aRootDoc->size(ModelAPI_Document::CONSTRUCTIONS_GROUP());
+     return aRootDoc->size(ModelAPI_ResultConstruction::group());
 -
    return 0;
  }