]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Composite Feature implementation. Sketch now is Composite.
authormpv <mikhail.ponikarov@opencascade.com>
Mon, 20 Oct 2014 08:23:27 +0000 (12:23 +0400)
committermpv <mikhail.ponikarov@opencascade.com>
Mon, 20 Oct 2014 08:23:27 +0000 (12:23 +0400)
34 files changed:
src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp
src/Model/Model_AttributeRefList.cpp
src/Model/Model_AttributeRefList.h
src/Model/Model_AttributeSelection.cpp
src/Model/Model_AttributeSelection.h
src/Model/Model_Data.h
src/ModelAPI/CMakeLists.txt
src/ModelAPI/ModelAPI_AttributeRefList.h
src/ModelAPI/ModelAPI_CompositeFeature.h [new file with mode: 0644]
src/ModelAPI/ModelAPI_Object.h
src/ModuleBase/ModuleBase_Operation.cpp
src/ModuleBase/ModuleBase_Operation.h
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_OperationFeatureBase.cpp
src/PartSet/PartSet_OperationFeatureBase.h
src/PartSet/PartSet_OperationFeatureCreate.cpp
src/PartSet/PartSet_OperationFeatureCreate.h
src/PartSet/PartSet_OperationFeatureEdit.cpp
src/PartSet/PartSet_OperationFeatureEdit.h
src/PartSet/PartSet_OperationFeatureEditMulti.cpp
src/PartSet/PartSet_OperationFeatureEditMulti.h
src/PartSet/PartSet_OperationSketch.cpp
src/PartSet/PartSet_OperationSketch.h
src/PartSet/PartSet_OperationSketchBase.h
src/PartSet/PartSet_Tools.cpp
src/PartSet/PartSet_Tools.h
src/SketchPlugin/SketchPlugin_Feature.cpp
src/SketchPlugin/SketchPlugin_Feature.h
src/SketchPlugin/SketchPlugin_Sketch.cpp
src/SketchPlugin/SketchPlugin_Sketch.h
src/SketchSolver/SketchSolver_ConstraintGroup.cpp
src/SketchSolver/SketchSolver_ConstraintGroup.h
src/SketchSolver/SketchSolver_ConstraintManager.cpp
src/SketchSolver/SketchSolver_ConstraintManager.h

index 60ee2b6898bd0f8d6b5e89f9beb9f7de43b227d3..0e997edafe6fe27d0eda36920a0cdb026c80a0e9 100644 (file)
@@ -35,6 +35,8 @@ void FeaturesPlugin_Extrusion::execute()
     return;
   boost::shared_ptr<GeomAPI_Shape> aFace = 
     boost::dynamic_pointer_cast<GeomAPI_Shape>(aFaceRef->value());
+  if (!aFace)
+    return;
 
   double aSize = data()->real(FeaturesPlugin_Extrusion::SIZE_ID())->value();
   if (data()->boolean(FeaturesPlugin_Extrusion::REVERSE_ID())->value())
index 3d3af3467a634402939bdce3243832fce39e4701..014592f0d3eebd58a02679f862777e510745c69c 100644 (file)
@@ -26,7 +26,7 @@ void Model_AttributeRefList::remove(ObjectPtr theObject)
   owner()->data()->sendAttributeUpdated(this);
 }
 
-int Model_AttributeRefList::size()
+int Model_AttributeRefList::size() const
 {
   return myRef->Extent();
 }
@@ -46,6 +46,21 @@ list<ObjectPtr> Model_AttributeRefList::list()
   return aResult;
 }
 
