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 _GeomAdaptor_TransformedSurface_HeaderFile
0015 #define _GeomAdaptor_TransformedSurface_HeaderFile
0016
0017 #include <Adaptor3d_Surface.hxx>
0018 #include <GeomAdaptor_Surface.hxx>
0019 #include <gp_Trsf.hxx>
0020
0021 #include <optional>
0022
0023 class Geom_BezierSurface;
0024 class Geom_BSplineSurface;
0025 class Geom_Surface;
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 class GeomAdaptor_TransformedSurface : public Adaptor3d_Surface
0037 {
0038 DEFINE_STANDARD_RTTIEXT(GeomAdaptor_TransformedSurface, Adaptor3d_Surface)
0039 public:
0040
0041 Standard_EXPORT GeomAdaptor_TransformedSurface();
0042
0043
0044
0045
0046 Standard_EXPORT GeomAdaptor_TransformedSurface(const occ::handle<Geom_Surface>& theSurface,
0047 const gp_Trsf& theTrsf);
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058 Standard_EXPORT GeomAdaptor_TransformedSurface(const occ::handle<Geom_Surface>& theSurface,
0059 const double theUFirst,
0060 const double theULast,
0061 const double theVFirst,
0062 const double theVLast,
0063 const gp_Trsf& theTrsf,
0064 const double theTolU = 0.0,
0065 const double theTolV = 0.0);
0066
0067
0068 Standard_EXPORT occ::handle<Adaptor3d_Surface> ShallowCopy() const override;
0069
0070
0071
0072
0073 Standard_EXPORT void Load(const occ::handle<Geom_Surface>& theSurface, const gp_Trsf& theTrsf);
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084 Standard_EXPORT void Load(const occ::handle<Geom_Surface>& theSurface,
0085 const double theUFirst,
0086 const double theULast,
0087 const double theVFirst,
0088 const double theVLast,
0089 const gp_Trsf& theTrsf,
0090 const double theTolU = 0.0,
0091 const double theTolV = 0.0);
0092
0093
0094
0095 Standard_EXPORT void SetTrsf(const gp_Trsf& theTrsf);
0096
0097
0098 bool HasTrsf() const { return myTrsf.Form() != gp_Identity; }
0099
0100
0101 const gp_Trsf& Trsf() const { return myTrsf; }
0102
0103
0104 Standard_DEPRECATED(
0105 "Use AdaptorSurfaceOriginal() instead to get the original surface without transformation")
0106 const GeomAdaptor_Surface& Surface() const { return mySurf; }
0107
0108
0109 const GeomAdaptor_Surface& AdaptorSurfaceOriginal() const { return mySurf; }
0110
0111
0112
0113 Standard_EXPORT const GeomAdaptor_Surface& AdaptorSurfaceTransformed() const;
0114
0115
0116 const occ::handle<Geom_Surface>& GeomSurfaceOriginal() const { return mySurf.Surface(); }
0117
0118
0119 Standard_EXPORT const occ::handle<Geom_Surface>& GeomSurfaceTransformed() const;
0120
0121
0122 Standard_DEPRECATED("Use GeomSurfaceOriginal() or GeomSurfaceTransformed() instead")
0123 const occ::handle<Geom_Surface>& GeomSurface() const { return GeomSurfaceOriginal(); }
0124
0125
0126 double FirstUParameter() const override { return mySurf.FirstUParameter(); }
0127
0128 double LastUParameter() const override { return mySurf.LastUParameter(); }
0129
0130 double FirstVParameter() const override { return mySurf.FirstVParameter(); }
0131
0132 double LastVParameter() const override { return mySurf.LastVParameter(); }
0133
0134 GeomAbs_Shape UContinuity() const override { return mySurf.UContinuity(); }
0135
0136 GeomAbs_Shape VContinuity() const override { return mySurf.VContinuity(); }
0137
0138 int NbUIntervals(const GeomAbs_Shape theS) const override { return mySurf.NbUIntervals(theS); }
0139
0140 int NbVIntervals(const GeomAbs_Shape theS) const override { return mySurf.NbVIntervals(theS); }
0141
0142 Standard_EXPORT void UIntervals(NCollection_Array1<double>& theT,
0143 const GeomAbs_Shape theS) const override;
0144
0145 Standard_EXPORT void VIntervals(NCollection_Array1<double>& theT,
0146 const GeomAbs_Shape theS) const override;
0147
0148 Standard_EXPORT occ::handle<Adaptor3d_Surface> UTrim(const double theFirst,
0149 const double theLast,
0150 const double theTol) const override;
0151
0152 Standard_EXPORT occ::handle<Adaptor3d_Surface> VTrim(const double theFirst,
0153 const double theLast,
0154 const double theTol) const override;
0155
0156 bool IsUClosed() const override { return mySurf.IsUClosed(); }
0157
0158 bool IsVClosed() const override { return mySurf.IsVClosed(); }
0159
0160 bool IsUPeriodic() const override { return mySurf.IsUPeriodic(); }
0161
0162 double UPeriod() const override { return mySurf.UPeriod(); }
0163
0164 bool IsVPeriodic() const override { return mySurf.IsVPeriodic(); }
0165
0166 double VPeriod() const override { return mySurf.VPeriod(); }
0167
0168
0169 double ToleranceU() const { return mySurf.ToleranceU(); }
0170
0171
0172 double ToleranceV() const { return mySurf.ToleranceV(); }
0173
0174
0175 [[nodiscard]] Standard_EXPORT gp_Pnt EvalD0(const double theU, const double theV) const final;
0176
0177
0178 [[nodiscard]] Standard_EXPORT Geom_Surface::ResD1 EvalD1(const double theU,
0179 const double theV) const final;
0180
0181
0182 [[nodiscard]] Standard_EXPORT Geom_Surface::ResD2 EvalD2(const double theU,
0183 const double theV) const final;
0184
0185
0186 [[nodiscard]] Standard_EXPORT Geom_Surface::ResD3 EvalD3(const double theU,
0187 const double theV) const final;
0188
0189
0190 [[nodiscard]] Standard_EXPORT gp_Vec EvalDN(const double theU,
0191 const double theV,
0192 const int theNu,
0193 const int theNv) const final;
0194
0195 double UResolution(const double theR3d) const override { return mySurf.UResolution(theR3d); }
0196
0197 double VResolution(const double theR3d) const override { return mySurf.VResolution(theR3d); }
0198
0199 GeomAbs_SurfaceType GetType() const override { return mySurf.GetType(); }
0200
0201 Standard_EXPORT gp_Pln Plane() const override;
0202
0203 Standard_EXPORT gp_Cylinder Cylinder() const override;
0204
0205 Standard_EXPORT gp_Cone Cone() const override;
0206
0207 Standard_EXPORT gp_Sphere Sphere() const override;
0208
0209 Standard_EXPORT gp_Torus Torus() const override;
0210
0211 int UDegree() const override { return mySurf.UDegree(); }
0212
0213 int NbUPoles() const override { return mySurf.NbUPoles(); }
0214
0215 int VDegree() const override { return mySurf.VDegree(); }
0216
0217 int NbVPoles() const override { return mySurf.NbVPoles(); }
0218
0219 int NbUKnots() const override { return mySurf.NbUKnots(); }
0220
0221 int NbVKnots() const override { return mySurf.NbVKnots(); }
0222
0223 bool IsURational() const override { return mySurf.IsURational(); }
0224
0225 bool IsVRational() const override { return mySurf.IsVRational(); }
0226
0227 Standard_EXPORT occ::handle<Geom_BezierSurface> Bezier() const override;
0228
0229 Standard_EXPORT occ::handle<Geom_BSplineSurface> BSpline() const override;
0230
0231 Standard_EXPORT gp_Ax1 AxeOfRevolution() const override;
0232
0233 Standard_EXPORT gp_Dir Direction() const override;
0234
0235 Standard_EXPORT occ::handle<Adaptor3d_Curve> BasisCurve() const override;
0236
0237 Standard_EXPORT occ::handle<Adaptor3d_Surface> BasisSurface() const override;
0238
0239 Standard_EXPORT double OffsetValue() const override;
0240
0241 protected:
0242
0243 void invalidateTransformedCache();
0244
0245
0246
0247 void ensureTransformedCache() const;
0248
0249
0250
0251 void initTransformedCache() const;
0252
0253
0254
0255 const GeomAdaptor_Surface& transformedAdaptor() const;
0256
0257 protected:
0258 GeomAdaptor_Surface mySurf;
0259 gp_Trsf myTrsf;
0260 mutable std::optional<GeomAdaptor_Surface> myTransformedAdaptor;
0261 };
0262
0263 #endif