|
|
|||
File indexing completed on 2026-07-30 09:13:31
0001 // Created on: 1993-03-24 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 _Geom2d_Curve_HeaderFile 0018 #define _Geom2d_Curve_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_Type.hxx> 0022 0023 #include <Geom2d_Geometry.hxx> 0024 #include <Standard_Real.hxx> 0025 #include <GeomAbs_Shape.hxx> 0026 #include <Standard_Integer.hxx> 0027 class gp_Trsf2d; 0028 class gp_Pnt2d; 0029 class gp_Vec2d; 0030 0031 class Geom2d_Curve; 0032 DEFINE_STANDARD_HANDLE(Geom2d_Curve, Geom2d_Geometry) 0033 0034 //! The abstract class Curve describes the common 0035 //! behavior of curves in 2D space. The Geom2d 0036 //! package provides numerous concrete classes of 0037 //! derived curves, including lines, circles, conics, Bezier 0038 //! or BSpline curves, etc. 0039 //! The main characteristic of these curves is that they 0040 //! are parameterized. The Geom2d_Curve class shows: 0041 //! - how to work with the parametric equation of a 0042 //! curve in order to calculate the point of parameter 0043 //! u, together with the vector tangent and the 0044 //! derivative vectors of order 2, 3,..., N at this point; 0045 //! - how to obtain general information about the curve 0046 //! (for example, level of continuity, closed 0047 //! characteristics, periodicity, bounds of the parameter field); 0048 //! - how the parameter changes when a geometric 0049 //! transformation is applied to the curve or when the 0050 //! orientation of the curve is inverted. 0051 //! All curves must have a geometric continuity: a curve is 0052 //! at least "C0". Generally, this property is checked at 0053 //! the time of construction or when the curve is edited. 0054 //! Where this is not the case, the documentation 0055 //! explicitly states so. 0056 //! Warning 0057 //! The Geom2d package does not prevent the 0058 //! construction of curves with null length or curves which 0059 //! self-intersect. 0060 class Geom2d_Curve : public Geom2d_Geometry 0061 { 0062 0063 public: 0064 //! Changes the direction of parametrization of <me>. 0065 //! The "FirstParameter" and the "LastParameter" are not changed 0066 //! but the orientation of the curve is modified. If the curve 0067 //! is bounded the StartPoint of the initial curve becomes the 0068 //! EndPoint of the reversed curve and the EndPoint of the initial 0069 //! curve becomes the StartPoint of the reversed curve. 0070 Standard_EXPORT virtual void Reverse() = 0; 0071 0072 //! Computes the parameter on the reversed curve for 0073 //! the point of parameter U on this curve. 0074 //! Note: The point of parameter U on this curve is 0075 //! identical to the point of parameter 0076 //! ReversedParameter(U) on the reversed curve. 0077 Standard_EXPORT virtual Standard_Real ReversedParameter(const Standard_Real U) const = 0; 0078 0079 //! Computes the parameter on the curve transformed by 0080 //! T for the point of parameter U on this curve. 0081 //! Note: this function generally returns U but it can be 0082 //! redefined (for example, on a line). 0083 Standard_EXPORT virtual Standard_Real TransformedParameter(const Standard_Real U, 0084 const gp_Trsf2d& T) const; 0085 0086 //! Returns the coefficient required to compute the 0087 //! parametric transformation of this curve when 0088 //! transformation T is applied. This coefficient is the 0089 //! ratio between the parameter of a point on this curve 0090 //! and the parameter of the transformed point on the 0091 //! new curve transformed by T. 0092 //! Note: this function generally returns 1. but it can be 0093 //! redefined (for example, on a line). 0094 Standard_EXPORT virtual Standard_Real ParametricTransformation(const gp_Trsf2d& T) const; 0095 0096 //! Creates a reversed duplicate Changes the orientation of this curve. The first and 0097 //! last parameters are not changed, but the parametric 0098 //! direction of the curve is reversed. 0099 //! If the curve is bounded: 0100 //! - the start point of the initial curve becomes the end 0101 //! point of the reversed curve, and 0102 //! - the end point of the initial curve becomes the start 0103 //! point of the reversed curve. 0104 //! - Reversed creates a new curve. 0105 Standard_NODISCARD Standard_EXPORT Handle(Geom2d_Curve) Reversed() const; 0106 0107 //! Returns the value of the first parameter. 0108 //! Warnings : 0109 //! It can be RealFirst or RealLast from package Standard 0110 //! if the curve is infinite 0111 Standard_EXPORT virtual Standard_Real FirstParameter() const = 0; 0112 0113 //! Value of the last parameter. 0114 //! Warnings : 0115 //! It can be RealFirst or RealLast from package Standard 0116 //! if the curve is infinite 0117 Standard_EXPORT virtual Standard_Real LastParameter() const = 0; 0118 0119 //! Returns true if the curve is closed. 0120 //! Examples : 0121 //! Some curves such as circle are always closed, others such as line 0122 //! are never closed (by definition). 0123 //! Some Curves such as OffsetCurve can be closed or not. These curves 0124 //! are considered as closed if the distance between the first point 0125 //! and the last point of the curve is lower or equal to the Resolution 0126 //! from package gp which is a fixed criterion independent of the 0127 //! application. 0128 Standard_EXPORT virtual Standard_Boolean IsClosed() const = 0; 0129 0130 //! Returns true if the parameter of the curve is periodic. 0131 //! It is possible only if the curve is closed and if the 0132 //! following relation is satisfied : 0133 //! for each parametric value U the distance between the point 0134 //! P(u) and the point P (u + T) is lower or equal to Resolution 0135 //! from package gp, T is the period and must be a constant. 0136 //! There are three possibilities : 0137 //! . the curve is never periodic by definition (SegmentLine) 0138 //! . the curve is always periodic by definition (Circle) 0139 //! . the curve can be defined as periodic (BSpline). In this case 0140 //! a function SetPeriodic allows you to give the shape of the 0141 //! curve. The general rule for this case is : if a curve can be 0142 //! periodic or not the default periodicity set is non periodic 0143 //! and you have to turn (explicitly) the curve into a periodic 0144 //! curve if you want the curve to be periodic. 0145 Standard_EXPORT virtual Standard_Boolean IsPeriodic() const = 0; 0146 0147 //! Returns the period of this curve. 0148 //! raises if the curve is not periodic 0149 Standard_EXPORT virtual Standard_Real Period() const; 0150 0151 //! It is the global continuity of the curve : 0152 //! C0 : only geometric continuity, 0153 //! C1 : continuity of the first derivative all along the Curve, 0154 //! C2 : continuity of the second derivative all along the Curve, 0155 //! C3 : continuity of the third derivative all along the Curve, 0156 //! G1 : tangency continuity all along the Curve, 0157 //! G2 : curvature continuity all along the Curve, 0158 //! CN : the order of continuity is infinite. 0159 Standard_EXPORT virtual GeomAbs_Shape Continuity() const = 0; 0160 0161 //! Returns true if the degree of continuity of this curve is at least N. 0162 //! Exceptions Standard_RangeError if N is less than 0. 0163 Standard_EXPORT virtual Standard_Boolean IsCN(const Standard_Integer N) const = 0; 0164 0165 //! Returns in P the point of parameter U. 0166 //! If the curve is periodic then the returned point is P(U) with 0167 //! U = Ustart + (U - Uend) where Ustart and Uend are the 0168 //! parametric bounds of the curve. 0169 //! 0170 //! Raised only for the "OffsetCurve" if it is not possible to 0171 //! compute the current point. For example when the first 0172 //! derivative on the basis curve and the offset direction 0173 //! are parallel. 0174 Standard_EXPORT virtual void D0(const Standard_Real U, gp_Pnt2d& P) const = 0; 0175 0176 //! Returns the point P of parameter U and the first derivative V1. 0177 //! Raised if the continuity of the curve is not C1. 0178 Standard_EXPORT virtual void D1(const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1) const = 0; 0179 0180 //! Returns the point P of parameter U, the first and second 0181 //! derivatives V1 and V2. 0182 //! Raised if the continuity of the curve is not C2. 0183 Standard_EXPORT virtual void D2(const Standard_Real U, 0184 gp_Pnt2d& P, 0185 gp_Vec2d& V1, 0186 gp_Vec2d& V2) const = 0; 0187 0188 //! Returns the point P of parameter U, the first, the second 0189 //! and the third derivative. 0190 //! Raised if the continuity of the curve is not C3. 0191 Standard_EXPORT virtual void D3(const Standard_Real U, 0192 gp_Pnt2d& P, 0193 gp_Vec2d& V1, 0194 gp_Vec2d& V2, 0195 gp_Vec2d& V3) const = 0; 0196 0197 //! For the point of parameter U of this curve, computes 0198 //! the vector corresponding to the Nth derivative. 0199 //! Exceptions 0200 //! StdFail_UndefinedDerivative if: 0201 //! - the continuity of the curve is not "CN", or 0202 //! - the derivative vector cannot be computed easily; 0203 //! this is the case with specific types of curve (for 0204 //! example, a rational BSpline curve where N is greater than 3). 0205 //! Standard_RangeError if N is less than 1. 0206 Standard_EXPORT virtual gp_Vec2d DN(const Standard_Real U, const Standard_Integer N) const = 0; 0207 0208 //! Computes the point of parameter U on <me>. 0209 //! If the curve is periodic then the returned point is P(U) with 0210 //! U = Ustart + (U - Uend) where Ustart and Uend are the 0211 //! parametric bounds of the curve. 0212 //! 0213 //! it is implemented with D0. 0214 //! 0215 //! Raised only for the "OffsetCurve" if it is not possible to 0216 //! compute the current point. For example when the first 0217 //! derivative on the basis curve and the offset direction 0218 //! are parallel. 0219 Standard_EXPORT gp_Pnt2d Value(const Standard_Real U) const; 0220 0221 //! Dumps the content of me into the stream 0222 Standard_EXPORT virtual void DumpJson(Standard_OStream& theOStream, 0223 Standard_Integer theDepth = -1) const Standard_OVERRIDE; 0224 0225 DEFINE_STANDARD_RTTIEXT(Geom2d_Curve, Geom2d_Geometry) 0226 0227 protected: 0228 private: 0229 }; 0230 0231 #endif // _Geom2d_Curve_HeaderFile
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|