+ObjectPtr Model_AttributeRefList::object(const int theIndex) const
+{
+  boost::shared_ptr<Model_Document> aDoc = boost::dynamic_pointer_cast<Model_Document>(
+      owner()->document());
+  if (aDoc) {
+    const TDF_LabelList& aList = myRef->List();
+    int anIndex = 0;
+    for (TDF_ListIteratorOfLabelList aLIter(aList); aLIter.More(); aLIter.Next(), anIndex++) {
+      if (anIndex == theIndex)
+        return aDoc->object(aLIter.Value());
+    }
+  }
+  return ObjectPtr();
+}
+
 Model_AttributeRefList::Model_AttributeRefList(TDF_Label& theLabel)
 {
   myIsInitialized = theLabel.FindAttribute(TDataStd_ReferenceList::GetID(), myRef) == Standard_True;
index d784769e6c52b6619e5d9bb9be8bdecd9f4d90cf..2b0edac1fc99c7a2f4ab30f1109f29e2c140b668 100644 (file)
@@ -27,11 +27,14 @@ class Model_AttributeRefList : public ModelAPI_AttributeRefList
   MODEL_EXPORT virtual void remove(ObjectPtr theObject);
 
   /// Returns number of features in the list
-  MODEL_EXPORT virtual int size();
+  MODEL_EXPORT virtual int size() const;
 
   /// Returns the list of features
   MODEL_EXPORT virtual std::list<ObjectPtr> list();
 
+  /// Returns the list of features
+  MODEL_EXPORT virtual ObjectPtr object(const int theIndex) const;
+
  protected:
   /// Objects are created for features automatically
   MODEL_EXPORT Model_AttributeRefList(TDF_Label& theLabel);
index 62659de6c59560f4468b759b0102c7c5b0d09fd6..901686539335c7f790e82502a9852d5438fd7a87 100644 (file)
@@ -9,11 +9,16 @@
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultConstruction.h>
+#include <ModelAPI_CompositeFeature.h>
 #include <GeomAPI_Shape.h>
 
 #include <TNaming_Selector.hxx>
 #include <TNaming_NamedShape.hxx>
+#include <TNaming_Tool.hxx>
 #include <TopoDS_Shape.hxx>
+#include <TDataStd_ReferenceList.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopExp_Explorer.hxx>
 
 using namespace std;
 
@@ -29,24 +34,12 @@ void Model_AttributeSelection::setValue(const ResultPtr& theContext,
   if (!isOldContext)
     myRef.setValue(theContext);
 
-  // perform the selection
-  TNaming_Selector aSel(myRef.myRef->Label());
-  TopoDS_Shape aNewShape = theSubShape ? theSubShape->impl<TopoDS_Shape>() : TopoDS_Shape();
-  TopoDS_Shape aContext;
+  if (theContext->groupName() == ModelAPI_ResultBody::group())
+    selectBody(theContext, theSubShape);
+  else if (theContext->groupName() == ModelAPI_ResultConstruction::group())
+    selectConstruction(theContext, theSubShape);
 
-  ResultBodyPtr aBody = boost::dynamic_pointer_cast<ModelAPI_ResultBody>(myRef.value());
-  if (aBody)
-    aContext = aBody->shape()->impl<TopoDS_Shape>();
-  else {
-    ResultConstructionPtr aConstr = boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(myRef.value());
-    if (aConstr)
-      aContext = aConstr->shape()->impl<TopoDS_Shape>();
-    else
-      throw std::invalid_argument("a result with shape is expected");
-  }
-  aSel.Select(aNewShape, aContext);
   myIsInitialized = true;
-
   owner()->data()->sendAttributeUpdated(this);
 }
 
@@ -76,5 +69,74 @@ ResultPtr Model_AttributeSelection::context() {
 
 void Model_AttributeSelection::setObject(const boost::shared_ptr<ModelAPI_Object>& theObject)
 {
+  ModelAPI_AttributeSelection::setObject(theObject);
   myRef.setObject(theObject);
 }
+
+void Model_AttributeSelection::selectBody(
+    const ResultPtr& theContext, const boost::shared_ptr<GeomAPI_Shape>& theSubShape)
+{
+  // perform the selection
+  TNaming_Selector aSel(myRef.myRef->Label());
+  TopoDS_Shape aNewShape = theSubShape ? theSubShape->impl<TopoDS_Shape>() : TopoDS_Shape();
+  TopoDS_Shape aContext;
+
+  ResultBodyPtr aBody = boost::dynamic_pointer_cast<ModelAPI_ResultBody>(myRef.value());
+  if (aBody)
+    aContext = aBody->shape()->impl<TopoDS_Shape>();
+  else {
+    ResultConstructionPtr aConstr = boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(myRef.value());
+    if (aConstr)
+      aContext = aConstr->shape()->impl<TopoDS_Shape>();
+    else
+      throw std::invalid_argument("a result with shape is expected");
+  }
+  Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(aNewShape, myRef.myRef->Label());
+  TDF_Label aLab = aNS->Label();
+
+  aSel.Select(aNewShape, aContext);
+}
+
+#include <BRepTools.hxx>
+
+void Model_AttributeSelection::selectConstruction(
+    const ResultPtr& theContext, const boost::shared_ptr<GeomAPI_Shape>& theSubShape)
+{
+  FeaturePtr aContextFeature = owner()->document()->feature(theContext);
+  CompositeFeaturePtr aComposite = 
+    boost::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aContextFeature);
+  if (!aComposite || aComposite->numberOfSubs() == 0) {
+    return; // saving of context is enough: result construction contains exactly the needed shape
+  }
+  boost::shared_ptr<Model_Data> aData = boost::dynamic_pointer_cast<Model_Data>(owner()->data());
+  TDF_Label aLab = aData->label();
+  // identify the reuslts of sub-object of the composite by edges
+  const TopoDS_Shape& aSubShape = theSubShape->impl<TopoDS_Shape>();
+  TopTools_MapOfShape allEdges;
+  for(TopExp_Explorer anEdgeExp(aSubShape, TopAbs_EDGE); anEdgeExp.More(); anEdgeExp.Next()) {
+    BRepTools::Write(anEdgeExp.Current(), "D:\\selected.brep");
+    allEdges.Add(anEdgeExp.Current());
+  }
+  // iterate and store the result ids of sub-elements
+  Handle(TDataStd_ReferenceList) aRefs = TDataStd_ReferenceList::Set(aLab);
+  const int aSubNum = aComposite->numberOfSubs();
+  for(int a = 0; a < aSubNum; a++) {
+    FeaturePtr aSub = aComposite->subFeature(a);
+    const std::list<boost::shared_ptr<ModelAPI_Result> >& aResults = aSub->results();
+    std::list<boost::shared_ptr<ModelAPI_Result> >::const_iterator aRes = aResults.cbegin();
+    // there may be many shapes (circle and center): register if at least one is in selection
+    for(; aRes != aResults.cend(); aRes++) {
+      ResultConstructionPtr aConstr = 
+        boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aRes);
+      if (aConstr->shape()) {
+        const TopoDS_Shape& aResShape = aConstr->shape()->impl<TopoDS_Shape>();
+        BRepTools::Write(aResShape, "D:\\sub.brep");
+        if (allEdges.Contains(aResShape)) {
+          boost::shared_ptr<Model_Data> aSubData = boost::dynamic_pointer_cast<Model_Data>(aSub->data());
+          TDF_Label aSubLab = aSubData->label();
+          aRefs->Append(aSubLab);
+        }
+      }
+    }
+  }
+}
index b380fef83534337571da6cc5a1222d2203de2cee..b41c4dffc83712520ab9aef3052f8499871f2926 100644 (file)
@@ -33,6 +33,14 @@ public:
 protected:
   /// Objects are created for features automatically
   MODEL_EXPORT Model_AttributeSelection(TDF_Label& theLabel);
+    /// Performs the selection for the body result (TNaming Selection)
+
+  /// Performs the selection for the body result (TNaming selection)
+  virtual void selectBody(
+    const ResultPtr& theContext, const boost::shared_ptr<GeomAPI_Shape>& theSubShape);
+  /// Performs the selection for the construction result (selection by index)
+  virtual void selectConstruction(
+    const ResultPtr& theContext, const boost::shared_ptr<GeomAPI_Shape>& theSubShape);
 
   friend class Model_Data;
 };
index 45360d1a8e23b5253b3f2bee56f56e9a183575a0..8aead1b5b9c1a0e0b8435307d67f446095ca6220 100644 (file)
@@ -56,6 +56,7 @@ class Model_Data : public ModelAPI_Data
   friend class Model_AttributeReference;
   friend class Model_AttributeRefAttr;
   friend class Model_AttributeRefList;
+  friend class Model_AttributeSelection;
 
  public:
   /// Returns the name of the feature visible by the user in the object browser
