]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
authorvsv <vitaly.smetannikov@opencascade.com>
Tue, 24 Mar 2015 12:38:09 +0000 (15:38 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Tue, 24 Mar 2015 12:38:09 +0000 (15:38 +0300)
31 files changed:
CMakeLists.txt
src/Config/plugins.xml
src/FeaturesPlugin/FeaturesPlugin_Placement.cpp
src/FeaturesPlugin/FeaturesPlugin_Placement.h
src/FeaturesPlugin/placement_widget.xml
src/GeomAPI/GeomAPI_Ax3.cpp
src/GeomAPI/GeomAPI_Ax3.h
src/GeomAPI/GeomAPI_PlanarEdges.cpp
src/GeomAPI/GeomAPI_PlanarEdges.h
src/GeomAlgoAPI/GeomAlgoAPI_Placement.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Placement.h
src/GeomData/GeomData_Dir.cpp
src/GeomData/GeomData_Dir.h
src/GeomDataAPI/GeomDataAPI_Dir.h
src/ModuleBase/ModuleBase_WidgetLineEdit.h
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp
src/ParametersPlugin/CMakeLists.txt [new file with mode: 0644]
src/ParametersPlugin/ParametersPlugin.h [new file with mode: 0644]
src/ParametersPlugin/ParametersPlugin_Parameter.cpp [new file with mode: 0644]
src/ParametersPlugin/ParametersPlugin_Parameter.h [new file with mode: 0644]
src/ParametersPlugin/ParametersPlugin_Plugin.cpp [new file with mode: 0644]
src/ParametersPlugin/ParametersPlugin_Plugin.h [new file with mode: 0644]
src/ParametersPlugin/plugin-Parameters.xml [new file with mode: 0644]
src/PartSet/PartSet_Tools.cpp
src/PartSet/PartSet_WidgetSketchLabel.cpp
src/SketchPlugin/SketchPlugin_Sketch.cpp
src/SketchPlugin/SketchPlugin_Sketch.h
src/SketchSolver/SketchSolver_ConstraintGroup.cpp
src/SketchSolver/SketchSolver_ConstraintGroup.h
src/XGUI/XGUI_pictures.qrc
src/XGUI/pictures/expression.png [new file with mode: 0644]

index 789636f2afb261daeeb20d5ab08302d473979efc..f1042dade8d9700e911dd188a865d35ee3b9dbc9 100644 (file)
@@ -65,6 +65,7 @@ ADD_SUBDIRECTORY (src/GeomApp)
 ADD_SUBDIRECTORY (src/ExchangePlugin)
 ADD_SUBDIRECTORY (src/GeomValidators)
 ADD_SUBDIRECTORY (src/InitializationPlugin)
+ADD_SUBDIRECTORY (src/ParametersPlugin)
 
 IF(${HAVE_SALOME})
     ADD_SUBDIRECTORY (src/NewGeom)
index 212647ecebe1226f313e2423781aa2d9d96fc084..623b8097394293d4479c6302bf8282185a5b657b 100644 (file)
@@ -9,6 +9,7 @@
   <plugin library="FeaturesPlugin" configuration="plugin-Features.xml"/>
   <plugin library="ExchangePlugin" configuration="plugin-Exchange.xml"/>
   <plugin script="ConnectorPlugin" configuration="plugin-Connector.xml" dependency="Geometry"/>
+  <plugin library="ParametersPlugin" configuration="plugin-Parameters.xml"/>
   <plugin library="SketchSolver"/>
   <plugin library="GeomValidators"/>
   <plugin library="DFBrowser" internal="true"/>
index 44ad7523e4f6330e8853cec73da101699c1def22..fd59eb3867880427717fb2d801961f83cce6d43e 100644 (file)
@@ -9,6 +9,7 @@
 #include <ModelAPI_ResultConstruction.h>
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_AttributeSelection.h>
+#include <ModelAPI_AttributeBoolean.h>
 
 #include <GeomAPI_Face.h>
 #include <GeomAPI_Pln.h>
@@ -26,6 +27,8 @@ void FeaturesPlugin_Placement::initAttributes()
 {
   data()->addAttribute(FeaturesPlugin_Placement::BASE_FACE_ID(), ModelAPI_AttributeSelection::type());
   data()->addAttribute(FeaturesPlugin_Placement::ATTRACT_FACE_ID(), ModelAPI_AttributeSelection::type());
+  data()->addAttribute(FeaturesPlugin_Placement::REVERSE_ID(), ModelAPI_AttributeBoolean::type());
+  data()->addAttribute(FeaturesPlugin_Placement::CENTERING_ID(), ModelAPI_AttributeBoolean::type());
 }
 
 void FeaturesPlugin_Placement::execute()
@@ -87,11 +90,16 @@ void FeaturesPlugin_Placement::execute()
     return;
   }
 
-  std::shared_ptr<GeomAPI_Pln> aBasePlane = aBaseFace1->getPlane();
-  std::shared_ptr<GeomAPI_Pln> aSlavePlane = aSlaveFace1->getPlane();
+  // Flags of the Placement
+  AttributeBooleanPtr aBoolAttr = std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(
+      data()->attribute(FeaturesPlugin_Placement::REVERSE_ID()));
+  bool isReverse = aBoolAttr->value();
+  aBoolAttr = std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(
+      data()->attribute(FeaturesPlugin_Placement::CENTERING_ID()));
+  bool isCentering = aBoolAttr->value();
 
   std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data());
-  GeomAlgoAPI_Placement aFeature(aSlaveObject, aSlavePlane, aBasePlane);
+  GeomAlgoAPI_Placement aFeature(aSlaveObject, aBaseFaceContext, aSlaveFace1, aBaseFace1, isReverse, isCentering);
   if(!aFeature.isDone()) {
     static const std::string aFeatureError = "Placement algorithm failed";
     setError(aFeatureError);
index e96541de32bf43b44a7b147077f6d97ac611a45a..bf74f1364ce4c7f56d42f5485a25d6d9edad51c7 100644 (file)
@@ -43,6 +43,18 @@ class FeaturesPlugin_Placement : public ModelAPI_Feature
     static const std::string MY_ATTRACT_FACE_ID("placement_attractable_face");
     return MY_ATTRACT_FACE_ID;
   }
