Open CASCADE Technology
7.3.0
|
Describes a rational or non-rational Bezier curve. More...
#include <Geom_BezierCurve.hxx>
Public Member Functions | |
Geom_BezierCurve (const TColgp_Array1OfPnt &CurvePoles) | |
Creates a non rational Bezier curve with a set of poles CurvePoles. The weights are defaulted to all being 1. Raises ConstructionError if the number of poles is greater than MaxDegree + 1 or lower than 2. More... | |
Geom_BezierCurve (const TColgp_Array1OfPnt &CurvePoles, const TColStd_Array1OfReal &PoleWeights) | |
Creates a rational Bezier curve with the set of poles CurvePoles and the set of weights PoleWeights . If all the weights are identical the curve is considered as non rational. Raises ConstructionError if the number of poles is greater than MaxDegree + 1 or lower than 2 or CurvePoles and CurveWeights have not the same length or one weight value is lower or equal to Resolution from package gp. More... | |
void | Increase (const Standard_Integer Degree) |
Increases the degree of a bezier curve. Degree is the new degree of <me>. Raises ConstructionError if Degree is greater than MaxDegree or lower than 2 or lower than the initial degree of <me>. More... | |
void | InsertPoleAfter (const Standard_Integer Index, const gp_Pnt &P) |
Inserts a pole P after the pole of range Index. If the curve <me> is rational the weight value for the new pole of range Index is 1.0. raised if Index is not in the range [1, NbPoles]. More... | |
void | InsertPoleAfter (const Standard_Integer Index, const gp_Pnt &P, const Standard_Real Weight) |
Inserts a pole with its weight in the set of poles after the pole of range Index. If the curve was non rational it can become rational if all the weights are not identical. Raised if Index is not in the range [1, NbPoles]. More... | |
void | InsertPoleBefore (const Standard_Integer Index, const gp_Pnt &P) |
Inserts a pole P before the pole of range Index. If the curve <me> is rational the weight value for the new pole of range Index is 1.0. Raised if Index is not in the range [1, NbPoles]. More... | |
void | InsertPoleBefore (const Standard_Integer Index, const gp_Pnt &P, const Standard_Real Weight) |
Inserts a pole with its weight in the set of poles after the pole of range Index. If the curve was non rational it can become rational if all the weights are not identical. Raised if Index is not in the range [1, NbPoles]. More... | |
void | RemovePole (const Standard_Integer Index) |
Removes the pole of range Index. If the curve was rational it can become non rational. Raised if Index is not in the range [1, NbPoles] Raised if Degree is lower than 2. More... | |
void | Reverse () override |
Reverses the direction of parametrization of <me> Value (NewU) = Value (1 - OldU) More... | |
Standard_Real | ReversedParameter (const Standard_Real U) const override |
Returns the parameter on the reversed curve for the point of parameter U on <me>. More... | |
void | Segment (const Standard_Real U1, const Standard_Real U2) |
Segments the curve between U1 and U2 which can be out of the bounds of the curve. The curve is oriented from U1 to U2. The control points are modified, the first and the last point are not the same but the parametrization range is [0, 1] else it could not be a Bezier curve. Warnings : Even if <me> is not closed it can become closed after the segmentation for example if U1 or U2 are out of the bounds of the curve <me> or if the curve makes loop. After the segmentation the length of a curve can be null. More... | |
void | SetPole (const Standard_Integer Index, const gp_Pnt &P) |
Substitutes the pole of range index with P. If the curve <me> is rational the weight of range Index is not modified. raiseD if Index is not in the range [1, NbPoles]. More... | |
void | SetPole (const Standard_Integer Index, const gp_Pnt &P, const Standard_Real Weight) |
Substitutes the pole and the weights of range Index. If the curve <me> is not rational it can become rational if all the weights are not identical. If the curve was rational it can become non rational if all the weights are identical. Raised if Index is not in the range [1, NbPoles] Raised if Weight <= Resolution from package gp. More... | |
void | SetWeight (const Standard_Integer Index, const Standard_Real Weight) |
Changes the weight of the pole of range Index. If the curve <me> is not rational it can become rational if all the weights are not identical. If the curve was rational it can become non rational if all the weights are identical. Raised if Index is not in the range [1, NbPoles] Raised if Weight <= Resolution from package gp. More... | |
Standard_Boolean | IsClosed () const override |
Returns True if the distance between the first point and the last point of the curve is lower or equal to the Resolution from package gp. More... | |
Standard_Boolean | IsCN (const Standard_Integer N) const override |
Continuity of the curve, returns True. More... | |
Standard_Boolean | IsPeriodic () const override |
Returns True if the parametrization of a curve is periodic. (P(u) = P(u + T) T = constante) More... | |
Standard_Boolean | IsRational () const |
Returns false if all the weights are identical. The tolerance criterion is Resolution from package gp. More... | |
GeomAbs_Shape | Continuity () const override |
a Bezier curve is CN More... | |
Standard_Integer | Degree () const |
Returns the polynomial degree of the curve. it is the number of poles - 1 point P and derivatives (V1, V2, V3) computation The Bezier Curve has a Polynomial representation so the parameter U can be out of the bounds of the curve. More... | |
void | D0 (const Standard_Real U, gp_Pnt &P) const override |
Returns in P the point of parameter U. If the curve is periodic then the returned point is P(U) with U = Ustart + (U - Uend) where Ustart and Uend are the parametric bounds of the curve. More... | |
void | D1 (const Standard_Real U, gp_Pnt &P, gp_Vec &V1) const override |
Returns the point P of parameter U and the first derivative V1. Raised if the continuity of the curve is not C1. More... | |
void | D2 (const Standard_Real U, gp_Pnt &P, gp_Vec &V1, gp_Vec &V2) const override |
Returns the point P of parameter U, the first and second derivatives V1 and V2. Raised if the continuity of the curve is not C2. More... | |
void | D3 (const Standard_Real U, gp_Pnt &P, gp_Vec &V1, gp_Vec &V2, gp_Vec &V3) const override |
For this Bezier curve, computes. More... | |
gp_Vec | DN (const Standard_Real U, const Standard_Integer N) const override |
For the point of parameter U of this Bezier curve, computes the vector corresponding to the Nth derivative. Note: the parameter U can be outside the bounds of the curve. Exceptions Standard_RangeError if N is less than 1. More... | |
gp_Pnt | StartPoint () const override |
Returns Value (U=0.), it is the first control point of the curve. More... | |
gp_Pnt | EndPoint () const override |
Returns Value (U=1.), it is the last control point of the Bezier curve. More... | |
Standard_Real | FirstParameter () const override |
Returns the value of the first parameter of this Bezier curve. This is 0.0, which gives the start point of this Bezier curve. More... | |
Standard_Real | LastParameter () const override |
Returns the value of the last parameter of this Bezier curve. This is 1.0, which gives the end point of this Bezier curve. More... | |
Standard_Integer | NbPoles () const |
Returns the number of poles of this Bezier curve. More... | |
const gp_Pnt & | Pole (const Standard_Integer Index) const |
Returns the pole of range Index. Raised if Index is not in the range [1, NbPoles]. More... | |
void | Poles (TColgp_Array1OfPnt &P) const |
Returns all the poles of the curve. More... | |
const TColgp_Array1OfPnt & | Poles () const |
Returns all the poles of the curve. More... | |
Standard_Real | Weight (const Standard_Integer Index) const |
Returns the weight of range Index. Raised if Index is not in the range [1, NbPoles]. More... | |
void | Weights (TColStd_Array1OfReal &W) const |
Returns all the weights of the curve. More... | |
const TColStd_Array1OfReal * | Weights () const |
Returns all the weights of the curve. More... | |
void | Transform (const gp_Trsf &T) override |
Applies the transformation T to this Bezier curve. More... | |
void | Resolution (const Standard_Real Tolerance3D, Standard_Real &UTolerance) |
Computes for this Bezier curve the parametric tolerance UTolerance for a given 3D tolerance Tolerance3D. If f(t) is the equation of this Bezier curve, UTolerance ensures that: |t1-t0| < UTolerance ===> |f(t1)-f(t0)| < Tolerance3D. More... | |
Handle< Geom_Geometry > | Copy () const override |
Creates a new object which is a copy of this Bezier curve. More... | |
Public Member Functions inherited from Geom_Curve | |
virtual Standard_Real | TransformedParameter (const Standard_Real U, const gp_Trsf &T) const |
Returns the parameter on the transformed curve for the transform of the point of parameter U on <me>. More... | |
virtual Standard_Real | ParametricTransformation (const gp_Trsf &T) const |
Returns a coefficient to compute the parameter on the transformed curve for the transform of the point on <me>. More... | |
Handle< Geom_Curve > | Reversed () const |
Returns a copy of <me> reversed. More... | |
virtual Standard_Real | Period () const |
Returns the period of this curve. Exceptions Standard_NoSuchObject if this curve is not periodic. More... | |
gp_Pnt | Value (const Standard_Real U) const |
Computes the point of parameter U on <me>. If the curve is periodic then the returned point is P(U) with U = Ustart + (U - Uend) where Ustart and Uend are the parametric bounds of the curve. it is implemented with D0. More... | |
Public Member Functions inherited from Geom_Geometry | |
void | Mirror (const gp_Pnt &P) |
Performs the symmetrical transformation of a Geometry with respect to the point P which is the center of the symmetry. More... | |
void | Mirror (const gp_Ax1 &A1) |
Performs the symmetrical transformation of a Geometry with respect to an axis placement which is the axis of the symmetry. More... | |
void | Mirror (const gp_Ax2 &A2) |
Performs the symmetrical transformation of a Geometry with respect to a plane. The axis placement A2 locates the plane of the symmetry : (Location, XDirection, YDirection). More... | |
void | Rotate (const gp_Ax1 &A1, const Standard_Real Ang) |
Rotates a Geometry. A1 is the axis of the rotation. Ang is the angular value of the rotation in radians. More... | |
void | Scale (const gp_Pnt &P, const Standard_Real S) |
Scales a Geometry. S is the scaling value. More... | |
void | Translate (const gp_Vec &V) |
Translates a Geometry. V is the vector of the tanslation. More... | |
void | Translate (const gp_Pnt &P1, const gp_Pnt &P2) |
Translates a Geometry from the point P1 to the point P2. More... | |
Handle< Geom_Geometry > | Mirrored (const gp_Pnt &P) const |
Handle< Geom_Geometry > | Mirrored (const gp_Ax1 &A1) const |
Handle< Geom_Geometry > | Mirrored (const gp_Ax2 &A2) const |
Handle< Geom_Geometry > | Rotated (const gp_Ax1 &A1, const Standard_Real Ang) const |
Handle< Geom_Geometry > | Scaled (const gp_Pnt &P, const Standard_Real S) const |
Handle< Geom_Geometry > | Transformed (const gp_Trsf &T) const |
Handle< Geom_Geometry > | Translated (const gp_Vec &V) const |
Handle< Geom_Geometry > | Translated (const gp_Pnt &P1, const gp_Pnt &P2) const |
Public Member Functions inherited from Standard_Transient | |
Standard_Transient () | |
Empty constructor. More... | |
Standard_Transient (const Standard_Transient &) | |
Copy constructor – does nothing. More... | |
Standard_Transient & | operator= (const Standard_Transient &) |
Assignment operator, needed to avoid copying reference counter. More... | |
virtual | ~Standard_Transient () |
Destructor must be virtual. More... | |
virtual void | Delete () const |
Memory deallocator for transient classes. More... | |
virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
Returns a type descriptor about this object. More... | |
Standard_Boolean | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
Returns a true value if this is an instance of Type. More... | |
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
Returns a true value if this is an instance of TypeName. More... | |
Standard_Boolean | IsKind (const opencascade::handle< Standard_Type > &theType) const |
Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
Standard_Boolean | IsKind (const Standard_CString theTypeName) const |
Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
Standard_Transient * | This () const |
Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More... | |
Standard_Integer | GetRefCount () const |
Get the reference counter of this object. More... | |
void | IncrementRefCounter () const |
Increments the reference counter of this object. More... | |
Standard_Integer | DecrementRefCounter () const |
Decrements the reference counter of this object; returns the decremented value. More... | |
Static Public Member Functions | |
static Standard_Integer | MaxDegree () |
Returns the value of the maximum polynomial degree of any Geom_BezierCurve curve. This value is 25. More... | |
Static Public Member Functions inherited from Standard_Transient | |
static const char * | get_type_name () |
Returns a type descriptor about this object. More... | |
static const opencascade::handle< Standard_Type > & | get_type_descriptor () |
Returns type descriptor of Standard_Transient class. More... | |
Additional Inherited Members | |
Public Types inherited from Standard_Transient | |
typedef void | base_type |
Returns a type descriptor about this object. More... | |
Describes a rational or non-rational Bezier curve.
Geom_BezierCurve::Geom_BezierCurve | ( | const TColgp_Array1OfPnt & | CurvePoles | ) |
Creates a non rational Bezier curve with a set of poles CurvePoles. The weights are defaulted to all being 1. Raises ConstructionError if the number of poles is greater than MaxDegree + 1 or lower than 2.
Geom_BezierCurve::Geom_BezierCurve | ( | const TColgp_Array1OfPnt & | CurvePoles, |
const TColStd_Array1OfReal & | PoleWeights | ||
) |
Creates a rational Bezier curve with the set of poles CurvePoles and the set of weights PoleWeights . If all the weights are identical the curve is considered as non rational. Raises ConstructionError if the number of poles is greater than MaxDegree + 1 or lower than 2 or CurvePoles and CurveWeights have not the same length or one weight value is lower or equal to Resolution from package gp.
|
overridevirtual |
a Bezier curve is CN
Implements Geom_Curve.
|
overridevirtual |
Creates a new object which is a copy of this Bezier curve.
Implements Geom_Geometry.
|
overridevirtual |
Returns in P the point of parameter U. If the curve is periodic then the returned point is P(U) with U = Ustart + (U - Uend) where Ustart and Uend are the parametric bounds of the curve.
Raised only for the "OffsetCurve" if it is not possible to compute the current point. For example when the first derivative on the basis curve and the offset direction are parallel.
Implements Geom_Curve.
|
overridevirtual |
Returns the point P of parameter U and the first derivative V1. Raised if the continuity of the curve is not C1.
Implements Geom_Curve.
|
overridevirtual |
Returns the point P of parameter U, the first and second derivatives V1 and V2. Raised if the continuity of the curve is not C2.
Implements Geom_Curve.
|
overridevirtual |
For this Bezier curve, computes.
Implements Geom_Curve.
Standard_Integer Geom_BezierCurve::Degree | ( | ) | const |
Returns the polynomial degree of the curve. it is the number of poles - 1 point P and derivatives (V1, V2, V3) computation The Bezier Curve has a Polynomial representation so the parameter U can be out of the bounds of the curve.
|
overridevirtual |
For the point of parameter U of this Bezier curve, computes the vector corresponding to the Nth derivative. Note: the parameter U can be outside the bounds of the curve. Exceptions Standard_RangeError if N is less than 1.
Implements Geom_Curve.
|
overridevirtual |
Returns Value (U=1.), it is the last control point of the Bezier curve.
Implements Geom_BoundedCurve.
|
overridevirtual |
Returns the value of the first parameter of this Bezier curve. This is 0.0, which gives the start point of this Bezier curve.
Implements Geom_Curve.
void Geom_BezierCurve::Increase | ( | const Standard_Integer | Degree | ) |
Increases the degree of a bezier curve. Degree is the new degree of <me>. Raises ConstructionError if Degree is greater than MaxDegree or lower than 2 or lower than the initial degree of <me>.
void Geom_BezierCurve::InsertPoleAfter | ( | const Standard_Integer | Index, |
const gp_Pnt & | P | ||
) |
Inserts a pole P after the pole of range Index. If the curve <me> is rational the weight value for the new pole of range Index is 1.0. raised if Index is not in the range [1, NbPoles].
raised if the resulting number of poles is greater than MaxDegree + 1.
void Geom_BezierCurve::InsertPoleAfter | ( | const Standard_Integer | Index, |
const gp_Pnt & | P, | ||
const Standard_Real | Weight | ||
) |
Inserts a pole with its weight in the set of poles after the pole of range Index. If the curve was non rational it can become rational if all the weights are not identical. Raised if Index is not in the range [1, NbPoles].
Raised if the resulting number of poles is greater than MaxDegree + 1. Raised if Weight is lower or equal to Resolution from package gp.
void Geom_BezierCurve::InsertPoleBefore | ( | const Standard_Integer | Index, |
const gp_Pnt & | P | ||
) |
Inserts a pole P before the pole of range Index. If the curve <me> is rational the weight value for the new pole of range Index is 1.0. Raised if Index is not in the range [1, NbPoles].
Raised if the resulting number of poles is greater than MaxDegree + 1.
void Geom_BezierCurve::InsertPoleBefore | ( | const Standard_Integer | Index, |
const gp_Pnt & | P, | ||
const Standard_Real | Weight | ||
) |
Inserts a pole with its weight in the set of poles after the pole of range Index. If the curve was non rational it can become rational if all the weights are not identical. Raised if Index is not in the range [1, NbPoles].
Raised if the resulting number of poles is greater than MaxDegree + 1. Raised if Weight is lower or equal to Resolution from package gp.
|
overridevirtual |
Returns True if the distance between the first point and the last point of the curve is lower or equal to the Resolution from package gp.
Implements Geom_Curve.
|
overridevirtual |
Continuity of the curve, returns True.
Implements Geom_Curve.
|
overridevirtual |
Returns True if the parametrization of a curve is periodic. (P(u) = P(u + T) T = constante)
Implements Geom_Curve.
Standard_Boolean Geom_BezierCurve::IsRational | ( | ) | const |
Returns false if all the weights are identical. The tolerance criterion is Resolution from package gp.
|
overridevirtual |
Returns the value of the last parameter of this Bezier curve. This is 1.0, which gives the end point of this Bezier curve.
Implements Geom_Curve.
|
static |
Returns the value of the maximum polynomial degree of any Geom_BezierCurve curve. This value is 25.
Standard_Integer Geom_BezierCurve::NbPoles | ( | ) | const |
Returns the number of poles of this Bezier curve.
const gp_Pnt& Geom_BezierCurve::Pole | ( | const Standard_Integer | Index | ) | const |
Returns the pole of range Index. Raised if Index is not in the range [1, NbPoles].
void Geom_BezierCurve::Poles | ( | TColgp_Array1OfPnt & | P | ) | const |
Returns all the poles of the curve.
Raised if the length of P is not equal to the number of poles.
const TColgp_Array1OfPnt& Geom_BezierCurve::Poles | ( | ) | const |
Returns all the poles of the curve.
void Geom_BezierCurve::RemovePole | ( | const Standard_Integer | Index | ) |
Removes the pole of range Index. If the curve was rational it can become non rational. Raised if Index is not in the range [1, NbPoles] Raised if Degree is lower than 2.
void Geom_BezierCurve::Resolution | ( | const Standard_Real | Tolerance3D, |
Standard_Real & | UTolerance | ||
) |
Computes for this Bezier curve the parametric tolerance UTolerance for a given 3D tolerance Tolerance3D. If f(t) is the equation of this Bezier curve, UTolerance ensures that: |t1-t0| < UTolerance ===> |f(t1)-f(t0)| < Tolerance3D.
|
overridevirtual |
Reverses the direction of parametrization of <me> Value (NewU) = Value (1 - OldU)
Implements Geom_Curve.
|
overridevirtual |
Returns the parameter on the reversed curve for the point of parameter U on <me>.
returns 1-U
Implements Geom_Curve.
void Geom_BezierCurve::Segment | ( | const Standard_Real | U1, |
const Standard_Real | U2 | ||
) |
Segments the curve between U1 and U2 which can be out of the bounds of the curve. The curve is oriented from U1 to U2. The control points are modified, the first and the last point are not the same but the parametrization range is [0, 1] else it could not be a Bezier curve. Warnings : Even if <me> is not closed it can become closed after the segmentation for example if U1 or U2 are out of the bounds of the curve <me> or if the curve makes loop. After the segmentation the length of a curve can be null.
void Geom_BezierCurve::SetPole | ( | const Standard_Integer | Index, |
const gp_Pnt & | P | ||
) |
Substitutes the pole of range index with P. If the curve <me> is rational the weight of range Index is not modified. raiseD if Index is not in the range [1, NbPoles].
void Geom_BezierCurve::SetPole | ( | const Standard_Integer | Index, |
const gp_Pnt & | P, | ||
const Standard_Real | Weight | ||
) |
Substitutes the pole and the weights of range Index. If the curve <me> is not rational it can become rational if all the weights are not identical. If the curve was rational it can become non rational if all the weights are identical. Raised if Index is not in the range [1, NbPoles] Raised if Weight <= Resolution from package gp.
void Geom_BezierCurve::SetWeight | ( | const Standard_Integer | Index, |
const Standard_Real | Weight | ||
) |
Changes the weight of the pole of range Index. If the curve <me> is not rational it can become rational if all the weights are not identical. If the curve was rational it can become non rational if all the weights are identical. Raised if Index is not in the range [1, NbPoles] Raised if Weight <= Resolution from package gp.
|
overridevirtual |
Returns Value (U=0.), it is the first control point of the curve.
Implements Geom_BoundedCurve.
|
overridevirtual |
Applies the transformation T to this Bezier curve.
Implements Geom_Geometry.
Standard_Real Geom_BezierCurve::Weight | ( | const Standard_Integer | Index | ) | const |
Returns the weight of range Index. Raised if Index is not in the range [1, NbPoles].
void Geom_BezierCurve::Weights | ( | TColStd_Array1OfReal & | W | ) | const |
Returns all the weights of the curve.
Raised if the length of W is not equal to the number of poles.
|
inline |
Returns all the weights of the curve.