index b0299b5cf1ce57a8e623c938f47d8a8ecccd119b..13e4ee12ee28db715e778ed6d4ba2b257e57d0ac 100644 (file)
@@ -8,6 +8,7 @@ SET(PROJECT_HEADERS
     ModelAPI_Session.h
     ModelAPI_Plugin.h
     ModelAPI_Feature.h
+    ModelAPI_CompositeFeature.h
     ModelAPI_Data.h
     ModelAPI_Object.h
     ModelAPI_Document.h
index b8b5c700ba1346b80213fa587d70c68c54692408..abb39beb645cc8b9bb3cf6b58c54cb291406aa88 100644 (file)
@@ -36,11 +36,14 @@ class ModelAPI_AttributeRefList : public ModelAPI_Attribute
   MODELAPI_EXPORT virtual void remove(ObjectPtr theObject) = 0;
 
   /// Returns number of features in the list
-  MODELAPI_EXPORT virtual int size() = 0;
+  MODELAPI_EXPORT virtual int size() const = 0;
 
   /// Returns the list of features
   MODELAPI_EXPORT virtual std::list<ObjectPtr> list() = 0;
 
+ /// Returns the referenced object by the zero-based index
+  MODELAPI_EXPORT virtual ObjectPtr object(const int theIndex) const = 0;
+
  protected:
   /// Objects are created for features automatically
   MODELAPI_EXPORT ModelAPI_AttributeRefList()
diff --git a/src/ModelAPI/ModelAPI_CompositeFeature.h b/src/ModelAPI/ModelAPI_CompositeFeature.h
new file mode 100644 (file)
index 0000000..3c822e6
--- /dev/null
@@ -0,0 +1,32 @@
+// File:        ModelAPI_CompositeFeature.hxx
+// Created:     20 Oct 2014
+// Author:      Mikhail PONIKAROV
+
+#ifndef ModelAPI_CompositeFeature_H_
+#define ModelAPI_CompositeFeature_H_
+
+#include "ModelAPI_Feature.h"
+
+/**\class ModelAPI_CompositeFeature
+ * \ingroup DataModel
+ * \brief Feature that consists of other features: like sketcher
+ * with edges inside. It just allows t oadd a feature to this feature only
+ * instead of adding in both document and this feature.
+ */
+class ModelAPI_CompositeFeature : public ModelAPI_Feature
+{
+public:
+  /// Adds feature to the sketch and to its document
+  virtual boost::shared_ptr<ModelAPI_Feature> addFeature(std::string theID) = 0;
+
+  /// Returns the number of sub-elements
+  virtual int numberOfSubs() const = 0;
+
+  /// Returns the sub-feature by zero-base index
+  virtual boost::shared_ptr<ModelAPI_Feature> subFeature(const int theIndex) const = 0;
+};
+
+//! Pointer on the composite feature object
+typedef boost::shared_ptr<ModelAPI_CompositeFeature> CompositeFeaturePtr;
+
+#endif
index a00d6e3b856214479f23f42921929ba6562dcfd9..7c539d7d52e84608445a9033a9d5e8afaa4ca491 100644 (file)
@@ -34,7 +34,7 @@ class ModelAPI_Object
   }
 
   /// Returns the data manager of this object: attributes
-  virtual boost::shared_ptr<ModelAPI_Data> data()
+  virtual boost::shared_ptr<ModelAPI_Data> data() const
   {
     return myData;
   }
index d55bdc3f0e54ef8dcc5ccacb6158db8f1aa0fb43..19876df75612ffd5f5b1d2ee36c8a92ed17e45c8 100644 (file)
@@ -121,10 +121,15 @@ void ModuleBase_Operation::flushCreated()
   Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED));
 }
 