+  /// attribute name of flag of reverse direction
+  inline static const std::string& REVERSE_ID()
+  {
+    static const std::string MY_REVERSE_ID("placement_reverse_direction");
+    return MY_REVERSE_ID;
+  }
+  /// attribute name of flag of centering position
+  inline static const std::string& CENTERING_ID()
+  {
+    static const std::string MY_CENTERING_ID("placement_centering");
+    return MY_CENTERING_ID;
+  }
 
   /// Returns the kind of a feature
   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
index fd4924fa027d7f1625c9c85a286d534acd9e573f..4a8832004b43d339540bc395cccd6a9f966820e0 100644 (file)
@@ -8,11 +8,19 @@
     shape_types="face"
   />
   <shape_selector id="placement_attractable_face" 
-               label="Select a face" 
-               icon=":icons/cut_shape.png" 
-               tooltip="Select a face of moved object" 
-               shape_types="face" 
-               concealment="true" >
-       <validator id="PartSet_DifferentObjects"/>
+    label="Select a face" 
+    icon=":icons/cut_shape.png" 
+    tooltip="Select a face of moved object" 
+    shape_types="face" 
+    concealment="true" >
+    <validator id="PartSet_DifferentObjects"/>
   </shape_selector>
+  <boolvalue id="placement_reverse_direction"
+    label="Reverse"
+    default="false"
+    tooltip="Reverse placement direction"/>
+  <boolvalue id="placement_centering"
+    label="Centering"
+    default="false"
+    tooltip="Center faces under placement"/>
 </source>
index d7950b585126717c0e96d409e92ceb1a7d877d5c..892869a4c9a7f4593af69285648478443bb49e07 100644 (file)
@@ -25,13 +25,11 @@ GeomAPI_Ax3::GeomAPI_Ax3()
 
 GeomAPI_Ax3::GeomAPI_Ax3(std::shared_ptr<GeomAPI_Pnt> theOrigin,
                          std::shared_ptr<GeomAPI_Dir> theDirX,
-                         std::shared_ptr<GeomAPI_Dir> theDirY,
                          std::shared_ptr<GeomAPI_Dir> theNorm)
 : GeomAPI_Interface(new gp_Ax3(theOrigin->impl<gp_Pnt>(), 
                                theNorm->impl<gp_Dir>(), 
                                theDirX->impl<gp_Dir>()))
  {
-   MY_AX3->SetYDirection(theDirY->impl<gp_Dir>());
  }
 
 void GeomAPI_Ax3::setOrigin(const std::shared_ptr<GeomAPI_Pnt>& theOrigin)
index 67bde43efd50a2b1e331ffe33202901c295e5df9..6a554e2b393b3f2516cd7ed9a368fccb92524bf5 100644 (file)
@@ -29,7 +29,6 @@ public:
   /// \param theNorm direction of normal vector
   GeomAPI_Ax3(std::shared_ptr<GeomAPI_Pnt> theOrigin,
               std::shared_ptr<GeomAPI_Dir> theDirX,
-              std::shared_ptr<GeomAPI_Dir> theDirY,
               std::shared_ptr<GeomAPI_Dir> theNorm);
 
   /// Sets origin point
index f7757cf7e94b7b32a3ad5f0a23067ece92cd4381..619716256d1b81865122b9a0122b880216a5c1b8 100644 (file)
@@ -93,8 +93,7 @@ std::shared_ptr<GeomAPI_Dir> GeomAPI_PlanarEdges::norm() const
 
 void GeomAPI_PlanarEdges::setPlane(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
                                    const std::shared_ptr<GeomAPI_Dir>& theDirX,
-                                   const std::shared_ptr<GeomAPI_Dir>& theDirY,
                                    const std::shared_ptr<GeomAPI_Dir>& theNorm)
 {
-  myPlane = std::shared_ptr<GeomAPI_Ax3>(new GeomAPI_Ax3(theOrigin, theDirX, theDirY, theNorm));
+  myPlane = std::shared_ptr<GeomAPI_Ax3>(new GeomAPI_Ax3(theOrigin, theDirX, theNorm));
 }
\ No newline at end of file
index 1eddd16c899ca9bb59c39d39eb34a33eafe47820..c26ad2505e180e386ff739d3852b85012581ab52 100644 (file)
@@ -61,7 +61,6 @@ class GeomAPI_PlanarEdges : public GeomAPI_Shape
   /// \param theNorm normal direction of the plane axis
   GEOMAPI_EXPORT void setPlane(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
                                const std::shared_ptr<GeomAPI_Dir>& theDirX,
-                               const std::shared_ptr<GeomAPI_Dir>& theDirY,
                                const std::shared_ptr<GeomAPI_Dir>& theNorm);
 
 private:
index 3cc4f85aedc6bea31cedcd8ecf2e713996ef2a54..e5714a22e789ff59934315f5f9f0fa09b32c5bea 100644 (file)
@@ -8,52 +8,85 @@
 #include <GeomAlgoAPI_DFLoader.h>
 
 #include <GeomAPI_Pnt.h>
+#include <GeomAPI_Pln.h>
 
 #include <BRepBuilderAPI_Transform.hxx>
 #include <gp_Trsf.hxx>
 #include <gp_Quaternion.hxx>
 #include <TopExp_Explorer.hxx>
 #include <BRepCheck_Analyzer.hxx>
+#include <BRepClass3d_SolidClassifier.hxx>
 #include <GProp_GProps.hxx>
 #include <BRepGProp.hxx>
 #include <Precision.hxx>
