X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchAPI%2FSketchAPI_Sketch.h;h=a6ce997207990eed4572ad8ec1110b5d09385546;hb=ed5df03349ef8e7a9ab592a6a52df0a801d5af14;hp=f178514441a2c97ea09592e7098bd7b0d329c067;hpb=7074394f8f08413d885f63be01df6bd5007b868c;p=modules%2Fshaper.git diff --git a/src/SketchAPI/SketchAPI_Sketch.h b/src/SketchAPI/SketchAPI_Sketch.h index f17851444..a6ce99720 100644 --- a/src/SketchAPI/SketchAPI_Sketch.h +++ b/src/SketchAPI/SketchAPI_Sketch.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_ @@ -43,6 +42,10 @@ class SketchAPI_Arc; class SketchAPI_MacroArc; class SketchAPI_Circle; class SketchAPI_MacroCircle; +class SketchAPI_Ellipse; +class SketchAPI_MacroEllipse; +class SketchAPI_EllipticArc; +class SketchAPI_MacroEllipticArc; class SketchAPI_IntersectionPoint; class SketchAPI_Line; class SketchAPI_Mirror; @@ -99,6 +102,11 @@ public: SKETCHAPI_EXPORT void setPlane(const std::shared_ptr & thePlane); + /// Change sketch plane + SKETCHAPI_EXPORT + void setPlane(const ModelHighAPI_Selection & thePlane, + bool theRemoveExternalDependency = false); + /// Set external SKETCHAPI_EXPORT void setExternal(const ModelHighAPI_Selection & theExternal); @@ -107,6 +115,14 @@ public: SKETCHAPI_EXPORT void setExternal(std::shared_ptr thePlaneObject); + /// Change order of sketch results (faces) + SKETCHAPI_EXPORT + void changeFacesOrder(const std::list >& theFaces); + + /// List points not connected by constraints with other sketch entitites + SKETCHAPI_EXPORT + std::list< std::shared_ptr > getFreePoints(); + /// Add point SKETCHAPI_EXPORT std::shared_ptr addPoint( @@ -125,11 +141,13 @@ public: /// Add intersection point SKETCHAPI_EXPORT std::shared_ptr - addIntersectionPoint(const ModelHighAPI_Selection & theExternal); + addIntersectionPoint(const ModelHighAPI_Selection & theExternal, + bool theKeepResult = false); /// Add point SKETCHAPI_EXPORT std::shared_ptr - addIntersectionPoint(const std::string & theExternalName); + addIntersectionPoint(const std::string & theExternalName, + bool theKeepResult = false); /// Add line SKETCHAPI_EXPORT @@ -226,19 +244,21 @@ public: const std::shared_ptr& theEnd, const std::shared_ptr& thePassed); - /// Add arc + /// Add transversal/tangent arc SKETCHAPI_EXPORT std::shared_ptr addArc( - const ModelHighAPI_RefAttr& theTangentPoint, + const ModelHighAPI_RefAttr& theConnectedPoint, double theEndX, double theEndY, - bool theInversed); + bool theInversed, + bool theTransversal = false); - /// Add arc + /// Add transversal/tangent arc SKETCHAPI_EXPORT std::shared_ptr addArc( - const ModelHighAPI_RefAttr& theTangentPoint, + const ModelHighAPI_RefAttr& theConnectedPoint, const std::shared_ptr& theEnd, - bool theInversed); + bool theInversed, + bool theTransversal = false); /// Add arc SKETCHAPI_EXPORT @@ -248,14 +268,72 @@ public: SKETCHAPI_EXPORT std::shared_ptr addArc(const std::string & theExternalName); + /// Add ellipse + SKETCHAPI_EXPORT + std::shared_ptr addEllipse( + double theCenterX, double theCenterY, + double theFocusX, double theFocusY, + double theMinorRadius); + /// Add ellipse + SKETCHAPI_EXPORT + std::shared_ptr addEllipse( + const std::shared_ptr& theCenter, + const std::shared_ptr& theFocus, + double theRadius); + /// Add ellipse + SKETCHAPI_EXPORT + std::shared_ptr addEllipse( + double thePoint1X, double thePoint1Y, + double thePoint2X, double thePoint2Y, + double thePassedX, double thePassedY, + bool isPoint1Center = true); + /// Add ellipse + SKETCHAPI_EXPORT + std::shared_ptr addEllipse( + const std::pair, ModelHighAPI_RefAttr>& thePoint1, + const std::pair, ModelHighAPI_RefAttr>& thePoint2, + const std::pair, ModelHighAPI_RefAttr>& thePassedPoint, + bool isPoint1Center = true); + /// Add ellipse + SKETCHAPI_EXPORT + std::shared_ptr addEllipse(const ModelHighAPI_Selection & theExternal); + /// Add ellipse + SKETCHAPI_EXPORT + std::shared_ptr addEllipse(const std::string & theExternalName); + + /// Add elliptic arc + SKETCHAPI_EXPORT + std::shared_ptr addEllipticArc( + double theCenterX, double theCenterY, + double theFocusX, double theFocusY, + double theStartX, double theStartY, + double theEndX, double theEndY, + bool theInversed = false); + /// Add elliptic arc + SKETCHAPI_EXPORT + std::shared_ptr addEllipticArc( + const std::pair, ModelHighAPI_RefAttr>& theCenter, + const std::pair, ModelHighAPI_RefAttr>& theMajorAxisPoint, + const std::pair, ModelHighAPI_RefAttr>& theStartPoint, + const std::pair, ModelHighAPI_RefAttr>& theEndPoint, + bool theInversed = false); + /// Add elliptic arc + SKETCHAPI_EXPORT + std::shared_ptr addEllipticArc(const ModelHighAPI_Selection & theExternal); + /// Add elliptic arc + SKETCHAPI_EXPORT + std::shared_ptr addEllipticArc(const std::string & theExternalName); + /// Add projection SKETCHAPI_EXPORT std::shared_ptr addProjection( - const ModelHighAPI_Selection & theExternalFeature); + const ModelHighAPI_Selection & theExternalFeature, + bool theKeepResult = false); /// Add projection SKETCHAPI_EXPORT - std::shared_ptr addProjection(const std::string & theExternalName); + std::shared_ptr addProjection(const std::string & theExternalName, + bool theKeepResult = false); /// Add mirror SKETCHAPI_EXPORT @@ -279,7 +357,8 @@ public: const ModelHighAPI_RefAttr & theCenter, const ModelHighAPI_Double & theAngle, const ModelHighAPI_Integer & theNumberOfObjects, - bool theFullValue = false); + bool theFullValue = false, + bool theReversed = false); /// Add split SKETCHAPI_EXPORT @@ -329,6 +408,21 @@ public: /// Set distance SKETCHAPI_EXPORT std::shared_ptr setDistance( + const ModelHighAPI_RefAttr & thePoint, + const ModelHighAPI_RefAttr & thePointOrLine, + const ModelHighAPI_Double & theValue, + bool isSigned = false); + + /// Set signed distance + SKETCHAPI_EXPORT + std::shared_ptr setSignedDistance( + const ModelHighAPI_RefAttr & thePoint, + const ModelHighAPI_RefAttr & thePointOrLine, + const ModelHighAPI_Double & theValue); + + /// Set unsigned distance + SKETCHAPI_EXPORT + std::shared_ptr setUnsignedDistance( const ModelHighAPI_RefAttr & thePoint, const ModelHighAPI_RefAttr & thePointOrLine, const ModelHighAPI_Double & theValue);