-FeaturePtr ModuleBase_Operation::createFeature(const bool theFlushMessage)
+FeaturePtr ModuleBase_Operation::createFeature(
+  const bool theFlushMessage, CompositeFeaturePtr theCompositeFeature)
 {
-  boost::shared_ptr<ModelAPI_Document> aDoc = document();
-  myFeature = aDoc->addFeature(getDescription()->operationId().toStdString());
+  if (theCompositeFeature) {
+    myFeature = theCompositeFeature->addFeature(getDescription()->operationId().toStdString());
+  } else {
+    boost::shared_ptr<ModelAPI_Document> aDoc = document();
+    myFeature = aDoc->addFeature(getDescription()->operationId().toStdString());
+  }
   if (myFeature) {  // TODO: generate an error if feature was not created
     myIsModified = true;
     // Model update should call "execute" of a feature.
index dbf2b3406c1851ab1c91e25e4ea96e3603220528..80cab9e125b85f9afd783ed2480d906f86bf41ce 100644 (file)
@@ -11,7 +11,7 @@
 #include <ModuleBase.h>
 #include <ModuleBase_ViewerPrs.h>
 
-#include <ModelAPI_Feature.h>
+#include <ModelAPI_CompositeFeature.h>
 #include <ModelAPI_Document.h>
 
 #include <QObject>
@@ -192,8 +192,10 @@ signals:
 
   /// Creates an operation new feature
   /// \param theFlushMessage the flag whether the create message should be flushed
-  /// \returns the created feature
-  virtual FeaturePtr createFeature(const bool theFlushMessage = true);
+  /// \param theCompositeFeature the feature that must be used for adding the created object or null
+  /// \returns the created 
+  virtual FeaturePtr createFeature(const bool theFlushMessage = true, 
+    CompositeFeaturePtr theCompositeFeature = CompositeFeaturePtr());
 
   /// Verifies whether this operator can be commited.
   /// \return Returns TRUE if current operation can be committed, e.g. all parameters are filled
index a44256ea79eac1c1f3629a90499eefde3b2c2fca..15742d1b9319ed897ff5bbe53052b444146eabf1 100644 (file)
@@ -421,7 +421,7 @@ ModuleBase_Operation* PartSet_Module::createOperation(const std::string& theCmdI
     anOperation = new PartSet_OperationSketch(theCmdId.c_str(), this);
   } else {
     ModuleBase_Operation* aCurOperation = myWorkshop->currentOperation();
-    FeaturePtr aSketch;
+    CompositeFeaturePtr aSketch;
     PartSet_OperationSketchBase* aPrevOp = dynamic_cast<PartSet_OperationSketchBase*>(aCurOperation);
     if (aPrevOp) {
       aSketch = aPrevOp->sketch();
index 3e0c412ec133c564cd4627bd6e4b633db7f132a5..9955fa5f05a9eefd10a419b6c013c83b66c0df61 100644 (file)
@@ -44,7 +44,7 @@ using namespace std;
 
 PartSet_OperationFeatureBase::PartSet_OperationFeatureBase(const QString& theId,
                                                                QObject* theParent,
-                                                               FeaturePtr theFeature)
+                                                               CompositeFeaturePtr theFeature)
     : PartSet_OperationSketchBase(theId, theParent),
       mySketch(theFeature)
 {
@@ -54,7 +54,7 @@ PartSet_OperationFeatureBase::~PartSet_OperationFeatureBase()
 {
 }
 
-FeaturePtr PartSet_OperationFeatureBase::sketch() const
+CompositeFeaturePtr PartSet_OperationFeatureBase::sketch() const
 {
   return mySketch;
 }
index baef75f9f53101d2fe6455937479f5afda8bea63..a9651e6f85536884b551d5f99f0ffcdb409fe76d 100644 (file)
@@ -29,13 +29,13 @@ Q_OBJECT
   /// \param theId the feature identifier
   /// \param theParent the operation parent
   /// \param theSketch the parent feature
-  PartSet_OperationFeatureBase(const QString& theId, QObject* theParent, FeaturePtr theSketch);
+  PartSet_OperationFeatureBase(const QString& theId, QObject* theParent, CompositeFeaturePtr theSketch);
   /// Destructor
   virtual ~PartSet_OperationFeatureBase();
 
   /// Returns the operation sketch feature
   /// \returns the sketch instance
-  virtual FeaturePtr sketch() const;
+  virtual CompositeFeaturePtr sketch() const;
 
   /// Gives the current selected objects to be processed by the operation
   /// \param theEvent the mouse event
@@ -56,7 +56,7 @@ Q_OBJECT
   //bool setWidgetValue(ObjectPtr theFeature, double theX, double theY);
 
  protected:
-  FeaturePtr mySketch;  ///< the sketch of the feature
+  CompositeFeaturePtr mySketch;  ///< the sketch of the feature
 };
 
 #endif
index fe4b73858d949b332b314bd8e8abf9fbdef8fe53..0bc2d9238b818f5f51b4ccc8cc1afd29dca400f2 100644 (file)
@@ -46,7 +46,7 @@ using namespace std;
 
 PartSet_OperationFeatureCreate::PartSet_OperationFeatureCreate(const QString& theId,
                                                                QObject* theParent,
-                                                               FeaturePtr theFeature)
+                                                               CompositeFeaturePtr theFeature)
     : PartSet_OperationFeatureBase(theId, theParent, theFeature)
 {
 }
@@ -176,15 +176,10 @@ void PartSet_OperationFeatureCreate::afterCommitOperation()
   emit featureConstructed(feature(), FM_Deactivation);
 }
 
-FeaturePtr PartSet_OperationFeatureCreate::createFeature(const bool theFlushMessage)
+FeaturePtr PartSet_OperationFeatureCreate::createFeature(const bool theFlushMessage,
+  CompositeFeaturePtr theCompositeFeature)
 {
-  FeaturePtr aNewFeature = ModuleBase_Operation::createFeature(false);
-  if (sketch()) {
-    boost::shared_ptr<SketchPlugin_Feature> aFeature = boost::dynamic_pointer_cast<
-        SketchPlugin_Feature>(sketch());
-
-    aFeature->addSub(aNewFeature);
-  }
+  FeaturePtr aNewFeature = ModuleBase_Operation::createFeature(false, sketch());
 
   if (theFlushMessage)
     flushCreated();
index 531b4ff22f1d89ddba0d50fd5a2105be553ccd55..b13b8ece551344d3efb079359872832f4d886f77 100644 (file)
@@ -34,7 +34,8 @@ Q_OBJECT
   /// \param theId the feature identifier
   /// \param theParent the operation parent
   /// \param theSketch the parent feature
-  PartSet_OperationFeatureCreate(const QString& theId, QObject* theParent, FeaturePtr theSketch);
+  PartSet_OperationFeatureCreate(
+    const QString& theId, QObject* theParent, CompositeFeaturePtr theSketch);
   /// Destructor
   virtual ~PartSet_OperationFeatureCreate();
 
@@ -85,7 +86,8 @@ Q_OBJECT
   /// the sketch feature
   /// \param theFlushMessage the flag whether the create message should be flushed
   /// \returns the created feature
-  virtual FeaturePtr createFeature(const bool theFlushMessage = true);
+  virtual FeaturePtr createFeature(const bool theFlushMessage = true,
+    CompositeFeaturePtr theCompositeFeature = CompositeFeaturePtr());
 
   /// Verifies whether this operator can be commited.
   /// \return Returns TRUE if current operation can be committed, e.g. all parameters are filled
index 1e0932280931eaf2fd2e1ee83163e555cf1ac6c3..ecc1f0b1e1753dd17472067d53558f4c1649a5f4 100644 (file)
@@ -40,7 +40,7 @@ using namespace std;
 
 PartSet_OperationFeatureEdit::PartSet_OperationFeatureEdit(const QString& theId,
                                                            QObject* theParent,
-                                                           FeaturePtr theFeature)
+                                                           CompositeFeaturePtr theFeature)
     : PartSet_OperationFeatureBase(theId, theParent, theFeature),
       myIsBlockedSelection(false)
 {
@@ -196,7 +196,8 @@ void PartSet_OperationFeatureEdit::blockSelection(bool isBlocked, const bool isR
   }
 }
 
-FeaturePtr PartSet_OperationFeatureEdit::createFeature(const bool /*theFlushMessage*/)
+FeaturePtr PartSet_OperationFeatureEdit::createFeature(const bool theFlushMessage,
+  CompositeFeaturePtr theCompositeFeature)
 {
   // do nothing in order to do not create a new feature
   return FeaturePtr();
index 67223fce62fa0b756da56fae9c00c33cda84ca0c..1b741a56a06b2a2d578d9920cabe5305d03d37b4 100644 (file)
@@ -66,7 +66,7 @@ Q_OBJECT
   /// \param theId the feature identifier
   /// \param theParent the operation parent
   /// \param theFeature the parent feature
-  PartSet_OperationFeatureEdit(const QString& theId, QObject* theParent, FeaturePtr theFeature);
+  PartSet_OperationFeatureEdit(const QString& theId, QObject* theParent, CompositeFeaturePtr theFeature);
   /// Destructor
   virtual ~PartSet_OperationFeatureEdit();
 
@@ -114,7 +114,8 @@ Q_OBJECT
   /// Returns NULL feature. This is an operation of edition, not creation.
   /// \param theFlushMessage the flag whether the create message should be flushed
   /// \returns the created feature
-  virtual FeaturePtr createFeature(const bool theFlushMessage = true);
+  virtual FeaturePtr createFeature(const bool theFlushMessage = true, 
+    CompositeFeaturePtr theCompositeFeature = CompositeFeaturePtr());
 
  protected:
   /// Emits a signal about the selection blocking. Emits a signal to change the selection.
index b36e16ca201c7c71418bcf4261ab577522116abb..9c98058604b8920cdbbb412820ecefd43d5b126c 100644 (file)
@@ -34,7 +34,7 @@ using namespace std;
 
 PartSet_OperationFeatureEditMulti::PartSet_OperationFeatureEditMulti(const QString& theId,
                                                                      QObject* theParent,
-                                                                     FeaturePtr theFeature)
+                                                                     CompositeFeaturePtr theFeature)
     : PartSet_OperationSketchBase(theId, theParent),
       mySketch(theFeature),
       myIsBlockedSelection(false)
@@ -96,7 +96,7 @@ void PartSet_OperationFeatureEditMulti::initSelection(
   }
 }
 