+
 #define DEB_PLACEMENT 1
 GeomAlgoAPI_Placement::GeomAlgoAPI_Placement(
-    std::shared_ptr<GeomAPI_Shape> theAttractiveFace,
-    std::shared_ptr<GeomAPI_Pln> theSourcePlane,
-    std::shared_ptr<GeomAPI_Pln> theDestPlane)
+    std::shared_ptr<GeomAPI_Shape> theSourceShape,
+    std::shared_ptr<GeomAPI_Shape> theDestShape,
+    std::shared_ptr<GeomAPI_Face> theSourcePlane,
+    std::shared_ptr<GeomAPI_Face> theDestPlane,
+    bool theIsReverse,
+    bool theIsCentering)
   : myDone(false),
     myShape(new GeomAPI_Shape())
 {
-  build(theAttractiveFace, theSourcePlane, theDestPlane);
+  build(theSourceShape, theDestShape, theSourcePlane, theDestPlane, theIsReverse, theIsCentering);
 }
 
 void GeomAlgoAPI_Placement::build(
-    const std::shared_ptr<GeomAPI_Shape>& theAttractiveShape,
-    const std::shared_ptr<GeomAPI_Pln>& theSourcePlane,
-    const std::shared_ptr<GeomAPI_Pln>& theDestPlane)
+    const std::shared_ptr<GeomAPI_Shape>& theSourceShape,
+    const std::shared_ptr<GeomAPI_Shape>& theDestShape,
+    const std::shared_ptr<GeomAPI_Face>& theSourcePlane,
+    const std::shared_ptr<GeomAPI_Face>& theDestPlane,
+    bool theIsReverse,
+    bool theIsCentering)
 {
-  std::shared_ptr<GeomAPI_Dir> aSourceDir = theSourcePlane->direction();
-  std::shared_ptr<GeomAPI_Pnt> aSourceLoc = theSourcePlane->location();
-  std::shared_ptr<GeomAPI_Dir> aDestDir = theDestPlane->direction();
-  std::shared_ptr<GeomAPI_Pnt> aDestLoc = theDestPlane->location();
+  std::shared_ptr<GeomAPI_Pln> aSourcePlane = theSourcePlane->getPlane();
+  std::shared_ptr<GeomAPI_Pln> aDestPlane = theDestPlane->getPlane();
+  std::shared_ptr<GeomAPI_Dir> aSourceDir = aSourcePlane->direction();
+  std::shared_ptr<GeomAPI_Pnt> aSourceLoc = aSourcePlane->location();
+  std::shared_ptr<GeomAPI_Dir> aDestDir = aDestPlane->direction();
+  std::shared_ptr<GeomAPI_Pnt> aDestLoc = aDestPlane->location();
+
+  // Initial shapes
+  const TopoDS_Shape& aSourceShape = theSourceShape->impl<TopoDS_Shape>();
+  const TopoDS_Shape& aDestShape = theDestShape->impl<TopoDS_Shape>();
 
   // Calculate transformation
   gp_Trsf aTrsf;
   gp_Vec aSrcDir(aSourceDir->x(), aSourceDir->y(), aSourceDir->z());
   gp_Vec aDstDir(aDestDir->x(), aDestDir->y(), aDestDir->z());
+  // Check the material of the solids to be on the correct side
+  BRepClass3d_SolidClassifier aClassifier;
+  aClassifier.Load(aSourceShape);
+  static const double aTransStep = 10. * Precision::Confusion();
+  gp_Pnt aPoint(aSourceLoc->x(), aSourceLoc->y(), aSourceLoc->z());
+  aPoint.Translate(aSrcDir * aTransStep);
+  aClassifier.Perform(aPoint, Precision::Confusion());
+  if ((aClassifier.State() == TopAbs_OUT && !theIsReverse) ||
+      (aClassifier.State() == TopAbs_IN && theIsReverse))
+    aSrcDir.Reverse();
+  aClassifier.Load(aDestShape);
+  aPoint.SetCoord(aDestLoc->x(), aDestLoc->y(), aDestLoc->z());
+  aPoint.Translate(aDstDir * aTransStep);
+  aClassifier.Perform(aPoint, Precision::Confusion());
+  if (aClassifier.State() == TopAbs_IN)
+    aDstDir.Reverse();
+  // Calculate rotation
   gp_Quaternion aRot(aSrcDir, aDstDir);
   aTrsf.SetRotation(aRot);
-  gp_Vec aSrcCenter(aSourceLoc->x(), aSourceLoc->y(), aSourceLoc->z());
-  aSrcCenter.Transform(aTrsf);
-  gp_Vec aTrans(aDestLoc->x() - aSrcCenter.X(),
-                aDestLoc->y() - aSrcCenter.Y(),
-                aDestLoc->z() - aSrcCenter.Z());
+  // Calculate translation
+  gp_Vec aSrcLoc(aSourceLoc->x(), aSourceLoc->y(), aSourceLoc->z());
+  gp_Vec aDstLoc(aDestLoc->x(), aDestLoc->y(), aDestLoc->z());
+  if (!theIsCentering)
+    aDstLoc = aSrcLoc + gp_Vec(aDstDir) * (aDstLoc-aSrcLoc).Dot(aDstDir);
+  aSrcLoc.Transform(aTrsf);
+  gp_Vec aTrans = aDstLoc - aSrcLoc;
   aTrsf.SetTransformation(aRot, aTrans);
 
   // Transform the shape with copying it
-  const TopoDS_Shape& aShape = theAttractiveShape->impl<TopoDS_Shape>();
-  BRepBuilderAPI_Transform* aBuilder = new BRepBuilderAPI_Transform(aShape, aTrsf, true);
+  BRepBuilderAPI_Transform* aBuilder = new BRepBuilderAPI_Transform(aSourceShape, aTrsf, true);
   if(aBuilder) {
     setImpl(aBuilder);
     myDone = aBuilder->IsDone() == Standard_True;
index 7bebf97c991277d85bf28dbdffffad328b9bc7e7..703f609c159c6f7a23dc45d209e34ac34555d797 100644 (file)
@@ -10,7 +10,7 @@
 #include <GeomAlgoAPI.h>
 #include <GeomAPI_Shape.h>
 #include <GeomAPI_Dir.h>
-#include <GeomAPI_Pln.h>
+#include <GeomAPI_Face.h>
 #include <GeomAlgoAPI_MakeShape.h>
 #include <GeomAPI_DataMapOfShapeShape.h>
 #include <memory>
@@ -24,13 +24,19 @@ class GeomAlgoAPI_Placement : public GeomAPI_Interface
 public:
   /** \brief Creates an object which is obtained from current object by transformation calculated
    *         as a movement of the source plane to be coincident with the destination plane
-   *  \param[in] theAttractiveShape shape to be moved
-   *  \param[in] theSourcePlane     plane on the shape to be made coincident with destination plane
-   *  \param[in] theDestPlane       destination plane
+   *  \param[in] theSourceShape  shape to be moved
+   *  \param[in] theDestShape    invariabt shape
+   *  \param[in] theSourcePlane  plane on the shape to be made coincident with destination plane
+   *  \param[in] theDestPlane    destination plane
+   *  \param[in] theIsReverse    indicates that the solid materials should be on the same side against the destination plane
+   *  \param[in] theIsCentering  indicates the planes should be centered
    */
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_Placement(std::shared_ptr<GeomAPI_Shape> theAttractiveShape,
-                                           std::shared_ptr<GeomAPI_Pln> theSourcePlane,
-                                           std::shared_ptr<GeomAPI_Pln> theDestPlane);
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Placement(std::shared_ptr<GeomAPI_Shape> theSourceShape,
+                                           std::shared_ptr<GeomAPI_Shape> theDestShape,
+                                           std::shared_ptr<GeomAPI_Face> theSourcePlane,
+                                           std::shared_ptr<GeomAPI_Face> theDestPlane,
+                                           bool theIsReverse = false,
+                                           bool theIsCentering = false);
 
   /// Returns True if algorithm succeed
   GEOMALGOAPI_EXPORT const bool isDone() const
@@ -56,9 +62,12 @@ public:
 
 private:
   /// builds resulting shape
-  void build(const std::shared_ptr<GeomAPI_Shape>& theAttractiveShape,
-             const std::shared_ptr<GeomAPI_Pln>& theSourcePlane,
-             const std::shared_ptr<GeomAPI_Pln>& theDestPlane);
+  void build(const std::shared_ptr<GeomAPI_Shape>& theSourceShape,
+             const std::shared_ptr<GeomAPI_Shape>& theDestShape,
+             const std::shared_ptr<GeomAPI_Face>& theSourcePlane,
+             const std::shared_ptr<GeomAPI_Face>& theDestPlane,
+             bool theIsReverse,
+             bool theIsCentering);
 
   /// fields
   bool myDone;
index d36e8a8f5c84685b7b3d6fbc879ee6aa03ca2fa2..d5272dda21f432786c2ca04ff8e983b99a7a5108 100644 (file)
@@ -5,7 +5,8 @@
 // Author:      Mikhail PONIKAROV
 
 #include "GeomData_Dir.h"
-#include "GeomAPI_Dir.h"
+#include <GeomAPI_Dir.h>
+#include <GeomAPI_XYZ.h>
 #include <gp_Dir.hxx>
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_Data.h>
@@ -49,6 +50,12 @@ std::shared_ptr<GeomAPI_Dir> GeomData_Dir::dir()
       new GeomAPI_Dir(myCoords->Value(0), myCoords->Value(1), myCoords->Value(2)));
 }
 
