]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1343 Improvement of Extrusion and Revolution operations: extrusion cut.
authornds <nds@opencascade.com>
Thu, 24 Mar 2016 06:29:57 +0000 (09:29 +0300)
committerdbv <dbv@opencascade.com>
Fri, 25 Mar 2016 15:50:20 +0000 (18:50 +0300)
15 files changed:
src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp
src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.h
src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp
src/FeaturesPlugin/extrusion_widget.xml
src/FeaturesPlugin/extrusioncut_widget.xml
src/GeomValidators/GeomValidators_Face.cpp
src/GeomValidators/GeomValidators_Face.h
src/ModuleBase/ModuleBase_Tools.cpp
src/ModuleBase/ModuleBase_Tools.h
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp
src/ModuleBase/ModuleBase_WidgetMultiSelector.h
src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp
src/ModuleBase/ModuleBase_WidgetShapeSelector.h
src/PartSet/PartSet_WidgetSketchCreator.cpp
src/PartSet/PartSet_WidgetSketchCreator.h

index dc0b3a948c36f175306c9035bcc4243906beec27..65a6c6a8dcf961361c114f9c44f9588bd5974055 100644 (file)
 //=================================================================================================
 void FeaturesPlugin_CompositeBoolean::initAttributes()
 {
+  AttributeSelectionListPtr aSelection = 
+    std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(data()->addAttribute(
+    LIST_ID(), ModelAPI_AttributeSelectionList::typeId()));
+
   data()->addAttribute(SKETCH_OBJECT_ID(), ModelAPI_AttributeReference::typeId());
+  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(),
+                                                               SKETCH_OBJECT_ID());
 
   // Boolean works with solids always.
   data()->addAttribute(BOOLEAN_OBJECTS_ID(), ModelAPI_AttributeSelectionList::typeId());
-  AttributeSelectionListPtr aSelection = data()->selectionList(BOOLEAN_OBJECTS_ID());
+  aSelection = data()->selectionList(BOOLEAN_OBJECTS_ID());
   aSelection->setSelectionType("SOLID");
 
   initMakeSolidsAttributes();
@@ -96,6 +102,9 @@ bool FeaturesPlugin_CompositeBoolean::isSub(ObjectPtr theObject) const
 //=================================================================================================
 void FeaturesPlugin_CompositeBoolean::removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature)
 {
+  AttributeSelectionListPtr aFacesSelectionList = selectionList(LIST_ID());
+  if (aFacesSelectionList.get() && aFacesSelectionList->size() > 0)
+    aFacesSelectionList->clear();
 }
 
 //=================================================================================================
@@ -115,6 +124,14 @@ void FeaturesPlugin_CompositeBoolean::erase()
 //=================================================================================================
 void FeaturesPlugin_CompositeBoolean::execute()
 {
+  /// feature extrusion does not have the next attribute
+  AttributeSelectionListPtr aFacesSelectionList = selectionList(LIST_ID());
+  if (aFacesSelectionList.get() && !aFacesSelectionList->isInitialized()) {
+    AttributeReferencePtr aSketchAttr = reference(SKETCH_OBJECT_ID());
+    if (aSketchAttr.get() && aSketchAttr->isInitialized())
+      setSketchObjectToList();
+  }
+
   // Getting faces to create solids.
   std::shared_ptr<ModelAPI_Feature> aSketchFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(
                                                      reference(SKETCH_OBJECT_ID())->value());
@@ -460,3 +477,20 @@ void FeaturesPlugin_CompositeBoolean::loadNamingDS(std::shared_ptr<ModelAPI_Resu
     }
   }
 }
+
+//=================================================================================================
+void FeaturesPlugin_CompositeBoolean::setSketchObjectToList()
+{
+  std::shared_ptr<ModelAPI_Feature> aSketchFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(
+                                                       reference(SKETCH_OBJECT_ID())->value());
+
+  if(aSketchFeature.get() && !aSketchFeature->results().empty()) {
+    ResultPtr aSketchRes = aSketchFeature->results().front();
+    ResultConstructionPtr aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aSketchRes);
+    if(aConstruction.get()) {
+      AttributeSelectionListPtr aFacesSelectionList = selectionList(LIST_ID());
+      if (aFacesSelectionList.get() && aFacesSelectionList->size() == 0)
+        aFacesSelectionList->append(aSketchRes, std::shared_ptr<GeomAPI_Shape>());
+    }
+  }
+}
index f171bc6e85dbee548714b7a769794c8c5cdd7283..7cae61fd9da390ab4442f4d8112b907f88f5156c 100644 (file)
@@ -27,6 +27,14 @@ class FeaturesPlugin_CompositeBoolean : public ModelAPI_CompositeFeature
     return MY_SKETCH_OBJECT_ID;
   }
 