-FeaturePtr PartSet_OperationFeatureEditMulti::sketch() const
+CompositeFeaturePtr PartSet_OperationFeatureEditMulti::sketch() const
 {
   return mySketch;
 }
index b34b638ad498cd5c113e9472fc76dcb77981da38..44de5817bc6325261866f36df5e15fde4ab8a24f 100644 (file)
@@ -66,7 +66,7 @@ Q_OBJECT
   /// \param theParent the operation parent
   /// \param theFeature the parent feature
   PartSet_OperationFeatureEditMulti(const QString& theId, QObject* theParent,
-                                    FeaturePtr theFeature);
+                                    CompositeFeaturePtr theFeature);
   /// Destructor
   virtual ~PartSet_OperationFeatureEditMulti();
 
@@ -78,7 +78,7 @@ Q_OBJECT
 
   /// Returns the operation sketch feature
   /// \returns the sketch instance
-  virtual FeaturePtr sketch() const;
+  virtual CompositeFeaturePtr sketch() const;
 
   /// Processes the mouse pressed in the point
   /// \param theEvent the mouse event
@@ -122,7 +122,7 @@ Q_OBJECT
   void sendFeatures();
 
  private:
-  FeaturePtr mySketch;  ///< the sketch feature
+  CompositeFeaturePtr mySketch;  ///< the sketch feature
   std::list<ModuleBase_ViewerPrs> myFeatures;  ///< the features to apply the edit operation
   Point myCurPoint;  ///< the current 3D point clicked or moved
   bool myIsBlockedSelection;  ///< the state of the last state of selection blocked signal
index b98436a07f761417316706b4fcd9671c0ccb35e9..6deab5b2801ddc8ff68401fefd96e418e62be863 100644 (file)
@@ -48,9 +48,9 @@ PartSet_OperationSketch::~PartSet_OperationSketch()
 {
 }
 
-FeaturePtr PartSet_OperationSketch::sketch() const
+CompositeFeaturePtr PartSet_OperationSketch::sketch() const
 {
-  return feature();
+  return boost::dynamic_pointer_cast<ModelAPI_CompositeFeature>(feature());
 }
 
 void PartSet_OperationSketch::mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView,
index 92d2c4fa182057c873b6a0a680efa32adf50323f..d3ede8b3d0aec290ccf814e72e9da2674092557c 100644 (file)
@@ -43,7 +43,7 @@ Q_OBJECT
 
   /// Returns the operation sketch feature
   /// \returns the sketch instance
-  virtual FeaturePtr sketch() const;
+  virtual CompositeFeaturePtr sketch() const;
 
   /// Processes the mouse pressed in the point
   /// \param theEvent the mouse event
index 39fbaf082b48bf509451ad49c5901faf22f3456c..c7d639348f858daae620f6403558e1f81e3f17a6 100644 (file)
@@ -62,7 +62,7 @@ Q_OBJECT
 
   /// Returns the operation sketch feature
   /// \returns the sketch instance
-  virtual FeaturePtr sketch() const = 0;
+  virtual CompositeFeaturePtr sketch() const = 0;
 
   /// Processes the mouse pressed in the point
   /// \param theEvent the mouse event
index ea47cde213c1babfc395b031cc5628f7c1b7c03b..892f610a0d36e43ebc4511f884184f9c97cc98bb 100644 (file)
@@ -235,17 +235,16 @@ FeaturePtr PartSet_Tools::feature(FeaturePtr theFeature, const std::string& theA
   return aFeature;
 }
 
