-// 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
//
// 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<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_
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;
SKETCHAPI_EXPORT
void setPlane(const std::shared_ptr<GeomAPI_Ax3> & 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);
SKETCHAPI_EXPORT
void setExternal(std::shared_ptr<ModelAPI_Object> thePlaneObject);
+ /// Change order of sketch results (faces)
+ SKETCHAPI_EXPORT
+ void changeFacesOrder(const std::list<std::list<ModelHighAPI_Selection> >& theFaces);
+
+ /// List points not connected by constraints with other sketch entitites
+ SKETCHAPI_EXPORT
+ std::list< std::shared_ptr<SketchAPI_Point> > getFreePoints();
+
/// Add point
SKETCHAPI_EXPORT
std::shared_ptr<SketchAPI_Point> addPoint(
const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
- /// Add arc
+ /// Add transversal/tangent arc
SKETCHAPI_EXPORT
std::shared_ptr<SketchAPI_MacroArc> 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<SketchAPI_MacroArc> addArc(
- const ModelHighAPI_RefAttr& theTangentPoint,
+ const ModelHighAPI_RefAttr& theConnectedPoint,
const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
- bool theInversed);
+ bool theInversed,
+ bool theTransversal = false);
/// Add arc
SKETCHAPI_EXPORT
SKETCHAPI_EXPORT
std::shared_ptr<SketchAPI_Arc> addArc(const std::string & theExternalName);
+ /// Add ellipse
+ SKETCHAPI_EXPORT
+ std::shared_ptr<SketchAPI_Ellipse> addEllipse(
+ double theCenterX, double theCenterY,
+ double theFocusX, double theFocusY,
+ double theMinorRadius);
+ /// Add ellipse
+ SKETCHAPI_EXPORT
+ std::shared_ptr<SketchAPI_Ellipse> addEllipse(
+ const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theFocus,
+ double theRadius);
+ /// Add ellipse
+ SKETCHAPI_EXPORT
+ std::shared_ptr<SketchAPI_MacroEllipse> addEllipse(
+ double thePoint1X, double thePoint1Y,
+ double thePoint2X, double thePoint2Y,
+ double thePassedX, double thePassedY,
+ bool isPoint1Center = true);
+ /// Add ellipse
+ SKETCHAPI_EXPORT
+ std::shared_ptr<SketchAPI_MacroEllipse> addEllipse(
+ const std::pair<std::shared_ptr<GeomAPI_Pnt2d>, ModelHighAPI_RefAttr>& thePoint1,
+ const std::pair<std::shared_ptr<GeomAPI_Pnt2d>, ModelHighAPI_RefAttr>& thePoint2,
+ const std::pair<std::shared_ptr<GeomAPI_Pnt2d>, ModelHighAPI_RefAttr>& thePassedPoint,
+ bool isPoint1Center = true);
+ /// Add ellipse
+ SKETCHAPI_EXPORT
+ std::shared_ptr<SketchAPI_Ellipse> addEllipse(const ModelHighAPI_Selection & theExternal);
+ /// Add ellipse
+ SKETCHAPI_EXPORT
+ std::shared_ptr<SketchAPI_Ellipse> addEllipse(const std::string & theExternalName);
+
+ /// Add elliptic arc
+ SKETCHAPI_EXPORT
+ std::shared_ptr<SketchAPI_EllipticArc> 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<SketchAPI_MacroEllipticArc> addEllipticArc(
+ const std::pair<std::shared_ptr<GeomAPI_Pnt2d>, ModelHighAPI_RefAttr>& theCenter,
+ const std::pair<std::shared_ptr<GeomAPI_Pnt2d>, ModelHighAPI_RefAttr>& theMajorAxisPoint,
+ const std::pair<std::shared_ptr<GeomAPI_Pnt2d>, ModelHighAPI_RefAttr>& theStartPoint,
+ const std::pair<std::shared_ptr<GeomAPI_Pnt2d>, ModelHighAPI_RefAttr>& theEndPoint,
+ bool theInversed = false);
+ /// Add elliptic arc
+ SKETCHAPI_EXPORT
+ std::shared_ptr<SketchAPI_EllipticArc> addEllipticArc(const ModelHighAPI_Selection & theExternal);
+ /// Add elliptic arc
+ SKETCHAPI_EXPORT
+ std::shared_ptr<SketchAPI_EllipticArc> addEllipticArc(const std::string & theExternalName);
+
/// Add projection
SKETCHAPI_EXPORT
std::shared_ptr<SketchAPI_Projection> addProjection(