X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchAPI%2FSketchAPI_BSpline.h;h=003a45d9706d812dcd3e05969c874d7743eb1a15;hb=06e7f5859095193fc7f498bd89a7d28009794f53;hp=70370ad0ba6ae1ad43ebc8cc918cad61e6cdff3b;hpb=a4461306d16531c21f019477c95101e370e551de;p=modules%2Fshaper.git diff --git a/src/SketchAPI/SketchAPI_BSpline.h b/src/SketchAPI/SketchAPI_BSpline.h index 70370ad0b..003a45d97 100644 --- a/src/SketchAPI/SketchAPI_BSpline.h +++ b/src/SketchAPI/SketchAPI_BSpline.h @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2020 CEA/DEN, EDF R&D +// Copyright (C) 2019-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -28,9 +28,11 @@ #include #include +#include + +#include +#include -class ModelHighAPI_Double; -class ModelHighAPI_Integer; class ModelHighAPI_Selection; /// \class SketchAPI_BSpline @@ -43,51 +45,26 @@ public: SKETCHAPI_EXPORT explicit SketchAPI_BSpline(const std::shared_ptr& theFeature); - /// Constructor with values. - SKETCHAPI_EXPORT SketchAPI_BSpline( - const std::shared_ptr& theFeature, - const std::list >& thePoles, - const std::list& theWeights = std::list()); - - /// Constructor with values. - SKETCHAPI_EXPORT SketchAPI_BSpline( - const std::shared_ptr& theFeature, - const int theDegree, - const std::list >& thePoles, - const std::list& theWeights = std::list(), - const std::list& theKnots = std::list(), - const std::list& theMults = std::list()); - - /// Constructor with external. - SKETCHAPI_EXPORT - SketchAPI_BSpline(const std::shared_ptr& theFeature, - const ModelHighAPI_Selection& theExternal); - - /// Constructor with external. - SKETCHAPI_EXPORT - SketchAPI_BSpline(const std::shared_ptr& theFeature, - const std::string& theExternalName); - /// Destructor. SKETCHAPI_EXPORT virtual ~SketchAPI_BSpline(); INTERFACE_8(SketchPlugin_BSpline::ID(), - poles, SketchPlugin_BSpline::POLES_ID(), + poles, SketchPlugin_BSplineBase::POLES_ID(), GeomDataAPI_Point2DArray, /** B-spline poles */, - weights, SketchPlugin_BSpline::WEIGHTS_ID(), + weights, SketchPlugin_BSplineBase::WEIGHTS_ID(), ModelAPI_AttributeDoubleArray, /** B-spline weights */, - knots, SketchPlugin_BSpline::KNOTS_ID(), + knots, SketchPlugin_BSplineBase::KNOTS_ID(), ModelAPI_AttributeDoubleArray, /** B-spline knots */, - multiplicities, SketchPlugin_BSpline::MULTS_ID(), + multiplicities, SketchPlugin_BSplineBase::MULTS_ID(), ModelAPI_AttributeIntArray, /** Knots multiplicities */, - degree, SketchPlugin_BSpline::DEGREE_ID(), + degree, SketchPlugin_BSplineBase::DEGREE_ID(), ModelAPI_AttributeInteger, /** B-spline degree */, startPoint, SketchPlugin_BSpline::START_ID(), GeomDataAPI_Point2D, /** First pole of B-spline */, endPoint, SketchPlugin_BSpline::END_ID(), GeomDataAPI_Point2D, /** Last pole of B-spline */, - external, SketchPlugin_BSpline::EXTERNAL_ID(), + external, SketchPlugin_BSplineBase::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */) /// Set by poles and weights. @@ -108,10 +85,6 @@ public: SKETCHAPI_EXPORT void setByExternal(const ModelHighAPI_Selection& theExternal); - /// Set by external name. - SKETCHAPI_EXPORT - void setByExternalName(const std::string& theExternalName); - /// Generate list of construction points coincident with B-spline poles SKETCHAPI_EXPORT std::list > controlPoles( @@ -124,10 +97,19 @@ public: const std::list& regular = std::list(), const std::list& auxiliary = std::list()) const; + /// Insert new pole after the pole with the given index + SKETCHAPI_EXPORT + bool insertPole(const int theIndex, + const std::shared_ptr& theCoordinates, + const ModelHighAPI_Double& theWeight = ModelHighAPI_Double(1.0)); + /// Dump wrapped feature SKETCHAPI_EXPORT virtual void dump(ModelHighAPI_Dumper& theDumper) const; +protected: + SketchAPI_BSpline(const std::shared_ptr& theFeature, bool theInitialize); + private: /// Initialize start and end points of B-spline and apply internal coincidence /// constraint to keep them on the corresponding pole. @@ -155,4 +137,24 @@ private: /// Pointer on B-spline object. typedef std::shared_ptr BSplinePtr; + + +/// \class SketchAPI_BSplinePeriodic +/// \ingroup CPPHighAPI +/// \brief Interface for BSplinePeriodic feature. +class SketchAPI_BSplinePeriodic : public SketchAPI_BSpline +{ +public: + /// Constructor without values. + SKETCHAPI_EXPORT + explicit SketchAPI_BSplinePeriodic(const std::shared_ptr& theFeature); + + /// Destructor. + SKETCHAPI_EXPORT + virtual ~SketchAPI_BSplinePeriodic() {} + + static std::string ID() { return SketchPlugin_BSplinePeriodic::ID(); } + virtual std::string getID() { return SketchPlugin_BSplinePeriodic::ID(); } +}; + #endif // SketchAPI_BSpline_H_