C3D Toolkit  Kernel - 110464, Vision - 2.5.0.35

Contour in two-dimensional space. More...

#include <cur_contour.h>

+ Inheritance diagram for MbContour:
+ Collaboration diagram for MbContour:

Public Member Functions

 MbContour ()
 Empty contour.
 
template<class Curves >
 MbContour (const Curves &, bool same)
 Constructor by curves vector.
 
Common functions of a geometric object.
virtual MbePlaneType IsA () const
 Get the object type.
 
virtual MbePlaneType Type () const
 Get the group type of the object.
 
virtual MbPlaneItemDuplicate (MbRegDuplicate *=NULL) const
 Create a copy. More...
 
virtual bool IsSimilar (const MbPlaneItem &) const
 Determine whether the objects are similar. More...
 
virtual bool SetEqual (const MbPlaneItem &)
 Make the objects equal. More...
 
virtual bool IsSame (const MbPlaneItem &, double accuracy=LENGTH_EPSILON) const
 Determine whether objects are equal. More...
 
virtual void Transform (const MbMatrix &, MbRegTransform *ireg=NULL, const MbSurface *newSurface=NULL)
 Transform according to the matrix. More...
 
virtual void Move (const MbVector &, MbRegTransform *=NULL, const MbSurface *newSurface=NULL)
 Translate along a vector. More...
 
virtual void Rotate (const MbCartPoint &, const MbDirection &angle, MbRegTransform *=NULL, const MbSurface *newSurface=NULL)
 Rotate about a point. More...
 
virtual MbCurveOffset (double rad) const
 Construct the equidistant curve which is shifted by the given value. More...
 
virtual void AddYourGabaritTo (MbRect &) const
 Extend the given bounding rectangle so that it encloses this object.
 
virtual void CalculateGabarit (MbRect &) const
 Detect the bounding box of a curve. More...
 
virtual void CalculateLocalGabarit (const MbMatrix &into, MbRect &local) const
 Calculate bounding box in the local coordinate system. More...
 
const MbRectGetGabarit () const
 
const MbRectGetCube () const
 
void SetDirtyGabarit () const
 
void CopyGabarit (const MbContour &c)
 
bool IsGabaritEmpty () const
 
virtual double DistanceToPoint (const MbCartPoint &) const
 Calculate the distance to a point.
 
virtual MbeState Deformation (const MbRect &, const MbMatrix &)
 Deform the curve. More...
 
virtual bool IsInRectForDeform (const MbRect &) const
 Determine visibility of a curve in rectangle.
 
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 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...
 
Functions for curve domain description.
virtual double GetTMin () const
 Get the minimum value of parameter.
 
virtual double GetTMax () const
 Get the maximum value of parameter.
 
virtual bool IsClosed () const
 Define whether the curve is closed. More...
 
virtual bool IsStraight () const
 Define whether the curve is rectilinear..
 
virtual bool IsSmoothConnected (double angleEps) const
 Define whether joints of contour/curve are smooth.
 
Functions for working in the domain of a curve.

Functions: PointOn, FirstDer, SecondDer, ThirdDer,... correct parameter when it is outside domain.

virtual void PointOn (double &, MbCartPoint &) const
 Calculate a point on the curve. More...
 
virtual void FirstDer (double &, MbVector &) const
 Calculate first derivative.
 
virtual void SecondDer (double &, MbVector &) const
 Calculate second derivative.
 
virtual void ThirdDer (double &, MbVector &) const
 Calculate third derivative.
 
Function for working inside and outside of the curve domain.

Function _PointOn, _FirstDer, _SecondDer, _ThirdDer,... do not correct a parameter when it is outside domain. If non-closed curve is outside of the domain in the general case it continues along a tangent, which it has at the respective end.

virtual void _PointOn (double, MbCartPoint &) const
 Calculate point at curve and its extension. More...
 
virtual void _FirstDer (double, MbVector &) const
 Calculate first derivative at curve and its extension.
 
virtual void _SecondDer (double, MbVector &) const
 Calculate second derivative at curve and its extension.
 
virtual void _ThirdDer (double, MbVector &) const
 Calculate third derivative at curve and its extension.
 
Functions for get of the group of data inside and outside the curve's domain of parameter.
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...
 
Functions of the motion along the 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...
 
Common functions of curve
virtual bool HasLength (double &) const
 Calculate the metric length of a curve. More...
 
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 double CalculateMetricLength () const
 Calculate the metric length of a curve.
 
double GetParamLength () const
 
double CalculateParamLength ()
 
double GetArea (double sag=Math::deviateSag) const
 
virtual MbNurbsNurbsCurve (const MbCurveIntoNurbsInfo &) const
 Construct a NURBS copy of a curve. More...
 
virtual MbContourNurbsContour () const
 Approximate of a curve by the contour from NURBS curves.
 
void SetClosed ()
 Set the closedness attribute of contour.
 
void CheckClosed (double eps)
 Set the closedness attribute of contour.
 
void InitClosed (bool c)
 Set the closedness attribute of contour.
 
bool IsClosedContinuousC0 (double eps=5.0 *PARAM_NEAR) const
 Check for closedness and continuity of contour points. More...
 
void CloseByLineSeg (bool calcData)
 Close the contour by segment.
 
virtual double CalculateLength (double t1, double t2) const
 Calculate the metric length 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...
 
void Clear (bool calculateParamLength=true)
 Reset variables caching.
 
ptrdiff_t FindSegment (double &t, double &tSeg) const
 Finding of a contour segment.
 
size_t GetSegmentsCount () const
 Get the number of contour segments.
 
const MbCurveGetSegment (size_t ind) const
 Get contour segment by the index.
 
MbCurveSetSegment (size_t ind)
 Get contour segment by the index.
 
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.
 
virtual double PointProjection (const MbCartPoint &) const
 Find the point projection to the curve.
 
virtual bool NearPointProjection (const MbCartPoint &, double xEpsilon, double yEpsilon, double &t, bool ext, MbRect1D *tRange=NULL) const
 Find the point projection to the curve. More...
 
double DistanceToBorder (const MbCartPoint &) const
 Parametric distance to the nearest boundary.
 
void Trimm (double t1, double t2)
 Trim a part of the contour.
 
virtual void PerpendicularPoint (const MbCartPoint &, SArray< double > &tFind) const
 Find perpendiculars to a curve. More...
 
virtual void TangentPoint (const MbCartPoint &, SArray< double > &tFind) const
 Find tangents to a curve. More...
 
virtual void IntersectHorizontal (double y, SArray< double > &) const
 Find intersections of a curve with horizontal line. More...
 
virtual void IntersectVertical (double x, SArray< double > &) const
 Find intersections of a curve with vertical line. More...
 
virtual void SelfIntersect (SArray< MbCrossPoint > &, double metricEps=Math::LengthEps) const
 Find self-intersections of curve. More...
 
bool IsSelfIntersect (double metricEps, bool considerPartialCoincidence) const
 Is it a contour with self-intersections? More...
 
bool FilletTwoSegments (ptrdiff_t &index, double rad, bool &del1, bool &del2)
 Fillet of two neighboring elements with information about removal.
 
bool FilletTwoSegments (ptrdiff_t &index, double rad)
 Fillet of two neighboring elements.
 
bool ChamferTwoSegments (ptrdiff_t &index, double len, double angle, bool type, bool firstSeg, bool &del1, bool &del2)
 Insertion of chamfer between two neighboring elements with information about removal.
 
bool ChamferTwoSegments (ptrdiff_t &index, double len, double angle, bool type, bool firstSeg=true)
 Insertion of chamfer between two neighboring elements.
 
bool Fillet (double rad)
 Fillet of contour.
 
bool Chamfer (double len, double angle, bool type)
 Insertion of the chamfer.
 
MbeState RemoveFilletOrChamfer (const MbCartPoint &pnt)
 Remove fillet or contour chamfer Split contour into non-overlapping segments.
 
bool InsertCrossPoints ()
 
void BreakSegment (ptrdiff_t &index, ptrdiff_t firtsIdx, SArray< MbCrossPoint > &cross, bool firstCurve=true)
 Splitting of contour segments at the points of intersection.
 
