File indexing completed on 2025-01-18 10:03:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _Geom2dAdaptor_Curve_HeaderFile
0018 #define _Geom2dAdaptor_Curve_HeaderFile
0019
0020 #include <Adaptor2d_Curve2d.hxx>
0021 #include <BSplCLib_Cache.hxx>
0022 #include <Geom2d_Curve.hxx>
0023 #include <Geom2dEvaluator_Curve.hxx>
0024 #include <GeomAbs_CurveType.hxx>
0025 #include <GeomAbs_Shape.hxx>
0026 #include <gp_Pnt2d.hxx>
0027 #include <Standard_NullObject.hxx>
0028 #include <TColStd_Array1OfReal.hxx>
0029
0030 class gp_Vec2d;
0031 class gp_Lin2d;
0032 class gp_Circ2d;
0033 class gp_Elips2d;
0034 class gp_Hypr2d;
0035 class gp_Parab2d;
0036 class Geom2d_BezierCurve;
0037 class Geom2d_BSplineCurve;
0038
0039
0040
0041
0042
0043
0044
0045
0046 class Geom2dAdaptor_Curve : public Adaptor2d_Curve2d
0047 {
0048 DEFINE_STANDARD_RTTIEXT(Geom2dAdaptor_Curve, Adaptor2d_Curve2d)
0049 public:
0050
0051 Standard_EXPORT Geom2dAdaptor_Curve();
0052
0053 Standard_EXPORT Geom2dAdaptor_Curve(const Handle(Geom2d_Curve)& C);
0054
0055
0056 Standard_EXPORT Geom2dAdaptor_Curve(const Handle(Geom2d_Curve)& C, const Standard_Real UFirst, const Standard_Real ULast);
0057
0058
0059 Standard_EXPORT virtual Handle(Adaptor2d_Curve2d) ShallowCopy() const Standard_OVERRIDE;
0060
0061
0062 Standard_EXPORT void Reset();
0063
0064 void Load (const Handle(Geom2d_Curve)& theCurve)
0065 {
0066 if (theCurve.IsNull()) { throw Standard_NullObject(); }
0067 load (theCurve, theCurve->FirstParameter(), theCurve->LastParameter());
0068 }
0069
0070
0071 void Load (const Handle(Geom2d_Curve)& theCurve, const Standard_Real theUFirst, const Standard_Real theULast)
0072 {
0073 if (theCurve.IsNull()) { throw Standard_NullObject(); }
0074 if (theUFirst > theULast) { throw Standard_ConstructionError(); }
0075 load (theCurve, theUFirst, theULast);
0076 }
0077
0078 const Handle(Geom2d_Curve)& Curve() const { return myCurve; }
0079
0080 virtual Standard_Real FirstParameter() const Standard_OVERRIDE { return myFirst; }
0081
0082 virtual Standard_Real LastParameter() const Standard_OVERRIDE { return myLast; }
0083
0084 Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
0085
0086
0087
0088
0089 Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
0090
0091
0092
0093
0094
0095
0096 Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
0097
0098
0099
0100
0101
0102 Standard_EXPORT Handle(Adaptor2d_Curve2d) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
0103
0104 Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
0105
0106 Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
0107
0108 Standard_EXPORT Standard_Real Period() const Standard_OVERRIDE;
0109
0110
0111 Standard_EXPORT gp_Pnt2d Value (const Standard_Real U) const Standard_OVERRIDE;
0112
0113
0114 Standard_EXPORT void D0 (const Standard_Real U, gp_Pnt2d& P) const Standard_OVERRIDE;
0115
0116
0117
0118
0119
0120 Standard_EXPORT void D1 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V) const Standard_OVERRIDE;
0121
0122
0123
0124
0125
0126
0127 Standard_EXPORT void D2 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const Standard_OVERRIDE;
0128
0129
0130
0131
0132
0133
0134 Standard_EXPORT void D3 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) const Standard_OVERRIDE;
0135
0136
0137
0138
0139
0140
0141
0142 Standard_EXPORT gp_Vec2d DN (const Standard_Real U, const Standard_Integer N) const Standard_OVERRIDE;
0143
0144
0145 Standard_EXPORT Standard_Real Resolution (const Standard_Real Ruv) const Standard_OVERRIDE;
0146
0147 virtual GeomAbs_CurveType GetType() const Standard_OVERRIDE { return myTypeCurve; }
0148
0149 Standard_EXPORT gp_Lin2d Line() const Standard_OVERRIDE;
0150
0151 Standard_EXPORT gp_Circ2d Circle() const Standard_OVERRIDE;
0152
0153 Standard_EXPORT gp_Elips2d Ellipse() const Standard_OVERRIDE;
0154
0155 Standard_EXPORT gp_Hypr2d Hyperbola() const Standard_OVERRIDE;
0156
0157 Standard_EXPORT gp_Parab2d Parabola() const Standard_OVERRIDE;
0158
0159 Standard_EXPORT Standard_Integer Degree() const Standard_OVERRIDE;
0160
0161 Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
0162
0163 Standard_EXPORT Standard_Integer NbPoles() const Standard_OVERRIDE;
0164
0165 Standard_EXPORT Standard_Integer NbKnots() const Standard_OVERRIDE;
0166
0167 Standard_EXPORT virtual Standard_Integer NbSamples() const Standard_OVERRIDE;
0168
0169 Standard_EXPORT Handle(Geom2d_BezierCurve) Bezier() const Standard_OVERRIDE;
0170
0171 Standard_EXPORT Handle(Geom2d_BSplineCurve) BSpline() const Standard_OVERRIDE;
0172
0173 private:
0174
0175 Standard_EXPORT GeomAbs_Shape LocalContinuity (const Standard_Real U1, const Standard_Real U2) const;
0176
0177 Standard_EXPORT void load (const Handle(Geom2d_Curve)& C, const Standard_Real UFirst, const Standard_Real ULast);
0178
0179
0180 Standard_Boolean IsBoundary(const Standard_Real theU, Standard_Integer& theSpanStart, Standard_Integer& theSpanFinish) const;
0181
0182
0183
0184 void RebuildCache (const Standard_Real theParameter) const;
0185
0186 protected:
0187
0188 Handle(Geom2d_Curve) myCurve;
0189 GeomAbs_CurveType myTypeCurve;
0190 Standard_Real myFirst;
0191 Standard_Real myLast;
0192
0193 Handle(Geom2d_BSplineCurve) myBSplineCurve;
0194 mutable Handle(BSplCLib_Cache) myCurveCache;
0195 Handle(Geom2dEvaluator_Curve) myNestedEvaluator;
0196
0197 };
0198
0199 DEFINE_STANDARD_HANDLE(Geom2dAdaptor_Curve, Adaptor2d_Curve2d)
0200
0201 #endif