+  /// attribute name of references sketch entities list, it should contain a sketch result or
+  /// a pair a sketch result to sketch face
+  inline static const std::string& LIST_ID()
+  {
+    static const std::string MY_GROUP_LIST_ID("base");
+    return MY_GROUP_LIST_ID;
+  }
+
   /// Attribute name of sketch feature.
   inline static const std::string& SKETCH_SELECTION_ID()
   {
@@ -90,6 +98,9 @@ protected:
                     GeomAlgoAPI_MakeShape& theMakeShape,
                     GeomAPI_DataMapOfShapeShape& theMapOfShapes);
 
+  /// Set the sub-object to list of exturusion base.
+  void setSketchObjectToList();
+
 protected:
   /// Type of boolean operation.
   GeomAlgoAPI_Boolean::OperationType myBooleanOperationType;
index cd843949fcf7149be79c07d12511e2bb879b41b3..d388035926c7cb47f7189600ee823ebf670537e3 100644 (file)
@@ -35,9 +35,6 @@ void FeaturesPlugin_Extrusion::initAttributes()
     LIST_ID(), ModelAPI_AttributeSelectionList::typeId()));
   // extrusion works with faces always
   aSelection->setSelectionType("FACE");
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(),
-                                    FeaturesPlugin_Extrusion::LIST_ID());
-
 
   data()->addAttribute(CREATION_METHOD(), ModelAPI_AttributeString::typeId());
 
@@ -73,7 +70,6 @@ void FeaturesPlugin_Extrusion::execute()
 
   // Getting faces.
   ListOfShape aFacesList;
