]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'master' into cgt/V240
authorClarisse Genrault <clarisse.genrault@cea.fr>
Wed, 3 Aug 2016 14:18:10 +0000 (16:18 +0200)
committerClarisse Genrault <clarisse.genrault@cea.fr>
Wed, 3 Aug 2016 14:18:10 +0000 (16:18 +0200)
Conflicts:
src/ConstructionAPI/ConstructionAPI_Axis.cpp
src/ConstructionAPI/ConstructionAPI_Axis.h
src/ConstructionPlugin/CMakeLists.txt
src/ConstructionPlugin/ConstructionPlugin_Axis.cpp
src/ConstructionPlugin/axis_widget.xml
src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h
src/PrimitivesPlugin/Test/UnitTestBox.py
src/PythonAPI/CMakeLists.txt

1  2 
src/ConstructionAPI/ConstructionAPI_Axis.h
src/ConstructionPlugin/ConstructionPlugin_Axis.cpp
src/PrimitivesPlugin/Test/UnitTestBox.py

index ed8f4bc620d006dd457ddce5f565ab0430408a0e,0b62587a637ac2a0d3e85d80cd188877d2ab6ee9..15ba00f3d9c61115f83734399759609b929cf9e7
@@@ -56,19 -69,29 +69,28 @@@ public
    /// Destructor
    CONSTRUCTIONAPI_EXPORT
    virtual ~ConstructionAPI_Axis();
--
-   INTERFACE_10(ConstructionPlugin_Axis::ID(),
-               creationMethod, ConstructionPlugin_Axis::METHOD(), ModelAPI_AttributeString, /** Creation method */,
-               firstPoint, ConstructionPlugin_Axis::POINT_FIRST(), ModelAPI_AttributeSelection, /** First point */,
-               secondPoint, ConstructionPlugin_Axis::POINT_SECOND(), ModelAPI_AttributeSelection, /** Second point */,
-               cylindricalFace, ConstructionPlugin_Axis::CYLINDRICAL_FACE(), ModelAPI_AttributeSelection, /** Cylindrical face */,
-               xDirection, ConstructionPlugin_Axis::X_DIRECTION(), ModelAPI_AttributeDouble, /** X direction */,
-               yDirection, ConstructionPlugin_Axis::Y_DIRECTION(), ModelAPI_AttributeDouble, /** Y direction */,
-               zDirection, ConstructionPlugin_Axis::Z_DIRECTION(), ModelAPI_AttributeDouble, /** Z direction */,
-               xDimension, ConstructionPlugin_Axis::DX(), ModelAPI_AttributeDouble, /** X dimension */,
-               yDimension, ConstructionPlugin_Axis::DY(), ModelAPI_AttributeDouble, /** Y dimension */,
-               zDimension, ConstructionPlugin_Axis::DZ(), ModelAPI_AttributeDouble, /** Z dimension */
-   )
+   INTERFACE_21(ConstructionPlugin_Axis::ID(),
+                creationMethod, ConstructionPlugin_Axis::METHOD(), ModelAPI_AttributeString, /** Creation method */,
+                firstPoint, ConstructionPlugin_Axis::POINT_FIRST(), ModelAPI_AttributeSelection, /** First point */,
+                secondPoint, ConstructionPlugin_Axis::POINT_SECOND(), ModelAPI_AttributeSelection, /** Second point */,
+                cylindricalFace, ConstructionPlugin_Axis::CYLINDRICAL_FACE(), ModelAPI_AttributeSelection, /** Cylindrical face */,
+                xDirection, ConstructionPlugin_Axis::X_DIRECTION(), ModelAPI_AttributeDouble, /** X direction */,
+                yDirection, ConstructionPlugin_Axis::Y_DIRECTION(), ModelAPI_AttributeDouble, /** Y direction */,
+                zDirection, ConstructionPlugin_Axis::Z_DIRECTION(), ModelAPI_AttributeDouble, /** Z direction */,
+                xDimension, ConstructionPlugin_Axis::DX(), ModelAPI_AttributeDouble, /** X dimension */,
+                yDimension, ConstructionPlugin_Axis::DY(), ModelAPI_AttributeDouble, /** Y dimension */,
+                zDimension, ConstructionPlugin_Axis::DZ(), ModelAPI_AttributeDouble, /** Z dimension */,
+                line, ConstructionPlugin_Axis::LINE(), ModelAPI_AttributeSelection, /** Line */,
+                plane, ConstructionPlugin_Axis::PLANE(), ModelAPI_AttributeSelection, /** Plane */,
+                point, ConstructionPlugin_Axis::POINT(), ModelAPI_AttributeSelection, /** Point */,
+                plane1, ConstructionPlugin_Axis::PLANE1(), ModelAPI_AttributeSelection, /** Plane 1 */,
+                useOffset1, ConstructionPlugin_Axis::USE_OFFSET1(), ModelAPI_AttributeString, /** Use offset 1 */,
+                offset1, ConstructionPlugin_Axis::OFFSET1(), ModelAPI_AttributeDouble, /** Offset 1 */,
+                reverseOffset1, ConstructionPlugin_Axis::REVERSE_OFFSET1(), ModelAPI_AttributeBoolean, /** Reverse offset 1 */,
+                plane2, ConstructionPlugin_Axis::PLANE2(), ModelAPI_AttributeSelection, /** Plane 2 */,
+                useOffset2, ConstructionPlugin_Axis::USE_OFFSET2(), ModelAPI_AttributeString, /** Use offset 2 */,
+                offset2, ConstructionPlugin_Axis::OFFSET2(), ModelAPI_AttributeDouble, /** Offset 2 */,
+                reverseOffset2, ConstructionPlugin_Axis::REVERSE_OFFSET2(), ModelAPI_AttributeBoolean, /** Reverse offset 2 */)
  
    /// Set points
    CONSTRUCTIONAPI_EXPORT
  
    /// Set direction
    CONSTRUCTIONAPI_EXPORT
