Open CASCADE Technology
6.9.1

This class implements the basis services for an offset curve in 3D space. The Offset curve in this package can be a self intersecting curve even if the basis curve does not selfintersect. The self intersecting portions are not deleted at the construction time. An offset curve is a curve at constant distance (Offset) from a basis curve in a reference direction V. The offset curve takes its parametrization from the basis curve. The Offset curve is in the direction of the normal N defined with the cross product T^V, where the vector T is given by the first derivative on the basis curve with non zero length. The distance offset may be positive or negative to indicate the preferred side of the curve : . distance offset >0 => the curve is in the direction of N . distance offset <0 => the curve is in the direction of  N. More...
#include <Geom_OffsetCurve.hxx>
Public Member Functions  
Geom_OffsetCurve (const Handle< Geom_Curve > &C, const Standard_Real Offset, const gp_Dir &V, const Standard_Boolean isNotCheckC0=Standard_False)  
C is the basis curve, Offset is the distance between <me> and the basis curve at any point. V defines the fixed reference direction (offset direction). If P is a point on the basis curve and T the first derivative with non zero length at this point, the corresponding point on the offset curve is in the direction of the vectorproduct N = V ^ T where N is a unitary vector. If isNotCheckC0 = TRUE checking if basis curve has C0continuity is not made. Warnings : In this package the entities are not shared. The OffsetCurve is built with a copy of the curve C. So when C is modified the OffsetCurve is not modified. More...  
void  Reverse () 
Changes the orientation of this offset curve. As a result: More...  
Standard_Real  ReversedParameter (const Standard_Real U) const 
Computes the parameter on the reversed curve for the point of parameter U on this offset curve. More...  
void  SetBasisCurve (const Handle< Geom_Curve > &C, const Standard_Boolean isNotCheckC0=Standard_False) 
Changes this offset curve by assigning C as the basis curve from which it is built. If isNotCheckC0 = TRUE checking if basis curve has C0continuity is not made. Exceptions Standard_ConstructionError if the curve C is not at least "C1" continuous. More...  
void  SetDirection (const gp_Dir &V) 
Changes this offset curve by assigning V as the reference vector used to compute the offset direction. More...  
void  SetOffsetValue (const Standard_Real D) 
Changes this offset curve by assigning D as the offset value. More...  
Handle< Geom_Curve >  BasisCurve () const 
Returns the basis curve of this offset curve. Note: The basis curve can be an offset curve. More...  
GeomAbs_Shape  Continuity () const 
Returns the global continuity of this offset curve as a value of the GeomAbs_Shape enumeration. The degree of continuity of this offset curve is equal to the degree of continuity of the basis curve minus 1. Continuity of the Offset curve : C0 : only geometric continuity, C1 : continuity of the first derivative all along the Curve, C2 : continuity of the second derivative all along the Curve, C3 : continuity of the third derivative all along the Curve, G1 : tangency continuity all along the Curve, G2 : curvature continuity all along the Curve, CN : the order of continuity is infinite. Warnings : Returns the continuity of the basis curve  1. The offset curve must have a unique offset direction defined at any point. More...  
const gp_Dir &  Direction () const 
Returns the reference vector of this offset curve. Value and derivatives Warnings : The exception UndefinedValue or UndefinedDerivative is raised if it is not possible to compute a unique offset direction. If T is the first derivative with not null length and V the offset direction the relation T(U) ^ V != 0 must be satisfied to evaluate the offset curve. No check is done at the creation time and we suppose in this package that the offset curve is well defined. More...  
void  D0 (const Standard_Real U, gp_Pnt &P) const 
Warning! this should not be called if the basis curve is not at least C1. Nevertheless if used on portion where the curve is C1, it is OK. More...  
void  D1 (const Standard_Real U, gp_Pnt &P, gp_Vec &V1) const 
Warning! this should not be called if the continuity of the basis curve is not C2. Nevertheless, it's OK to use it on portion where the curve is C2. More...  
void  D2 (const Standard_Real U, gp_Pnt &P, gp_Vec &V1, gp_Vec &V2) const 
Warning! this should not be called if the continuity of the basis curve is not C3. Nevertheless, it's OK to use it on portion where the curve is C3. More...  
void  D3 (const Standard_Real U, gp_Pnt &P, gp_Vec &V1, gp_Vec &V2, gp_Vec &V3) const 
Returns the point P of parameter U, the first, the second and the third derivative. Raised if the continuity of the curve is not C3. More...  
gp_Vec  DN (const Standard_Real U, const Standard_Integer N) const 
The returned vector gives the value of the derivative for the order of derivation N. More...  
void  Value (const Standard_Real U, gp_Pnt &P, gp_Pnt &Pbasis, gp_Vec &V1basis) const 
Warning! this should not be called if the basis curve is not at least C1. Nevertheless if used on portion where the curve is C1, it is OK. More...  
void  D0 (const Standard_Real U, gp_Pnt &P, gp_Pnt &Pbasis, gp_Vec &V1basis) const 
Warning! this should not be called if the continuity of the basis curve is not C1. Nevertheless, it's OK to use it on portion where the curve is C1. More...  
void  D1 (const Standard_Real U, gp_Pnt &P, gp_Pnt &Pbasis, gp_Vec &V1, gp_Vec &V1basis, gp_Vec &V2basis) const 
Warning! this should not be called if the continuity of the basis curve is not C1. Nevertheless, it's OK to use it on portion where the curve is C1. More...  
void  D2 (const Standard_Real U, gp_Pnt &P, gp_Pnt &Pbasis, gp_Vec &V1, gp_Vec &V2, gp_Vec &V1basis, gp_Vec &V2basis, gp_Vec &V3basis) const 
Warning! this should not be called if the continuity of the basis curve is not C3. Nevertheless, it's OK to use it on portion where the curve is C3. More...  
Standard_Real  FirstParameter () const 
Returns the value of the first parameter. Warnings : It can be RealFirst from package Standard if the curve is infinite. More...  
Standard_Real  LastParameter () const 
Returns the value of the first or last parameter of this offset curve. The first parameter corresponds to the start point of the curve. The last parameter corresponds to the end point. Note: the first and last parameters of this offset curve are also the ones of its basis curve. More...  
Standard_Real  Offset () const 
Returns the offset value of this offset curve. More...  
Standard_Boolean  IsClosed () const 
Returns True if the distance between the start point and the end point of the curve is lower or equal to Resolution from package gp. More...  
Standard_Boolean  IsCN (const Standard_Integer N) const 
Returns true if the degree of continuity of the basis curve of this offset curve is at least N + 1. This method answer True if the continuity of the basis curve is N + 1. We suppose in this class that a normal direction to the basis curve (used to compute the offset curve) is defined at any point on the basis curve. Raised if N < 0. More...  
Standard_Boolean  IsPeriodic () const 
Returns true if this offset curve is periodic, i.e. if the basis curve of this offset curve is periodic. More...  
virtual Standard_Real  Period () const 
Returns the period of this offset curve, i.e. the period of the basis curve of this offset curve. Exceptions Standard_NoSuchObject if the basis curve is not periodic. More...  
void  Transform (const gp_Trsf &T) 
Applies the transformation T to this offset curve. Note: the basis curve is also modified. More...  
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>. me>Transformed(T)>Value(me>TransformedParameter(U,T)) is the same point as me>Value(U).Transformed(T) This methods calls the basis curve method. 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_Geometry >  Copy () const 
Creates a new object which is a copy of this offset curve. More...  
GeomAbs_Shape  GetBasisCurveContinuity () const 
Returns continuity of the basis curve. More...  
Public Member Functions inherited from Geom_Curve  
Handle< Geom_Curve >  Reversed () const 
Returns a copy of <me> reversed. 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 MMgt_TShared  
virtual void  Delete () const 
Memory deallocator for transient classes. More...  
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 const Handle_Standard_Type &  DynamicType () const 
Returns a type information object about this object. More...  
Standard_Boolean  IsInstance (const 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 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...  
virtual Handle_Standard_Transient  This () const 
Returns a Handle which references this object. Must never be called to objects created in stack. More...  
Standard_Integer  GetRefCount () const 
Get the reference counter of this object. More...  
This class implements the basis services for an offset curve in 3D space. The Offset curve in this package can be a self intersecting curve even if the basis curve does not selfintersect. The self intersecting portions are not deleted at the construction time. An offset curve is a curve at constant distance (Offset) from a basis curve in a reference direction V. The offset curve takes its parametrization from the basis curve. The Offset curve is in the direction of the normal N defined with the cross product T^V, where the vector T is given by the first derivative on the basis curve with non zero length. The distance offset may be positive or negative to indicate the preferred side of the curve : . distance offset >0 => the curve is in the direction of N . distance offset <0 => the curve is in the direction of  N.
On the Offset curve : Value (U) = BasisCurve.Value(U) + (Offset * (T ^ V)) / T ^ V
At any point the Offset direction V must not be parallel to the vector T and the vector T must not have null length else the offset curve is not defined. So the offset curve has not the same continuity as the basis curve.
Warnings :
In this package we suppose that the continuity of the offset curve is one degree less than the continuity of the basis curve and we don't check that at any point T^V != 0.0
So to evaluate the curve it is better to check that the offset curve is well defined at any point because an exception could be raised. The check is not done in this package at the creation of the offset curve because the control needs the use of an algorithm which cannot be implemented in this package.
The OffsetCurve is closed if the first point and the last point are the same (The distance between these two points is lower or equal to the Resolution sea package gp) . The OffsetCurve can be closed even if the basis curve is not closed.
Geom_OffsetCurve::Geom_OffsetCurve  (  const Handle< Geom_Curve > &  C, 
const Standard_Real  Offset,  
const gp_Dir &  V,  
const Standard_Boolean  isNotCheckC0 = Standard_False 

) 
C is the basis curve, Offset is the distance between <me> and the basis curve at any point. V defines the fixed reference direction (offset direction). If P is a point on the basis curve and T the first derivative with non zero length at this point, the corresponding point on the offset curve is in the direction of the vectorproduct N = V ^ T where N is a unitary vector. If isNotCheckC0 = TRUE checking if basis curve has C0continuity is not made. Warnings : In this package the entities are not shared. The OffsetCurve is built with a copy of the curve C. So when C is modified the OffsetCurve is not modified.
Raised if the basis curve C is not at least C1. Warnings : No check is done to know if V^T != 0.0 at any point.
Handle< Geom_Curve > Geom_OffsetCurve::BasisCurve  (  )  const 
Returns the basis curve of this offset curve. Note: The basis curve can be an offset curve.

virtual 
Returns the global continuity of this offset curve as a value of the GeomAbs_Shape enumeration. The degree of continuity of this offset curve is equal to the degree of continuity of the basis curve minus 1. Continuity of the Offset curve : C0 : only geometric continuity, C1 : continuity of the first derivative all along the Curve, C2 : continuity of the second derivative all along the Curve, C3 : continuity of the third derivative all along the Curve, G1 : tangency continuity all along the Curve, G2 : curvature continuity all along the Curve, CN : the order of continuity is infinite. Warnings : Returns the continuity of the basis curve  1. The offset curve must have a unique offset direction defined at any point.
Implements Geom_Curve.

virtual 
Creates a new object which is a copy of this offset curve.
Implements Geom_Geometry.

virtual 
Warning! this should not be called if the basis curve is not at least C1. Nevertheless if used on portion where the curve is C1, it is OK.
Implements Geom_Curve.
void Geom_OffsetCurve::D0  (  const Standard_Real  U, 
gp_Pnt &  P,  
gp_Pnt &  Pbasis,  
gp_Vec &  V1basis  
)  const 
Warning! this should not be called if the continuity of the basis curve is not C1. Nevertheless, it's OK to use it on portion where the curve is C1.

virtual 
Warning! this should not be called if the continuity of the basis curve is not C2. Nevertheless, it's OK to use it on portion where the curve is C2.
Implements Geom_Curve.
void Geom_OffsetCurve::D1  (  const Standard_Real  U, 
gp_Pnt &  P,  
gp_Pnt &  Pbasis,  
gp_Vec &  V1,  
gp_Vec &  V1basis,  
gp_Vec &  V2basis  
)  const 
Warning! this should not be called if the continuity of the basis curve is not C1. Nevertheless, it's OK to use it on portion where the curve is C1.

virtual 
Warning! this should not be called if the continuity of the basis curve is not C3. Nevertheless, it's OK to use it on portion where the curve is C3.
Implements Geom_Curve.
void Geom_OffsetCurve::D2  (  const Standard_Real  U, 
gp_Pnt &  P,  
gp_Pnt &  Pbasis,  
gp_Vec &  V1,  
gp_Vec &  V2,  
gp_Vec &  V1basis,  
gp_Vec &  V2basis,  
gp_Vec &  V3basis  
)  const 
Warning! this should not be called if the continuity of the basis curve is not C3. Nevertheless, it's OK to use it on portion where the curve is C3.

virtual 
Returns the point P of parameter U, the first, the second and the third derivative. Raised if the continuity of the curve is not C3.
Implements Geom_Curve.
const gp_Dir& Geom_OffsetCurve::Direction  (  )  const 
Returns the reference vector of this offset curve. Value and derivatives Warnings : The exception UndefinedValue or UndefinedDerivative is raised if it is not possible to compute a unique offset direction. If T is the first derivative with not null length and V the offset direction the relation T(U) ^ V != 0 must be satisfied to evaluate the offset curve. No check is done at the creation time and we suppose in this package that the offset curve is well defined.

virtual 
The returned vector gives the value of the derivative for the order of derivation N.
The following functions compute the value and derivatives on the offset curve and returns the derivatives on the basis curve too. The computation of the value and derivatives on the basis curve are used to evaluate the offset curve
Warning: The exception UndefinedValue or UndefinedDerivative is raised if it is not possible to compute a unique offset direction. Raised if N < 1.
Implements Geom_Curve.

virtual 
Returns the value of the first parameter. Warnings : It can be RealFirst from package Standard if the curve is infinite.
Implements Geom_Curve.
GeomAbs_Shape Geom_OffsetCurve::GetBasisCurveContinuity  (  )  const 
Returns continuity of the basis curve.

virtual 
Returns True if the distance between the start point and the end point of the curve is lower or equal to Resolution from package gp.
Implements Geom_Curve.

virtual 
Returns true if the degree of continuity of the basis curve of this offset curve is at least N + 1. This method answer True if the continuity of the basis curve is N + 1. We suppose in this class that a normal direction to the basis curve (used to compute the offset curve) is defined at any point on the basis curve. Raised if N < 0.
Implements Geom_Curve.

virtual 
Returns true if this offset curve is periodic, i.e. if the basis curve of this offset curve is periodic.
Implements Geom_Curve.

virtual 
Returns the value of the first or last parameter of this offset curve. The first parameter corresponds to the start point of the curve. The last parameter corresponds to the end point. Note: the first and last parameters of this offset curve are also the ones of its basis curve.
Implements Geom_Curve.
Standard_Real Geom_OffsetCurve::Offset  (  )  const 
Returns the offset value of this offset curve.

virtual 
Returns a coefficient to compute the parameter on the transformed curve for the transform of the point on <me>.
Transformed(T)>Value(U * ParametricTransformation(T)) is the same point as Value(U).Transformed(T) This methods calls the basis curve method.
Reimplemented from Geom_Curve.

virtual 
Returns the period of this offset curve, i.e. the period of the basis curve of this offset curve. Exceptions Standard_NoSuchObject if the basis curve is not periodic.
Reimplemented from Geom_Curve.

virtual 
Changes the orientation of this offset curve. As a result:
Implements Geom_Curve.

virtual 
Computes the parameter on the reversed curve for the point of parameter U on this offset curve.
Implements Geom_Curve.
void Geom_OffsetCurve::SetBasisCurve  (  const Handle< Geom_Curve > &  C, 
const Standard_Boolean  isNotCheckC0 = Standard_False 

) 
Changes this offset curve by assigning C as the basis curve from which it is built. If isNotCheckC0 = TRUE checking if basis curve has C0continuity is not made. Exceptions Standard_ConstructionError if the curve C is not at least "C1" continuous.
void Geom_OffsetCurve::SetDirection  (  const gp_Dir &  V  ) 
Changes this offset curve by assigning V as the reference vector used to compute the offset direction.
void Geom_OffsetCurve::SetOffsetValue  (  const Standard_Real  D  ) 
Changes this offset curve by assigning D as the offset value.

virtual 
Applies the transformation T to this offset curve. Note: the basis curve is also modified.
Implements Geom_Geometry.

virtual 
Returns the parameter on the transformed curve for the transform of the point of parameter U on <me>. me>Transformed(T)>Value(me>TransformedParameter(U,T)) is the same point as me>Value(U).Transformed(T) This methods calls the basis curve method.
Reimplemented from Geom_Curve.
void Geom_OffsetCurve::Value  (  const Standard_Real  U, 
gp_Pnt &  P,  
gp_Pnt &  Pbasis,  
gp_Vec &  V1basis  
)  const 
Warning! this should not be called if the basis curve is not at least C1. Nevertheless if used on portion where the curve is C1, it is OK.