+std::shared_ptr<GeomAPI_XYZ> GeomData_Dir::xyz()
+{
+  return std::shared_ptr<GeomAPI_XYZ>(
+      new GeomAPI_XYZ(myCoords->Value(0), myCoords->Value(1), myCoords->Value(2)));
+}
+
 GeomData_Dir::GeomData_Dir(TDF_Label& theLabel)
 {
   myIsInitialized = theLabel.FindAttribute(TDataStd_RealArray::GetID(), myCoords) == Standard_True;
index 0080ffbc6df16c357a0c95ff11475b592b34b861..debd400552702b68455955f17d775b3f6f97d8ae 100644 (file)
@@ -14,6 +14,7 @@
 #include <memory>
 
 class GeomAPI_Dir;
+class GeomAPI_XYZ;
 
 /**\class GeomData_Dir
  * \ingroup DataModel
@@ -36,6 +37,8 @@ class GeomData_Dir : public GeomDataAPI_Dir
   GEOMDATA_EXPORT virtual double z() const;
   /// Returns the direction of this attribute
   GEOMDATA_EXPORT virtual std::shared_ptr<GeomAPI_Dir> dir();
+  /// Returns the coordinates of this attribute
+  GEOMDATA_EXPORT virtual std::shared_ptr<GeomAPI_XYZ> xyz();
 
  protected:
   /// Initializes attributes
index 968edb2325670112dc8e008c5afb2bb9c383ea1e..85d4b3a8c433706c41f92d0fb9580b719664c364 100644 (file)
@@ -11,6 +11,7 @@
 #include <ModelAPI_Attribute.h>
 
 class GeomAPI_Dir;
+class GeomAPI_XYZ;
 
 /**\class GeomDataAPI_Dir
  * \ingroup DataModel
@@ -33,6 +34,8 @@ class GeomDataAPI_Dir : public ModelAPI_Attribute
   virtual double z() const = 0;
   /// Returns the direction of this attribute
   virtual std::shared_ptr<GeomAPI_Dir> dir() = 0;
+  /// Returns the coordinates of this attribute
+  virtual std::shared_ptr<GeomAPI_XYZ> xyz() = 0;
 
   /// Returns the type of this class of attributes
   static inline std::string type()
index 965049db6cc8d0ed5cb69559b4e2e079ca06705e..067185cdd2ee565a70355eb7698a403237150ba9 100644 (file)
@@ -31,7 +31,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetLineEdit : public ModuleBase_ModelWidge
  public:
   /// Constructor
   /// \param theParent the parent object
-  /// \param theData the widget configuation. The attribute of the model widget is obtained from
+  /// \param theData the widget configuration.
   /// \param theParentId is Id of a parent of the current attribute
   ModuleBase_WidgetLineEdit(QWidget* theParent,
                                 const Config_WidgetAPI* theData,
index 8fc20d6b94e1bd76b76f13f82d4f26c8ce5b487f..ff8bafdea6a8746a9ca85a9063af9e2cc62cbe73 100644 (file)
@@ -122,7 +122,20 @@ void ModuleBase_WidgetMultiSelector::deactivate()
 bool ModuleBase_WidgetMultiSelector::storeValueCustom() const
 {
   // the value is stored on the selection changed signal processing 
-  return true;
+  // A rare case when plugin was not loaded. 
+  if(!myFeature)
+    return false;
+  DataPtr aData = myFeature->data();
+  AttributeSelectionListPtr aSelectionListAttr = 
+    std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(aData->attribute(attributeID()));
+
+  if (aSelectionListAttr) {
+    // Store shapes type
+     TopAbs_ShapeEnum aCurrentType =
+           ModuleBase_WidgetShapeSelector::shapeType(myTypeCombo->currentText());
+     aSelectionListAttr->setSelectionType(myTypeCombo->currentText().toStdString());
+  }   
+   return true;
 }
 
 //********************************************************************
@@ -138,7 +151,7 @@ bool ModuleBase_WidgetMultiSelector::restoreValue()
   if (aSelectionListAttr) {
     // Restore shape type
     setCurrentShapeType(
-      ModuleBase_WidgetShapeSelector::shapeType(aSelectionListAttr->selectionType().c_str()));
+         ModuleBase_WidgetShapeSelector::shapeType(aSelectionListAttr->selectionType().c_str()));
     updateSelectionList(aSelectionListAttr);
     return true;
   }
diff --git a/src/ParametersPlugin/CMakeLists.txt b/src/ParametersPlugin/CMakeLists.txt
new file mode 100644 (file)
index 0000000..287e84b
--- /dev/null
@@ -0,0 +1,35 @@
+INCLUDE(Common)
+
+INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/Events
+                    ${PROJECT_SOURCE_DIR}/src/Config
+                    ${PROJECT_SOURCE_DIR}/src/ModelAPI
+) 
+
+SET(PROJECT_HEADERS
+    ParametersPlugin.h
+    ParametersPlugin_Plugin.h
+    ParametersPlugin_Parameter.h
+)
+SET(PROJECT_SOURCES
+    ParametersPlugin_Plugin.cpp
+    ParametersPlugin_Parameter.cpp
+)
+
+SET(XML_RESOURCES
+    plugin-Parameters.xml
+)
+
+SET(PROJECT_LIBRARIES
+    Events
+    Config
+    ModelAPI
+)
+
+ADD_DEFINITIONS(-DPARAMETERSPLUGIN_EXPORTS)
+ADD_LIBRARY(ParametersPlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES})
+
+TARGET_LINK_LIBRARIES(ParametersPlugin ${PROJECT_LIBRARIES})
+
+INSTALL(TARGETS ParametersPlugin DESTINATION plugins)
+INSTALL(FILES ${XML_RESOURCES} DESTINATION plugins)
diff --git a/src/ParametersPlugin/ParametersPlugin.h b/src/ParametersPlugin/ParametersPlugin.h
new file mode 100644 (file)
index 0000000..7d223f4
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+#ifndef PARAMETERSPLUGIN_H
+#define PARAMETERSPLUGIN_H
+
+#if defined PARAMETERSPLUGIN_EXPORTS
+#if defined WIN32
+#define PARAMETERSPLUGIN_EXPORT              __declspec( dllexport )
+#else
+#define PARAMETERSPLUGIN_EXPORT
+#endif
+#else
+#if defined WIN32
+#define PARAMETERSPLUGIN_EXPORT              __declspec( dllimport )
+#else
+#define PARAMETERSPLUGIN_EXPORT
+#endif
+#endif
+
+#endif
+
diff --git a/src/ParametersPlugin/ParametersPlugin_Parameter.cpp b/src/ParametersPlugin/ParametersPlugin_Parameter.cpp
new file mode 100644 (file)
index 0000000..498b83d
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File:        ParametersPlugin_Parameter.cpp
+// Created:     23 MArch 2015
+// Author:      sbh
+
+#include "ParametersPlugin_Parameter.h"
+#include <ModelAPI_AttributeString.h>
+
+ParametersPlugin_Parameter::ParametersPlugin_Parameter()
+{
+}
+
+void ParametersPlugin_Parameter::initAttributes()
+{
+  data()->addAttribute(ParametersPlugin_Parameter::VARIABLE_ID(), ModelAPI_AttributeString::type());
+  data()->addAttribute(ParametersPlugin_Parameter::EXPRESSION_ID(), ModelAPI_AttributeString::type());
+}
+
+void ParametersPlugin_Parameter::execute()
+{
+}
diff --git a/src/ParametersPlugin/ParametersPlugin_Parameter.h b/src/ParametersPlugin/ParametersPlugin_Parameter.h
new file mode 100644 (file)
index 0000000..e7574fd
--- /dev/null
@@ -0,0 +1,54 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File:        ParametersPlugin_Parameter.h
+// Created:     23 MArch 2015
+// Author:      sbh
+
+#ifndef PARAMETERSPLUGIN_PARAMETER_H_
+#define PARAMETERSPLUGIN_PARAMETER_H_
+
+#include "ParametersPlugin.h"
+#include <ModelAPI_Feature.h>
+
+class ParametersPlugin_Parameter : public ModelAPI_Feature
+{
+ public:
+  /// Extrusion kind
+  inline static const std::string& ID()
+  {
+    static const std::string MY_EXTRUSION_ID("Parameter");
+    return MY_EXTRUSION_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& VARIABLE_ID()
+  {
+    static const std::string MY_VARIABLE_ID("variable");
+    return MY_VARIABLE_ID;
+  }
+
+  /// attribute name of extrusion size
+  inline static const std::string& EXPRESSION_ID()
+  {
+    static const std::string MY_EXPRESSION_ID("expression");
+    return MY_EXPRESSION_ID;
+  }
+
+  /// Returns the kind of a feature
+  PARAMETERSPLUGIN_EXPORT virtual const std::string& getKind()
+  {
+    static std::string MY_KIND = ParametersPlugin_Parameter::ID();
+    return MY_KIND;
+  }
+
+  /// Creates a new part document if needed
+  PARAMETERSPLUGIN_EXPORT virtual void execute();
+
+  /// Request for initialization of data model of the feature: adding all attributes
+  PARAMETERSPLUGIN_EXPORT virtual void initAttributes();
+
+  /// Use plugin manager for features creation
+  ParametersPlugin_Parameter();
+};
+
+#endif
diff --git a/src/ParametersPlugin/ParametersPlugin_Plugin.cpp b/src/ParametersPlugin/ParametersPlugin_Plugin.cpp
new file mode 100644 (file)
index 0000000..9affdd7
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+#include <ParametersPlugin_Plugin.h>
+#include <ParametersPlugin_Parameter.h>
+
+#include <ModelAPI_Session.h>
+
+#include <memory>
+
+// the only created instance of this plugin
+static ParametersPlugin_Plugin* MY_PARAMETERSPLUGIN_INSTANCE = new ParametersPlugin_Plugin();
+
+ParametersPlugin_Plugin::ParametersPlugin_Plugin()
+{
+  // register this plugin
+  SessionPtr aSession = ModelAPI_Session::get();
+  aSession->registerPlugin(this);
+}
+
+FeaturePtr ParametersPlugin_Plugin::createFeature(std::string theFeatureID)
+{
+  // TODO: register some features
+  if (theFeatureID == ParametersPlugin_Parameter::ID()) {
+    return FeaturePtr(new ParametersPlugin_Parameter);
+  }
+  return FeaturePtr();
+}
+
diff --git a/src/ParametersPlugin/ParametersPlugin_Plugin.h b/src/ParametersPlugin/ParametersPlugin_Plugin.h
new file mode 100644 (file)
index 0000000..d82198f
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+#ifndef PARAMETERSPLUGIN_PLUGIN_H_
+#define PARAMETERSPLUGIN_PLUGIN_H_
+
+#include <ParametersPlugin.h>
+#include <ModelAPI_Plugin.h>
+#include <ModelAPI_Feature.h>
+
+/**\class ParametersPlugin_Plugin
+ * TODO: Add documentation
+ */
+class PARAMETERSPLUGIN_EXPORT ParametersPlugin_Plugin : public ModelAPI_Plugin
+{
+ public:
+  /// Creates the feature object of this plugin by the feature string ID
+  virtual FeaturePtr createFeature(std::string theFeatureID);
+
+ public:
+  ParametersPlugin_Plugin();
+};
+
+#endif
+
diff --git a/src/ParametersPlugin/plugin-Parameters.xml b/src/ParametersPlugin/plugin-Parameters.xml
new file mode 100644 (file)
index 0000000..63ba2ab
--- /dev/null
@@ -0,0 +1,12 @@
+<!-- Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+<plugin>
+  <workbench id="Part">
+    <group id="Parameters">
+      <feature id="Parameter" title="New Variable" tooltip="Creates a variable" icon=":pictures/expression.png">
+        <stringvalue id="variable" label="Name"/>
+        <stringvalue id="expression" icon="Value"/>
+      </feature>
+    </group>
+  </workbench>
+</plugin>
index 56f1ac3fc83708bdb32db18c07286b58c225aa4b..f7c4ab57f0c6fde0261324b1410766d0acf8a20b 100644 (file)
@@ -99,8 +99,9 @@ Handle(V3d_View) theView,
 
   std::shared_ptr<GeomDataAPI_Dir> aX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
       aData->attribute(SketchPlugin_Sketch::DIRX_ID()));
