File indexing completed on 2026-09-28 09:20:08
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef GeomBndLib_Surface_HeaderFile
0015 #define GeomBndLib_Surface_HeaderFile
0016
0017 #include <GeomBndLib_BezierSurface.hxx>
0018 #include <GeomBndLib_BSplineSurface.hxx>
0019 #include <GeomBndLib_Cone.hxx>
0020 #include <GeomBndLib_Cylinder.hxx>
0021 #include <GeomBndLib_OffsetSurface.hxx>
0022 #include <GeomBndLib_OtherSurface.hxx>
0023 #include <GeomBndLib_Plane.hxx>
0024 #include <GeomBndLib_Sphere.hxx>
0025 #include <GeomBndLib_SurfaceOfExtrusion.hxx>
0026 #include <GeomBndLib_SurfaceOfRevolution.hxx>
0027 #include <GeomBndLib_Torus.hxx>
0028 #include <Bnd_Box.hxx>
0029 #include <GeomAbs_SurfaceType.hxx>
0030 #include <gp_Trsf.hxx>
0031 #include <Standard.hxx>
0032 #include <Standard_DefineAlloc.hxx>
0033
0034 #include <optional>
0035 #include <variant>
0036
0037 class Adaptor3d_Surface;
0038 class Geom_Surface;
0039
0040
0041
0042 class GeomBndLib_Surface
0043 {
0044 public:
0045 DEFINE_STANDARD_ALLOC
0046
0047
0048 Standard_EXPORT GeomBndLib_Surface(const Adaptor3d_Surface& theSurf);
0049
0050
0051 Standard_EXPORT GeomBndLib_Surface(const occ::handle<Geom_Surface>& theSurf);
0052
0053 GeomBndLib_Surface(const GeomBndLib_Surface&) = delete;
0054 GeomBndLib_Surface& operator=(const GeomBndLib_Surface&) = delete;
0055 GeomBndLib_Surface(GeomBndLib_Surface&&) = delete;
0056 GeomBndLib_Surface& operator=(GeomBndLib_Surface&&) = delete;
0057
0058
0059 GeomAbs_SurfaceType GetType() const { return mySurfType; }
0060
0061
0062 [[nodiscard]] Standard_EXPORT Bnd_Box Box(double theTol) const;
0063
0064
0065 [[nodiscard]] Standard_EXPORT Bnd_Box
0066 Box(double theUMin, double theUMax, double theVMin, double theVMax, double theTol) const;
0067
0068
0069 [[nodiscard]] Standard_EXPORT Bnd_Box BoxOptimal(double theTol) const;
0070
0071
0072 [[nodiscard]] Standard_EXPORT Bnd_Box
0073 BoxOptimal(double theUMin, double theUMax, double theVMin, double theVMax, double theTol) const;
0074
0075
0076 Standard_EXPORT void Add(double theTol, Bnd_Box& theBox) const;
0077
0078
0079 Standard_EXPORT void Add(double theUMin,
0080 double theUMax,
0081 double theVMin,
0082 double theVMax,
0083 double theTol,
0084 Bnd_Box& theBox) const;
0085
0086
0087 Standard_EXPORT void AddOptimal(double theTol, Bnd_Box& theBox) const;
0088
0089
0090 Standard_EXPORT void AddOptimal(double theUMin,
0091 double theUMax,
0092 double theVMin,
0093 double theVMax,
0094 double theTol,
0095 Bnd_Box& theBox) const;
0096
0097 private:
0098 using EvaluatorVariant = std::variant<std::monostate,
0099 GeomBndLib_Plane,
0100 GeomBndLib_Cylinder,
0101 GeomBndLib_Cone,
0102 GeomBndLib_Sphere,
0103 GeomBndLib_Torus,
0104 GeomBndLib_BezierSurface,
0105 GeomBndLib_BSplineSurface,
0106 GeomBndLib_SurfaceOfRevolution,
0107 GeomBndLib_SurfaceOfExtrusion,
0108 GeomBndLib_OffsetSurface,
0109 GeomBndLib_OtherSurface>;
0110 bool initFromSurface(const occ::handle<Geom_Surface>& theSurf);
0111 bool initFromSurfaceType(GeomAbs_SurfaceType theType, const occ::handle<Geom_Surface>& theSurf);
0112 void initOtherSurface(const Adaptor3d_Surface& theSurf);
0113 void initOtherSurface(const occ::handle<Geom_Surface>& theSurf);
0114 const Adaptor3d_Surface* adaptor() const;
0115 double effectiveU1() const;
0116 double effectiveU2() const;
0117 double effectiveV1() const;
0118 double effectiveV2() const;
0119
0120 private:
0121 const Adaptor3d_Surface* myAdaptorRef = nullptr;
0122 occ::handle<Adaptor3d_Surface> myAdaptorOwned;
0123 EvaluatorVariant myEvaluator;
0124 GeomAbs_SurfaceType mySurfType;
0125 };
0126
0127 #endif