-   void setPointAndDirection(const ModelHighAPI_Selection & thePoint,
-                             const ModelHighAPI_Double & theX,
-                             const ModelHighAPI_Double & theY,
-                             const ModelHighAPI_Double & theZ);
-   
+   void setByPointAndDirection(const ModelHighAPI_Selection& thePoint,
+                               const ModelHighAPI_Double& theX,
+                               const ModelHighAPI_Double& theY,
+                               const ModelHighAPI_Double& theZ);
    /// Set dimensions
    CONSTRUCTIONAPI_EXPORT
-   void setDimensions(const ModelHighAPI_Double & theDX,
-                      const ModelHighAPI_Double & theDY,
-                      const ModelHighAPI_Double & theDZ);
+   void setByDimensions(const ModelHighAPI_Double& theDX,
+                        const ModelHighAPI_Double& theDY,
+                        const ModelHighAPI_Double& theDZ);
+   /// Set by line
+   CONSTRUCTIONAPI_EXPORT
+   void setByLine(const ModelHighAPI_Selection& theCylindricalFace);
+   /// Set by plane and point
+   CONSTRUCTIONAPI_EXPORT
+   void setByPlaneAndPoint(const ModelHighAPI_Selection& thePlane,
+                           const ModelHighAPI_Selection& thePoint);
+   /// Set by two planes
+   CONSTRUCTIONAPI_EXPORT
+   void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
+                       const ModelHighAPI_Selection& thePlane2);
+   /// Set by two planes
+   CONSTRUCTIONAPI_EXPORT
+   void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
+                       const ModelHighAPI_Double& theOffset1,
+                       const bool theReverseOffset1,
+                       const ModelHighAPI_Selection& thePlane2,
+                       const ModelHighAPI_Double& theOffset2,
+                       const bool theReverseOffset2);
  };
  
- //! Pointer on Axis object
+ /// Pointer on Axis object
  typedef std::shared_ptr<ConstructionAPI_Axis> AxisPtr;
  
- /**\ingroup CPPHighAPI
-  * \brief Create Axis feature
-  */
+ /// \ingroup CPPHighAPI
+ /// \brief Create Axis feature
  CONSTRUCTIONAPI_EXPORT
- AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document> & thePart,
-                 const ModelHighAPI_Selection & thePoint1,
-                 const ModelHighAPI_Selection & thePoint2);
+ AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
+                 const ModelHighAPI_Selection& theObject1,
+                 const ModelHighAPI_Selection& theObject2);
  
- /**\ingroup CPPHighAPI
-  * \brief Create Axis feature
-  */
+ /// \ingroup CPPHighAPI
+ /// \brief Create Axis feature
  CONSTRUCTIONAPI_EXPORT
- AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document> & thePart,
-                 const ModelHighAPI_Selection & theCylindricalFace);
+ AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
+                 const ModelHighAPI_Selection& theObject);
  
- /**\ingroup CPPHighAPI
-  * \brief Create Axis feature
-  */
+ /// \ingroup CPPHighAPI
+ /// \brief Create Axis feature
  CONSTRUCTIONAPI_EXPORT
- AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document> & thePart,
-                 const ModelHighAPI_Selection & thePoint,
-                 const ModelHighAPI_Double & theX,
-                 const ModelHighAPI_Double & theY,
-                 const ModelHighAPI_Double & theZ);
- /**\ingroup CPPHighAPI
-  * \brief Create Axis feature
-  */
+ AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
+                 const ModelHighAPI_Selection& thePoint,
+                 const ModelHighAPI_Double& theX,
+                 const ModelHighAPI_Double& theY,
+                 const ModelHighAPI_Double& theZ);
+ /// \ingroup CPPHighAPI
+ /// \brief Create Axis feature
  CONSTRUCTIONAPI_EXPORT
- AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document> & thePart,
-                 const ModelHighAPI_Double & theDX,
-                 const ModelHighAPI_Double & theDY,
-                 const ModelHighAPI_Double & theDZ);
+ AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
+                 const ModelHighAPI_Double& theDX,
+                 const ModelHighAPI_Double& theDY,
+                 const ModelHighAPI_Double& theDZ);
  
- //--------------------------------------------------------------------------------------
- //--------------------------------------------------------------------------------------
+ /// \ingroup CPPHighAPI
+ /// \brief Create Axis feature
+ CONSTRUCTIONAPI_EXPORT
+ AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
+                 const ModelHighAPI_Selection& thePlane1,
+                 const ModelHighAPI_Double& theOffset1,
+                 const bool theReverseOffset1,
+                 const ModelHighAPI_Selection& thePlane2,
+                 const ModelHighAPI_Double& theOffset2,
+                 const bool theReverseOffset2);
 -
  #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_ */
index 90d9dcf312998d7a6ab5e24d038b9563722c3211,1317356de7f708746508ccba492e7957ccfad393..d639437a90a428a1d8c007eb67c3f3f391517eef
@@@ -68,6 -73,23 +73,23 @@@ void ConstructionPlugin_Axis::initAttri
                         ModelAPI_AttributeDouble::typeId());
    data()->addAttribute(ConstructionPlugin_Axis::DZ(),
                         ModelAPI_AttributeDouble::typeId());
 -
++  
+   /// Attributes for axis by line.
+   data()->addAttribute(LINE(), ModelAPI_AttributeSelection::typeId());
+   /// Attributes for axis by plane and point.
+   data()->addAttribute(PLANE(), ModelAPI_AttributeSelection::typeId());
+   data()->addAttribute(POINT(), ModelAPI_AttributeSelection::typeId());
+   /// Attributes for axis by two planes.
+   data()->addAttribute(PLANE1(), ModelAPI_AttributeSelection::typeId());
+   data()->addAttribute(USE_OFFSET1(), ModelAPI_AttributeString::typeId());
+   data()->addAttribute(OFFSET1(), ModelAPI_AttributeDouble::typeId());
+   data()->addAttribute(REVERSE_OFFSET1(), ModelAPI_AttributeBoolean::typeId());
+   data()->addAttribute(PLANE2(), ModelAPI_AttributeSelection::typeId());
+   data()->addAttribute(USE_OFFSET2(), ModelAPI_AttributeString::typeId());
+   data()->addAttribute(OFFSET2(), ModelAPI_AttributeDouble::typeId());
+   data()->addAttribute(REVERSE_OFFSET2(), ModelAPI_AttributeBoolean::typeId());
  }
  
  void ConstructionPlugin_Axis::createAxisByTwoPoints()
index ef63b01098246a956d326904e49e47c348317eef,ebbac5509d61b44466fe2068635ecf87ec638811..8735244d4907f673b70a352d4429f49253b780bc
@@@ -97,11 -98,11 +98,19 @@@ aPoint1 = aPart.addFeature("Point"
  aPoint2 = aPart.addFeature("Point")
  assert(aPoint1.getKind() == "Point")
  assert(aPoint2.getKind() == "Point")
++<<<<<<< HEAD
 +aPoint1.string("creation_method").setValue("by_xyz")
 +aPoint1.real("x").setValue(2.0)
 +aPoint1.real("y").setValue(2.0)
 +aPoint1.real("z").setValue(2.0)
 +aPoint2.string("creation_method").setValue("by_xyz")
++=======
+ # aPoint1.string("creation_method").setValue("by_xyz")
+ aPoint1.real("x").setValue(2.0)
+ aPoint1.real("y").setValue(2.0)
+ aPoint1.real("z").setValue(2.0)
+ # aPoint2.string("creation_method").setValue("by_xyz")
++>>>>>>> master
  aPoint2.real("x").setValue(2.5)
  aPoint2.real("y").setValue(2.5)
  aPoint2.real("z").setValue(2.5)
@@@ -128,9 -129,10 +137,16 @@@ assert (math.fabs(aResVolume2 - aRefVol
  #Check the naming by selecting a face and making a plane out of it
  aPlaneRight = aPart.addFeature("Plane")
  assert(aPlaneRight.getKind() == "Plane")
++<<<<<<< HEAD
 +aPlaneRight.string("CreationMethod").setValue("PlaneByFaceAndDistance")
 +aSelectionAttr = aPlaneRight.selection("planeFace")
 +aSelectionAttr.selectSubShape("face", "Box_2_1/Right_1")
++=======
+ aPlaneRight.string("creation_method").setValue("by_other_plane")
+ aSelectionAttr = aPlaneRight.selection("plane")
+ aSelectionAttr.selectSubShape("face", "Box_2_1/Right_1")
+ aPlaneRight.string("by_other_plane_option").setValue("by_distance_from_other")
++>>>>>>> master
  aPlaneRight.real("distance").setValue(0.5)
  aPlaneRight.execute()