-  std::shared_ptr<GeomDataAPI_Dir> anY = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
-      aData->attribute(SketchPlugin_Sketch::DIRY_ID()));
+  std::shared_ptr<GeomDataAPI_Dir> aNorm = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
+      aData->attribute(SketchPlugin_Sketch::NORM_ID()));
+  std::shared_ptr<GeomAPI_XYZ> anY = aNorm->xyz()->cross(aX->xyz());
 
   gp_Pnt anOriginPnt(anOrigin->x(), anOrigin->y(), anOrigin->z());
   gp_Vec aVec(anOriginPnt, thePoint);
@@ -138,13 +139,14 @@ std::shared_ptr<GeomAPI_Pnt> PartSet_Tools::convertTo3D(const double theX, const
       aData->attribute(SketchPlugin_Sketch::ORIGIN_ID()));
   std::shared_ptr<GeomDataAPI_Dir> aX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
       aData->attribute(SketchPlugin_Sketch::DIRX_ID()));
-  std::shared_ptr<GeomDataAPI_Dir> aY = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
-      aData->attribute(SketchPlugin_Sketch::DIRY_ID()));
+  std::shared_ptr<GeomDataAPI_Dir> aNorm = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
+      aData->attribute(SketchPlugin_Sketch::NORM_ID()));
+  std::shared_ptr<GeomAPI_Dir> aY(new GeomAPI_Dir(aNorm->dir()->cross(aX->dir())));
 
   std::shared_ptr<GeomAPI_Pnt2d> aPnt2d = 
     std::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(theX, theY));
 