bool CheckConnection (double eps=Math::LengthEps) const
 Check for contour continuity.
 
bool CheckConnection (double xEps, double yEps) const
 Check for contour continuity.
 
void FilletTwoSegmentsZero (ptrdiff_t &index, int defaultSense, bool fullInsert)
 Rounding two neighboring elements by arc of zero radius.
 
void FilletZero (int defaultSense, bool fullInsert=false)
 Rounding contour by arc of zero radius.
 
void ChamferTwoSegmentsZero (ptrdiff_t &index, double rad)
 Insertion of chamfer between two neighboring elements for construction of the offset.
 
void ChamferZero (double rad)
 Insertion of chamfer for construction of the offset.
 
void DeleteDegenerateSegments (double radius, MbCurve *curve, bool mode)
 Removal of degenerate contour segments.
 
void Equid (double radLeft, double radRight, int side, bool mode, PArray< MbCurve > &equLeft, PArray< MbCurve > &equRight)
 Construction of offset to contour. More...
 
void CreateNewContours (RPArray< MbCurve > &)
 Construction of new contours from equidistance.
 
double CalculateArea (double sag=Math::deviateSag) const
 Calculation of contour area if contour is closed.
 
int GetSense () const
 Determination of traverse direction if contour is closed.
 
void SetSense (int sense)
 Set the traverse direction of the contour.
 
virtual void Inverse (MbRegTransform *=NULL)
 Set the opposite direction of curve.
 
bool NormalizeReparametrization ()
 
virtual size_t GetCount () const
 Define the number of splittings for one passage in operations.
 
virtual bool DistanceToPointIfLess (const MbCartPoint &toP, double &d) const
 Calculate the distance to a point. More...
 
virtual bool GetSpecificPoint (const MbCartPoint &from, double &dmax, MbCartPoint &pnt) const
 Return a specific point of a curve. More...
 
bool GetSegmentMiddlePoint (const MbCartPoint &from, MbCartPoint &midPoint) const
 Get a mid-point of the contour segment.
 
bool GetLinearSegment (const MbCartPoint &from, double maxDist, MbCartPoint &p1, MbCartPoint &p2, double &d) const
 Get the linear segment of contour.
 
MbArcGetArcSegment (const MbCartPoint &from, double maxDist, double &d) const
 Get the arc segment of contour.
 
bool GetSegmentLength (const MbCartPoint &from, double &length) const
 Get the contour segment length.
 
virtual bool GetWeightCentre (MbCartPoint &) const
 Calculate the center of gravity of a curve.
 
virtual bool GetCentre (MbCartPoint &) const
 Calculate a center of curve.
 
ptrdiff_t FindNearestNode (const MbCartPoint &to) const
 Find the nearest node of contour to point.
 
ptrdiff_t FindNearestSegment (const MbCartPoint &to) const
 Find the nearest segment of contour to point.
 
virtual void OffsetCuspPoint (SArray< double > &tCusps, double dist) const
 Find the special points of an offset curve. More...
 
virtual double GetRadius () const
 Get the physical radius of the curve or null if it impossible. More...
 
virtual bool GetAxisPoint (MbCartPoint &) const
 Calculate a point to construct an axis. More...
 
void CombineNurbsSegments ()
 Unite NURBS curves into the contour.
 
virtual void GetProperties (MbProperties &)
 Get properties of the object.
 
virtual void SetProperties (const MbProperties &)
 Set properties of the object.
 
virtual void GetBasisPoints (MbControlData &) const
 Get the basis points of the curve.
 
virtual void SetBasisPoints (const MbControlData &)
 Change the object by control points.
 
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 derivatives of the length of the joints of the segments. 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.
 
Function for working with segments of contour
bool Init (List< MbCurve > &curves)
 Initialization by list of curves.
 
void Init (const MbContour &other)
 Initialization by a contour.
 
template<class Curves >
bool Init (Curves &curves, bool same)
 Initialization by array of curves.
 
template<class Points >
bool InitByPoints (const Points &)
 Initialization by array of points (closed contour).
 
bool InitAsRectangle (const MbCartPoint *)
 Initialization as rectangle (4 points are given).
 
bool InitByRectangle (const MbRect &)
 Initialization by rectangle of bounding box.
 
bool AddSegment (MbCurve *)
 Add a segment to the contour.
 
bool AddSegmentOrDeleteCurve (MbCurve *)
 Add a curve as segment or remove its.
 
MbCurveAddSegment (const MbCurve *pBasis, double t1, double t2, int sense=1)
 
bool AddAtSegment (MbCurve *newSegment, size_t index)
 Insert a segment before the contour segment with the index "index".
 
bool AddAfterSegment (MbCurve *newSegment, size_t index)
 Insert a segment after the contour segment with the index "index". Function for addition of a new curve with checking.
 
bool AddCurveWithRuledCheck (MbCurve &newCur, double absEps, bool toEndOnly=false, bool checkSame=true, VERSION version=Math::DefaultMathVersion())
 
void DeleteSegments ()
 Remove all segments from contour.
 
void DeleteSegment (size_t ind)
 Remove a segment from contour.
 
void DetachSegments ()
 Detach all segments from the contour without removing.
 
MbCurveDetachSegment (size_t ind)
 Detach a segment from contour return it.
 
void SetSegment (MbCurve &newSegment, size_t ind)
 Replace a segment in the contour.
 
void SegmentsAdd (MbCurve &newSegment, bool calculateParamLength=true)
 Add a segment to the contour without checking.
 
void SegmentsInsert (size_t ind, MbCurve &newSegment)
 Insert a segment into contour before an index without checking.
 
void SegmentsRemove (size_t ind)
 Remove a segment without checking.
 
void SegmentsDetach (size_t ind)
 Detach a segment without checking.
 
void Calculate (bool calcArea=false)
 Calculate parameters: rect, paramLength, metricLength, closed.
 
void SegmentsReserve (size_t additionalSpace)
 Reserve memory for this number of elements.
 
void SegmentsAdjust ()
 Free the unnecessary memory.
 
template<class Curves >
bool GetSegments (Curves &segms) const
 Get contour segments.
 
void SetMetricLength (double len) const
 
bool SetBegEndPoint (double t)
 Set the start (end) point for closed contour.
 
void ReplaceContoursAndPolylines ()
 Replace segments of contour and segments of polyline.
 
void GetPolygon (double sag, SArray< MbCartPoint > &poly, double eps) const
 Get points of polygon.
 
bool IsAnyCurvilinear () const
 Whether the contour has a curved segment.
 
bool IsSameSegments (const MbContour &cntr) const
 Whether contours contains identical segments.
 
bool GetBegSegmentPoint (size_t i, MbCartPoint &) const
 Get the start point of i-th segment.
 
bool GetEndSegmentPoint (size_t i, MbCartPoint &) const
 Get the end point of i-th segment.
 
bool CornerNormal (double t, MbVector &norm) const
 Normal by parameter with consideration of segments joints. More...
 
template<class Params >
void GetCornerParams (Params &params) const
 Parameters of segments joints. More...
 
bool GetTwoTangents (double t, MbVector &tan1, MbVector &tan2) const
 Calculation of two tangents (for parameters of joints). More...
 
Functions for working with names of contours.
void GetSegmentsNames (SimpleNameArray &names) const
 Get names of segments. More...
 
void SetSegmentsNames (const SimpleNameArray &names)
 Set names of segments. 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 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 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).
 
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..
 
double GetParamLength () const
 Calculate the parametric length of a curve.
 
virtual void ResetTCalc () const
 Reset the current value of parameter.
 
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 MbCurveNurbsCurve (const MbNurbsParameters &tParameters) const
 Construct a NURBS copy of a curve. More...
 
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 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 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 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.
 
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...
 
- 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.
 

Protected Member Functions

 MbContour (const MbContour *, MbRegDuplicate *)
 Copy constructor.
 
- 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

RPArray< MbCurvesegments
 An array of contour segments.
 
bool closed
 An Attribute of curve closedness.
 
double paramLength
 Parametric length of a contour.
 
double metricLength
 Metric length of a contour.
 
MbRect rect
 Bounding box.
 
c3d::DoublePair areaSign
 Contour area with a sign.
 
- Protected Attributes inherited from MbCurve
SimpleName name
 A curve name.
 

Detailed Description

Contour in two-dimensional space.

Contour is a composite curve in which the beginning of each subsequent segment is joined to the end of the previous one. Contour is closed if the end of last segment is joined to the beginning of the first segment.
If the segments of a composite curve are not smoothly joined then the composite curve will have breaks. In general case in places of joining segments derivatives of a composite curve have discontinuity along the length and direction.
The initial value of the composite curve is equal to zero. The parametric length of a composite curve is equal to the sum of the parametric lengths of components of its segments.
When the calculation of the radius-vector of a composite curve segment is determined at first, the value of composite curve parameter and the corresponding value of the own parameters of this segment corresponds to this segment. Then computes the radius-vector of the segment which will be the radius-vector of the composite curve.
Other composite curves are not used as segments of the composite curve. If it is required to create a composite curve based on other composite curves, then the latter must be regarded as a set of their curves, and not as single curves.
The two-dimensional contour is used for planar modeling and also for describing of two-dimensional areas, for example for determining of the domain of surface.

Member Function Documentation

◆ Duplicate()

virtual MbPlaneItem& MbContour::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 MbCurve.

Reimplemented in MbContourWithBreaks.

◆ IsSimilar()

virtual bool MbContour::IsSimilar ( const MbPlaneItem item) const
virtual

Determine whether the objects are similar.

Objects of the same type are considered to be similar if data of the objects can be equated or the data are also similar (pointers). Similar object can be initialized by data of object similar to it (equate one to another without changing of addresses).

Parameters
[in]item- Object for comparison.
Returns
Whether the objects are similar.

Reimplemented from MbPlaneItem.

◆ SetEqual()

virtual bool MbContour::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 MbCurve.

◆ IsSame()

virtual bool MbContour::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 MbCurve.

◆ Transform()

virtual void MbContour::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 MbCurve.

Reimplemented in MbContourWithBreaks.

◆ Move()

virtual void MbContour::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 MbCurve.

Reimplemented in MbContourWithBreaks.

◆ Rotate()

virtual void MbContour::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 MbCurve.

Reimplemented in MbContourWithBreaks.

◆ Offset()

virtual MbCurve* MbContour::Offset ( double  rad) const
virtual

Construct the equidistant curve which is shifted by the given value.

Construct the equidistant curve which is shifted by the given value. The function inserts (in a contour's copy) the arcs of zero radius between neighbor segments. This is necessary to provide continuity of the contour for both directions of displacement. But it can lead to the appearance of self-intersections of an contour. Then the function performs an equidistant offset of all segments. This function has a limited scope of using. You can use the OffsetContour function instead this function.

Parameters
[in]rad- Equidistant offset.
Returns
Returns the equidistant curve if it's possible to build it, otherwise - NULL.

Reimplemented from MbCurve.

◆ CalculateGabarit()

virtual void MbContour::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.

◆ CalculateLocalGabarit()

virtual void MbContour::CalculateLocalGabarit ( const MbMatrix into,
MbRect local 
) const
virtual

Calculate bounding box in the local coordinate system.

For getting a bounding box of an object relatively to the local coordinate system, a sent rectangle becomes empty. After that bounding boxes of an object in the local coordinate system are calculated and saved in a rectangle 'rect'.

Parameters
[in]matr- A transition matrix from the current coordinate system of the object to the local coordinate system.
[out]rect- A rectangle with information about bounds.

Reimplemented from MbCurve.

◆ Deformation()

virtual MbeState MbContour::Deformation ( const MbRect rect,
const MbMatrix matr 
)
virtual

Deform the curve.

If the bounding rectangle of a curve intersects the given one, then the curve is transformed according to the matrix with a help of 'Transform' function.

Parameters
[in]rect- A rectangle, in which the visibility of a curve is checked.
[in]matr- A deformation matrix.
Returns
A state of a curve after deformation.

Reimplemented from MbCurve.

◆ PrepareIntegralData()

virtual void MbContour::PrepareIntegralData ( const bool  forced) const
virtual

Calculate temporary (mutable) data of an object.

Calculate the temporary data of an object depending of the "forced" parameter. Calculate only data that was not calculated earlier if parameter "forced" is equal false. Recalculate all temporary data of an object if parameter "forced" is equal true.

Parameters
[in]forced- Forced recalculation.

Reimplemented from MbCurve.

◆ DeletePart()

virtual MbeState MbContour::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 MbContour::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* MbContour::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.

◆ IsClosed()

virtual bool MbContour::IsClosed ( ) const
virtual

Define whether the curve is closed.

Define whether the curve is closed.
A curve is considered as closed if it is cyclic:

  • start point is coincident with end point,
  • derivatives in start point and end point coincide,
    if there are breaks at curve (in cases when a curve is contour or polyline), then derivatives may not coincide; in Bezier curve derivatives should coincide by direction, but they may differ by absolute value.
    Returns
    True if a curve is closed.

Implements MbCurve.

◆ PointOn()

virtual void MbContour::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 MbCurve.

◆ _PointOn()

virtual void MbContour::_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 MbContour::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.

Reimplemented from MbCurve.

◆ Step()

virtual double MbContour::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 MbContour::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.

◆ HasLength()

virtual bool MbContour::HasLength ( double &  length) const
virtual

Calculate the metric length of a curve.

Calculate the metric length of a curve and save the result in the variable 'length'.

Parameters
[in,out]length- Calculated length of a curve.
Returns
True - if the length of a curve differs from null. Otherwise returns false.

Implements MbCurve.

◆ GetMetricLength()

virtual double MbContour::GetMetricLength ( ) const
virtual

Calculate the metric length of a curve.

If a length of a curve is already calculated and saved in the object then this function returns the existing result, without repeating of calculations. Otherwise the length is calculated by the function CalculateMetricLength().

Returns
Length of a curve.

Implements MbCurve.

◆ GetLengthEvaluation()

virtual double MbContour::GetLengthEvaluation ( ) const
virtual

Calculate the metric length of a curve.

The length of a curve is inaccurately calculated, by approximation of polyline. If the more accurate curve's length is required, then use the function CalculateMetricLength().

Reimplemented from MbCurve.

◆ NurbsCurve()

virtual MbNurbs* MbContour::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.

◆ IsClosedContinuousC0()

bool MbContour::IsClosedContinuousC0 ( double  eps = 5.0 *PARAM_NEAR) const

Check for closedness and continuity of contour points.

Check for closedness and continuity of contour points. Checking for coincidence of first and last points of the contour, coincidence of the last point of each segment with the first point of the next segment. Equality of points is checked roughly by default - with tolerance is equal to 5* PARAM_NEAR.

Returns
true, if contour is closed and continuous.

◆ CalculateLength()

virtual double MbContour::CalculateLength ( double  t1,
double  t2 
) const
virtual

Calculate the metric length of a curve.

Calculate the metric length of unclosed curve from parameter t1 to parameter t2. The condition t1 < t2 should satisfied.

Parameters
[in]t1- Start parameter of a curve section.
[in]t2- End parameter of a curve section.
Returns
Length of a curve.

Reimplemented from MbCurve.

◆ DistanceAlong()

virtual bool MbContour::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.

◆ PointRelative()

virtual MbeItemLocation MbContour::PointRelative ( const MbCartPoint pnt,
double  eps = Math::LengthEps 
) const
virtual

Define the point position relative to the curve.

There is defined on which side from a curve the point is located, by the positive direction of a curve.

Parameters
[in]pnt- A given point.
[in]eps- A tolerance of detection.
Returns
Iloc_InItem = 1 - if the point is on the left from a curve,
iloc_OnItem = 0 - if the point is on a curve,
iloc_OutOfItem = 1 - if the point is on the right from a curve.

Reimplemented from MbCurve.

◆ NearPointProjection()

virtual bool MbContour::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.

◆ PerpendicularPoint()

virtual void MbContour::PerpendicularPoint ( const MbCartPoint pnt,
SArray< double > &  tFind 
) const
virtual

Find perpendiculars to a curve.

Find all perpendiculars to a curve from the given point. In this function a curve without extensions is considered.

Parameters
[in]pnt- A given point.
[in,out]tFind- An array of parameter on a curve, corresponding to the points on a curve, which the perpendiculars are passed through.

Reimplemented from MbCurve.

◆ TangentPoint()

virtual void MbContour::TangentPoint ( const MbCartPoint pnt,
SArray< double > &  tFind 
) const
virtual

Find tangents to a curve.

Find all tangents to a curve from the given point. A point may belong to a curve. In this function a curve without extensions is considered.

Parameters
[in]pnt- A given point.
[in,out]tFind- An array of parameters of a curve, corresponding to the tangent points.

Reimplemented from MbCurve.

◆ IntersectHorizontal()

virtual void MbContour::IntersectHorizontal ( double  y,
SArray< double > &  cross 
) const
virtual

Find intersections of a curve with horizontal line.

Find intersections of a curve with horizontal line.

Parameters
[in]y- An ordinate of points of a horizontal line.
[in,out]cross- An array of parameters of a curve corresponding to the intersection points.

Reimplemented from MbCurve.

◆ IntersectVertical()

virtual void MbContour::IntersectVertical ( double  x,
SArray< double > &  cross 
) const
virtual

Find intersections of a curve with vertical line.

Find intersections of a curve with vertical line.

Parameters
[in]x- An abscissa of points of a vertical line.
[in,out]cross- An array of parameters of a curve corresponding to the intersection points.

Reimplemented from MbCurve.

◆ SelfIntersect()

virtual void MbContour::SelfIntersect ( SArray< MbCrossPoint > &  ,
double  metricEps = Math::LengthEps 
) const
virtual

Find self-intersections of curve.

Find the points of self-intersection of a curve and the corresponding parameters.

Parameters
[in,out]crossPnt- An array of points of self-intersection.

Reimplemented from MbCurve.

◆ IsSelfIntersect()

bool MbContour::IsSelfIntersect ( double  metricEps,
bool  considerPartialCoincidence 
) const

Is it a contour with self-intersections?

Is it a contour with self-intersections?

Parameters
[in]metricEps- Accuracy (it's recommended to use Math::LengthEps).
[in]considerPartialCoincidence- Consider partial coincidence of neighboring segments as self-intersection (true - by default).

◆ Equid()

void MbContour::Equid ( double  radLeft,
double  radRight,
int  side,
bool  mode,
PArray< MbCurve > &  equLeft,
PArray< MbCurve > &  equRight 
)

Construction of offset to contour.

Construction of offset to contour of the left and right. A name of every offset contour matches with the name of the initial one.

Parameters
[in]radLeft- The equidistance radius on the left by direction.
[in]radRight- The equidistance radius on the right by direction.
[in]side- Attribute defining the side to construct:
0 - on the left by direction,
1 - on the right by direction,
2 - on the both sides.
[in]mode- The way of traverse of angles:
true - by arc, false - by section.
[out]equLeft- The array of contours on the left side.
[out]equRight- The array of contours on the right side.

◆ DistanceToPointIfLess()

virtual bool MbContour::DistanceToPointIfLess ( const MbCartPoint to,
double &  d 
) const
virtual

Calculate the distance to a point.

Calculate distance to object from a given point near the object. Distance is calculated and stored to 'd' variable if it is less then initial value of 'd'. There can be performance benefit in comparison with DistanceToPoint function due to primarily checking the distance from point to bounding box and performing the further calculations only if this distance is not greater than the given one.

Parameters
[in]to- Point.
[in,out]d- Specified distance from object on input. Distance from point to object on output if operation succeeded.
Returns
True if distance from point to the object is less than the given one, otherwise false. Calculate the distance from a point and change the given value of distance if the distance is less than the given one.

Reimplemented from MbCurve.

◆ GetSpecificPoint()

virtual bool MbContour::GetSpecificPoint ( const MbCartPoint from,
double &  dmax,
MbCartPoint pnt 
) const
virtual

Return a specific point of a curve.

Return a specific point of a curve if the distance from it to the given point is less than dmax. Specific points of a bounded curve are its start and end points.

Parameters
[in]from- A control point
[in,out]dmax- Input - maximum distance for search of specific point. Output - a distance from the point 'from' to the found specific point.
[in,out]pnt- Tangent vector.
Returns
True - if the specific point is found.

Reimplemented from MbCurve.

◆ OffsetCuspPoint()

virtual void MbContour::OffsetCuspPoint ( SArray< double > &  tCusps,
double  dist 
) const
virtual

Find the special points of an offset curve.

Special points of an offset curve are the points where the curvature radius of the initial curve equals to the value of shift of an offset curve.

Parameters
[in,out]tCusps- An array of parameters of special points.
[in]dist- Shift of the offset curve.

Reimplemented from MbCurve.

◆ GetRadius()

virtual double MbContour::GetRadius ( ) const
virtual

Get the physical radius of the curve or null if it impossible.

In general case 0 is returned. A value different from 0 may be obtained only in a case, when the curve is an arc of a circle or it is equivalent to an arc of a circle.

Returns
A value of radius, if it is existed, or 0.0.

Reimplemented from MbCurve.

◆ GetAxisPoint()

virtual bool MbContour::GetAxisPoint ( MbCartPoint p) const
virtual

Calculate a point to construct an axis.

Calculates a point to construct an axis, if a curve may be constructed by rotation of a point around an axis.

Returns
true, if such axis exists.

Reimplemented from MbCurve.

◆ IsContinuousDerivative()

virtual bool MbContour::IsContinuousDerivative ( bool &  contLength,
bool &  contDirect,
c3d::DoubleVector params = NULL,
double  epsilon = EPSILON 
) const
virtual

Have the first derivative of the curve the continuous length and direction?

Are absent any discontinuities of the derivative at length or at direction in the junction of path segments?

Parameters
[out]contLength- The length is continuous (true/false).
[out]contDirect- The direction of the first derivative is continuous (true/false).
[in]epsilon- The accuracy of the calculation.

Reimplemented from MbCurve.

◆ SetContinuousDerivativeLength()

virtual bool MbContour::SetContinuousDerivativeLength ( VERSION  version,
double  epsilon = EPSILON 
)
virtual

Eliminate the discontinuities of the derivatives of the length of the joints of the segments.

Eliminate the discontinuities of the derivatives of the length of the joints of the segments.

Parameters
[in]epsilon- The accuracy of the calculation.
[in]version- Math version.

Reimplemented from MbCurve.

◆ CornerNormal()

bool MbContour::CornerNormal ( double  t,
MbVector norm 
) const

Normal by parameter with consideration of segments joints.

Normal by parameter with consideration of segments joints

Parameters
[in]t- Parameter on the contour
[out]norm- Unit vector of normal if not hit on the joint of segments
if we got on the joint of segments then the vector is directed, as the sum of two normals on segments in joint, with length which is equal to 1 divided by the sine of half angle between the segments
Returns
true, if got on the joint of segments

◆ GetCornerParams()

template<class Params >
void MbContour::GetCornerParams ( Params &  params) const

Parameters of segments joints.

Parameters of segments joints without minimal and maximal contour parameter.

Parameters
[out]params- Set of parameters.

◆ GetTwoTangents()

bool MbContour::GetTwoTangents ( double  t,
MbVector tan1,
MbVector tan2 
) const

Calculation of two tangents (for parameters of joints).

Calculation of two tangents for parameter of segments joint corresponding to the segments. If parameter is not one of parameters of segments joints tangents are equal. and maximal contour parameter.

Parameters
[in]t- A parameter.
[out]tan1- First tangent.
[out]tan2- Second tangent.

◆ GetSegmentsNames()

void MbContour::GetSegmentsNames ( SimpleNameArray names) const

Get names of segments.

Get names of contour segments.

Parameters
[out]names- Names of segments

◆ SetSegmentsNames()

void MbContour::SetSegmentsNames ( const SimpleNameArray names)

Set names of segments.

Set names of contour segments by array of names.

Parameters
[in]names- A set of names.

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