-  //AttributeSelectionListPtr aFacesSelectionList = selectionList(LIST_ID());
   for(int anIndex = 0; anIndex < aFacesSelectionList->size(); anIndex++) {
     AttributeSelectionPtr aFaceSel = aFacesSelectionList->value(anIndex);
     std::shared_ptr<GeomAPI_Shape> aFaceShape = aFaceSel->value();
index 3dc5813d50b45f3d46a6504ef20c82065c3b6709..63099b851e56828becd9b12721ea1b8b2c205479 100644 (file)
@@ -7,8 +7,6 @@
 1. Planar face of non-sketch object or a plane. Sketch creation will be started.&lt;br /&gt;
 2. An existing sketch face or contour. Extrusion will be filled by it.&lt;br /&gt;
 3. An existing result shape of kind: wires/edge/vertices.Extrusion will be filled by it."
-    icon=":icons/sketch.png"
-    tooltip="Create or edit a sketch"
     shape_types="face objects">
   </sketch_launcher>
   <composite_multi_selector id="base"
index 5a1c29076f2b548acc73f87ae60ec9570ebe86e3..610509a097ef26008e3c90dbfa158c6d1ca22b5f 100755 (executable)
@@ -3,10 +3,20 @@
 <source>
   <groupbox title="Extrusion">
     <sketch_launcher id="sketch"
-      label="Sketch"
-      icon=":icons/sketch.png"
-      tooltip="Create or edit a sketch">
+      attribute_list_id="base"
+      label="Select:&lt;br /&gt;
+1. Planar face of non-sketch object or a plane. Sketch creation will be started.&lt;br /&gt;
+2. An existing sketch face or contour. Extrusion will be filled by it.&lt;br /&gt;
+3. An existing result shape of kind: wires/edge/vertices.Extrusion will be filled by it."
+      shape_types="face objects">
     </sketch_launcher>
+    <composite_multi_selector id="base"
+      label="Select a sketch face"
+      icon=":icons/sketch.png"
+      tooltip="Select a sketch face"
+      type_choice="Faces Objects">
+      <validator id="FeaturesPlugin_ValidatorExtrusionBase" parameters="Sketch"/>
+    </composite_multi_selector>
     <toolbox id="CreationMethod">
       <box id="BySizes" title="By sizes" icon=":icons/dimension_up_down_32x32.png">
         <groupbox>
index 51a5012cdab7ac5cc292a9478893ac9a9b9f3cb0..d3b075fde59c5f4d976d512719cf50fca579bc96 100644 (file)
@@ -8,6 +8,8 @@
 
 #include <GeomAPI_Face.h>
 
+#include <GeomAbs_SurfaceType.hxx>
+
 #include <Events_Error.h>
 
 #include <QString>
@@ -16,7 +18,7 @@
 typedef std::map<std::string, GeomAbs_SurfaceType> FaceTypes;
 static FaceTypes MyFaceTypes;
 
-GeomAbs_SurfaceType GeomValidators_Face::faceType(const std::string& theType)
+GeomAbs_SurfaceType faceType(const std::string& theType)
 {
   if (MyFaceTypes.size() == 0) {
     MyFaceTypes["plane"] = GeomAbs_Plane;
index b10cecff75b70270dd243a7696729d0aa24e50fd..f547dbb47f5f4124e7a2a16d65b6df09c3862db1 100644 (file)
@@ -10,8 +10,6 @@
 #include "GeomValidators.h"
 #include "ModelAPI_AttributeValidator.h"
 
-#include <GeomAbs_SurfaceType.hxx>
-
 /**
 * \ingroup Validators
 * A validator of selection
@@ -27,10 +25,6 @@ class GeomValidators_Face : public ModelAPI_AttributeValidator
   GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
                                              const std::list<std::string>& theArguments,
                                              std::string& theError) const;
-protected:
-  /// Convert string to TypeOfFace value
-  /// \param theType a string value
-  GEOMVALIDATORS_EXPORT static GeomAbs_SurfaceType faceType(const std::string& theType);
 };
 
 #endif
index 02e774313557d097188d93aa4c4db0c24571cc50..1bc60c1edc122fec444043b8f043407c9a4972a8 100755 (executable)
 #include <ModelAPI_AttributeRefAttr.h>
 #include <ModelAPI_AttributeReference.h>
 #include <ModelAPI_AttributeSelection.h>
+#include <ModelAPI_AttributeSelectionList.h>
+#include <ModelAPI_AttributeRefList.h>
+#include <ModelAPI_AttributeRefAttrList.h>
+
 #include <ModelAPI_Data.h>
 #include <ModelAPI_Result.h>
 #include <ModelAPI_ResultCompSolid.h>
@@ -39,6 +43,7 @@
 #include <QColor>
 
 #include <sstream>
+#include <string>
 
 const double tolerance = 1e-7;
 
@@ -424,6 +429,67 @@ std::string findGreedAttribute(ModuleBase_IWorkshop* theWorkshop, const FeatureP
   return anAttributeId;
 }
 
+void setObject(const AttributePtr& theAttribute, const ObjectPtr& theObject,
+               const GeomShapePtr& theShape, ModuleBase_IWorkshop* theWorkshop,
+               const bool theTemporarily)
+{
+  if (!theAttribute.get())
+    return;
+
+  std::string aType = theAttribute->attributeType();
+  if (aType == ModelAPI_AttributeReference::typeId()) {
+    AttributeReferencePtr aRef = std::dynamic_pointer_cast<ModelAPI_AttributeReference>(theAttribute);
+    ObjectPtr aObject = aRef->value();
+    if (!(aObject && aObject->isSame(theObject))) {
+      aRef->setValue(theObject);
+    }
+  } else if (aType == ModelAPI_AttributeRefAttr::typeId()) {
+    AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+
+    AttributePtr anAttribute = theWorkshop->module()->findAttribute(theObject, theShape);
+    if (anAttribute.get())
+      aRefAttr->setAttr(anAttribute);
+    else {
+      ObjectPtr aObject = aRefAttr->object();
+      if (!(aObject && aObject->isSame(theObject))) {
+        aRefAttr->setObject(theObject);
+      }
+    }
+  } else if (aType == ModelAPI_AttributeSelection::typeId()) {
+    AttributeSelectionPtr aSelectAttr =
+                             std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
+    ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
+    if (aSelectAttr.get() != NULL) {
+      aSelectAttr->setValue(aResult, theShape, theTemporarily);
+    }
+  }
+  if (aType == ModelAPI_AttributeSelectionList::typeId()) {
+    AttributeSelectionListPtr aSelectionListAttr =
+                         std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
+    ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
+    if (!aSelectionListAttr->isInList(aResult, theShape, theTemporarily))
+      aSelectionListAttr->append(aResult, theShape, theTemporarily);
+  }
+  else if (aType == ModelAPI_AttributeRefList::typeId()) {
+    AttributeRefListPtr aRefListAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(theAttribute);
+    if (!aRefListAttr->isInList(theObject))
+      aRefListAttr->append(theObject);
+  }
+  else if (aType == ModelAPI_AttributeRefAttrList::typeId()) {
+    AttributeRefAttrListPtr aRefAttrListAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttrList>(theAttribute);
+    AttributePtr anAttribute = theWorkshop->module()->findAttribute(theObject, theShape);
+
+    if (anAttribute.get()) {
+      if (!aRefAttrListAttr->isInList(anAttribute))
+        aRefAttrListAttr->append(anAttribute);
+    }
+    else {
+      if (!aRefAttrListAttr->isInList(theObject))
+        aRefAttrListAttr->append(theObject);
+    }
+  }
+}
+
 } // namespace ModuleBase_Tools
 
 
index 3e8f3b4d740f370999c118abf6f65196deb77bdc..594c5ed280761c424812e038e6a5e8a3ab72c960 100755 (executable)
@@ -28,6 +28,8 @@ class ModuleBase_ParamIntSpinBox;
 class ModuleBase_ParamSpinBox;
 class ModuleBase_IWorkshop;
 
+class GeomAPI_Shape;
+
 namespace ModuleBase_Tools {
 
 /*
@@ -176,6 +178,19 @@ MODULEBASE_EXPORT void getParameters(QStringList& theParameters);
 /// \theParameters a list of parameter names
 MODULEBASE_EXPORT std::string findGreedAttribute(ModuleBase_IWorkshop* theWorkshop,
                                                  const FeaturePtr& theFeature);
+
+/// Set the object to the attribute depending on the attribute type. If it is a list,
+/// the values are appended if they are not in the list yet.
+/// \param theAttribute an attribute where the object and shape are set
+/// \param theObject an object
+/// \param theShape a shape
+/// \param theWorkshop to find an attribute for the given shape for attribute reference
+/// \param theTemporarily if it is true, do not store and name the added in the data framework
+///        It is useful for attribute selection
+MODULEBASE_EXPORT void setObject(const AttributePtr& theAttribute, const ObjectPtr& theObject,
+                                 const std::shared_ptr<GeomAPI_Shape>& theShape,
+                                 ModuleBase_IWorkshop* theWorkshop,
+                                 const bool theTemporarily = false);
 }
 
 #endif
index 59c24dc85b9ae9e8f0d6a0668385fed30cee5704..5877c601aeb0e2581a284750cd3f72b0ec5694fb 100755 (executable)
@@ -21,6 +21,7 @@
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_AttributeRefList.h>
 #include <ModelAPI_AttributeRefAttrList.h>
+#include <ModelAPI_Tools.h>
 
 #include <Config_WidgetAPI.h>
 
@@ -271,36 +272,12 @@ void ModuleBase_WidgetMultiSelector::restoreAttributeValue(bool theValid)
 }
 
 //********************************************************************
-void ModuleBase_WidgetMultiSelector::setObject(ObjectPtr theSelectedObject,
+void ModuleBase_WidgetMultiSelector::setObject(ObjectPtr theObject,
                                                GeomShapePtr theShape)
 {
   DataPtr aData = myFeature->data();
-  AttributePtr anAttribute = aData->attribute(attributeID());
-  std::string aType = anAttribute->attributeType();
-  if (aType == ModelAPI_AttributeSelectionList::typeId()) {
-    AttributeSelectionListPtr aSelectionListAttr = aData->selectionList(attributeID());
-    ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theSelectedObject);
-    if (!aSelectionListAttr->isInList(aResult, theShape, myIsInValidate))
-      aSelectionListAttr->append(aResult, theShape, myIsInValidate);
-  }
-  else if (aType == ModelAPI_AttributeRefList::typeId()) {
-    AttributeRefListPtr aRefListAttr = aData->reflist(attributeID());
-    if (!aRefListAttr->isInList(theSelectedObject))
-      aRefListAttr->append(theSelectedObject);
-  }
-  else if (aType == ModelAPI_AttributeRefAttrList::typeId()) {
-    AttributeRefAttrListPtr aRefAttrListAttr = aData->refattrlist(attributeID());
-    AttributePtr anAttribute = myWorkshop->module()->findAttribute(theSelectedObject, theShape);
-
-    if (anAttribute.get()) {
-      if (!aRefAttrListAttr->isInList(anAttribute))
-        aRefAttrListAttr->append(anAttribute);
-    }
-    else {
-      if (!aRefAttrListAttr->isInList(theSelectedObject))
-        aRefAttrListAttr->append(theSelectedObject);
-    }
-  }
+  ModuleBase_Tools::setObject(aData->attribute(attributeID()), theObject, theShape,
+                              myWorkshop, myIsInValidate);
 }
 
 //********************************************************************
index 81fcbed1dd9a83149d6b7adbfb3992173c32115d..69ab6e146681a8760c3514cc9c2088ce94c707a8 100755 (executable)
@@ -126,10 +126,10 @@ protected:
 
   /// Append the values to the model attribute of the widget. It casts this attribute to
   /// the specific type and set the given values
-  /// \param theSelectedObject an object
+  /// \param theObject an object
   /// \param theShape a selected shape, which is used in the selection attribute
   /// \return true if it is succeed
-  void setObject(ObjectPtr theSelectedObject, GeomShapePtr theShape);
+  void setObject(ObjectPtr theObject, GeomShapePtr theShape);
 
   /// Creates a backup of the current values of the attribute
   /// It should be realized in the specific widget because of different
index 55b9e9dc14fdce37693a2fb9c4b61791192c0535..1dae8449eff932561ee1410ea404d4494ed8c8e6 100644 (file)
@@ -107,36 +107,12 @@ bool ModuleBase_WidgetShapeSelector::storeValueCustom() const
 }
 
 //********************************************************************
-void ModuleBase_WidgetShapeSelector::setObject(ObjectPtr theSelectedObject,
+void ModuleBase_WidgetShapeSelector::setObject(ObjectPtr theObject,
                                                GeomShapePtr theShape)
 {
   DataPtr aData = myFeature->data();
-  std::string aType = aData->attribute(attributeID())->attributeType();
-  if (aType == ModelAPI_AttributeReference::typeId()) {
-    AttributeReferencePtr aRef = aData->reference(attributeID());
-    ObjectPtr aObject = aRef->value();
-    if (!(aObject && aObject->isSame(theSelectedObject))) {
-      aRef->setValue(theSelectedObject);
-    }
-  } else if (aType == ModelAPI_AttributeRefAttr::typeId()) {
-    AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID());
-
-    AttributePtr anAttribute = myWorkshop->module()->findAttribute(theSelectedObject, theShape);
-    if (anAttribute.get())
-      aRefAttr->setAttr(anAttribute);
-    else {
-      ObjectPtr aObject = aRefAttr->object();
-      if (!(aObject && aObject->isSame(theSelectedObject))) {
-        aRefAttr->setObject(theSelectedObject);
-      }
-    }
-  } else if (aType == ModelAPI_AttributeSelection::typeId()) {
-    AttributeSelectionPtr aSelectAttr = aData->selection(attributeID());
-    ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theSelectedObject);
-    if (aSelectAttr.get() != NULL) {
-      aSelectAttr->setValue(aResult, theShape);
-    }
-  }
+  ModuleBase_Tools::setObject(aData->attribute(attributeID()), theObject, theShape,
+                              myWorkshop, myIsInValidate);
 }
 
 //********************************************************************
index 4c73b1765d2a4c3efbca31fdd530d6d3bca99489..c3e48ab25051d6eb507903e385fd05cceafc4aaa 100644 (file)
@@ -102,10 +102,10 @@ Q_OBJECT
 
   /// Store the values to the model attribute of the widget. It casts this attribute to
   /// the specific type and set the given values
-  /// \param theSelectedObject an object
+  /// \param theObject an object
   /// \param theShape a selected shape, which is used in the selection attribute
   /// \return true if it is succeed
-  virtual void setObject(ObjectPtr theSelectedObject, GeomShapePtr theShape);
+  virtual void setObject(ObjectPtr theObject, GeomShapePtr theShape);
 
   /// Get the shape from the attribute if the attribute contains a shape, e.g. selection attribute
   /// \return a shape
index 58c2776d1119b7ec5de2a105dcb90f7378f95a96..8243a253a5bf6914138b351b50cff65f4686cd68 100644 (file)
@@ -249,7 +249,7 @@ void PartSet_WidgetSketchCreator::onSelectionChanged()
     for (; anIt != aLast; anIt++) {
       ModuleBase_ViewerPrs aValue = *anIt;
       if (isValidInFilters(aValue))
-        aProcessed = setSelectionCustom(aValue) || aProcessed;
+        aProcessed = setBaseAttributeSelection(aValue) || aProcessed;
     }
     if (aProcessed) {
       emit valuesChanged();
@@ -263,10 +263,14 @@ void PartSet_WidgetSketchCreator::onSelectionChanged()
 }
 
 //********************************************************************
-void PartSet_WidgetSketchCreator::setObject(ObjectPtr theSelectedObject,
+void PartSet_WidgetSketchCreator::setObject(ObjectPtr theObject,
                                             GeomShapePtr theShape)
 {
-  // do nothing because all processing is in onSelectionChanged()
+  DataPtr aData = myFeature->data();
+  ModuleBase_Tools::setObject(aData->attribute(attributeID()), theObject, theShape,
+                              myWorkshop, myIsInValidate);
+
+  //::setObject(aData->attribute(attributeID()), theObject, theShape);
 }
 
 bool PartSet_WidgetSketchCreator::startSketchOperation(const QList<ModuleBase_ViewerPrs>& theValues)
@@ -426,3 +430,17 @@ void PartSet_WidgetSketchCreator::onResumed(ModuleBase_Operation* theOp)
     }
   }
 }
+
+bool PartSet_WidgetSketchCreator::setBaseAttributeSelection(const ModuleBase_ViewerPrs& theValue)
+{
+  bool isDone = false;
+  ObjectPtr anObject;
+  GeomShapePtr aShape;
+  getGeomSelection(theValue, anObject, aShape);
+
+  std::string anAttributeId = myAttributeListID;
+  DataPtr aData = myFeature->data();
+  ModuleBase_Tools::setObject(aData->attribute(anAttributeId), anObject, aShape,
+                              myWorkshop, false);
+  return true;
+}
index 7a341689d179dc21a371d3993e9958cfc4c1830f..0936eff29515c7a4caad22fb2cbba1a56654fb3f 100644 (file)
@@ -14,6 +14,7 @@
 class QLabel;
 class QLineEdit;
 class PartSet_Module;
+class ModelAPI_Tools;
 class ModuleBase_Operation;
 class ModuleBase_IWorkshop;
 class PartSet_PreviewPlanes;
@@ -81,10 +82,10 @@ protected:
 
   /// Store the values to the model attribute of the widget. It casts this attribute to
   /// the specific type and set the given values
-  /// \param theSelectedObject an object
+  /// \param theObject an object
   /// \param theShape a selected shape, which is used in the selection attribute
   /// \return true if it is succeed
-  virtual void setObject(ObjectPtr theSelectedObject, GeomShapePtr theShape);
+  virtual void setObject(ObjectPtr theObject, GeomShapePtr theShape);
 
 private:
   /// Returns true if the selection mode is active. This is when composition feature has no
@@ -106,6 +107,11 @@ private:
   /// \return true if the sketch is started
   bool startSketchOperation(const QList<ModuleBase_ViewerPrs>& theValues);
 
+  /// Appends the selection to the sketch base attribute 
+  /// \param theValue a selection value from the viewer
+  /// \return true if the value is set
+  bool setBaseAttributeSelection(const ModuleBase_ViewerPrs& theValue);
+
 private:
   std::string myAttributeListID;