-  return aPnt2d->to3D(aC->pnt(), aX->dir(), aY->dir());
+  return aPnt2d->to3D(aC->pnt(), aX->dir(), aY);
 }
 
 ObjectPtr PartSet_Tools::nearestFeature(QPoint thePoint, Handle_V3d_View theView,
@@ -417,14 +419,16 @@ std::shared_ptr<GeomAPI_Pnt> PartSet_Tools::point3D(std::shared_ptr<GeomAPI_Pnt2
   if (!theSketch || !thePoint2D)
     return aPoint;
 
+  DataPtr aData = theSketch->data();
   std::shared_ptr<GeomDataAPI_Point> aC = std::dynamic_pointer_cast<GeomDataAPI_Point>(
-      theSketch->data()->attribute(SketchPlugin_Sketch::ORIGIN_ID()));
+      aData->attribute(SketchPlugin_Sketch::ORIGIN_ID()));
   std::shared_ptr<GeomDataAPI_Dir> aX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
-      theSketch->data()->attribute(SketchPlugin_Sketch::DIRX_ID()));
-  std::shared_ptr<GeomDataAPI_Dir> aY = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
-      theSketch->data()->attribute(SketchPlugin_Sketch::DIRY_ID()));
+      aData->attribute(SketchPlugin_Sketch::DIRX_ID()));
+  std::shared_ptr<GeomDataAPI_Dir> aNorm = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
+      aData->attribute(SketchPlugin_Sketch::NORM_ID()));
+  std::shared_ptr<GeomAPI_Dir> aY(new GeomAPI_Dir(aNorm->dir()->cross(aX->dir())));
 
-  return thePoint2D->to3D(aC->pnt(), aX->dir(), aY->dir());
+  return thePoint2D->to3D(aC->pnt(), aX->dir(), aY);
 }
 
 ResultPtr PartSet_Tools::createFixedObjectByExternal(const TopoDS_Shape& theShape, 
index 96435f627a95826200c5ed20017793ba04989e46..d47fadecdcdc159462422c6fffc9261e4f09d327 100644 (file)
@@ -287,9 +287,6 @@ std::shared_ptr<GeomAPI_Dir> PartSet_WidgetSketchLabel::setSketchPlane(const Top
   std::shared_ptr<GeomDataAPI_Dir> aDirX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
       aData->attribute(SketchPlugin_Sketch::DIRX_ID()));
   aDirX->setValue(aXDir);
-  std::shared_ptr<GeomDataAPI_Dir> aDirY = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
-      aData->attribute(SketchPlugin_Sketch::DIRY_ID()));
-  aDirY->setValue(aYDir);
   std::shared_ptr<GeomAPI_Dir> aDir = aPlane->direction();
   return aDir;
 }
index 466024127b2af00ea9d0a95bf4ad70db9b187f26..365db4ca69b59d5d4aca8311afa65980b1aca50a 100644 (file)
@@ -46,7 +46,6 @@ void SketchPlugin_Sketch::initAttributes()
 {
   data()->addAttribute(SketchPlugin_Sketch::ORIGIN_ID(), GeomDataAPI_Point::type());
   data()->addAttribute(SketchPlugin_Sketch::DIRX_ID(), GeomDataAPI_Dir::type());
-  data()->addAttribute(SketchPlugin_Sketch::DIRY_ID(), GeomDataAPI_Dir::type());
   data()->addAttribute(SketchPlugin_Sketch::NORM_ID(), GeomDataAPI_Dir::type());
   data()->addAttribute(SketchPlugin_Sketch::FEATURES_ID(), ModelAPI_AttributeRefList::type());
   // the selected face, base for the sketcher plane, not obligatory
@@ -66,8 +65,6 @@ void SketchPlugin_Sketch::execute()
       data()->attribute(SketchPlugin_Sketch::ORIGIN_ID()));
   std::shared_ptr<GeomDataAPI_Dir> aDirX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
       data()->attribute(SketchPlugin_Sketch::DIRX_ID()));
-  std::shared_ptr<GeomDataAPI_Dir> aDirY = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
-      data()->attribute(SketchPlugin_Sketch::DIRY_ID()));
   std::shared_ptr<GeomDataAPI_Dir> aNorm = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
       data()->attribute(SketchPlugin_Sketch::NORM_ID()));
 
@@ -117,7 +114,7 @@ void SketchPlugin_Sketch::execute()
   for (; aShapeIt != aFeaturesPreview.end(); ++aShapeIt) {
     aBigWire->addEdge(*aShapeIt);
   }
-  aBigWire->setPlane(anOrigin->pnt(), aDirX->dir(), aDirY->dir(), aNorm->dir());
+  aBigWire->setPlane(anOrigin->pnt(), aDirX->dir(), aNorm->dir());
 
 //  GeomAlgoAPI_SketchBuilder::createFaces(anOrigin->pnt(), aDirX->dir(), aDirY->dir(), aNorm->dir(),
 //                                         aFeaturesPreview, aLoops, aWires);
@@ -198,13 +195,14 @@ std::shared_ptr<GeomAPI_Pnt> SketchPlugin_Sketch::to3D(const double theX, const
 {
   std::shared_ptr<GeomDataAPI_Point> aC = std::dynamic_pointer_cast<GeomDataAPI_Point>(
       data()->attribute(SketchPlugin_Sketch::ORIGIN_ID()));
+  std::shared_ptr<GeomDataAPI_Dir> aNorm = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
+      data()->attribute(SketchPlugin_Sketch::NORM_ID()));
   std::shared_ptr<GeomDataAPI_Dir> aX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
       data()->attribute(SketchPlugin_Sketch::DIRX_ID()));
-  std::shared_ptr<GeomDataAPI_Dir> aY = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
-      data()->attribute(SketchPlugin_Sketch::DIRY_ID()));
+  std::shared_ptr<GeomAPI_Dir> aY(new GeomAPI_Dir(aNorm->dir()->cross(aX->dir())));
 
   std::shared_ptr<GeomAPI_XYZ> aSum = aC->pnt()->xyz()->added(aX->dir()->xyz()->multiplied(theX))
-      ->added(aY->dir()->xyz()->multiplied(theY));
+      ->added(aY->xyz()->multiplied(theY));
 
   return std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aSum));
 }
@@ -214,11 +212,12 @@ std::shared_ptr<GeomAPI_Pnt2d> SketchPlugin_Sketch::to2D(
 {
   std::shared_ptr<GeomDataAPI_Point> aC = std::dynamic_pointer_cast<GeomDataAPI_Point>(
       data()->attribute(SketchPlugin_Sketch::ORIGIN_ID()));
+  std::shared_ptr<GeomDataAPI_Dir> aNorm = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
+      data()->attribute(SketchPlugin_Sketch::NORM_ID()));
   std::shared_ptr<GeomDataAPI_Dir> aX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
       data()->attribute(SketchPlugin_Sketch::DIRX_ID()));
-  std::shared_ptr<GeomDataAPI_Dir> aY = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
-      data()->attribute(SketchPlugin_Sketch::DIRY_ID()));
-  return thePnt->to2D(aC->pnt(), aX->dir(), aY->dir());
+  std::shared_ptr<GeomAPI_Dir> aY(new GeomAPI_Dir(aNorm->dir()->cross(aX->dir())));
+  return thePnt->to2D(aC->pnt(), aX->dir(), aY);
 }
 
 
@@ -250,12 +249,10 @@ std::shared_ptr<GeomAPI_Ax3> SketchPlugin_Sketch::coordinatePlane() const
     aData->attribute(SketchPlugin_Sketch::ORIGIN_ID()));
   std::shared_ptr<GeomDataAPI_Dir> aX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
     aData->attribute(SketchPlugin_Sketch::DIRX_ID()));
