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_Curve_HeaderFile
0015 #define GeomBndLib_Curve_HeaderFile
0016
0017 #include <GeomBndLib_BezierCurve.hxx>
0018 #include <GeomBndLib_BSplineCurve.hxx>
0019 #include <GeomBndLib_Circle.hxx>
0020 #include <GeomBndLib_Ellipse.hxx>
0021 #include <GeomBndLib_Hyperbola.hxx>
0022 #include <GeomBndLib_Line.hxx>
0023 #include <GeomBndLib_OffsetCurve.hxx>
0024 #include <GeomBndLib_OtherCurve.hxx>
0025 #include <GeomBndLib_Parabola.hxx>
0026 #include <Bnd_Box.hxx>
0027 #include <GeomAbs_CurveType.hxx>
0028 #include <Standard.hxx>
0029 #include <Standard_DefineAlloc.hxx>
0030
0031 #include <variant>
0032
0033 class Adaptor3d_Curve;
0034 class Geom_Curve;
0035
0036
0037
0038 class GeomBndLib_Curve
0039 {
0040 public:
0041 DEFINE_STANDARD_ALLOC
0042
0043
0044 Standard_EXPORT GeomBndLib_Curve(const Adaptor3d_Curve& theCurve);
0045
0046
0047 Standard_EXPORT GeomBndLib_Curve(const occ::handle<Geom_Curve>& theCurve);
0048
0049 GeomBndLib_Curve(const GeomBndLib_Curve&) = delete;
0050 GeomBndLib_Curve& operator=(const GeomBndLib_Curve&) = delete;
0051 GeomBndLib_Curve(GeomBndLib_Curve&&) = delete;
0052 GeomBndLib_Curve& operator=(GeomBndLib_Curve&&) = delete;
0053
0054
0055 GeomAbs_CurveType GetType() const { return myCurveType; }
0056
0057
0058 [[nodiscard]] Standard_EXPORT Bnd_Box Box(double theTol) const;
0059
0060
0061 [[nodiscard]] Standard_EXPORT Bnd_Box Box(double theU1, double theU2, double theTol) const;
0062
0063
0064 [[nodiscard]] Standard_EXPORT Bnd_Box BoxOptimal(double theTol) const;
0065
0066
0067 [[nodiscard]] Standard_EXPORT Bnd_Box BoxOptimal(double theU1, double theU2, double theTol) const;
0068
0069
0070 Standard_EXPORT void Add(double theTol, Bnd_Box& theBox) const;
0071
0072
0073 Standard_EXPORT void Add(double theU1, double theU2, double theTol, Bnd_Box& theBox) const;
0074
0075
0076 Standard_EXPORT void AddOptimal(double theTol, Bnd_Box& theBox) const;
0077
0078
0079 Standard_EXPORT void AddOptimal(double theU1, double theU2, double theTol, Bnd_Box& theBox) const;
0080
0081 private:
0082 using EvaluatorVariant = std::variant<std::monostate,
0083 GeomBndLib_Line,
0084 GeomBndLib_Circle,
0085 GeomBndLib_Ellipse,
0086 GeomBndLib_Hyperbola,
0087 GeomBndLib_Parabola,
0088 GeomBndLib_BezierCurve,
0089 GeomBndLib_BSplineCurve,
0090 GeomBndLib_OffsetCurve,
0091 GeomBndLib_OtherCurve>;
0092 const Adaptor3d_Curve* adaptor() const;
0093 double effectiveU1() const;
0094 double effectiveU2() const;
0095
0096 private:
0097 const Adaptor3d_Curve* myAdaptorRef = nullptr;
0098 occ::handle<Adaptor3d_Curve> myAdaptorOwned;
0099 EvaluatorVariant myEvaluator;
0100 GeomAbs_CurveType myCurveType;
0101 };
0102
0103 #endif