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