-void PartSet_Tools::createConstraint(FeaturePtr theSketch,
+void PartSet_Tools::createConstraint(CompositeFeaturePtr theSketch,
                                      boost::shared_ptr<GeomDataAPI_Point2D> thePoint1,
                                      boost::shared_ptr<GeomDataAPI_Point2D> thePoint2)
 {
-  boost::shared_ptr<ModelAPI_Document> aDoc = document();
-  FeaturePtr aFeature = aDoc->addFeature(SketchPlugin_ConstraintCoincidence::ID());
-
+  FeaturePtr aFeature;
   if (theSketch) {
-    boost::shared_ptr<SketchPlugin_Feature> aSketch = boost::dynamic_pointer_cast<
-        SketchPlugin_Feature>(theSketch);
-    aSketch->addSub(aFeature);
+    aFeature = theSketch->addFeature(SketchPlugin_ConstraintCoincidence::ID());
+  } else {
+    boost::shared_ptr<ModelAPI_Document> aDoc = document();
+    aFeature = aDoc->addFeature(SketchPlugin_ConstraintCoincidence::ID());
   }
 
   boost::shared_ptr<ModelAPI_Data> aData = aFeature->data();
@@ -262,7 +261,7 @@ void PartSet_Tools::createConstraint(FeaturePtr theSketch,
     aFeature->execute();
 }
 
-void PartSet_Tools::setConstraints(FeaturePtr theSketch, FeaturePtr theFeature,
+void PartSet_Tools::setConstraints(CompositeFeaturePtr theSketch, FeaturePtr theFeature,
                                    const std::string& theAttribute, double theClickedX,
                                    double theClickedY)
 {
@@ -302,7 +301,7 @@ void PartSet_Tools::setConstraints(FeaturePtr theSketch, FeaturePtr theFeature,
   }
 }
 
-boost::shared_ptr<GeomAPI_Pln> PartSet_Tools::sketchPlane(FeaturePtr theSketch)
+boost::shared_ptr<GeomAPI_Pln> PartSet_Tools::sketchPlane(CompositeFeaturePtr theSketch)
 {
   boost::shared_ptr<GeomAPI_Pln> aPlane;
   double aA, aB, aC, aD;
@@ -322,7 +321,7 @@ boost::shared_ptr<GeomAPI_Pln> PartSet_Tools::sketchPlane(FeaturePtr theSketch)
 }
 
 boost::shared_ptr<GeomAPI_Pnt> PartSet_Tools::point3D(boost::shared_ptr<GeomAPI_Pnt2d> thePoint2D,
-                                                      FeaturePtr theSketch)
+                                                      CompositeFeaturePtr theSketch)
 {
   boost::shared_ptr<GeomAPI_Pnt> aPoint;
   if (!theSketch || !thePoint2D)
index d1b5b4d5cd9f4646495b0613cb4319a67da3ec59..160814747f5184035d4814a27d8a85688519e865 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <QPoint>
 
-#include <ModelAPI_Feature.h>
+#include <ModelAPI_CompositeFeature.h>
 
 #include <boost/shared_ptr.hpp>
 
@@ -97,7 +97,7 @@ class PARTSET_EXPORT PartSet_Tools
   /// Creates a constraint on two points
   /// \param thePoint1 the first point
   /// \param thePoint1 the second point
-  static void createConstraint(FeaturePtr theSketch,
+  static void createConstraint(CompositeFeaturePtr theSketch,
                                boost::shared_ptr<GeomDataAPI_Point2D> thePoint1,
                                boost::shared_ptr<GeomDataAPI_Point2D> thePoint2);
 
@@ -107,21 +107,21 @@ class PARTSET_EXPORT PartSet_Tools
   /// \param theAttribute a name of the requried attribute attribute
   /// \param theClickedX the horizontal coordnate of the point
   /// \param theClickedY the vertical coordnate of the point
-  static void setConstraints(FeaturePtr theSketch, FeaturePtr theFeature,
+  static void setConstraints(CompositeFeaturePtr theSketch, FeaturePtr theFeature,
                              const std::string& theAttribute, double theClickedX,
                              double theClickedY);
 
   /// Create a sketch plane instance
   /// \param theSketch a sketch feature
   /// \return API object of geom plane
-  static boost::shared_ptr<GeomAPI_Pln> sketchPlane(FeaturePtr theSketch);
+  static boost::shared_ptr<GeomAPI_Pln> sketchPlane(CompositeFeaturePtr theSketch);
 
   /// Create a point 3D on a basis of point 2D and sketch feature
   /// \param thePoint2D a point on a sketch
   /// \param theSketch a sketch feature
   /// \return API object of point 3D
   static boost::shared_ptr<GeomAPI_Pnt> point3D(boost::shared_ptr<GeomAPI_Pnt2d> thePoint2D,
-                                                FeaturePtr theSketch);
+                                                CompositeFeaturePtr theSketch);
   /// Check whether there is a constraint with the feature kind given
   /// \param theKind a feature kind
   /// \return the boolean value
index c3c800bd992ca865bfe4ec7ba0637964c8ac6cfb..9fd9ee2f662ab59ab4db0ec8ecd6d4ba1cb77106 100644 (file)
@@ -17,8 +17,9 @@ SketchPlugin_Sketch* SketchPlugin_Feature::sketch()
     // find sketch that references to this feature
     int aSketches = document()->size(ModelAPI_Feature::group());
     for (int a = 0; a < aSketches && !mySketch; a++) {
-      boost::shared_ptr<SketchPlugin_Sketch> aSketch = boost::dynamic_pointer_cast<
-          SketchPlugin_Sketch>(document()->object(ModelAPI_Feature::group(), a));
+      ObjectPtr anObj = document()->object(ModelAPI_Feature::group(), a);
+      boost::shared_ptr<SketchPlugin_Sketch> aSketch = 
+        boost::dynamic_pointer_cast<SketchPlugin_Sketch>(anObj);
       if (aSketch) {
         std::list<ObjectPtr> aList = aSketch->data()->reflist(SketchPlugin_Sketch::FEATURES_ID())
             ->list();
index d51301880a14e01c6c9d345275f577a13dbbd88e..24b856b1fd37dc3cd9be5f27cd05687a7dbcfb96 100644 (file)
@@ -6,7 +6,7 @@
 #define SketchPlugin_Feature_H_
 
 #include "SketchPlugin.h"
-#include <ModelAPI_Feature.h>
+#include <ModelAPI_CompositeFeature.h>
 #include <GeomAPI_Shape.h>
 #include <GeomAPI_AISObject.h>
 #include <ModelAPI_Document.h>
@@ -27,13 +27,6 @@ class SketchPlugin_Feature : public ModelAPI_Feature
   static AISObjectPtr simpleAISObject(boost::shared_ptr<ModelAPI_Result> theRes,
                                       AISObjectPtr thePrevious);
 
-  /// Adds sub-feature of the higher level feature (sub-element of the sketch)
-  /// \param theFeature sub-feature
-  SKETCHPLUGIN_EXPORT virtual const void addSub(const FeaturePtr& theFeature)
-  {
-  }
-  ;
-
   /// Returns true if this feature must be displayed in the history (top level of Part tree)
   SKETCHPLUGIN_EXPORT virtual bool isInHistory()
   {
index 0bbcfe2a76969e396527c3ff6a184ea247fe0a00..a8fef3263d7e4a5b3c3922a851e92dff80db7c0b 100644 (file)
@@ -100,10 +100,25 @@ void SketchPlugin_Sketch::execute()
   setResult(aConstr);
 }
 
-const void SketchPlugin_Sketch::addSub(const FeaturePtr& theFeature)
+boost::shared_ptr<ModelAPI_Feature> SketchPlugin_Sketch::addFeature(std::string theID)
 {
-  boost::dynamic_pointer_cast<SketchPlugin_Feature>(theFeature)->setSketch(this);
-  data()->reflist(SketchPlugin_Sketch::FEATURES_ID())->append(theFeature);
+  boost::shared_ptr<ModelAPI_Feature> aNew = document()->addFeature(theID);
+  if (aNew) {
+    boost::dynamic_pointer_cast<SketchPlugin_Feature>(aNew)->setSketch(this);
+    data()->reflist(SketchPlugin_Sketch::FEATURES_ID())->append(aNew);
+  }
+  return aNew;
+}
+
+int SketchPlugin_Sketch::numberOfSubs() const
+{
+  return data()->reflist(SketchPlugin_Sketch::FEATURES_ID())->size();
+}
+
+boost::shared_ptr<ModelAPI_Feature> SketchPlugin_Sketch::subFeature(const int theIndex) const
+{
+  ObjectPtr anObj = data()->reflist(SketchPlugin_Sketch::FEATURES_ID())->object(theIndex);
+  return boost::dynamic_pointer_cast<ModelAPI_Feature>(anObj);
 }
 
 boost::shared_ptr<GeomAPI_Pnt> SketchPlugin_Sketch::to3D(const double theX, const double theY)
@@ -195,5 +210,5 @@ void SketchPlugin_Sketch::erase()
       document()->removeFeature(aFeature, false);
     }
   }
-  SketchPlugin_Feature::erase();
+  ModelAPI_CompositeFeature::erase();
 }
index 07f8ae269ec8e34eee0af6f9a4559b15e9c61d7d..c35b37ce1f3cb0b97badfa985f62db8310460d04 100644 (file)
@@ -25,7 +25,7 @@
  * \ingroup DataModel
  * \brief Feature for creation of the new part in PartSet.
  */
-class SketchPlugin_Sketch : public SketchPlugin_Feature, public GeomAPI_IPresentable
+class SketchPlugin_Sketch : public ModelAPI_CompositeFeature, public GeomAPI_IPresentable
 {
  public:
   /// Sketch feature kind
@@ -78,10 +78,6 @@ class SketchPlugin_Sketch : public SketchPlugin_Feature, public GeomAPI_IPresent
   /// Request for initialization of data model of the feature: adding all attributes
   SKETCHPLUGIN_EXPORT virtual void initAttributes();
 
-  /// Adds sub-feature of the higher level feature (sub-element of the sketch)
-  /// \param theFeature sub-feature
-  SKETCHPLUGIN_EXPORT virtual const void addSub(const FeaturePtr& theFeature);
-
   /// Moves the feature
   /// \param theDeltaX the delta for X coordinate is moved
   /// \param theDeltaY the delta for Y coordinate is moved
@@ -118,6 +114,15 @@ class SketchPlugin_Sketch : public SketchPlugin_Feature, public GeomAPI_IPresent
   /// removes also all sub-sketch elements
   SKETCHPLUGIN_EXPORT virtual void erase();
 
+  SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> addFeature(std::string theID);
+
+  /// Returns the number of sub-elements
+  SKETCHPLUGIN_EXPORT virtual int numberOfSubs() const;
+
+  /// Returns the sub-feature by zero-base index
+  SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> 
+    subFeature(const int theIndex) const;
+
  protected:
   /// Creates a plane and append it to the list
   /// \param theX the X normal value
index 1ef8518dc7732aa0206bb153db11a307631ae287..20158ab6ec36a22498ebbc5ec75380d128e767c4 100644 (file)
@@ -68,7 +68,7 @@ static int Search(const uint32_t& theEntityID, const std::vector<T>& theEntities
 // ========================================================
 
 SketchSolver_ConstraintGroup::SketchSolver_ConstraintGroup(
-    boost::shared_ptr<SketchPlugin_Feature> theWorkplane)
+    boost::shared_ptr<ModelAPI_CompositeFeature> theWorkplane)
     : myID(++myGroupIndexer),
       myParamMaxID(0),
       myEntityMaxID(0),
@@ -116,7 +116,7 @@ SketchSolver_ConstraintGroup::~SketchSolver_ConstraintGroup()
 //  Purpose:  verify the group is based on the given workplane
 // ============================================================================
 bool SketchSolver_ConstraintGroup::isBaseWorkplane(
-    boost::shared_ptr<SketchPlugin_Feature> theWorkplane) const
+    boost::shared_ptr<ModelAPI_CompositeFeature> theWorkplane) const
 {
   return theWorkplane == mySketch;
 }
@@ -776,7 +776,7 @@ Slvs_hEntity SketchSolver_ConstraintGroup::changeNormal(
 //  Class:    SketchSolver_ConstraintGroup
 //  Purpose:  create workplane for the group
 // ============================================================================
-bool SketchSolver_ConstraintGroup::addWorkplane(boost::shared_ptr<SketchPlugin_Feature> theSketch)
+bool SketchSolver_ConstraintGroup::addWorkplane(boost::shared_ptr<ModelAPI_CompositeFeature> theSketch)
 {
   if (myWorkplane.h || theSketch->getKind().compare(SketchPlugin_Sketch::ID()) != 0)
     return false;  // the workplane already exists or the function parameter is not Sketch
index 2337f5187883059f751f128430e48d02f6bc22fa..c8a673029e2ce047589e971d17e7cdb2b132dd70 100644 (file)
@@ -30,7 +30,7 @@ class SketchSolver_ConstraintGroup
    *         Throws an exception if theWorkplane is not an object of SketchPlugin_Sketch type
    *  \remark Type of theSketch is not verified inside
    */
-  SketchSolver_ConstraintGroup(boost::shared_ptr<SketchPlugin_Feature> theWorkplane);
+  SketchSolver_ConstraintGroup(boost::shared_ptr<ModelAPI_CompositeFeature> theWorkplane);
 
   ~SketchSolver_ConstraintGroup();
 
@@ -69,9 +69,9 @@ class SketchSolver_ConstraintGroup
    *  \param[in] theWorkplane the feature to be compared with base workplane
    *  \return \c true if workplanes are the same
    */
-  bool isBaseWorkplane(boost::shared_ptr<SketchPlugin_Feature> theWorkplane) const;
+  bool isBaseWorkplane(boost::shared_ptr<ModelAPI_CompositeFeature> theWorkplane) const;
 
-  boost::shared_ptr<SketchPlugin_Feature> getWorkplane() const
+  boost::shared_ptr<ModelAPI_CompositeFeature> getWorkplane() const
   {
     return mySketch;
   }
@@ -188,7 +188,7 @@ protected:
    *  \param[in] theSketch parameters of workplane are the attributes of this sketch
    *  \return \c true if success, \c false if workplane parameters are not consistent
    */
-  bool addWorkplane(boost::shared_ptr<SketchPlugin_Feature> theSketch);
+  bool addWorkplane(boost::shared_ptr<ModelAPI_CompositeFeature> theSketch);
 
   /** \brief Add the entities of constraint for points coincidence into the appropriate list
    *  \param[in] thePoint1 identifier of the first point
@@ -224,7 +224,7 @@ protected:
   std::list<Slvs_hConstraint> myTempConstraints;  ///< The list of identifiers of temporary constraints (SLVS_C_WHERE_DRAGGED) applied for all other points moved by user
 
   // SketchPlugin entities
-  boost::shared_ptr<SketchPlugin_Feature> mySketch;        ///< Equivalent to workplane
+  boost::shared_ptr<ModelAPI_CompositeFeature> mySketch;        ///< Equivalent to workplane
   ConstraintMap myConstraintMap;  ///< The map between SketchPlugin and SolveSpace constraints
   std::map<boost::shared_ptr<ModelAPI_Attribute>, Slvs_hEntity> myEntityAttrMap;  ///< The map between "attribute" parameters of constraints and their equivalent SolveSpace entities
   std::map<FeaturePtr, Slvs_hEntity> myEntityFeatMap;  ///< The map between "feature" parameters of constraints and their equivalent SolveSpace entities
index c0ade33a73680d44350a1919be5ebe31baed40f0..ebc25b1fa35edf7dbbb20e78b976258937cd914c 100644 (file)
@@ -88,8 +88,8 @@ void SketchSolver_ConstraintManager::processEvent(
         // Only sketches and constraints can be added by Create event
         const std::string& aFeatureKind = aFeature->getKind();
         if (aFeatureKind.compare(SketchPlugin_Sketch::ID()) == 0) {
-          boost::shared_ptr<SketchPlugin_Feature> aSketch = boost::dynamic_pointer_cast<
-              SketchPlugin_Feature>(aFeature);
+          boost::shared_ptr<ModelAPI_CompositeFeature> aSketch = boost::dynamic_pointer_cast<
+              ModelAPI_CompositeFeature>(aFeature);
           if (aSketch)
             changeWorkplane(aSketch);
           continue;
@@ -144,7 +144,7 @@ void SketchSolver_ConstraintManager::processEvent(
 //  Purpose:  update workplane by given parameters of the sketch
 // ============================================================================
 bool SketchSolver_ConstraintManager::changeWorkplane(
-    boost::shared_ptr<SketchPlugin_Feature> theSketch)
+    boost::shared_ptr<ModelAPI_CompositeFeature> theSketch)
 {
   bool aResult = true;  // changed when a workplane wrongly updated
   bool isUpdated = false;
@@ -189,7 +189,7 @@ bool SketchSolver_ConstraintManager::changeConstraintOrEntity(
     // There are no groups applicable for this constraint => create new one
     // The group will be created only for constraints, not for features
     if (!aConstraint) return false;
-    boost::shared_ptr<SketchPlugin_Feature> aWP = findWorkplane(aConstraint);
+    boost::shared_ptr<ModelAPI_CompositeFeature> aWP = findWorkplane(aConstraint);
     if (!aWP)
       return false;
     SketchSolver_ConstraintGroup* aGroup = new SketchSolver_ConstraintGroup(aWP);
@@ -309,7 +309,7 @@ void SketchSolver_ConstraintManager::findGroups(
     boost::shared_ptr<SketchPlugin_Feature> theFeature,
     std::set<Slvs_hGroup>& theGroupIDs) const
 {
-  boost::shared_ptr<SketchPlugin_Feature> aWP = findWorkplane(theFeature);
+  boost::shared_ptr<ModelAPI_CompositeFeature> aWP = findWorkplane(theFeature);
 
   SketchSolver_ConstraintGroup* anEmptyGroup = 0;  // appropriate empty group for specified constraint
   std::vector<SketchSolver_ConstraintGroup*>::const_iterator aGroupIter;
@@ -331,15 +331,15 @@ void SketchSolver_ConstraintManager::findGroups(
 //  Class:    SketchSolver_Session
 //  Purpose:  search workplane containing given feature
 // ============================================================================
-boost::shared_ptr<SketchPlugin_Feature> SketchSolver_ConstraintManager::findWorkplane(
+boost::shared_ptr<ModelAPI_CompositeFeature> SketchSolver_ConstraintManager::findWorkplane(
     boost::shared_ptr<SketchPlugin_Feature> theFeature) const
 {
   // Already verified workplanes
-  std::set<boost::shared_ptr<SketchPlugin_Feature> > aVerified;
+  std::set<boost::shared_ptr<ModelAPI_CompositeFeature> > aVerified;
 
   std::vector<SketchSolver_ConstraintGroup*>::const_iterator aGroupIter;
   for (aGroupIter = myGroups.begin(); aGroupIter != myGroups.end(); aGroupIter++) {
-    boost::shared_ptr<SketchPlugin_Feature> aWP = (*aGroupIter)->getWorkplane();
+    boost::shared_ptr<ModelAPI_CompositeFeature> aWP = (*aGroupIter)->getWorkplane();
     if (aVerified.find(aWP) != aVerified.end())
       continue;
 
@@ -353,7 +353,7 @@ boost::shared_ptr<SketchPlugin_Feature> SketchSolver_ConstraintManager::findWork
     aVerified.insert(aWP);
   }
 
-  return boost::shared_ptr<SketchPlugin_Feature>();
+  return boost::shared_ptr<ModelAPI_CompositeFeature>();
 }
 
 // ============================================================================
index b0aefd196ea3f8c9ddd8c36e09cd219e924a0d4e..b13a67182460bb373c4da9300f00f250415e16b5 100644 (file)
@@ -65,7 +65,7 @@ class SketchSolver_ConstraintManager : public Events_Listener
    *  \return \c true if the workplane changed successfully
    *  \remark Type of theSketch is not verified inside
    */
-  bool changeWorkplane(boost::shared_ptr<SketchPlugin_Feature> theSketch);
+  bool changeWorkplane(boost::shared_ptr<ModelAPI_CompositeFeature> theSketch);
 
   /** \brief Removes a workplane from the manager.
    *         All groups based on such workplane will be removed too.
@@ -95,7 +95,7 @@ class SketchSolver_ConstraintManager : public Events_Listener
    *  \param[in] theFeature object to be found
    *  \return workplane containing the feature
    */
-  boost::shared_ptr<SketchPlugin_Feature> findWorkplane(
+  boost::shared_ptr<ModelAPI_CompositeFeature> findWorkplane(
       boost::shared_ptr<SketchPlugin_Feature> theFeature) const;
 
  private: