File indexing completed on 2026-09-28 09:20:07
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef GeomBndLib_Curve2d_HeaderFile
0015 #define GeomBndLib_Curve2d_HeaderFile
0016
0017 #include <GeomBndLib_BezierCurve2d.hxx>
0018 #include <GeomBndLib_BSplineCurve2d.hxx>
0019 #include <GeomBndLib_Circle2d.hxx>
0020 #include <GeomBndLib_Ellipse2d.hxx>
0021 #include <GeomBndLib_Hyperbola2d.hxx>
0022 #include <GeomBndLib_Line2d.hxx>
0023 #include <GeomBndLib_OffsetCurve2d.hxx>
0024 #include <GeomBndLib_OtherCurve2d.hxx>
0025 #include <GeomBndLib_Parabola2d.hxx>
0026 #include <Bnd_Box2d.hxx>
0027 #include <GeomAbs_CurveType.hxx>
0028 #include <Standard.hxx>
0029 #include <Standard_DefineAlloc.hxx>
0030
0031 #include <variant>
0032
0033 class Adaptor2d_Curve2d;
0034 class Geom2d_Curve;
0035
0036
0037
0038 class GeomBndLib_Curve2d
0039 {
0040 public:
0041 DEFINE_STANDARD_ALLOC
0042
0043
0044 Standard_EXPORT GeomBndLib_Curve2d(const Adaptor2d_Curve2d& theCurve);
0045
0046
0047 Standard_EXPORT GeomBndLib_Curve2d(const occ::handle<Geom2d_Curve>& theCurve);
0048
0049 GeomBndLib_Curve2d(const GeomBndLib_Curve2d&) = delete;
0050 GeomBndLib_Curve2d& operator=(const GeomBndLib_Curve2d&) = delete;
0051 GeomBndLib_Curve2d(GeomBndLib_Curve2d&&) = delete;
0052 GeomBndLib_Curve2d& operator=(GeomBndLib_Curve2d&&) = delete;
0053
0054
0055 GeomAbs_CurveType GetType() const { return myCurveType; }
0056
0057
0058 [[nodiscard]] Standard_EXPORT Bnd_Box2d Box(double theTol) const;
0059
0060
0061 [[nodiscard]] Standard_EXPORT Bnd_Box2d Box(double theU1, double theU2, double theTol) const;
0062
0063
0064 [[nodiscard]] Standard_EXPORT Bnd_Box2d BoxOptimal(double theTol) const;
0065
0066
0067 [[nodiscard]] Standard_EXPORT Bnd_Box2d BoxOptimal(double theU1,
0068 double theU2,
0069 double theTol) const;
0070
0071
0072 Standard_EXPORT void Add(double theTol, Bnd_Box2d& theBox) const;
0073
0074
0075 Standard_EXPORT void Add(double theU1, double theU2, double theTol, Bnd_Box2d& theBox) const;
0076
0077
0078 Standard_EXPORT void AddOptimal(double theTol, Bnd_Box2d& theBox) const;
0079
0080
0081 Standard_EXPORT void AddOptimal(double theU1,
0082 double theU2,
0083 double theTol,
0084 Bnd_Box2d& theBox) const;
0085
0086 private:
0087 using EvaluatorVariant = std::variant<std::monostate,
0088 GeomBndLib_Line2d,
0089 GeomBndLib_Circle2d,
0090 GeomBndLib_Ellipse2d,
0091 GeomBndLib_Hyperbola2d,
0092 GeomBndLib_Parabola2d,
0093 GeomBndLib_BezierCurve2d,
0094 GeomBndLib_BSplineCurve2d,
0095 GeomBndLib_OffsetCurve2d,
0096 GeomBndLib_OtherCurve2d>;
0097 const Adaptor2d_Curve2d* adaptor() const;
0098 double effectiveU1() const;
0099 double effectiveU2() const;
0100
0101 private:
0102 const Adaptor2d_Curve2d* myAdaptorRef = nullptr;
0103 occ::handle<Adaptor2d_Curve2d> myAdaptorOwned;
0104 EvaluatorVariant myEvaluator;
0105 GeomAbs_CurveType myCurveType;
0106 };
0107
0108 #endif