C3D Toolkit  Kernel - 109696, Vision - 2.4.0.76

Composite Hermite cubic spline in two-dimensional space. More...

#include <cur_hermit.h>

+ Inheritance diagram for MbHermit:
+ Collaboration diagram for MbHermit:

Public Member Functions

void LocalCoordinate (double &t, ptrdiff_t &index1, ptrdiff_t &index2, double &param1, double &param2, double &paramD, double &paramW, double &quota1, double &quota2) const
 Definition of local coordinates in a surface region.
 
Common functions of geometric object.
virtual MbePlaneType IsA () const
 Get the object type.
 
virtual bool SetEqual (const MbPlaneItem &)
 Make the objects equal. More...
 
virtual void Transform (const MbMatrix &matr, MbRegTransform *ireg=NULL, const MbSurface *newSurface=NULL)
 Transform according to the matrix. More...
 
virtual void Move (const MbVector &to, MbRegTransform *=NULL, const MbSurface *newSurface=NULL)
 Translate along a vector. More...
 
virtual void Rotate (const MbCartPoint &pnt, const MbDirection &angle, MbRegTransform *=NULL, const MbSurface *newSurface=NULL)
 Rotate about a point. More...
 
virtual bool IsSame (const MbPlaneItem &other, double accuracy=LENGTH_EPSILON) const
 Determine whether objects are equal. More...
 
virtual MbPlaneItemDuplicate (MbRegDuplicate *=NULL) const
 Create a copy. More...
 
Common functions of curve
virtual MbeState DeletePart (double t1, double t2, MbCurve *&part2)
 Delete the piece of a curve. More...
 
virtual MbeState TrimmPart (double t1, double t2, MbCurve *&part2)
 Keep the piece of a curve. More...
 
virtual MbCurveTrimmed (double t1, double t2, int sense) const
 Construct a trimmed curve. More...
 
virtual MbNurbsNurbsCurve (const MbCurveIntoNurbsInfo &) const
 Construct a NURBS copy of a curve. More...
 
virtual MbCurveNurbsCurve (const MbNurbsParameters &) const
 Construct a NURBS copy of a curve. More...
 
virtual MbContourNurbsContour () const
 Approximate of a curve by the contour from NURBS curves.
 
virtual double GetTMin () const
 Get the minimum value of parameter.
 
virtual double GetTMax () const
 Get the maximum value of parameter.
 
virtual void PointOn (double &t, MbCartPoint &p) const
 Calculate a point on the curve. More...
 
virtual void FirstDer (double &t, MbVector &fd) const
 Calculate first derivative.
 
virtual void SecondDer (double &t, MbVector &sd) const
 Calculate second derivative.
 
virtual void ThirdDer (double &t, MbVector &td) const
 Calculate third derivative.
 
virtual void _PointOn (double t, MbCartPoint &p) const
 Calculate point at curve and its extension. More...
 
virtual void Explore (double &t, bool ext, MbCartPoint &pnt, MbVector &fir, MbVector *sec, MbVector *thir) const
 Calculate point and derivatives of object for given parameter. More...
 
virtual void Inverse (MbRegTransform *iReg=NULL)
 Set the opposite direction of curve.
 
virtual double Step (double t, double sag) const
 Calculate parameter step. More...
 
virtual double DeviationStep (double t, double angle) const
 Calculate parameter step. More...
 
virtual double PointProjection (const MbCartPoint &pnt) const
 Find the point projection to the curve.
 
virtual bool NearPointProjection (const MbCartPoint &pnt, double xEpsilon, double yEpsilon, double &t, bool ext, MbRect1D *tRange=NULL) const
 Find the point projection to the curve. More...
 
virtual double CalculateMetricLength () const
 Calculate the metric length of a curve.
 
virtual bool GetWeightCentre (MbCartPoint &wc) const
 Calculate the center of gravity of a curve.
 
virtual void CalculateGabarit (MbRect &r) const
 Detect the bounding box of a curve. More...
 
virtual bool DistanceAlong (double &t, double len, int curveDir, double eps=Math::LengthEps, VERSION version=Math::DefaultMathVersion()) const
 Translate parameter along the curve. More...
 
virtual void GetCurvatureContinuityBounds (std::vector< double > &params) const
 Get the boundaries of the sections of the curve on which the continuity of curvature is preserved.
 
virtual bool IsStraight () const
 Define whether the curve is rectilinear..
 
virtual size_t GetCount () const
 Define the number of splittings for one passage in operations.
 
virtual ptrdiff_t GetNearPointIndex (const MbCartPoint &pnt) const
 Get index of the point nearest to the given one.
 
virtual void Rebuild ()
 Rebuild curve.
 
virtual void SetClosed (bool cls)
 Set attribute of closedness.
 
virtual void AddPoint (const MbCartPoint &pnt)
 Add point to the end of the array of control points.
 
virtual void InsertPoint (ptrdiff_t index, const MbCartPoint &pnt)
 Insert a point to the array of control points. More...
 
virtual void InsertPoint (double t, const MbCartPoint &pnt, double xEps, double yEps)
 Insert a point to the array of control points. More...
 
virtual void InsertPoint (double t, const MbCartPoint &pnt, const MbVector &v, double xEps, double yEps)
 Insert a point to the array of control points. More...
 
virtual void SetCurveValue (double t, const MbCartPoint &pnt, double tDelta, const MbVector &v, double xEps, double yEps)
 
virtual void ChangePoint (ptrdiff_t index, const MbCartPoint &pnt)
 Replace a point. More...
 
virtual void RemovePoint (ptrdiff_t index)
 Remove control point with given index.
 
void GetVector (ptrdiff_t index, MbVector &vec) const
 
MbCartPointSetPoint (ptrdiff_t index)
 
MbVectorSetVector (ptrdiff_t index)
 
bool SetTangentVectors (const SArray< MbVector > &tauVectors)
 
virtual size_t GetPointsCount () const
 Get count of control points.
 
virtual size_t GetParamsCount () const
 Get count of parameters.
 
virtual bool CheckParam (double &t, ptrdiff_t &i0, ptrdiff_t &i1, double &t0, double &t1) const
 Drive a parameter into the curve domain. More...
 
virtual double GetParam (ptrdiff_t index) const
 Get parameter corresponding to the point with specified index.
 
virtual MbCurveCicleCopy (double t1, double t2) const
 
virtual void GetRuleInterval (ptrdiff_t index, double &t1, double &t2) const
 Get the range of influence of point of the curve. More...
 
virtual void SetBegEndDerivesEqual ()
 Set equal derivatives at the ends.
 
virtual void ClosedBreak ()
 Make curve open, keeping coincidence of the beginning and the end.
 
bool SetLimitParam (double newTMin, double newTMax)
 
void CalculateDerivatives ()
 
void SetLimitVector (int n, const MbVector &v)
 
MbHermitCurvesCombine (double t0, double w0, bool add, const MbHermit &init, double t1, double w1, double koef, bool checkClosed) const
 Create a curve by joining a part of this curve with a part of "init" curve.
 
size_t GetVectorListCount () const
 
void GetVectorList (SArray< MbVector > &vectors) const
 
const MbVector_GetVectorList (size_t i) const
 
MbVector_SetVectorList (size_t i)
 
size_t GetTListCount () const
 
virtual void GetTList (SArray< double > &params) const
 
double _GetTList (size_t i) const
 
bool AddPoints (SArray< double > &params, SArray< MbCartPoint > &points)
 
bool InsertPoints (SArray< double > &params, SArray< MbCartPoint > &points)
 
bool DerivativesCorrection (double accuracy)
 
ptrdiff_t GetIndex (double t) const
 Determination of the maximum index of parameter array on the left.
 
virtual void GetProperties (MbProperties &properties)
 Get properties of the object.
 
virtual void SetProperties (const MbProperties &properties)
 Set properties of the object.
 
- Public Member Functions inherited from MbPolyCurve
virtual ~MbPolyCurve ()
 Destructor.
 
virtual MbePlaneType Type () const
 Get the group type of the object.
 
virtual void AddYourGabaritTo (MbRect &r) const
 Extend the given bounding rectangle so that it encloses this object.
 
virtual void Refresh ()
 Set all temporary (mutable) data of object to undefined (initial) state.
 
virtual void PrepareIntegralData (const bool forced) const
 Calculate temporary (mutable) data of an object. More...
 
virtual bool IsClosed () const
 Define whether the curve is closed. More...
 
virtual bool HasLength (double &length) const
 Calculate the metric length of a curve. More...
 
virtual MbeState Deformation (const MbRect &, const MbMatrix &)
 Deform the curve. More...
 
virtual bool IsInRectForDeform (const MbRect &r) const
 Determine visibility of a curve in rectangle.
 
virtual double GetMetricLength () const
 Calculate the metric length of a curve. More...
 
virtual double GetLengthEvaluation () const
 Calculate the metric length of a curve. More...
 
virtual bool GetSpecificPoint (const MbCartPoint &from, double &dmax, MbCartPoint &pnt) const
 Return a specific point of a curve. More...
 
virtual void GetBasisPoints (MbControlData &) const
 Get the basis points of the curve.
 
virtual void SetBasisPoints (const MbControlData &)
 Change the object by control points.
 
virtual void GetPoint (ptrdiff_t index, MbCartPoint &pnt) const
 Get control point. More...
 
virtual void RemovePoints ()
 Remove all points.
 
virtual bool ChangePointsValue (const SArray< MbCartPoint > &pntList)
 Change control points. More...
 
virtual void AddAfter (const MbCartPoint &pnt, ptrdiff_t index)
 Insert a point to the array of control points. More...
 
virtual void ChangePole (ptrdiff_t index, const MbCartPoint &pnt)
 Replace a pole. More...
 
size_t GetPointListCount () const
 Get count of control points.
 
ptrdiff_t GetPointListMaxIndex () const
 Get maximal index of array of control points.
 
template<class Points >
void GetPoints (Points &pnts) const
 Get array of control points.
 
void GetPointList (SArray< MbCartPoint > &pnts) const
 Get array of control points.
 
bool ReplacePoints (const SArray< MbCartPoint > &pnts)
 Replace the set of control points.
 
bool ReplacePoints (const std::vector< MbCartPoint > &pnts)
 Replace the set of control points.
 
const MbCartPointGetPointList (size_t i) const
 Get control point with the given index.
 
MbCartPointSetPointList (size_t i)
 Get control point with the given index.
 
ptrdiff_t GetUppIndex () const
 Get the maximal index of array of control points.
 
size_t GetSegmentsCount () const
 Get count of ranges.
 
bool NurbsParam (double epsilon, double &pmin, double &pmax, ptrdiff_t &i1, double &t1, ptrdiff_t &i2, double &t2) const
 Get information for NurbsCurve function. More...
 
- Public Member Functions inherited from MbCurve
virtual ~MbCurve ()
 Destructor.
 
virtual MbePlaneType Family () const
 Get family of object.
 
size_t size () const
 Number of objects if object is interpreted as vector of objects.
 
const MbCurveoperator[] (size_t) const
 An access operator.
 
virtual void AddYourGabaritMtr (MbRect &rect, const MbMatrix &matr) const
 Add a bounding box to rectangle. More...
 
virtual void CalculateLocalGabarit (const MbMatrix &into, MbRect &local) const
 Calculate bounding box in the local coordinate system. More...
 
virtual bool IsVisibleInRect (const MbRect &rect, bool exact=false) const
 Determine visibility of an object in rectangle. More...
 
virtual bool IsCompleteInRect (const MbRect &rect) const
 Determine whether an object is fully visible in rectangle. More...
 
virtual double DistanceToPoint (const MbCartPoint &toP) const
 Calculate the distance to a point.
 
virtual bool DistanceToPointIfLess (const MbCartPoint &toP, double &d) const
 Calculate the distance to a point. More...
 
virtual double GetPeriod () const
 Return period. More...
 
virtual bool IsPeriodic () const
 Define whether the curve is periodic.
 
bool IsTouch (double eps=Math::LengthEps) const
 Determine whether a curve is closed regardless of the smoothness of the closure. More...
 
void Tangent (double &t, MbVector &v) const
 Calculate tangent vector (normalized).
 
void Tangent (double &t, MbDirection &d) const
 Calculate tangent vector (normalized).
 
void Normal (double &t, MbVector &v) const
 Calculate main normal vector (normalized).
 
void Normal (double &t, MbDirection &d) const
 Calculate main normal vector (normalized).
 
virtual void _FirstDer (double t, MbVector &v) const
 Calculate first derivative at curve and its extension.
 
virtual void _SecondDer (double t, MbVector &v) const
 Calculate second derivative at curve and its extension.
 
virtual void _ThirdDer (double t, MbVector &v) const
 Calculate third derivative at curve and its extension.
 
void _Tangent (double t, MbVector &v) const
 Calculate tangent vector (normalized).
 
void _Tangent (double t, MbDirection &d) const
 Calculate tangent vector (normalized).
 
void _Normal (double t, MbVector &v) const
 Calculate main normal vector (normalized) at curve and its extension.
 
void _Normal (double t, MbDirection &d) const
 Calculate main normal vector (normalized) at curve and its extension.
 
virtual double Curvature (double t) const
 Calculate curvature of curve.
 
double CurvatureDerive (double t) const
 Calculate derivative of curvature by parameter.
 
double CurvatureRadius (double t) const
 Calculate radius of curve with a sign.
 
virtual bool IsBounded () const
 Define whether the curve is bounded.
 
virtual bool IsDegenerate (double eps=Math::LengthEps) const
 Define whether the curve is degenerate..
 
virtual bool IsSmoothConnected (double angleEps) const
 Define whether joints of contour/curve are smooth.
 
double GetParamLength () const
 Calculate the parametric length of a curve.
 
virtual double CalculateLength (double t1, double t2) const
 Calculate the metric length of a curve. More...
 
virtual void ResetTCalc () const
 Reset the current value of parameter.
 
virtual MbCurveOffset (double rad) const
 Construct the equidistant curve which is shifted by the given value.
 
virtual bool BeginApprox (double sag, double &tbeg, double &tend, MbCartPoint &pnt, bool &existNextPoint) const
 Start approximation for the drawing. More...
 
virtual bool GetNextPoint (double sag, double tend, double &tcur, MbCartPoint &pnt) const
 Calculate the next point. More...
 
virtual void CalculatePolygon (double sag, MbPolygon &poligon) const
 Calculate an array of points for drawing. More...
 
MbNurbsNurbsCurve (const MbCurveIntoNurbsInfo *nInfo=NULL) const
 Construct a NURBS copy of a curve. More...
 
virtual MbeItemLocation PointRelative (const MbCartPoint &pnt, double eps=Math::LengthEps) const
 Define the point position relative to the curve. More...
 
virtual MbeLocation PointLocation (const MbCartPoint &pnt, double eps=Math::LengthEps) const
 The point position relative to the curve.
 
MbeNewtonResult PointProjectionNewton (const MbCartPoint &p, double xEpsilon, double yEpsilon, size_t iterLimit, double &t, bool ext) const
 Find the point projection to the curve. More...
 
void PointProjection (const MbCartPoint &pnt, MbCartPoint &on) const
 Calculate the point projection to the curve. More...
 
void BasePointProjection (const MbCartPoint &pnt, MbCartPoint &on) const
 Calculate the point projection to the curve. More...
 
void PointProjectionAndAngle (MbCartPoint &on, double &angle) const
 Calculate the point projection to the curve. More...
 
bool DirectPointProjection (const MbCartPoint &pnt, const MbDirection &dir, MbCartPoint &pp) const
 Calculate the point projection to the curve. More...
 
virtual bool SmallestPerpendicular (const MbCartPoint &pnt, double &tProj) const
 Find the nearest perpendicular to the curve. More...
 
virtual void TangentPoint (const MbCartPoint &pnt, SArray< double > &tFind) const
 Find tangents to a curve. More...
 
virtual void PerpendicularPoint (const MbCartPoint &pnt, SArray< double > &tFind) const
 Find perpendiculars to a curve. More...
 
virtual void IntersectHorizontal (double y, SArray< double > &cross) const
 Find intersections of a curve with horizontal line. More...
 
virtual void IntersectVertical (double x, SArray< double > &cross) const
 Find intersections of a curve with vertical line. More...
 
virtual void Isoclinal (const MbVector &angle, SArray< double > &tFind) const
 Construct isoclines. More...
 
void HorzIsoclinal (SArray< double > &tFind) const
 Construct horizontal isoclines. More...
 
void VertIsoclinal (SArray< double > &tFind) const
 Construct vertical isoclines. More...
 
void LowestPoint (MbCartPoint &lowestPoint, double &tLowest) const
 Find the lowest point of a curve and the corresponding parameter.
 
virtual void SelfIntersect (SArray< MbCrossPoint > &, double metricEps=Math::LengthEps) const
 Find self-intersections of curve. More...
 
virtual void OffsetCuspPoint (SArray< double > &tCusps, double dist) const
 Find the special points of an offset curve. More...
 
virtual bool GoThroughPoint (MbCartPoint &pnt)
 Create a curve through a point. More...
 
virtual bool GetMiddlePoint (MbCartPoint &) const
 Calculate a middle point of a curve.
 
virtual void GetStartPoint (MbCartPoint &) const
 Calculate a start point of a curve.
 
virtual void GetEndPoint (MbCartPoint &) const
 Calculate an end point of a curve.
 
virtual bool GetCentre (MbCartPoint &) const
 Calculate a center of curve.
 
virtual double GetRadius () const
 Get the physical radius of the curve or null if it impossible. More...
 
virtual bool GetAxisPoint (MbCartPoint &p) const
 Calculate a point to construct an axis. More...
 
virtual bool IsSimilarToCurve (const MbCurve &curve, double precision=PARAM_PRECISION) const
 Define whether the curves are similar for the merge.
 
void GetPointsByEvenParamDelta (size_t n, std::vector< MbCartPoint > &pnts) const
 Get n points of a curve with equal intervals by parameter.
 
void GetPointsByEvenParamDelta (size_t n, SArray< MbCartPoint > &pnts) const
 
virtual void GetPointsByEvenLengthDelta (size_t n, std::vector< MbCartPoint > &pnts) const
 Get n points of a curve with equal intervals by arc length.
 
void GetPointsByEvenLengthDelta (size_t n, SArray< MbCartPoint > &pnts) const
 
virtual double LengthBetween2Points (MbCartPoint &p1, MbCartPoint &p2, MbCartPoint *pc=NULL) const
 Calculate minimal length of a curve between two points on it. More...
 
bool IsPointOn (const MbCartPoint &, double eps=Math::LengthEps) const
 Check whether the point is on a curve with the tolerance eps.
 
bool IsParamOn (double t, double eps=Math::paramEpsilon) const
 Check whether the parameter is inside a range with the tolerance eps.
 
void CorrectCyclicParameter (double &t, double eps=Math::paramRegion) const
 Correct parameter for closed curves. More...
 
void CorrectParameter (double &t) const
 Correct parameter. More...
 
MbCurveInverseDuplicate () const
 Create a copy with changed direction.
 
bool IsInverseSame (const MbCurve &curve, double accuracy=LENGTH_EPSILON) const
 Define whether an inversed curve is the same.
 
virtual bool IsReparamSame (const MbCurve &curve, double &factor) const
 Define whether a reparameterized curve is the same. More...
 
MbCartPoint GetLimitPoint (ptrdiff_t number) const
 Calculate the boundary point. More...
 
void GetLimitPoint (ptrdiff_t number, MbCartPoint &pnt) const
 Calculate the boundary point. More...
 
void GetLimitTangent (ptrdiff_t number, MbVector &v) const
 Calculate a tangent vector to the boundary point. More...
 
void GetLimitPointAndTangent (ptrdiff_t number, MbCartPoint &pnt, MbVector &v) const
 Calculate a tangent vector and point at the end of a curve. More...
 
bool AreLimitPointsEqual () const
 Are boundary points equal? More...
 
virtual const MbCurveGetBasisCurve () const
 Returns the base curve if exists or itself.
 
virtual MbCurveSetBasisCurve ()
 Returns the base curve if exists or itself.
 
virtual double GetParamDelta () const
 Return an indent by parameter of a curve.
 
virtual const MbCurveGetSubstrate () const
 Get a substrate or itself.
 
virtual MbCurveSetSubstrate ()
 Get a substrate or itself.
 
virtual int SubstrateCurveDirection () const
 Return direction of a substrate relative to a curve or vice versa.
 
virtual void SubstrateToCurve (double &) const
 Transform a substrate parameter to the curve parameter.
 
virtual void CurveToSubstrate (double &) const
 Transform a curve parameter to the substrate parameter.
 
virtual double GetParamToUnit () const
 Return increment of parameter, corresponding to the unit length in space.
 
virtual double GetParamToUnit (double t) const
 Return increment of parameter, corresponding to the unit length in space according to parameter.
 
virtual double GetTEpsilon (double epsilon) const
 Return the minimal discernible value of parameter with the given tolerance.
 
virtual double GetTEpsilon (double t, double epsilon) const
 Return the minimal discernible value of parameter with the given tolerance according to parameter.
 
virtual double GetTRegion (double epsilon) const
 Return the minimal discernible value of parameter with the given tolerance.
 
virtual double GetTRegion (double t, double epsilon) const
 Return the minimal discernible value of parameter with the given tolerance according to parameter.
 
double GetTMid () const
 Return the middle of parametric range of a curve.
 
double GetTRange () const
 Return the parametric length of a curve.
 
MbCartPoint PointOn (double &t) const
 Calculate point on the curve.
 
MbVector FirstDer (double &t) const
 Calculate first derivative.
 
MbDirection Tangent (double &t) const
 Calculate tangent vector (normalized).
 
MbDirection Normal (double &t) const
 Calculate the normal vector.
 
double DerLength (double &t) const
 Calculate the length of derivative vector.
 
virtual MbPropertyCreateProperty (MbePrompt name) const
 Create a custom property.
 
virtual bool IsContinuousDerivative (bool &contLength, bool &contDirect, c3d::DoubleVector *params=NULL, double epsilon=EPSILON) const
 Have the first derivative of the curve the continuous length and direction? More...
 
virtual bool SetContinuousDerivativeLength (VERSION version, double epsilon=EPSILON)
 Eliminate the discontinuities of the first derivative at length. More...
 
bool IsSpaceNear (const MbCurve &curve, double eps, bool ext, double devSag=5.0 *Math::deviateSag) const
 Check whether the two curves are metrically close. More...
 
bool IsSpaceNear (const MbCurve &curve, double xEps, double yEps, bool ext, double xNear, double yNear, double devSag=5.0 *Math::deviateSag) const
 Check whether the two curves are metrically close. More...
 
SimpleName GetCurveName () const
 A curve name.
 
void SetCurveName (SimpleName newName)
 Set a curve name.
 
- Public Member Functions inherited from MbPlaneItem
virtual ~MbPlaneItem ()
 Destructor.
 
void PrepareWrite () const
 Object registration. More...
 
virtual MbeRefType RefType () const
 Get the registration type (for copying, duplication).
 
void Rotate (const MbCartPoint &pnt, double angle, MbRegTransform *iReg=NULL, const MbSurface *newSurface=NULL)
 Rotate about a point. More...
 
virtual bool IsSimilar (const MbPlaneItem &item) const
 Determine whether the objects are similar. More...
 
- Public Member Functions inherited from TapeBase
 TapeBase (RegistrableRec regs=noRegistrable)
 Constructor.
 
 TapeBase (const TapeBase &)
 Copy-constructor.
 
virtual ~TapeBase ()
 Destructor.
 
RegistrableRec GetRegistrable () const
 Whether the stream class is registrable.
 
void SetRegistrable (RegistrableRec regs=registrable) const
 Set the state of registration of the stream class.
 
virtual const char * GetPureName (const VersionContainer &) const
 Get the class name.
 
virtual bool IsFamilyRegistrable () const
 Whether the object belongs to a registrable family.
 
- Public Member Functions inherited from MbRefItem
 MbRefItem ()
 Constructor without parameters.
 
refcount_t GetUseCount () const
 Get count of references (get count of owners of an object).
 
refcount_t AddRef () const
 Increase count of references by one.
 
refcount_t DecRef () const
 Decrease count of references by one.
 
refcount_t Release () const
 Decrease count of references by one and if count of references became zero, then remove itself.
 
- Public Member Functions inherited from MbNestSyncItem
void Lock () const
 Switch lock on (locking happens only in parallel region).
 
void Unlock () const
 Switch lock off if locking has been set.
 
CommonRecursiveMutexGetLock () const
 Get a pointer to the mutex object. Return NULL if no parallelism. For use in ScopedLock.
 

Static Public Member Functions

static MbHermitCreate (const MbHermit &)
 Create copy of spline. More...
 
static MbHermitCreate (const SArray< MbCartPoint > &initList, bool cls)
 Create spline. More...
 
static MbHermitCreate (const SArray< double > &initParams, const SArray< MbCartPoint > &initPoints, bool cls)
 Create spline. More...
 
static MbHermitCreate (const SArray< double > &initParams, const SArray< MbCartPoint > &initPoints, const SArray< MbVector > &initVectors, bool cls)
 Create spline. More...
 
static MbHermitCreate (const SArray< double > &initParams, const SArray< MbCartPoint > &initPoints, const SArray< ptrdiff_t > &vLabels, bool cls)
 Create spline, agreed with LoftSurface. More...
 
static MbHermitCreate (const MbCartPoint &p1, const MbCartPoint &p2)
 Create spline. More...
 
static MbHermitCreate (double t1, const MbCartPoint &p1, const MbVector &v1, double t2, const MbCartPoint &p2, const MbVector &v2)
 Create spline. More...
 

Protected Member Functions

 MbHermit ()
 Constructor by default.
 
 MbHermit (const MbHermit &)
 Copy constructor.
 
 MbHermit (const SArray< MbCartPoint > &initList, bool cls)
 Constructor by point set and an attribute of closedness. More...
 
- Protected Member Functions inherited from MbPolyCurve
 MbPolyCurve ()
 Default constructor.
 
 MbPolyCurve (const MbPolyCurve &pCurve)
 Copy-constructor.
 
virtual bool CanChangeClosed () const
 Determine whether it is possible to change an attribute of closedness.
 
- Protected Member Functions inherited from MbCurve
 MbCurve ()
 Default constructor.
 
 MbCurve (const MbCurve &other)
 Copy-constructor.
 
- Protected Member Functions inherited from MbPlaneItem
 MbPlaneItem ()
 Constructor.
 

Protected Attributes

SArray< MbVectorvectorList
 Set of derivatives at the control points.
 
SArray< double > tList
 Set of parameters at the control points.
 
ptrdiff_t splinesCount
 The number of splines.
 
- Protected Attributes inherited from MbPolyCurve
SArray< MbCartPointpointList
 Set of control points.
 
ptrdiff_t uppIndex
 Count of curve pieces (is equal to count of control points minus one).
 
bool closed
 An attribute of curve closedness.
 
MbRect rect
 Bounding rectangle.
 
double metricLength
 Metric length of a spline.
 
- Protected Attributes inherited from MbCurve
SimpleName name
 A curve name.
 

Detailed Description

Composite Hermite cubic spline in two-dimensional space.

Composite Hermite cubic spline is defined by control points pointList, the first derivatives of spline vectorList in control points and values of the spline parameter in control point. For unclosed curve the sets pointList, vectorList and tList must contain the same number of elements. For closed curve the number of elements tList must be one greater than the number of elements of pointList and vectorList. Hermite spline is a composite cubic curve. On each region between two neighboring control points the spline is described by the cubic polynomial with given points and derivatives at the edges. Hermite spline passes through its control points for parameter values ??from the set tList and has in them given derivatives. Cubic polynomials are connected smoothly at the control points and they have continuous first derivatives at these points. If the derivatives at the control points are not specified then they are calculated by the given control point and its two neighboring points. For this purpose parabola is constructed by three points and the values ??of parameters in these points, and after this the derivative of parabola is calculated at the middle point. Derivatives at the boundary control points are defined by two points and the condition on the edge for the second derivative (zero).

Constructor & Destructor Documentation

◆ MbHermit()

MbHermit::MbHermit ( const SArray< MbCartPoint > &  initList,
bool  cls 
)
protected

Constructor by point set and an attribute of closedness.

Constructor by point set and an attribute of closedness.

Parameters
[in]initList- An array of curve points. For a closed curve the number of points must be no less than three, for an open curve - no less than two.
[in]cls- A curve closedness.

Member Function Documentation

◆ Create() [1/7]

static MbHermit* MbHermit::Create ( const MbHermit )
static

Create copy of spline.

Create copy of spline.

Returns
Returns pointer to the created object or null pointer in case of failure.

◆ Create() [2/7]

static MbHermit* MbHermit::Create ( const SArray< MbCartPoint > &  initList,
bool  cls 
)
static

Create spline.

Create spline and set parameters of spline.

Parameters
[in]initList- Set of control points.
[in]cls- A closedness attribute.
Returns
Returns pointer to the created object or null pointer in case of failure.

◆ Create() [3/7]

static MbHermit* MbHermit::Create ( const SArray< double > &  initParams,
const SArray< MbCartPoint > &  initPoints,
bool  cls 
)
static

Create spline.

Create spline and set parameters of spline.

Parameters
[in]initParams- Set of parameters at the control points.
[in]initPoints- Set of control points.
[in]cls- A closedness attribute.
Returns
Returns pointer to the created object or null pointer in case of failure.

◆ Create() [4/7]

static MbHermit* MbHermit::Create ( const SArray< double > &  initParams,
const SArray< MbCartPoint > &  initPoints,
const SArray< MbVector > &  initVectors,
bool  cls 
)
static

Create spline.

Create spline and set parameters of spline.

Parameters
[in]initParams- Set of parameters at the control points.
[in]initPoints- Set of control points.
[in]initVectors- Set of derivatives at the control points.
[in]cls- A closedness attribute.
Returns
Returns pointer to the created object or null pointer in case of failure.

◆ Create() [5/7]

static MbHermit* MbHermit::Create ( const SArray< double > &  initParams,
const SArray< MbCartPoint > &  initPoints,
const SArray< ptrdiff_t > &  vLabels,
bool  cls 
)
static

Create spline, agreed with LoftSurface.

Create spline and set parameters of spline.

Parameters
[in]initParams- Set of parameters at the control points.
[in]initPoints- Set of control points.
[in]vLabels- Array, containing indexes of points with same derivative.
[in]cls- A closedness attribute.
Returns
Returns pointer to the created object or null pointer in case of failure.

◆ Create() [6/7]

static MbHermit* MbHermit::Create ( const MbCartPoint p1,
const MbCartPoint p2 
)
static

Create spline.

Create a straight and set parameters of spline.

Parameters
[in]p1- Start point of curve.
[in]p2- End point of curve.
Returns
Returns pointer to the created object or null pointer in case of failure.

◆ Create() [7/7]

static MbHermit* MbHermit::Create ( double  t1,
const MbCartPoint p1,
const MbVector v1,
double  t2,
const MbCartPoint p2,
const MbVector v2 
)
static

Create spline.

Create spline and set parameters of spline.

Parameters
[in]t1- The initial parameter.
[in]p1- Start point of curve.
[in]v1- A tangent vector to the curve at the start point.
[in]t2- The final parameter.
[in]p2- End point of curve.
[in]v2- A tangent vector to the curve at the end point.
Returns
Returns pointer to the created object or null pointer in case of failure.

◆ SetEqual()

virtual bool MbHermit::SetEqual ( const MbPlaneItem item)
virtual

Make the objects equal.

It is possible to make equal only similar objects. Similar object is equated to a given one by changing of numerical data.

Parameters
[in]item- Object for initialization.
Returns
Whether the object is made equal to the given one.

Implements MbPolyCurve.

◆ Transform()

virtual void MbHermit::Transform ( const MbMatrix matr,
MbRegTransform iReg = NULL,
const MbSurface newSurface = NULL 
)
virtual

Transform according to the matrix.

Transform the initial object according to the matrix using the registrator. If the object contains references to the other geometric objects, then the nested objects are transformed according to the matrix. The registrator is used for preventing multiple transformation of the object. The function can be used without the registrator to transform a single object. The registrator must be used to transform a set of interdependent objects to prevent repeated transformation of the nested objects, since it is not ruled out that several objects from the set contain references to one or several common objects subject to transformation.

Parameters
[in]matr- A transformation matrix.
[in]iReg- Registrator.
[in]surface- New base surface of object provided that 'matr' is a transformation matrix from the old surface to a new one. For transformation of projection curve. It isn't considered if the surface is planar.

Implements MbPolyCurve.

◆ Move()

virtual void MbHermit::Move ( const MbVector to,
MbRegTransform iReg = NULL,
const MbSurface newSurface = NULL 
)
virtual

Translate along a vector.

Translate a geometric object along the vector using the registrator. If the object contains references to the other objects, then the translation operation is applied to the nested objects. The registrator is used for preventing multiple transformation of the object. The function can be used without the registrator to transform a single object. The registrator must be used to transform a set of interdependent objects to prevent repeated transformation of the nested objects, since it is not ruled out that several objects from the set contain references to one or several common objects subject to translation.

Parameters
[in]to- Translation vector.
[in]iReg- Registrator.
[in]surface- New base surface of object provided that 'matr' is a transformation matrix from the old surface to a new one. For transformation of projection curve. It isn't considered if the surface is planar.

Implements MbPolyCurve.

◆ Rotate()

virtual void MbHermit::Rotate ( const MbCartPoint pnt,
const MbDirection angle,
MbRegTransform iReg = NULL,
const MbSurface newSurface = NULL 
)
virtual

Rotate about a point.

Rotate an object about a point by the given angle using the registrator. If the object contains references to the other geometric objects, then the rotation operation is applied to the nested objects too. The registrator is used for preventing multiple transformation of the object. The function can be used without the registrator to transform a single object. The registrator must be used to transform a set of interdependent objects to prevent repeated transformation of the nested objects, since it is not ruled out that several objects from the set contain references to one or several common objects subject to rotation.

Parameters
[in]pnt- Fixed point.
[in]angle- The rotation angle.
[in]iReg- Registrator.
[in]surface- New base surface of object provided that 'matr' is a transformation matrix from the old surface to a new one. For transformation of projection curve. It isn't considered if the surface is planar.

Implements MbPolyCurve.

◆ IsSame()

virtual bool MbHermit::IsSame ( const MbPlaneItem item,
double  accuracy = LENGTH_EPSILON 
) const
virtual

Determine whether objects are equal.

Objects of the same types with similar (equal) data are considered to be equal.

Parameters
[in]item- Object for comparison.
[in]accuracy- The accuracy.
Returns
Whether the objects are equal.

Implements MbPolyCurve.

◆ Duplicate()

virtual MbPlaneItem& MbHermit::Duplicate ( MbRegDuplicate iReg = NULL) const
virtual

Create a copy.

Create a copy of the object using the registrator. The registrator is used for preventing multiple copying of an object. If the object contains references to other objects, then the included objects are copied too. It is allowed not to pass the registrator to a function. Then the new copy of the object will be created. It is allowed not to use the registrator while copying a single object or a set of disconnected objects. The registrator must be used to copy several correlated objects successively. It is possible that the objects' connection means that the objects contain references to the common objects. Then, while copying without using the registrator, one can get a set of copies which contain references to the different copies of a single included object, what leads to loss of connection between the copies.

Parameters
[in]iReg- Registrator.
Returns
Copy of the object.

Implements MbPolyCurve.

◆ DeletePart()

virtual MbeState MbHermit::DeletePart ( double  t1,
double  t2,
MbCurve *&  part2 
)
virtual

Delete the piece of a curve.

Delete a part of a curve between parameters t1 and t2. If the curve is split into two parts after deletion, then the initial object corresponds to the start part of a curve, and parameter 'part2' contains the end part of a curve. If the curve remained simply connected, then only the initial object changes.

Parameters
[in]t1- Start parameter of trimming.
[in]t2- End parameter of trimming.
[in,out]part2- The end part of a curve after deletion, if an initial curve is split into parts. It may be the only part after deletions, \ if the curve did not change (e. g. for a curve of MbLine type), in this case the returned value is dp_Degenerated.
Returns
A state of a curve after modification.

Implements MbCurve.

◆ TrimmPart()

virtual MbeState MbHermit::TrimmPart ( double  t1,
double  t2,
MbCurve *&  part2 
)
virtual

Keep the piece of a curve.

Leave a part of a curve between parameters t1 and t2.
In a case of success the returned value equals dp_Changed and a curve satisfies to the next conditions:

  • if an initial curve is closed then the start point of a trimmed curve should correspond to the parameter t1, the end point - to the parameter t2,
  • if an initial curve is not closed then the start point of a trimmed curve should correspond to the minimum parameter from t1 and t2, the end point - to the maximum one.
    Parameters
    [in]t1- Start parameter of trimming.
    [in]t2- End parameter of trimming.
    [in,out]part2- This may be filled by a result of trimming if the curve was not changed. In this case the returned value is dp_Degenerated. Otherwise NULL is returned.
    Returns
    A state of a curve after modification:
    dp_Degenerated - the curve is degenerated and there are possible three cases: the curve was not changed, because it would degenerate in a result of transformation, or it it was not changed and the result of trimming is 'part2',
    dp_NoChanged - the curve was not changes,
    dp_Changed - the curve is changed.
    Warning
    The function is designed for internal use only.

Implements MbCurve.

◆ Trimmed()

virtual MbCurve* MbHermit::Trimmed ( double  t1,
double  t2,
int  sense 
) const
virtual

Construct a trimmed curve.

Constructs a trimmed curve, a start point of which corresponds to a point with parameter t1 and an end point corresponds to a point with parameter t2. Direction of the constructed curve relative to the initial curve may be changed by the parameter 'sense'. If the curve is closed, then there may be obtained a trimmed curve, passing through the start of a curve.
In a case of closed curve (or for an arc - exception) three parameters 'sense', t1 and t2 clearly define the result. In a case of unclosed curve the parameter 'sense' and parameter of trimming should correspond each other:
1) if sense == 1, then t1 < t2,
2) if sense == -1, then t1 > t2,
If there is a discrepancy between 'sense' and parameters of trimming, then 'sense' parameter has higher priority. If parameters t1 and t2 are equal and the curve is closed, then in result a closed curve should be obtained.

Parameters
[in]t1- Parameter corresponding to start of a trimmed curve.
[in]t2- Parameter corresponding to end of a trimmed curve.
[in]sense- Direction of a trimmed curve in relation to an initial curve. sense = 1 - direction does not change. sense = -1 - direction changes to the opposite value.
Returns
A constructed trimmed curve.

Implements MbCurve.

◆ NurbsCurve() [1/2]

virtual MbNurbs* MbHermit::NurbsCurve ( const MbCurveIntoNurbsInfo nInfo) const
virtual

Construct a NURBS copy of a curve.

Constructs a NURBS curve which approximates a given curve inside the range [t1, t2]. with a given direction. If it is possible, constructs the accurate curve, perhaps with multiple knots. The number of knots for NURBS is defined depending on the curve.

Parameters
[in,out]nurbs- A constructed NURBS-curve.
[in]t1- Parameter corresponding to start of approximated part of a curve.
[in]t2- Parameter corresponding to end of approximated part of a curve.
[in]sense- Does the direction of parameter increasing along the NURBS curve coincide with direction of the initial curve. 'sense' > 0 - direction coincide.
[in]nInfo- Parameters of conversion of a curve to NURBS.
Returns
The constructed NURBS curve or NULL in a case of failure.

Implements MbCurve.

◆ NurbsCurve() [2/2]

virtual MbCurve* MbHermit::NurbsCurve ( const MbNurbsParameters tParameters) const
virtual

Construct a NURBS copy of a curve.

Constructs a NURBS curve which approximates a given curve with the given parameters. In parameters the degree and the number of knots of a spline and the range of curve's parameters changing may be set. If the flag of accurate approximation is not set in parameters then NURBS without multiple knots is constructed.

Parameters
[in]tParameters- Parameters for the construction of a NURBS copy of the curve.
Returns
The constructed NURBS curve or NULL in a case of failure.

Reimplemented from MbCurve.

◆ PointOn()

virtual void MbHermit::PointOn ( double &  t,
MbCartPoint p 
) const
virtual

Calculate a point on the curve.

Correct parameter when getting out of domain bounds and calculate a point on the curve.

Parameters
[in]t- Curve parameter.
[out]p- A point on the curve.

Implements MbPolyCurve.

◆ _PointOn()

virtual void MbHermit::_PointOn ( double  t,
MbCartPoint p 
) const
virtual

Calculate point at curve and its extension.

Calculate a point on the curve including the outside area determination parameter.

Parameters
[in]t- Curve parameter.
[out]p- A point on the curve.

Reimplemented from MbCurve.

◆ Explore()

virtual void MbHermit::Explore ( double &  t,
bool  ext,
MbCartPoint pnt,
MbVector fir,
MbVector sec,
MbVector thir 
) const
virtual

Calculate point and derivatives of object for given parameter.

Values of point and derivatives are calculated on parameter area and on extended curve.

Parameters
[in]t- Parameter.
[in]ext- On parameters area (false), on extended curve (true).
[out]pnt- Point.
[out]fir- Derivative with respect to t.
[out]sec- Second derivative with respect to t, if not NULL.
[out]thir- Third derivative with respect to t, if not NULL.

Implements MbPolyCurve.

◆ Step()

virtual double MbHermit::Step ( double  t,
double  sag 
) const
virtual

Calculate parameter step.

Calculate parameter step for the curve's approximation by its sag value. Calculation of the step is performed with consideration of curvature radius. A step of curve's approximation is chosen in such way, that the deviation of a curve from its polygon does not exceed the given sag value.

Parameters
[in]t- A parameter defining the point on a curve, at which a step should be calculated.
[in]sag- Maximum feasible sag value.
Returns
A sag value by parameter at given point.

Reimplemented from MbCurve.

◆ DeviationStep()

virtual double MbHermit::DeviationStep ( double  t,
double  ang 
) const
virtual

Calculate parameter step.

Calculate parameter step for the curve's approximation by the deviation angle of the tangent vector. A step of curve's approximation is chosen in such way, that angular deviation of the tangent curve at the next point does not exceed the given value ang.

Parameters
[in]t- A parameter defining the point on a curve, at which a step should be calculated.
[in]ang- The maximum feasible deviation angle of tangent.
Returns
A sag value by parameter at given point.

Reimplemented from MbCurve.

◆ NearPointProjection()

virtual bool MbHermit::NearPointProjection ( const MbCartPoint pnt,
double  xEpsilon,
double  yEpsilon,
double &  t,
bool  ext,
MbRect1D tRange = NULL 
) const
virtual

Find the point projection to the curve.

Find the nearest point projection to the curve or its by the given initial approximation. If the range of parameter changing 'tRange' is set, then find a projection in the given range. A range of parameter may not belong to the domain of a curve. The Newton method is used.

Note
Mathematical kernel provides a thread-safe function implementation for its objects.
Parameters
[in]pnt- A given point.
[in]xEpsilon- A tolerance of detection of the projection by x axis.
[in]yEpsilon- A tolerance of detection of the projection by y axis.
[in,out]t- Input - initial approximation, output - parameter of a curve corresponding to the nearest projection.
[in]ext- A flag defining whether to seek projection on the extension of the curve.
[in]tRange- A range of parameter changing in which the solution should be found.
Returns
True - if there is found a projection which satisfies to all input conditions.

Reimplemented from MbCurve.

◆ CalculateGabarit()

virtual void MbHermit::CalculateGabarit ( MbRect ) const
virtual

Detect the bounding box of a curve.

The sent rectangle becomes empty for getting a bounding box. Then bounding boxes of an object are calculated and saved into a rectangle 'rect'.

Reimplemented from MbCurve.

◆ DistanceAlong()

virtual bool MbHermit::DistanceAlong ( double &  t,
double  len,
int  curveDir,
double  eps = Math::LengthEps,
VERSION  version = Math::DefaultMathVersion() 
) const
virtual

Translate parameter along the curve.

Translate parameter along the curve by the given distance at the given direction. The new value of parameter is saved in the variable t. If the curve is not closed and the length of its part from the point with parameter t to the end at the given direction is less than the required shift, then calculations are performed on extension of the curve, if it possible to construct such extension.

Parameters
[in,out]t- Input - the initial value of parameter. Output - the new value of parameter.
[in]len- The value of shift along the curve.
[in]curveDir- The offset direction. If curveDir is non-negative, then the shift is directed to the side of increasing of parameter. Otherwise - to the side of decreasing of parameter.
[in]eps- Computational tolerance.
[in]version- Version.
Returns
True - if the operation is performed successfully, otherwise false.

Reimplemented from MbCurve.

◆ InsertPoint() [1/3]

virtual void MbHermit::InsertPoint ( ptrdiff_t  index,
const MbCartPoint pnt 
)
virtual

Insert a point to the array of control points.

Insert the given point by index.

Parameters
[in]pnt- A given point.
[in]index- Index to insert a point by.

Implements MbPolyCurve.

◆ InsertPoint() [2/3]

virtual void MbHermit::InsertPoint ( double  t,
const MbCartPoint pnt,
double  xEps,
double  yEps 
)
virtual

Insert a point to the array of control points.

Insert a point which corresponds to parameter 't' of the curve. If parameter 't' differs from the parameter of some point less than by the given tolerance, then the new point isn't inserted, already existent point close by parameter is replaced.

Parameters
[in]t- Parameter of the new point.
[in]pnt- A given point.
[in]xEps- Tolerance in x direction.
[in]yEps- Tolerance in y direction.

Implements MbPolyCurve.

◆ InsertPoint() [3/3]

virtual void MbHermit::InsertPoint ( double  t,
const MbCartPoint pnt,
const MbVector v,
double  xEps,
double  yEps 
)
virtual

Insert a point to the array of control points.

Insert a point and derivative vector corresponding to it, which will correspond to parameter 't' of the curve. If parameter 't' differs from the parameter of some point less than by the given tolerance, then the new point isn't inserted, already existent point close by parameter is replaced.

Parameters
[in]t- Parameter of the new point.
[in]pnt- A given point.
[in]v- Derivative at the given point.
[in]xEps- Tolerance in x direction.
[in]yEps- Tolerance in y direction.

Reimplemented from MbPolyCurve.

◆ ChangePoint()

virtual void MbHermit::ChangePoint ( ptrdiff_t  index,
const MbCartPoint pnt 
)
virtual

Replace a point.

Replace a point.

Parameters
[in]index- Index of a point to be changed.
[in]pnt- A given point.

Reimplemented from MbPolyCurve.

◆ CheckParam()

virtual bool MbHermit::CheckParam ( double &  t,
ptrdiff_t &  i0,
ptrdiff_t &  i1,
double &  t0,
double &  t1 
) const
virtual

Drive a parameter into the curve domain.

Check parameter. If it is out of the range of the curve parameters, then in case of closed curve drive it into the definition domain with changing by period. In case of open curve - make equal to the nearest boundary parameter. Determine indices of control points the given parameter is between, and also determine their parametric values.

Parameters
[in,out]t- On input - the given parameter. On output - parameter in the curve definition domain.
[out]i0- Index of control point to the left of the given parameter.
[out]i1- Index of control point to the right of the given parameter.
[out]t0- Parameter of control point to the left of the given parameter.
[out]t1- Parameter of control point to the right of the given parameter.
Returns
True if the operation succeeded.

Implements MbPolyCurve.

◆ GetRuleInterval()

virtual void MbHermit::GetRuleInterval ( ptrdiff_t  index,
double &  t1,
double &  t2 
) const
virtual

Get the range of influence of point of the curve.

Determines which range of curve parameter will be affected by changing of the control point with 'index' index.

Parameters
[in]index- Index of control point.
[out]t1- Minimal parameter of the range of influence.
[out]t2- Maximal parameter of the range of influence.

Implements MbPolyCurve.


The documentation for this class was generated from the following file: