Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:46:43

0001 // Created on: 1993-03-10
0002 // Created by: JCV
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Geom_Curve_HeaderFile
0018 #define _Geom_Curve_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Geom_Geometry.hxx>
0024 #include <Standard_Real.hxx>
0025 #include <GeomAbs_Shape.hxx>
0026 #include <Standard_Integer.hxx>
0027 class gp_Trsf;
0028 class gp_Pnt;
0029 class gp_Vec;
0030 
0031 
0032 class Geom_Curve;
0033 DEFINE_STANDARD_HANDLE(Geom_Curve, Geom_Geometry)
0034 
0035 //! The abstract class Curve describes the common
0036 //! behavior of curves in 3D space. The Geom package
0037 //! provides numerous concrete classes of derived
0038 //! curves, including lines, circles, conics, Bezier or
0039 //! BSpline curves, etc.
0040 //! The main characteristic of these curves is that they
0041 //! are parameterized. The Geom_Curve class shows:
0042 //! - how to work with the parametric equation of a curve
0043 //! in order to calculate the point of parameter u,
0044 //! together with the vector tangent and the derivative
0045 //! vectors of order 2, 3,..., N at this point;
0046 //! - how to obtain general information about the curve
0047 //! (for example, level of continuity, closed
0048 //! characteristics, periodicity, bounds of the parameter field);
0049 //! - how the parameter changes when a geometric
0050 //! transformation is applied to the curve or when the
0051 //! orientation of the curve is inverted.
0052 //! All curves must have a geometric continuity: a curve is
0053 //! at least "C0". Generally, this property is checked at
0054 //! the time of construction or when the curve is edited.
0055 //! Where this is not the case, the documentation states so explicitly.
0056 //! Warning
0057 //! The Geom package does not prevent the
0058 //! construction of curves with null length or curves which
0059 //! self-intersect.
0060 class Geom_Curve : public Geom_Geometry
0061 {
0062 
0063 public:
0064 
0065   
0066 
0067   //! Changes the direction of parametrization of <me>.
0068   //! The "FirstParameter" and the "LastParameter" are not changed
0069   //! but the orientation  of the curve is modified. If the curve
0070   //! is bounded the StartPoint of the initial curve becomes the
0071   //! EndPoint of the reversed curve  and the EndPoint of the initial
0072   //! curve becomes the StartPoint of the reversed curve.
0073   Standard_EXPORT virtual void Reverse() = 0;
0074   
0075   //! Returns the  parameter on the  reversed  curve for
0076   //! the point of parameter U on <me>.
0077   //!
0078   //! me->Reversed()->Value(me->ReversedParameter(U))
0079   //!
0080   //! is the same point as
0081   //!
0082   //! me->Value(U)
0083   Standard_EXPORT virtual Standard_Real ReversedParameter (const Standard_Real U) const = 0;
0084   
0085   //! Returns the  parameter on the  transformed  curve for
0086   //! the transform of the point of parameter U on <me>.
0087   //!
0088   //! me->Transformed(T)->Value(me->TransformedParameter(U,T))
0089   //!
0090   //! is the same point as
0091   //!
0092   //! me->Value(U).Transformed(T)
0093   //!
0094   //! This methods returns <U>
0095   //!
0096   //! It can be redefined. For example on the Line.
0097   Standard_EXPORT virtual Standard_Real TransformedParameter (const Standard_Real U, const gp_Trsf& T) const;
0098   
0099   //! Returns a  coefficient to compute the parameter on
0100   //! the transformed  curve  for  the transform  of the
0101   //! point on <me>.
0102   //!
0103   //! Transformed(T)->Value(U * ParametricTransformation(T))
0104   //!
0105   //! is the same point as
0106   //!
0107   //! Value(U).Transformed(T)
0108   //!
0109   //! This methods returns 1.
0110   //!
0111   //! It can be redefined. For example on the Line.
0112   Standard_EXPORT virtual Standard_Real ParametricTransformation (const gp_Trsf& T) const;
0113   
0114   //! Returns a copy of <me> reversed.
0115   Standard_NODISCARD Standard_EXPORT Handle(Geom_Curve) Reversed() const;
0116   
0117   //! Returns the value of the first parameter.
0118   //! Warnings :
0119   //! It can be RealFirst from package Standard
0120   //! if the curve is infinite
0121   Standard_EXPORT virtual Standard_Real FirstParameter() const = 0;
0122   
0123   //! Returns the value of the last parameter.
0124   //! Warnings :
0125   //! It can be RealLast from package Standard
0126   //! if the curve is infinite
0127   Standard_EXPORT virtual Standard_Real LastParameter() const = 0;
0128   
0129   //! Returns true if the curve is closed.
0130   //! Some curves such as circle are always closed, others such as line
0131   //! are never closed (by definition).
0132   //! Some Curves such as OffsetCurve can be closed or not. These curves
0133   //! are considered as closed if the distance between the first point
0134   //! and the last point of the curve is lower or equal to the Resolution
0135   //! from package gp which is a fixed criterion independent of the
0136   //! application.
0137   Standard_EXPORT virtual Standard_Boolean IsClosed() const = 0;
0138   
0139   //! Is the parametrization of the curve periodic ?
0140   //! It is possible only if the curve is closed and if the
0141   //! following relation is satisfied :
0142   //! for each parametric value U the distance between the point
0143   //! P(u) and the point P (u + T) is lower or equal to Resolution
0144   //! from package gp, T is the period and must be a constant.
0145   //! There are three possibilities :
0146   //! . the curve is never periodic by definition (SegmentLine)
0147   //! . the curve is always periodic by definition (Circle)
0148   //! . the curve can be defined as periodic (BSpline). In this case
0149   //! a function SetPeriodic allows you to give the shape of the
0150   //! curve.  The general rule for this case is : if a curve can be
0151   //! periodic or not the default periodicity set is non periodic
0152   //! and you have to turn (explicitly) the curve into a periodic
0153   //! curve  if you want the curve to be periodic.
0154   Standard_EXPORT virtual Standard_Boolean IsPeriodic() const = 0;
0155   
0156   //! Returns the period of this curve.
0157   //! Exceptions Standard_NoSuchObject if this curve is not periodic.
0158   Standard_EXPORT virtual Standard_Real Period() const;
0159   
0160   //! It is the global continuity of the curve
0161   //! C0 : only geometric continuity,
0162   //! C1 : continuity of the first derivative all along the Curve,
0163   //! C2 : continuity of the second derivative all along the Curve,
0164   //! C3 : continuity of the third derivative all along the Curve,
0165   //! G1 : tangency continuity all along the Curve,
0166   //! G2 : curvature continuity all along the Curve,
0167   //! CN : the order of continuity is infinite.
0168   Standard_EXPORT virtual GeomAbs_Shape Continuity() const = 0;
0169   
0170   //! Returns true if the degree of continuity of this curve is at least N.
0171   //! Exceptions -  Standard_RangeError if N is less than 0.
0172   Standard_EXPORT virtual Standard_Boolean IsCN (const Standard_Integer N) const = 0;
0173   
0174   //! Returns in P the point of parameter U.
0175   //! If the curve is periodic  then the returned point is P(U) with
0176   //! U = Ustart + (U - Uend)  where Ustart and Uend are the
0177   //! parametric bounds of the curve.
0178   //!
0179   //! Raised only for the "OffsetCurve" if it is not possible to
0180   //! compute the current point. For example when the first
0181   //! derivative on the basis curve and the offset direction
0182   //! are parallel.
0183   Standard_EXPORT virtual void D0 (const Standard_Real U, gp_Pnt& P) const = 0;
0184   
0185 
0186   //! Returns the point P of parameter U and the first derivative V1.
0187   //! Raised if the continuity of the curve is not C1.
0188   Standard_EXPORT virtual void D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1) const = 0;
0189   
0190 
0191   //! Returns the point P of parameter U, the first and second
0192   //! derivatives V1 and V2.
0193   //! Raised if the continuity of the curve is not C2.
0194   Standard_EXPORT virtual void D2 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const = 0;
0195   
0196 
0197   //! Returns the point P of parameter U, the first, the second
0198   //! and the third derivative.
0199   //! Raised if the continuity of the curve is not C3.
0200   Standard_EXPORT virtual void D3 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const = 0;
0201   
0202 
0203   //! The returned vector gives the value of the derivative for the
0204   //! order of derivation N.
0205   //! Raised if the continuity of the curve is not CN.
0206   //!
0207   //! Raised if the   derivative  cannot  be  computed
0208   //! easily. e.g. rational bspline and n > 3.
0209   //! Raised if N < 1.
0210   Standard_EXPORT virtual gp_Vec DN (const Standard_Real U, const Standard_Integer N) const = 0;
0211   
0212   //! Computes the point of parameter U on <me>.
0213   //! If the curve is periodic  then the returned point is P(U) with
0214   //! U = Ustart + (U - Uend)  where Ustart and Uend are the
0215   //! parametric bounds of the curve.
0216   //! it is implemented with D0.
0217   //!
0218   //! Raised only for the "OffsetCurve" if it is not possible to
0219   //! compute the current point. For example when the first
0220   //! derivative on the basis curve and the offset direction are parallel.
0221   Standard_EXPORT gp_Pnt Value (const Standard_Real U) const;
0222 
0223   //! Dumps the content of me into the stream
0224   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0225 
0226 
0227 
0228 
0229   DEFINE_STANDARD_RTTIEXT(Geom_Curve,Geom_Geometry)
0230 
0231 protected:
0232 
0233 
0234 
0235 
0236 private:
0237 
0238 
0239 
0240 
0241 };
0242 
0243 
0244 
0245 
0246 
0247 
0248 
0249 #endif // _Geom_Curve_HeaderFile