-// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020 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
#include <ModelHighAPI_Interface.h>
#include <ModelHighAPI_Macro.h>
+#include <ModelHighAPI_Selection.h>
//--------------------------------------------------------------------------------------
class ModelAPI_CompositeFeature;
class ModelAPI_Object;
class ModelHighAPI_Integer;
class ModelHighAPI_RefAttr;
class ModelHighAPI_Reference;
-class ModelHighAPI_Selection;
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_BSpline;
class SketchAPI_IntersectionPoint;
class SketchAPI_Line;
class SketchAPI_Mirror;
class SketchAPI_Rotation;
class SketchAPI_Translation;
//--------------------------------------------------------------------------------------
+typedef std::pair<std::shared_ptr<GeomAPI_Pnt2d>, ModelHighAPI_RefAttr> PointOrReference;
+//--------------------------------------------------------------------------------------
/**\class SketchAPI_Sketch
* \ingroup CPPHighAPI
* \brief Interface for Sketch feature
/// 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,
+ const PointOrReference& thePoint1,
+ const PointOrReference& thePoint2,
+ const PointOrReference& thePassedPoint,
bool isPoint1Center = true);
/// Add ellipse
SKETCHAPI_EXPORT
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 PointOrReference& theCenter,
+ const PointOrReference& theMajorAxisPoint,
+ const PointOrReference& theStartPoint,
+ const PointOrReference& 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 B-spline
+ SKETCHAPI_EXPORT
+ std::shared_ptr<SketchAPI_BSpline> addSpline(
+ const ModelHighAPI_Selection & external = ModelHighAPI_Selection(),
+ const int degree = -1,
+ const std::list<PointOrReference>& poles = std::list<PointOrReference>(),
+ const std::list<ModelHighAPI_Double>& weights = std::list<ModelHighAPI_Double>(),
+ const std::list<ModelHighAPI_Double>& knots = std::list<ModelHighAPI_Double>(),
+ const std::list<ModelHighAPI_Integer>& multiplicities = std::list<ModelHighAPI_Integer>(),
+ const bool periodic = false);
+
/// Add projection
SKETCHAPI_EXPORT
std::shared_ptr<SketchAPI_Projection> addProjection(
std::shared_ptr<ModelHighAPI_Interface> setAngle(
const ModelHighAPI_RefAttr & theLine1,
const ModelHighAPI_RefAttr & theLine2,
- const ModelHighAPI_Double & theValue);
+ const ModelHighAPI_Double & theValue,
+ const std::string& type = std::string());
/// Set complementary angle
SKETCHAPI_EXPORT
//! Pointer on Sketch object
typedef std::shared_ptr<SketchAPI_Sketch> SketchPtr;
+//--------------------------------------------------------------------------------------
+
/**\ingroup CPPHighAPI
* \brief Create Sketch feature
*/
std::shared_ptr<ModelAPI_Object> thePlaneObject);
//--------------------------------------------------------------------------------------
+
+/** \ingroup CPPHighAPI
+ * \brief Copy sketch with all its sub-features
+ */
+SKETCHAPI_EXPORT
+SketchPtr copySketch(const std::shared_ptr<ModelAPI_Document> & thePart,
+ const SketchPtr & theSketch);
+
//--------------------------------------------------------------------------------------
#endif /* SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_ */