File indexing completed on 2026-09-28 09:20:06
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _GeomAdaptor_TransformedCurve_HeaderFile
0015 #define _GeomAdaptor_TransformedCurve_HeaderFile
0016
0017 #include <Adaptor3d_Curve.hxx>
0018 #include <Adaptor3d_CurveOnSurface.hxx>
0019 #include <GeomAdaptor_Curve.hxx>
0020 #include <gp_Trsf.hxx>
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 class GeomAdaptor_TransformedCurve : public Adaptor3d_Curve
0032 {
0033 DEFINE_STANDARD_RTTIEXT(GeomAdaptor_TransformedCurve, Adaptor3d_Curve)
0034 public:
0035
0036 Standard_EXPORT GeomAdaptor_TransformedCurve();
0037
0038
0039
0040
0041 Standard_EXPORT GeomAdaptor_TransformedCurve(const occ::handle<Geom_Curve>& theCurve,
0042 const gp_Trsf& theTrsf);
0043
0044
0045
0046
0047
0048
0049 Standard_EXPORT GeomAdaptor_TransformedCurve(const occ::handle<Geom_Curve>& theCurve,
0050 const double theFirst,
0051 const double theLast,
0052 const gp_Trsf& theTrsf);
0053
0054
0055 Standard_EXPORT occ::handle<Adaptor3d_Curve> ShallowCopy() const override;
0056
0057
0058
0059 void Load(const occ::handle<Geom_Curve>& theCurve) { myCurve.Load(theCurve); }
0060
0061
0062
0063
0064
0065 void Load(const occ::handle<Geom_Curve>& theCurve, const double theFirst, const double theLast)
0066 {
0067 myCurve.Load(theCurve, theFirst, theLast);
0068 }
0069
0070
0071
0072 void LoadCurveOnSurface(const occ::handle<Adaptor3d_CurveOnSurface>& theConSurf)
0073 {
0074 myConSurf = theConSurf;
0075 }
0076
0077
0078
0079 void SetTrsf(const gp_Trsf& theTrsf) { myTrsf = theTrsf; }
0080
0081
0082 const gp_Trsf& Trsf() const { return myTrsf; }
0083
0084
0085 bool Is3DCurve() const { return myConSurf.IsNull(); }
0086
0087
0088 bool IsCurveOnSurface() const { return !myConSurf.IsNull(); }
0089
0090
0091 const GeomAdaptor_Curve& Curve() const { return myCurve; }
0092
0093
0094 GeomAdaptor_Curve& ChangeCurve() { return myCurve; }
0095
0096
0097 const Adaptor3d_CurveOnSurface& CurveOnSurface() const { return *myConSurf; }
0098
0099
0100 const occ::handle<Geom_Curve>& GeomCurve() const { return myCurve.Curve(); }
0101
0102
0103 double FirstParameter() const override
0104 {
0105 return myConSurf.IsNull() ? myCurve.FirstParameter() : myConSurf->FirstParameter();
0106 }
0107
0108 double LastParameter() const override
0109 {
0110 return myConSurf.IsNull() ? myCurve.LastParameter() : myConSurf->LastParameter();
0111 }
0112
0113 GeomAbs_Shape Continuity() const override
0114 {
0115 return myConSurf.IsNull() ? myCurve.Continuity() : myConSurf->Continuity();
0116 }
0117
0118 int NbIntervals(const GeomAbs_Shape theS) const override
0119 {
0120 return myConSurf.IsNull() ? myCurve.NbIntervals(theS) : myConSurf->NbIntervals(theS);
0121 }
0122
0123 Standard_EXPORT void Intervals(NCollection_Array1<double>& theT,
0124 const GeomAbs_Shape theS) const override;
0125
0126 Standard_EXPORT occ::handle<Adaptor3d_Curve> Trim(const double theFirst,
0127 const double theLast,
0128 const double theTol) const override;
0129
0130 bool IsClosed() const override
0131 {
0132 return myConSurf.IsNull() ? myCurve.IsClosed() : myConSurf->IsClosed();
0133 }
0134
0135 bool IsPeriodic() const override
0136 {
0137 return myConSurf.IsNull() ? myCurve.IsPeriodic() : myConSurf->IsPeriodic();
0138 }
0139
0140 double Period() const override
0141 {
0142 return myConSurf.IsNull() ? myCurve.Period() : myConSurf->Period();
0143 }
0144
0145
0146 [[nodiscard]] Standard_EXPORT gp_Pnt EvalD0(const double theU) const final;
0147
0148
0149 [[nodiscard]] Standard_EXPORT Geom_Curve::ResD1 EvalD1(const double theU) const final;
0150
0151
0152 [[nodiscard]] Standard_EXPORT Geom_Curve::ResD2 EvalD2(const double theU) const final;
0153
0154
0155 [[nodiscard]] Standard_EXPORT Geom_Curve::ResD3 EvalD3(const double theU) const final;
0156
0157
0158 [[nodiscard]] Standard_EXPORT gp_Vec EvalDN(const double theU, const int theN) const final;
0159
0160 double Resolution(const double theR3d) const override
0161 {
0162 return myConSurf.IsNull() ? myCurve.Resolution(theR3d) : myConSurf->Resolution(theR3d);
0163 }
0164
0165 GeomAbs_CurveType GetType() const override
0166 {
0167 return myConSurf.IsNull() ? myCurve.GetType() : myConSurf->GetType();
0168 }
0169
0170 Standard_EXPORT gp_Lin Line() const override;
0171
0172 Standard_EXPORT gp_Circ Circle() const override;
0173
0174 Standard_EXPORT gp_Elips Ellipse() const override;
0175
0176 Standard_EXPORT gp_Hypr Hyperbola() const override;
0177
0178 Standard_EXPORT gp_Parab Parabola() const override;
0179
0180 int Degree() const override
0181 {
0182 return myConSurf.IsNull() ? myCurve.Degree() : myConSurf->Degree();
0183 }
0184
0185 bool IsRational() const override
0186 {
0187 return myConSurf.IsNull() ? myCurve.IsRational() : myConSurf->IsRational();
0188 }
0189
0190 int NbPoles() const override
0191 {
0192 return myConSurf.IsNull() ? myCurve.NbPoles() : myConSurf->NbPoles();
0193 }
0194
0195 int NbKnots() const override
0196 {
0197 return myConSurf.IsNull() ? myCurve.NbKnots() : myConSurf->NbKnots();
0198 }
0199
0200 Standard_EXPORT occ::handle<Geom_BezierCurve> Bezier() const override;
0201
0202 Standard_EXPORT occ::handle<Geom_BSplineCurve> BSpline() const override;
0203
0204 Standard_EXPORT occ::handle<Geom_OffsetCurve> OffsetCurve() const override;
0205
0206 protected:
0207 GeomAdaptor_Curve myCurve;
0208 occ::handle<Adaptor3d_CurveOnSurface> myConSurf;
0209 gp_Trsf myTrsf;
0210 };
0211
0212 #endif