-  std::shared_ptr<GeomDataAPI_Dir> aY = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
-    aData->attribute(SketchPlugin_Sketch::DIRY_ID()));
   std::shared_ptr<GeomDataAPI_Dir> aNorm = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
     aData->attribute(SketchPlugin_Sketch::NORM_ID()));
 
-  return std::shared_ptr<GeomAPI_Ax3>(new GeomAPI_Ax3(aC->pnt(), aX->dir(), aY->dir(), aNorm->dir()));
+  return std::shared_ptr<GeomAPI_Ax3>(new GeomAPI_Ax3(aC->pnt(), aX->dir(), aNorm->dir()));
 }
 
 void SketchPlugin_Sketch::erase()
@@ -309,9 +306,6 @@ void SketchPlugin_Sketch::attributeChanged(const std::string& theID) {
         std::shared_ptr<GeomDataAPI_Dir> aDirX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
           data()->attribute(SketchPlugin_Sketch::DIRX_ID()));
         aDirX->setValue(aXDir);
-        std::shared_ptr<GeomDataAPI_Dir> aDirY = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
-          data()->attribute(SketchPlugin_Sketch::DIRY_ID()));
-        aDirY->setValue(aYDir);
         std::shared_ptr<GeomAPI_Dir> aDir = aPlane->direction();
       }
     }
index 43a6e370792dc38e1d020ee6808fe739d6b5e04f..0c88f0d8f097c59f2dff814f9344ac942f343de9 100644 (file)
@@ -44,12 +44,6 @@ class SketchPlugin_Sketch : public ModelAPI_CompositeFeature//, public GeomAPI_I
     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()
   {
index c1f07f72be58b70d0ab6f1a543c578e2083b4d75..b650cbdabee544b8d56a85a3242adaf72f912dda 100644 (file)
@@ -1299,14 +1299,15 @@ Slvs_hEntity SketchSolver_ConstraintGroup::changeEntityFeature(FeaturePtr theEnt
 //  Purpose:  create/update the normal of workplane
 // ============================================================================
 Slvs_hEntity SketchSolver_ConstraintGroup::changeNormal(
-    std::shared_ptr<ModelAPI_Attribute> theDirX, std::shared_ptr<ModelAPI_Attribute> theDirY,
+    std::shared_ptr<ModelAPI_Attribute> theDirX,
     std::shared_ptr<ModelAPI_Attribute> theNorm)
 {
+  std::shared_ptr<GeomDataAPI_Dir> aNorm = std::dynamic_pointer_cast<GeomDataAPI_Dir>(theNorm);
   std::shared_ptr<GeomDataAPI_Dir> aDirX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(theDirX);
-  std::shared_ptr<GeomDataAPI_Dir> aDirY = std::dynamic_pointer_cast<GeomDataAPI_Dir>(theDirY);
-  if (!aDirX || !aDirY || (fabs(aDirX->x()) + fabs(aDirX->y()) + fabs(aDirX->z()) < tolerance)
-      || (fabs(aDirY->x()) + fabs(aDirY->y()) + fabs(aDirY->z()) < tolerance))
+  if (!aDirX || (fabs(aDirX->x()) + fabs(aDirX->y()) + fabs(aDirX->z()) < tolerance))
     return SLVS_E_UNKNOWN;
+  // calculate Y direction
+  std::shared_ptr<GeomAPI_Dir> aDirY(new GeomAPI_Dir(aNorm->dir()->cross(aDirX->dir())));
 
   // quaternion parameters of normal vector
   double qw, qx, qy, qz;
@@ -1370,14 +1371,12 @@ bool SketchSolver_ConstraintGroup::updateWorkplane()
   // Get parameters of workplane
   std::shared_ptr<ModelAPI_Attribute> aDirX = mySketch->data()->attribute(
       SketchPlugin_Sketch::DIRX_ID());
-  std::shared_ptr<ModelAPI_Attribute> aDirY = mySketch->data()->attribute(
-      SketchPlugin_Sketch::DIRY_ID());
   std::shared_ptr<ModelAPI_Attribute> aNorm = mySketch->data()->attribute(
       SketchPlugin_Sketch::NORM_ID());
   std::shared_ptr<ModelAPI_Attribute> anOrigin = mySketch->data()->attribute(
       SketchPlugin_Sketch::ORIGIN_ID());
   // Transform them into SolveSpace format
-  Slvs_hEntity aNormalWP = changeNormal(aDirX, aDirY, aNorm);
+  Slvs_hEntity aNormalWP = changeNormal(aDirX, aNorm);
   if (!aNormalWP)
     return false;
   Slvs_hEntity anOriginWP = changeEntity(anOrigin);
index 5c6f965e33b54d4344ddb5acff661dac4a11463f..e24d93a7d2bf0e6814e89de8e5cbebe7e24a4e28 100644 (file)
@@ -156,12 +156,10 @@ protected:
    *  on the plane transversed to created normal.
    *
    *  \param[in] theDirX first coordinate axis of the plane
-   *  \param[in] theDirY second coordinate axis of the plane
    *  \param[in] theNorm attribute for the normal (used to identify newly created entity)
    *  \return identifier of created or updated normal
    */
   Slvs_hEntity changeNormal(std::shared_ptr<ModelAPI_Attribute> theDirX,
-                            std::shared_ptr<ModelAPI_Attribute> theDirY,
                             std::shared_ptr<ModelAPI_Attribute> theNorm);
 
   /** \brief Adds or updates a parameter in the group
index 3176442f64049a911497746232d405bbe7f120aa..022b1c356d5683aa876bb84a5907b51c09a2452c 100644 (file)
@@ -44,5 +44,6 @@
      <file>pictures/module.png</file>
      <file>pictures/shading.png</file>
      <file>pictures/wireframe.png</file>
+     <file>pictures/expression.png</file>
  </qresource>
  </RCC>
diff --git a/src/XGUI/pictures/expression.png b/src/XGUI/pictures/expression.png
new file mode 100644 (file)
index 0000000..39dd556
Binary files /dev/null and b/src/XGUI/pictures/expression.png differ