C3D Toolkit
Kernel - 117950, Vision - 2.7.5.29
|
Elliptical arc in two-dimensional space. More...
#include <cur_arc.h>
Public Member Functions | |
MbArc () | |
Constructor of a circle with default parameters. More... | |
MbArc (double rad) | |
Constructor of a circle by radius. More... | |
MbArc (const MbCartPoint &p, double rad) | |
Constructor of a circle. More... | |
MbArc (const MbCartPoint &pc, const MbCartPoint &on) | |
Create a circle. More... | |
MbArc (const MbCartPoint &pc, double rad, const MbCartPoint &p1, const MbCartPoint &p2, int initSense) | |
Constructor of a circular arc. More... | |
MbArc (const MbCartPoint &pc, double rad, double t1, double t2, int initSense) | |
Constructor of a circular arc. More... | |
MbArc (const MbArc &init, const MbCartPoint &p1, const MbCartPoint &p2, int initSense) | |
Constructor of an elliptic arc based on a sample and bounding points. More... | |
MbArc (const MbCartPoint &pc, const MbCartPoint &p1, const MbCartPoint &p2, int initSense) | |
Constructor of a circular arc. More... | |
MbArc (const MbCartPoint &p1, const MbCartPoint &p2, const MbCartPoint &p3) | |
Constructor of a circular arc. More... | |
MbArc (const MbCartPoint &p1, const MbCartPoint &p2, double a4) | |
Constructor of a circular arc. More... | |
MbArc (double aa, double bb, const MbPlacement &place, const MbCartPoint &p1, const MbCartPoint &p2, int initSense) | |
Constructor of an elliptical arc. More... | |
MbArc (double aa, double bb, const MbPlacement &place, double t1, double t2, int initSense) | |
Constructor of an elliptical arc. More... | |
MbArc (const MbArc &ellipse, double t1, double t2, int initSense) | |
Constructor of an elliptical arc. More... | |
MbArc (double aa, double bb, const MbPlacement &pos) | |
Constructor of an ellipse. More... | |
MbArc (double aa, double bb, const MbCartPoint &c, double angle) | |
Constructor of an ellipse. More... | |
MbArc (const MbArc &init) | |
Copy-constructor. | |
virtual | ~MbArc () |
Destructor. | |
Common functions of a geometric object. | |
MbePlaneType | IsA () const override |
Get the object type. | |
MbPlaneItem & | Duplicate (MbRegDuplicate *=nullptr) const override |
Create a copy. More... | |
bool | IsSame (const MbPlaneItem &other, double accuracy=LENGTH_EPSILON) const override |
Determine whether objects are equal. More... | |
bool | SetEqual (const MbPlaneItem &) override |
Make the objects equal. More... | |
void | Transform (const MbMatrix &matr, MbRegTransform *ireg=nullptr, const MbSurface *newSurface=nullptr) override |
Transform according to the matrix. More... | |
void | Move (const MbVector &, MbRegTransform *=nullptr, const MbSurface *newSurface=nullptr) override |
Translate along a vector. More... | |
void | Rotate (const MbCartPoint &pnt, const MbDirection &angle, MbRegTransform *=nullptr, const MbSurface *newSurface=nullptr) override |
Rotate about a point. More... | |
double | DistanceToPoint (const MbCartPoint &) const override |
Calculate the distance to a point. | |
bool | DistanceToPointIfLess (const MbCartPoint &toP, double &d) const override |
Calculate the distance to a point. More... | |
void | AddYourGabaritTo (MbRect &r) const override |
Extend the given bounding rectangle so that it encloses this object. | |
void | CalculateGabarit (MbRect &r) const override |
Detect the bounding box of a curve. More... | |
bool | IsInRectForDeform (const MbRect &r) const override |
Determine visibility of a curve in rectangle. | |
MbeState | Deformation (const MbRect &, const MbMatrix &) override |
Deform the curve. More... | |
void | Refresh () override |
Set all temporary (mutable) data of object to undefined (initial) state. | |
void | PrepareIntegralData (const bool forced) const override |
Calculate temporary (mutable) data of an object. More... | |
bool | IsVisibleInRect (const MbRect &r, bool exact=false) const override |
Determine visibility of an object in rectangle. More... | |
bool | IsCompleteInRect (const MbRect &r) const override |
Determine whether an object is fully visible in rectangle. More... | |
bool | IsVisibleInRect (const MbRect &rect, bool exact=false) const override |
Determine visibility of an object in rectangle. More... | |
Functions for curve domain description | |
double | GetTMax () const override |
Get the maximum value of parameter. | |
double | GetTMin () const override |
Get the minimum value of parameter. | |
bool | IsClosed () const override |
Define whether the curve is closed. More... | |
double | GetPeriod () const override |
Return period. More... | |
Functions for working in the domain of a curve. | |
PointOn, FirstDer, SecondDer, ThirdDer,... functions correct parameter when it runs out the domain. | |
void | PointOn (double &t, MbCartPoint &) const override |
Calculate a point on the curve. More... | |
void | FirstDer (double &t, MbVector &) const override |
Calculate first derivative. | |
void | SecondDer (double &t, MbVector &) const override |
Calculate second derivative. | |
void | ThirdDer (double &t, MbVector &) const override |
Calculate third derivative. | |
virtual void | Normal (double &t, MbVector &) const |
Functions for working inside and outside of the curve domain. | |
_PointOn, _FirstDer, _SecondDer, _ThirdDer,... functions don't correct parameter when it runs out the domain. The bounded curve is extended due to the equations of curve. | |
void | _PointOn (double t, MbCartPoint &) const override |
Calculate point at curve and its extension. More... | |
void | _FirstDer (double t, MbVector &) const override |
Calculate first derivative at curve and its extension. | |
void | _SecondDer (double t, MbVector &) const override |
Calculate second derivative at curve and its extension. | |
void | _ThirdDer (double t, MbVector &) const override |
Calculate third derivative at curve and its extension. | |
virtual void | _Normal (double t, MbVector &) const |
Functions for get of the group of data inside and outside the curve's domain of parameter. | |
void | Explore (double &t, bool ext, MbCartPoint &pnt, MbVector &fir, MbVector *sec, MbVector *thir) const override |
Calculate point and derivatives of object for given parameter. More... | |
Functions of moving along the curve | |
double | Step (double t, double sag) const override |
Calculate parameter step. More... | |
double | DeviationStep (double t, double angle) const override |
Calculate parameter step. More... | |
Common functions of the curve | |
void | Inverse (MbRegTransform *iReg=nullptr) override |
Set the opposite direction of curve. | |
double | GetMetricLength () const override |
Calculate the metric length of a curve. More... | |
double | CalculateMetricLength () const override |
Calculate the metric length of a curve. | |
double | GetLengthEvaluation () const override |
Calculate the metric length of a curve. More... | |
double | Curvature (double t) const override |
Calculate curvature of curve. | |
double | CalculateLength (double t1, double t2) const override |
Calculate the metric length of a curve. More... | |
bool | DistanceAlong (double &t, double len, int curveDir, double eps=Math::LengthEps, VERSION version=Math::DefaultMathVersion()) const override |
Translate parameter along the curve. More... | |
double | PointProjection (const MbCartPoint &pnt) const override |
Find the point projection to the curve. | |
bool | NearPointProjection (const MbCartPoint &pnt, double xEpsilon, double yEpsilon, double &t, bool ext, MbRect1D *tRange=nullptr) const override |
Find the point projection to the curve. More... | |
void | TangentPoint (const MbCartPoint &pnt, SArray< double > &tFind) const override |
Find tangents to a curve. More... | |
void | PerpendicularPoint (const MbCartPoint &pnt, SArray< double > &tFind) const override |
Find perpendiculars to a curve. More... | |
bool | SmallestPerpendicular (const MbCartPoint &pnt, double &tProj) const override |
Find the nearest perpendicular to the curve. More... | |
void | IntersectHorizontal (double y, SArray< double > &cross) const override |
Find intersections of a curve with horizontal line. More... | |
void | IntersectVertical (double x, SArray< double > &cross) const override |
Find intersections of a curve with vertical line. More... | |
bool | GetCentre (MbCartPoint &c) const override |
Return the center of an ellipse or a circle. | |
virtual const MbCartPoint & | GetCentre () const |
Return the center of an ellipse or a circle. | |
bool | GetMiddlePoint (MbCartPoint &p) const override |
Calculate a middle point of a curve. | |
bool | GetWeightCentre (MbCartPoint &p) const override |
Calculate the center of gravity of a curve. | |
double | GetRadius () const override |
Get the physical radius of the curve or null if it impossible. More... | |
bool | IsSimilarToCurve (const MbCurve &curve, double precision=PARAM_PRECISION) const override |
Define whether the curves are similar for the merge. | |
size_t | GetCount () const override |
Define the number of splittings for one passage in operations. | |
void | GetPointsByEvenLengthDelta (size_t n, std::vector< MbCartPoint > &pnts) const override |
Get n points of a curve with equal intervals by arc length. | |
bool | HasLength (double &length) const override |
Calculate the metric length of a curve. More... | |
bool | IsDegenerate (double eps=Math::LengthEps) const override |
Define whether the curve is degenerate.. | |
MbNurbs * | NurbsCurve (const MbCurveIntoNurbsInfo &) const override |
Construct a NURBS copy of a curve. More... | |
MbCurve * | NurbsCurve (const MbNurbsParameters &) const override |
Construct a NURBS copy of a curve. More... | |
MbContour * | NurbsContour () const override |
Approximate of a curve by the contour from NURBS curves. | |
MbCurve * | Trimmed (double t1, double t2, int sense, bool saveParamLenAndLaw=false) const override |
Construct a trimmed curve. More... | |
MbCurve * | Offset (double rad) const override |
Construct the equidistant curve which is shifted by the given value. | |
MbeItemLocation | PointRelative (const MbCartPoint &pnt, double eps=Math::LengthEps) const override |
Define the point position relative to the curve. More... | |
MbeState | DeletePart (double t1, double t2, MbCurve *&part2) override |
Delete the piece of a curve. More... | |
MbeState | TrimmPart (double t1, double t2, MbCurve *&part2) override |
Keep the piece of a curve. More... | |
bool | ModifyByPoint (size_t ind, const MbCartPoint &pnt) |
Modify the ellipse by a characteristic point. More... | |
bool | GetSpecificPoint (const MbCartPoint &from, double &dmax, MbCartPoint &pnt) const override |
Return a specific point of a curve. More... | |
void | Isoclinal (const MbVector &angle, SArray< double > &tFind) const override |
Construct isoclines. More... | |
bool | GetAxisPoint (MbCartPoint &p) const override |
Calculate a point to construct an axis. More... | |
MbResultType | Extend (const MbCurveExtensionParameters ¶meters, c3d::PlaneCurveSPtr &resCurve) const override |
Extend the curve. More... | |
bool | IsCircle (double eps=PARAM_EPSILON) const |
Check whether the ellipse is a circle with a given tolerance. | |
Functions in the local coordinate system of object placement. | |
const MbPlacement & | GetPlacement () const |
Get the local coordinate system of an object. | |
void | SetPlacement (const MbPlacement &pl) |
Modify the local coordinate system of the object. | |
bool | IsPositionNormal () const |
Determine whether the local coordinate system is orthonormalized. | |
bool | IsPositionCircular () const |
Determine whether the local coordinate system is orthogonal with X and Y axes equal by length. | |
bool | IsPositionIsotropic () const |
Determine whether the local coordinate system is orthogonal and isotropic by the axes. | |
double | GetPositionAngle (const MbCartPoint &p) const |
Calculate the angle in the local coordinate system. More... | |
void | InitByPositionAngles (double a1, double a2, int initSense) |
Initialization of the ellipse parameters. More... | |
Functions for working with data. | |
double | GetR () const |
Return the radius and the length of semiaxis along X for the ellipse. | |
double | GetRadiusA () const |
Return the length of semiaxis along X. | |
double | GetRadiusB () const |
Return the length of semiaxis along Y. | |
void | SetRadiusA (double aa) |
Set the length of semiaxis along X. | |
void | SetRadiusB (double bb) |
Set the length of semiaxis along Y. | |
double | GetAngle () const |
Return the arc opening angle. Set the arc opening angle. The start point of the arc remains unchanged. | |
void | SetAngle (double ang) |
double | GetMajorAxisAngle () const |
Calculate the angle between OX axes of the local and the global coordinate systems. | |
double | GetTrim1 () const |
Return the parameter of the start point. | |
double | GetTrim2 () const |
Return the parameter of the end point. | |
int | GetSense () const |
Determine the flag of coincidence of the direction with the base curve direction. | |
void | SetTrim1 (double t) |
Set the parameter of the start point. | |
void | SetTrim2 (double t) |
Set the parameter of the end point. | |
void | SetRadius (double rad) |
Set the radius of the circular arc. | |
void | SetCentre (const MbCartPoint &c) |
Set the center. | |
void | SetDirection (bool clockwise) |
Set the arc orientation. | |
void | Init (const MbArc &) |
Initialize elliptical arcs with the given arc. | |
void | Init (const MbCartPoint &pc, double rad) |
Initialize a circle by the center and the radius | |
void | Init (double t1, double t2) |
Initialize arc by parameters for begin point and end point. | |
void | Init3Points (const MbCartPoint &p1, const MbCartPoint &p2, const MbCartPoint &p3, bool cl) |
Initialize a circular arc. More... | |
void | InitCircle (const MbCartPoint &p1, const MbCartPoint &p2, const MbCartPoint &p3) |
Initialize a circular arc. More... | |
void | InitArc (MbCartPoint &pc, const MbCartPoint &p1, const MbCartPoint &p2) |
Initialize a circular arc. More... | |
void | Init (const MbCartPoint &pc, double rad, const MbCartPoint &p1, const MbCartPoint &p2, bool clockwise) |
Initialize a circular arc. More... | |
void | Init (const MbCartPoint &pc, const MbCartPoint &p) |
Initialize a circle. More... | |
void | Init (const MbCartPoint &p1, double angle, double rad) |
Initialize a circle. More... | |
void | Init (const MbCartPoint &pc, const MbCartPoint &pnt, double angle) |
Initialize a circle. More... | |
void | Init (const MbCartPoint &pc, double angle1, double angle2, double rad, bool clockwise) |
Initialize a circular arc. More... | |
void | Init (const MbCartPoint &pc, const MbCartPoint &pnt, bool firstPoint, double angle, bool clockwise) |
Initialize a circular arc. More... | |
void | Init (const MbCartPoint &pc, double angle1, const MbCartPoint &p2, double rad, bool clockwise) |
Initialize a circular arc. More... | |
void | Init (MbArc *obj, const MbCartPoint &p1, const MbCartPoint &p2, int initSense) |
Initialize a circular arc. More... | |
void | Init (const MbCartPoint &p1, const MbCartPoint &p2, double angle, bool firstAngle, bool clockwise) |
Initialize a circular arc. More... | |
void | Init (MbCartPoint &pc, double angle1, double angle2, const MbCartPoint &pnt, bool firstPoint, bool clockwise) |
Initialize a circular arc. More... | |
void | Init (MbCartPoint &pc, const MbCartPoint &p, bool firstPoint, double angle, double rad, bool clockwise) |
Initialize a circular arc. More... | |
void | Init (const MbCartPoint &pc, const MbCartPoint &p1, const MbCartPoint &p2, int initSense) |
Initialize a circular arc. More... | |
void | Init (double a2, MbCartPoint &p1, MbCartPoint &p2, const DiskreteLengthData *diskrData=nullptr, bool correctFirstPnt=true) |
Initialize a circular arc. More... | |
void | Init (double aa, double bb, const MbPlacement &place) |
Initialize an ellipse. More... | |
void | Init (double aa, double bb, const MbCartPoint &pc, double ang) |
Initialize an ellipse. More... | |
void | Init1 (const MbCartPoint &c, const MbCartPoint &p1, double &len, double &angle) |
Initialize an ellipse. More... | |
void | Init2 (const MbCartPoint &c, const MbCartPoint &p1, MbCartPoint &p2, double &lenB) |
Initialize an ellipse. More... | |
void | Init3 (const MbCartPoint &c0, const MbCartPoint &p1, double angle, double &aa, double &bb) |
Initialize an ellipse. More... | |
void | Init4 (const MbCartPoint &p1, const MbCartPoint &p2, double angle, double &aa, double &bb) |
Initialize an ellipse. More... | |
void | Init5 (const MbCartPoint &c, const MbCartPoint &p1, const MbCartPoint &p2, double &aa, double &bb, double &angle) |
Initialize an ellipse. More... | |
void | Init6 (const MbCartPoint &p1, const MbCartPoint &p2, const MbCartPoint &p3, double &aa, double &bb, double &angle) |
Initialize an ellipse. More... | |
void | Init7 (const MbCartPoint &pc, MbCartPoint p1, MbCartPoint p2, MbCartPoint p3, double &aa, double &bb, double &angle) |
Initialize an ellipse. More... | |
void | Init8 (const MbCartPoint &p1, const MbDirection &dir1, const MbCartPoint &p2, const MbDirection &dir2, const MbCartPoint &p3, double &aa, double &bb, double &angle) |
Initialize an ellipse. More... | |
void | Init (double aa, double bb, const MbPlacement &place, double t1, double t2, int initSense) |
Initialize an elliptical arc. More... | |
void | Init (double aa, double bb, const MbPlacement &place, const MbCartPoint &p1, const MbCartPoint &p2, bool clockwise) |
Initialize an elliptical arc. More... | |
void | Init4 (const MbCartPoint &p1, const MbCartPoint &p2, const MbCartPoint &pB, const MbCartPoint &pE, bool clockwise=false) |
Initialize an elliptical arc. More... | |
bool | OnSector (const MbCartPoint &pnt) const |
Determine whether the ray from the center to the point is in the arc's sector. | |
bool | OnSector (double angle) const |
Determine whether the ray hits the arc's sector. More... | |
void | SetLimitPoint (ptrdiff_t number, const MbCartPoint &pnt) |
Replace the arc's point. More... | |
bool | IsClockwise () const |
Return the arc direction: true - clockwise, false - counterclockwise. | |
double | GetLimitAngle (ptrdiff_t number) const |
Return the angle of the end point. More... | |
void | SetLimitAngle (ptrdiff_t number, const MbCartPoint &pnt) |
Modify the end angle of the arc. More... | |
double | CheckParam (double &t) const |
Set the parameter to the range of the allowable values. | |
void | ParamToAngle (double &t) const |
Convert the parameter of the curve to the angle. | |
void | AngleToParam (double &t) const |
Convert the curve angle to the curve parameter. | |
void | ParameterInto (double &t) const |
Convert parameter of the base curve to the local parameter. | |
void | ParameterFrom (double &t) const |
Convert the local parameter to the parameter of the base curve. | |
bool | IsBaseParamOn (double t, double eps=Math::paramEpsilon) const |
Determine whether the parameter of the base curve is in range of the trimmed curve. | |
void | PointOnBaseEllipse (double &t, MbCartPoint &pnt) const |
Evaluate a point on ellipse. More... | |
double | PointProjectionOnBaseEllipse (const MbCartPoint &pnt) const |
Find the projection of a point onto the ellipse. More... | |
void | MakeAsBaseEllipse () |
Initialize as complete ellipse. | |
void | CopyBaseEllipse (const MbArc &init) |
Copy the base ellipse. | |
bool | IsSelfIntersectOffset (double d) const |
Determine whether the ellipse offset has self-intersections. More... | |
bool | ParametricToCanonicConic (double &A, double &B, double &C, double &D, double &E, double &F, double &X1, double &Y1, double &X2, double &Y2) const |
bool | Normalize () |
Orthonormalize the local coordinate system. | |
void | GetControlPoints (SArray< MbCartPoint > &points) |
Fill the array with the control points. | |
void | NormalizeTransform (const MbMatrix &mt) |
Orthonormalize the placement when transforming. | |
ptrdiff_t | EllipticIntersect (const MbLine &pLine, double cross[2], double eps0=PARAM_PRECISION) const |
Determine the parameters of intersection of a line with an ellipse. More... | |
const MbArc & | operator= (const MbArc &init) |
Overrides the assignment operator. | |
void | GetProperties (MbProperties &properties) override |
Get properties of the object. More... | |
void | SetProperties (const MbProperties &properties) override |
Change properties of the object. More... | |
void | GetBasisPoints (MbControlData &) const override |
Get control points of object. | |
void | SetBasisPoints (const MbControlData &) override |
Change the object by control points. | |
![]() | |
virtual | ~MbCurve () |
Destructor. | |
MbePlaneType | Type () const override |
Get the group type of the object. | |
MbePlaneType | Family () const override |
Get family of object. | |
void | Refresh () override |
Set all temporary (mutable) data of object to undefined (initial) state. | |
size_t | size () const |
Number of objects if object is interpreted as vector of objects. | |
const MbCurve * | operator[] (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... | |
bool | IsVisibleInRect (const MbRect &rect, bool exact=false) const override |
Determine visibility of an object in rectangle. More... | |
double | DistanceToPoint (const MbCartPoint &toP) const override |
Calculate the distance to a point. | |
bool | DistanceToPointIfLess (const MbCartPoint &toP, double &d) const override |
Calculate the distance to a point. 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. | |
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 | IsStraight (bool ignoreParams=false) const |
Define whether the curve is rectilinear.. | |
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 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... | |
MbNurbs * | NurbsCurve (const MbCurveIntoNurbsInfo *nInfo=nullptr) const |
Construct a NURBS copy of a 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... | |
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 void | GetStartPoint (MbCartPoint &) const |
Calculate a start point of a curve. | |
virtual void | GetEndPoint (MbCartPoint &) const |
Calculate an end point of a curve. | |
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 |
void | GetPointsByEvenLengthDelta (size_t n, SArray< MbCartPoint > &pnts) const |
virtual double | LengthBetween2Points (MbCartPoint &p1, MbCartPoint &p2, MbCartPoint *pc=nullptr) 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... | |
MbCurve * | InverseDuplicate () 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 MbCurve & | GetBasisCurve () const |
Returns the base curve if exists or itself. | |
virtual MbCurve & | SetBasisCurve () |
Returns the base curve if exists or itself. | |
virtual double | GetParamDelta () const |
Return an indent by parameter of a curve. | |
virtual const MbCurve & | GetSubstrate () const |
Get a substrate or itself. | |
virtual MbCurve & | SetSubstrate () |
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 void | GetAnalyticalFunctionsBounds (std::vector< double > ¶ms) const |
Get the boundaries of the curve sections that are described by one analytical function. More... | |
virtual void | BreakPoints (std::vector< double > &vBreaks, double precision=ANGLE_REGION) const |
\ ru Определение точек излома кривой. The determination of curve smoothness break points. | |
MbProperty & | CreateProperty (MbePrompt name) const override |
Create a custom property. | |
virtual bool | IsContinuousDerivative (bool &contLength, bool &contDirect, c3d::DoubleVector *params=nullptr, double epsilon=EPSILON) const |
Get properties of the object. 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. | |
![]() | |
virtual | ~MbPlaneItem () |
Destructor. | |
void | PrepareWrite () const |
Object registration. More... | |
MbeRefType | RefType () const override |
Get the registration type (for copying, duplication). | |
virtual void | Rotate (const MbCartPoint &pnt, double angle, MbRegTransform *iReg=nullptr, const MbSurface *newSurface=nullptr) |
Rotate about a point. More... | |
virtual bool | IsSimilar (const MbPlaneItem &item) const |
Determine whether the objects are similar. More... | |
![]() | |
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. | |
![]() | |
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. | |
![]() | |
void | Lock () const |
Switch lock on (locking happens only in parallel region). | |
void | Unlock () const |
Switch lock off if locking has been set. | |
CommonRecursiveMutex * | GetLock () const |
Get a pointer to the mutex object. Return nullptr if no parallelism. For use in ScopedLock. | |
Protected Member Functions | |
double | GetParamEpsilon (double eps=Math::LengthEps) const |
Get the parameter accuracy. | |
void | SetClosed () |
Make closed. | |
![]() | |
MbCurve () | |
Default constructor. | |
MbCurve (const MbCurve &other) | |
Copy-constructor. | |
![]() | |
MbPlaneItem () | |
Constructor. | |
![]() | |
MbRefItem () | |
Constructor without parameters. | |
Protected Attributes | |
MbPlacement | position |
Local coordinate system. | |
double | a |
Radius of semiaxis along X. | |
double | b |
Radius of semiaxis along Y. | |
double | trim1 |
The start point parameters. | |
double | trim2 |
The end point parameters. | |
int | sense |
Flag of coincidence with direction from axisX to axisY (sense==0 is not allowed). | |
bool | circle |
Whether the object is a circle (true) or an ellipse (false). | |
bool | closed |
Whether the object is a closed curve (true) or an arc (false). | |
MbRect | rect |
Auxiliary data. More... | |
double | metricLength |
Metric length of curve. | |
![]() | |
SimpleName | name |
A curve name. The object data is temporary and used internally. | |
Elliptical arc in two-dimensional space.
The elliptical arc is described by two radii a and b and two parameters trim1 and trim2 given in the local coordinate system 'position'.
Parameters 'trim1' and 'trim2' are measured along the arc in direction from position.axisX axis to position.axisY axis. Parameters 'trim1' and 'trim2' will be called parameters of trimming. Values of parameters of trimming equal to 0 and 2pi correspond to a point on position.axisX axis.
Parameter t of curve possesses the values in the range: 0<=t<=trim2-trim1. The curve can be closed. For closed curve: trim2-trim1=2pi.
Radius-vector of the curve in the method PointOn(double&t,MbCartPoint3D&r) is described by the function
r(t) = position.origin + (a cos(trim1+(sense)t) position.axisX) + (b sin(trim1+(sense)t) position.axisY).
Radii of the curve must be positive: a>0, b>0.
The following inequalities must be satisfied for the parameters of trimming: trim1<trim2 if sense==1 and trim1>trim2 if sense==-1.
The local coordinate system 'position' can be both right and left. If the local coordinate system is right and sense=+1 or the local coordinate system is left and sense=-1, then the arc is oriented counterclockwise.
MbArc::MbArc | ( | ) |
Constructor of a circle with default parameters.
A circle is created with center in the origin and zero radius.
MbArc::MbArc | ( | double | rad | ) |
Constructor of a circle by radius.
A circle is created with center in the origin and the given radius.
[in] | rad | - Radius. |
MbArc::MbArc | ( | const MbCartPoint & | p, |
double | rad | ||
) |
Constructor of a circle.
A circle is created with center in point 'p' and with the given radius.
[in] | p | - Center of circle. |
[in] | rad | - Radius. |
MbArc::MbArc | ( | const MbCartPoint & | pc, |
const MbCartPoint & | on | ||
) |
Create a circle.
A circle is created with center in point 'pc'. The radius is determined as the distance between points 'pc' and 'on'.
[in] | pc | - Center of circle. |
[in] | on | - Point on circle. |
MbArc::MbArc | ( | const MbCartPoint & | pc, |
double | rad, | ||
const MbCartPoint & | p1, | ||
const MbCartPoint & | p2, | ||
int | initSense | ||
) |
Constructor of a circular arc.
A circular arc is created with a center in point 'p' and with a given radius. Points 'p1' and 'p2' specify the bounds of arc. The start point of the arc lies on the ray starting from the circle center and passing through point 'p1'. The end point is on the ray passing through the point 'p2'. Parameter 'initSense' specifies the arc direction. If initSense > 0, then the orientation is counterclockwise.
[in] | pc | - Center of circle. |
[in] | rad | - Radius. |
[in] | p1 | - A point specifying the beginning of the arc. |
[in] | p2 | - A point specifying the end of the arc. |
[in] | initSense | - Direction. initSense > 0 - counterclockwise, initSense < 0 - clockwise. initSense cannot be equal to zero. |
MbArc::MbArc | ( | const MbCartPoint & | pc, |
double | rad, | ||
double | t1, | ||
double | t2, | ||
int | initSense | ||
) |
Constructor of a circular arc.
A circular arc is created with a center in point 'p' and with a given radius. t1 and t2 specify the start and the end angles of the arc. The angles are measured from the OX axis counterclockwise. The angles are given in radians. Parameter 'initSense' specifies the arc direction. If initSense > 0, then the orientation is counterclockwise.
[in] | pc | - Center of circle. |
[in] | rad | - Radius. |
[in] | t1 | - An angle specifying the beginning of the arc. |
[in] | t2 | - An angle specifying the end of the arc. |
[in] | initSense | - Direction. initSense > 0 - counterclockwise, initSense < 0 - clockwise. initSense can't be equal to zero. |
MbArc::MbArc | ( | const MbArc & | init, |
const MbCartPoint & | p1, | ||
const MbCartPoint & | p2, | ||
int | initSense | ||
) |
Constructor of an elliptic arc based on a sample and bounding points.
An arc based on the given sample of circle or ellipse is created. Points 'p1' and 'p2' specify the bounds of arc. The start point of the arc lies on the ray starting from the circle center and passing through point 'p1'. The end point is on the ray passing through the point 'p2'. Parameter 'initSense' specifies the arc direction. If initSense > 0, then the orientation is counterclockwise.
[in] | init | - A sample circle or ellipse. |
[in] | p1 | - A point specifying the beginning of the arc. |
[in] | p2 | - A point specifying the end of the arc. |
[in] | initSense | - Direction. initSense > 0 - counterclockwise, initSense < 0 - clockwise. initSense can't be equal to zero. |
MbArc::MbArc | ( | const MbCartPoint & | pc, |
const MbCartPoint & | p1, | ||
const MbCartPoint & | p2, | ||
int | initSense | ||
) |
Constructor of a circular arc.
An arc of a circle centered in point 'pc'. The radius is determined as the distance between points 'pc' and 'p1'. Points 'p1' and 'p2' specify the bounds of arc. The start point of the arc lies on the ray starting from the circle center and passing through point 'p1'. The end point is on the ray passing through the point 'p2'. Parameter 'initSense' specifies the arc direction. If initSense > 0, then the orientation is counterclockwise.
[in] | pc | - Center of circle. |
[in] | p1 | - A point determining the beginning of the arc and the radius. |
[in] | p2 | - A point specifying the end of the arc. |
[in] | initSense | - Direction. initSense > 0 - counterclockwise, initSense < 0 - clockwise. initSense can't be equal to zero. |
MbArc::MbArc | ( | const MbCartPoint & | p1, |
const MbCartPoint & | p2, | ||
const MbCartPoint & | p3 | ||
) |
Constructor of a circular arc.
A circular arc is created passing through 3 given points. Points p1 and p3 are the end points. Direction of moving along the arc is defined so as point p2 lay on the arc.
[in] | p1 | - Beginning of the arc. |
[in] | p2 | - A point on the arc. |
[in] | p3 | - End of the arc. |
MbArc::MbArc | ( | const MbCartPoint & | p1, |
const MbCartPoint & | p2, | ||
double | a4 | ||
) |
Constructor of a circular arc.
An arc is created with ends at the given points. A circle radius is defined by the given tangent of 1/4 of arc opening angle.
[in] | p1 | - Beginning of the arc. |
[in] | p2 | - End of the arc. |
[in] | a4 | - Tangent of 1/4 of the arc opening angle. |
MbArc::MbArc | ( | double | aa, |
double | bb, | ||
const MbPlacement & | place, | ||
const MbCartPoint & | p1, | ||
const MbCartPoint & | p2, | ||
int | initSense | ||
) |
Constructor of an elliptical arc.
An elliptical arc is created with the given semiaxes and the local coordinate system. Points 'p1' and 'p2' specify the bounds of arc. The start point of the arc lies on the ray starting from the circle center and passing through point 'p1'. The end point is on the ray passing through the point 'p2'. Parameter 'initSense' specifies the arc direction. If initSense > 0, then the orientation is counterclockwise.
[in] | aa | - Radius of semiaxis along X. |
[in] | bb | - Radius of semiaxis along Y. |
[in] | place | - The local coordinate system of the ellipse. |
[in] | p1 | - A point specifying the beginning of the arc. |
[in] | p2 | - A point specifying the end of the arc. |
[in] | initSense | - Direction. initSense > 0 - counterclockwise, initSense < 0 - clockwise. initSense can't be equal to zero. |
MbArc::MbArc | ( | double | aa, |
double | bb, | ||
const MbPlacement & | place, | ||
double | t1, | ||
double | t2, | ||
int | initSense | ||
) |
Constructor of an elliptical arc.
An elliptical arc is created with the given semiaxes and the local coordinate system. t1 and t2 specify the start and the end angles of the arc. The angles are measured from the OX axis counterclockwise. The angles are given in radians. Parameter 'initSense' specifies the arc direction. If initSense > 0, then the orientation is counterclockwise.
[in] | aa | - Radius of semiaxis along X. |
[in] | bb | - Radius of semiaxis along Y. |
[in] | place | - The local coordinate system of the ellipse. |
[in] | t1 | - An angle specifying the beginning of the arc. |
[in] | t2 | - An angle specifying the end of the arc. |
[in] | initSense | - Direction. initSense > 0 - counterclockwise, initSense < 0 - clockwise. initSense can't be equal to zero. |
MbArc::MbArc | ( | const MbArc & | ellipse, |
double | t1, | ||
double | t2, | ||
int | initSense | ||
) |
Constructor of an elliptical arc.
An elliptical arc is constructed with the local coordinate system and semiaxes of the given ellipse. t1 and t2 specify the start and the end angles of the arc. The angles are measured from the OX axis counterclockwise. The angles are given in radians. Parameter 'initSense' specifies the arc direction. If initSense > 0, then the orientation is counterclockwise.
[in] | ellipse | - A pattern ellipse. |
[in] | t1 | - An angle specifying the beginning of the arc. |
[in] | t2 | - An angle specifying the end of the arc. |
[in] | initSense | - Direction. initSense > 0 - counterclockwise, initSense < 0 - clockwise. initSense can't be equal to zero. |
MbArc::MbArc | ( | double | aa, |
double | bb, | ||
const MbPlacement & | pos | ||
) |
Constructor of an ellipse.
An ellipse is created with the given local coordinate system and semiaxes.
[in] | aa | - Radius of semiaxis along X. |
[in] | bb | - Radius of semiaxis along Y. |
[in] | pos | - The local coordinate system of the ellipse. |
MbArc::MbArc | ( | double | aa, |
double | bb, | ||
const MbCartPoint & | c, | ||
double | angle | ||
) |
Constructor of an ellipse.
An ellipse is created with the given semiaxes. The local coordinate system of the ellipse has the origin in point 'c'; OX axis of the local coordinate system forms angle 'angle' with the OX axis of the current coordinate system. Direction of turning from the current coordinate system axis to the axis of the new coordinate system.
[in] | aa | - Radius of semiaxis along X. |
[in] | bb | - Radius of semiaxis along Y. |
[in] | c | - Origin of local coordinate system of ellipse. |
[in] | angle | - An angle between OX axes of the local and the current coordinate systems. |
|
overridevirtual |
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.
[in] | iReg | - Registrator. |
Implements MbPlaneItem.
|
overridevirtual |
Determine whether objects are equal.
Objects of the same types with similar (equal) data are considered to be equal.
[in] | item | - Object for comparison. |
[in] | accuracy | - The accuracy. |
Implements MbPlaneItem.
|
overridevirtual |
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.
[in] | item | - Object for initialization. |
Implements MbPlaneItem.
|
overridevirtual |
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.
[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 MbPlaneItem.
|
overridevirtual |
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.
[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 MbPlaneItem.
|
overridevirtual |
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.
[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 MbPlaneItem.
|
overridevirtual |
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.
[in] | to | - Point. |
[in,out] | d | - Specified distance from object on input. Distance from point to object on output if operation succeeded. |
Implements MbPlaneItem.
|
overridevirtual |
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.
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.
[in] | rect | - A rectangle, in which the visibility of a curve is checked. |
[in] | matr | - A deformation matrix. |
Reimplemented from MbCurve.
|
overridevirtual |
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.
[in] | forced | - Forced recalculation. |
Reimplemented from MbCurve.
|
overridevirtual |
Determine visibility of an object in rectangle.
It is considered that the object is visible in rectangle if bounds of an object is crossed with the given rectangle or (high requirements to accuracy, exact = true) at least one point of object is in the rectangle.
[in] | rect | - Rectangle to check getting to. |
[in] | exact | - Check accuracy. If exact = true, then at least one point of object gets to the rectangle. if exact = false, it is sufficient to find intersection between rectangle and bounding box of an object. |
Implements MbPlaneItem.
|
overridevirtual |
Determine whether an object is fully visible in rectangle.
An object is fully contained in the given rectangle if its bounding rectangle is included in the given rectangle.
[in] | rect | - Rectangle to check inclusion to. |
Reimplemented from MbCurve.
|
overridevirtual |
Define whether the curve is closed.
Define whether the curve is closed.
A curve is considered as closed if it is cyclic:
Implements MbCurve.
|
overridevirtual |
Return period.
Return the period value if a curve can be closed. Let unclosed curve return null.
Reimplemented from MbCurve.
|
overridevirtual |
Calculate a point on the curve.
Correct parameter when getting out of domain bounds and calculate a point on the curve.
[in] | t | - Curve parameter. |
[out] | p | - A point on the curve. |
Implements MbCurve.
|
overridevirtual |
Calculate point at curve and its extension.
Calculate a point on the curve including the outside area determination parameter.
[in] | t | - Curve parameter. |
[out] | p | - A point on the curve. |
Reimplemented from MbCurve.
|
overridevirtual |
Calculate point and derivatives of object for given parameter.
Values of point and derivatives are calculated on parameter area and on extended curve.
[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 nullptr. |
[out] | thir | - Third derivative with respect to t, if not nullptr. |
Reimplemented from MbCurve.
|
overridevirtual |
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.
[in] | t | - A parameter defining the point on a curve, at which a step should be calculated. |
[in] | sag | - Maximum feasible sag value. |
Reimplemented from MbCurve.
|
overridevirtual |
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.
[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. |
Reimplemented from MbCurve.
|
overridevirtual |
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().
Implements MbCurve.
|
overridevirtual |
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.
|
overridevirtual |
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.
[in] | t1 | - Start parameter of a curve section. |
[in] | t2 | - End parameter of a curve section. |
Reimplemented from MbCurve.
|
overridevirtual |
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.
[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. |
Reimplemented from MbCurve.
|
overridevirtual |
Find the point projection to the curve.
Find the nearest projection of a point on a curve (in the range of the curve) or on its continuation by the given initial approximation. If the parameter ext = true, then also search for a projection on the continuation of the curve. If the range of change of the 'tRange' parameter is specified, then find the projection in the specified range. A range of parameter may not belong to the domain of a curve. The Newton method is used.
[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. |
Reimplemented from MbCurve.
|
overridevirtual |
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.
[in] | pnt | - A given point. |
[in,out] | tFind | - An array of parameters of a curve, corresponding to the tangent points. |
Reimplemented from MbCurve.
|
overridevirtual |
Find perpendiculars to a curve.
Find all perpendiculars to a curve from the given point. In this function a curve without extensions is considered.
[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.
|
overridevirtual |
Find the nearest perpendicular to the curve.
Find the nearest perpendicular to the curve from the given point. In this function perpendiculars to an extension of a curve are not considered.
[in] | pnt | - A given point. |
[in,out] | tProj | - Parameter on a curve, corresponding to the point on a curve, which the perpendicular is passed through. |
Reimplemented from MbCurve.
|
overridevirtual |
Find intersections of a curve with horizontal line.
Find intersections of a curve with horizontal line.
[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.
|
overridevirtual |
Find intersections of a curve with vertical line.
Find intersections of a curve with vertical line.
[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.
|
overridevirtual |
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.
Reimplemented from MbCurve.
|
overridevirtual |
Calculate the metric length of a curve.
Calculate the metric length of a curve and save the result in the variable 'length'.
[in,out] | length | - Calculated length of a curve. |
Implements MbCurve.
|
overridevirtual |
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.
[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. |
Implements MbCurve.
|
overridevirtual |
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.
[in] | tParameters | - Parameters for the construction of a NURBS copy of the curve. |
Reimplemented from MbCurve.
|
overridevirtual |
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.
[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. |
[in] | saveParLenAndLaw | - Save parametric length and law. |
Implements MbCurve.
|
overridevirtual |
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.
[in] | pnt | - A given point. |
[in] | eps | - A tolerance of detection. |
Reimplemented from MbCurve.
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.
[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. |
Implements MbCurve.
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:
[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 nullptr is returned. |
Implements MbCurve.
bool MbArc::ModifyByPoint | ( | size_t | ind, |
const MbCartPoint & | pnt | ||
) |
Modify the ellipse by a characteristic point.
[in] | ind | - Index of a characteristic point. Possible values: 0 - Ellipse center. 1 - The point on ellipse corresponding to 0 degrees. 2 - The point on ellipse corresponding to 90 degrees. 3 - The point on ellipse corresponding to 180 degrees. 4 - The point on ellipse corresponding to 270 degrees. |
[in] | pnt | - Characteristic point. |
|
overridevirtual |
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.
[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. |
Reimplemented from MbCurve.
Construct isoclines.
Construct lines at an angle to the axis OX and tangent to the curve.
[in] | angle | - A vector defining an inclination angle of line to the axis OX. |
[in,out] | tFind | - An array of parameters of a curve, corresponding to the tangent points. |
Reimplemented from MbCurve.
|
overridevirtual |
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.
Reimplemented from MbCurve.
|
overridevirtual |
Extend the curve.
Extend the curve according to the given parameters.
[in] | parameters | - Parameters of extension. |
[out] | resCurve | - The extended curve or nullptr if extension is impossible. |
Reimplemented from MbCurve.
double MbArc::GetPositionAngle | ( | const MbCartPoint & | p | ) | const |
Calculate the angle in the local coordinate system.
Calculate the angle between OX axis of the local coordinate system and the ray starting from the origin of local coordinate system and passing through point p.
[in] | p | - A given point. |
void MbArc::InitByPositionAngles | ( | double | a1, |
double | a2, | ||
int | initSense | ||
) |
Initialization of the ellipse parameters.
Parameters are calculated subject to the directions and angles corresponding to the beginning and the end of the arc calculated in the local coordinate system.
[in] | a1 | - The angle corresponding to the beginning of the arc. |
[in] | a2 | - The angle corresponding to the end of the arc. |
[in] | initSense | - Direction. initSense > 0 - counterclockwise, initSense < 0 - clockwise. initSense can't be equal to zero. |
void MbArc::Init3Points | ( | const MbCartPoint & | p1, |
const MbCartPoint & | p2, | ||
const MbCartPoint & | p3, | ||
bool | cl | ||
) |
Initialize a circular arc.
Initialize a circular arc passing through all 3 given points. Points p1 and p3 are the end points. If the arc is not closed, then the direction of moving along the arc is defined so as the point p2 lies on the arc.
[in] | p1 | - Beginning of the arc. |
[in] | p2 | - A point on the arc. |
[in] | p3 | - End of the arc. |
[in] | cl | - Closedness attribute. |
void MbArc::InitCircle | ( | const MbCartPoint & | p1, |
const MbCartPoint & | p2, | ||
const MbCartPoint & | p3 | ||
) |
Initialize a circular arc.
Initialize a circular arc passing through all 3 given points. Points p1 and p3 are the end points. The direction of moving along the arc is defined so as the point p2 lies on the arc.
[in] | p1 | - Beginning of the arc. |
[in] | p2 | - A point on the arc. |
[in] | p3 | - End of the arc. |
void MbArc::InitArc | ( | MbCartPoint & | pc, |
const MbCartPoint & | p1, | ||
const MbCartPoint & | p2 | ||
) |
Initialize a circular arc.
A new position of the arc center is specified, the arc center will be located on the bisector of the opening angle.
[in] | pc | - Center of circle. |
[in] | p1 | - Beginning of the arc. |
[in] | p2 | - End of the arc. |
void MbArc::Init | ( | const MbCartPoint & | pc, |
double | rad, | ||
const MbCartPoint & | p1, | ||
const MbCartPoint & | p2, | ||
bool | clockwise | ||
) |
Initialize a circular arc.
The center and the radius of the circle is being modified. Points 'p1' and 'p2' specify the bounds of arc. The start point of the arc lies on the ray starting from the circle center and passing through point 'p1'. The end point is on the ray passing through the point 'p2'. Parameter 'initSense' specifies the arc direction. If initSense > 0, then the orientation is counterclockwise.
[in] | pc | - Center of circle. |
[in] | rad | - Radius. |
[in] | p1 | - A point specifying the beginning of the arc. |
[in] | p2 | - A point specifying the end of the arc. |
[in] | clockwise | - Direction. clockwise > 0 - moving counterclockwise, clockwise < 0 - clockwise. 'clockwise' can't be equal to zero. |
void MbArc::Init | ( | const MbCartPoint & | pc, |
const MbCartPoint & | p | ||
) |
Initialize a circle.
The source object is changed to a circle with center in point 'pc'. The radius is determined as a distance between points pc and p.
[in] | pc | - Center of circle. |
[in] | p | - Point on circle. |
void MbArc::Init | ( | const MbCartPoint & | p1, |
double | angle, | ||
double | rad | ||
) |
Initialize a circle.
The source object is changed to a circle passing through point p1 with the given radius. Angle 'angle' specifies a line the circle's center lies on. It is the angle between a ray starting from point p1 and directed to the circle's center and OX axis.
[in] | p1 | - Point on circle. |
[in] | angle | - An angle specifying the position of the center on the circle. |
[in] | rad | - Radius. |
void MbArc::Init | ( | const MbCartPoint & | pc, |
const MbCartPoint & | pnt, | ||
double | angle | ||
) |
Initialize a circle.
The source object is changed to a circle with the given center and passing through point pnt. The radius is determined as the distance between points pc and pnt.
[in] | pc | - Center of circle. |
[in] | pnt | - Point on circle. |
[in] | angle | - Get the start parameter. |
void MbArc::Init | ( | const MbCartPoint & | pc, |
double | angle1, | ||
double | angle2, | ||
double | rad, | ||
bool | clockwise | ||
) |
Initialize a circular arc.
The source object is changed to a circular arc with the given center and radius. angle1 and angle2 specify the start and the end angles of the arc. The angles are measured from the OX axis counterclockwise. The angles are given in radians. Parameter 'clockwise' specifies the direction of the arc. If clockwise > 0, then the direction of moving is counterclockwise.
[in] | pc | - Center of circle. |
[in] | angle1 | - An angle specifying the beginning of the arc. |
[in] | angle2 | - An angle specifying the end of the arc. |
[in] | rad | - Radius. |
[in] | clockwise | - Direction. clockwise > 0 - moving counterclockwise, clockwise < 0 - clockwise. 'clockwise' can't be equal to zero. |
void MbArc::Init | ( | const MbCartPoint & | pc, |
const MbCartPoint & | pnt, | ||
bool | firstPoint, | ||
double | angle, | ||
bool | clockwise | ||
) |
Initialize a circular arc.
The source object is changed to a circular arc with the given center and passing through point pnt. The radius is determined as the distance between points pc and pnt. Parameter 'clockwise' specifies the direction of the arc. If clockwise > 0, then the direction of moving is counterclockwise.
[in] | pc | - Center of circle. |
[in] | pnt | - End point of the circular arc. |
[in] | firstPoint | - Flag determining whether the point pnt is the start point. |
[in] | angle | - The angle between the radius to the second point and the OX axis. |
[in] | clockwise | - Direction. clockwise > 0 - moving counterclockwise, clockwise < 0 - clockwise. 'clockwise' can't be equal to zero. |
void MbArc::Init | ( | const MbCartPoint & | pc, |
double | angle1, | ||
const MbCartPoint & | p2, | ||
double | rad, | ||
bool | clockwise | ||
) |
Initialize a circular arc.
The source object is changed to a circular arc with the given center and radius. The end point of the arc is determined as intersection of ray (pc, p2) and the circle. Parameter 'clockwise' specifies the direction of the arc. If clockwise > 0, then the direction of moving is counterclockwise.
[in] | pc | - Center of circle. |
[in] | angle1 | - The start parameter of the circle. |
[in] | p2 | - A point specifying the angle of the circular arc end. |
[in] | rad | - Radius. |
[in] | clockwise | - Direction. clockwise > 0 - moving counterclockwise, clockwise < 0 - clockwise. initSense can't be equal to zero. |
void MbArc::Init | ( | MbArc * | obj, |
const MbCartPoint & | p1, | ||
const MbCartPoint & | p2, | ||
int | initSense | ||
) |
Initialize a circular arc.
The source object is changed to a circular arc corresponding to a given object. The start and the end point of the arc is determined as intersection of rays passing from the center to points p1 and p2 with the circle. The end point of the arc is determined as intersection of ray (pc, p2) and the circle. Parameter 'initSense' specifies the arc direction. If initSense > 0, then the orientation is counterclockwise.
[in] | obj | - A pattern object. |
[in] | p1 | - A point determining the angle of the beginning of the circular arc. |
[in] | p2 | - A point specifying the angle of the circular arc end. |
[in] | initSense | - Direction. initSense > 0 - counterclockwise, initSense < 0 - clockwise. initSense can't be equal to zero. |
void MbArc::Init | ( | const MbCartPoint & | p1, |
const MbCartPoint & | p2, | ||
double | angle, | ||
bool | firstAngle, | ||
bool | clockwise | ||
) |
Initialize a circular arc.
In the result of the operation the circular arc is obtained which starts at point p1 and ends at point p2. For one of points the angle between the direction from the point to the circle center and the OX axis is specified. Parameter firstAngle determines for which of points the angle is specified. Parameter 'clockwise' specifies the direction of the arc. If clockwise > 0, then the direction of moving is counterclockwise.
[in] | p1 | - The start point of the circular arc. |
[in] | p2 | - The end point of the circular arc. |
[in] | angle | - The angle between the direction from the point to the circle center and OX axis. |
[in] | firstAngle | - Flag determining for which point the angle is specified. firstAngle == true - for the first one. |
[in] | clockwise | - Direction. clockwise > 0 - moving counterclockwise, clockwise < 0 - clockwise. 'clockwise' can't be equal to zero. |
void MbArc::Init | ( | MbCartPoint & | pc, |
double | angle1, | ||
double | angle2, | ||
const MbCartPoint & | pnt, | ||
bool | firstPoint, | ||
bool | clockwise | ||
) |
Initialize a circular arc.
In the result of the operation a circular arc is obtained one of ends of which is point pnt. For this point the angle between the line directed from the point to the circle center and OX axis is specified. Find projection pc onto this line to determine the circle center.
The second angle specifies the second end of the arc. Parameter 'clockwise' specifies the direction of the arc. If clockwise > 0, then the direction of moving is counterclockwise.
[in,out] | pc | - On input - the given point, on output - the circle center. |
[in] | angle1 | - Angle between the direction from the starting point of the arc to the circle center and OX axis. |
[in] | angle2 | - Angle between the direction from the end point of the arc to the circle center and OX axis. |
[in] | pnt | - End point of the circular arc. |
[in] | firstPoint | - Flag determining whether the point pnt is a starting point. |
[in] | clockwise | - Direction. clockwise > 0 - moving counterclockwise, clockwise < 0 - clockwise. 'clockwise' can't be equal to zero. |
void MbArc::Init | ( | MbCartPoint & | pc, |
const MbCartPoint & | p, | ||
bool | firstPoint, | ||
double | angle, | ||
double | rad, | ||
bool | clockwise | ||
) |
Initialize a circular arc.
The source object is changed to the circular arc with the given radius and passing through point p. The circle center should be defined so as it is as close to the given point pc as possible. Parameter 'clockwise' specifies the direction of the arc. If clockwise > 0, then the direction of moving is counterclockwise.
[in,out] | pc | - On input - the given point, on output - the circle center. |
[in] | p | - End point of the circular arc. |
[in] | firstPoint | - Flag determining whether the point pnt is a starting point. |
[in] | angle | - The angle between the radius to the second point and the OX axis. |
[in] | rad | - Radius. |
[in] | clockwise | - Direction. clockwise > 0 - moving counterclockwise, clockwise < 0 - clockwise. 'clockwise' can't be equal to zero. |
void MbArc::Init | ( | const MbCartPoint & | pc, |
const MbCartPoint & | p1, | ||
const MbCartPoint & | p2, | ||
int | initSense | ||
) |
Initialize a circular arc.
In the result of the operation the circular arc is obtained with the center in point pc. The radius is determined as the distance between points 'pc' and 'p1'. Directions from the center to points p1 and p2 specify the angles determining the start and the end of the circle. Parameter 'clockwise' specifies the direction of the arc. If clockwise > 0, then the direction of moving is counterclockwise.
[in] | pc | - Center of circle. |
[in] | p1 | - A point specifying the direction to the beginning of the circular arc. |
[in] | p2 | - A point specifying the direction to the end of the circular arc. |
[in] | initSense | - Direction. initSense > 0 - counterclockwise, initSense < 0 - clockwise. initSense can't be equal to zero. |
void MbArc::Init | ( | double | a2, |
MbCartPoint & | p1, | ||
MbCartPoint & | p2, | ||
const DiskreteLengthData * | diskrData = nullptr , |
||
bool | correctFirstPnt = true |
||
) |
Initialize a circular arc.
The initialization is performed by the starting and end points and 1/2 of the arc opening angle. If diskrData != nullptr, the radius is rounded and the first or the second point is corrected (depends on correctFirstPnt).
[in] | a2 | - 1/2 of the circular arc opening angle. |
[in,out] | p1 | - The starting point of the arc. Can be corrected after rounding the radius. |
[in,out] | p2 | - The end point of the arc. Can be corrected after rounding the radius. |
[in] | diskrData | - The structure for rounding the radius. |
[in] | correctFirstPnt | - Determines which point to be corrected after the rounding. correctFirstPnt == true - the first point is to be corrected. |
void MbArc::Init | ( | double | aa, |
double | bb, | ||
const MbPlacement & | place | ||
) |
Initialize an ellipse.
In the result of the operation the ellipse is obtained with the given local coordinate system and semiaxes.
[in] | aa | - Radius of semiaxis along X. |
[in] | bb | - Radius of semiaxis along Y. |
[in] | place | - The local coordinate system of the ellipse. |
void MbArc::Init | ( | double | aa, |
double | bb, | ||
const MbCartPoint & | pc, | ||
double | ang | ||
) |
Initialize an ellipse.
In the result of the operation the ellipse is obtained with the specified semiaxes. The ellipse local coordinate system has origin in point pc; OX axis of the local coordinate system forms angle ang with OX axis of the current coordinate system. The turning direction - from the axis of the current coordinate system to the axis of the new coordinate system.
[in] | aa | - Radius of semiaxis along X. |
[in] | bb | - Radius of semiaxis along Y. |
[in] | pc | - Origin of local coordinate system of ellipse. |
[in] | ang | - An angle between OX axes of the local and the current coordinate systems. |
void MbArc::Init1 | ( | const MbCartPoint & | c, |
const MbCartPoint & | p1, | ||
double & | len, | ||
double & | angle | ||
) |
Initialize an ellipse.
In the result of the operation an ellipse is obtained with center in point c. The length of ellipse semiaxis along X-axis is determined as the distance between points c and p1. The length of the second semiaxis is 0. The angle between OX axes of the ellipse's local coordinate system and the current coordinate system.
[in] | c | - The ellipse center. |
[in] | p1 | - A point on ellipse. |
[out] | len | - The length of semiaxis along X. |
[out] | angle | - An angle between OX axes of the local and the current coordinate systems. |
void MbArc::Init2 | ( | const MbCartPoint & | c, |
const MbCartPoint & | p1, | ||
MbCartPoint & | p2, | ||
double & | lenB | ||
) |
Initialize an ellipse.
In the result of the operation an ellipse is obtained with center in point c. Point p1 determines the direction of OX axis of ellipse's local coordinate system and the length of semiaxis along X. Point p2 determines the length of semiaxis along Y as the distance from the point to the OX axis of the local coordinate system. Point p2 is changed so as it lies on intersection of the ellipse with OY axis of the local coordinate system.
[in] | c | - The ellipse center. |
[in] | p1 | - A point on ellipse specifies OX axis. |
[in,out] | p2 | - Specifies the length of semiaxis along Y. On output - point on intersection of ellipse with OY axis of the local coordinate system. |
[out] | lenB | - The length of semiaxis along Y. |
void MbArc::Init3 | ( | const MbCartPoint & | c0, |
const MbCartPoint & | p1, | ||
double | angle, | ||
double & | aa, | ||
double & | bb | ||
) |
Initialize an ellipse.
In the result of the operation an ellipse is obtained inscribed into the rotated rectangle specified by the point of center c, the vertex p1 and the slope angle 'angle'. OX-axis of the local coordinate system of the ellipse will be oriented according to the angle 'angle'.
[in] | c0 | - The center of the rectangle. |
[in] | p1 | - The rectangle vertex. |
[in] | angle | - Slope angle of the rectangle. |
[out] | aa | - The length of semiaxis along X. |
[out] | bb | - The length of semiaxis along Y. |
void MbArc::Init4 | ( | const MbCartPoint & | p1, |
const MbCartPoint & | p2, | ||
double | angle, | ||
double & | aa, | ||
double & | bb | ||
) |
Initialize an ellipse.
In the result of the operation an ellipse is obtained inscribed into the rotated rectangle specified by two diagonal points p1 and p2 and the slope angle 'angle'. OX-axis of the local coordinate system of the ellipse will be oriented according to the angle 'angle'.
[in] | p1 | - The rectangle vertex. |
[in] | p2 | - The rectangle vertex. |
[in] | angle | - Slope angle of the rectangle. |
[out] | aa | - The length of semiaxis along X. |
[out] | bb | - The length of semiaxis along Y. |
void MbArc::Init5 | ( | const MbCartPoint & | c, |
const MbCartPoint & | p1, | ||
const MbCartPoint & | p2, | ||
double & | aa, | ||
double & | bb, | ||
double & | angle | ||
) |
Initialize an ellipse.
In the result of the operation an ellipse is obtained inscribed into the parallelogram given by three points: center of parallelogram (c), middle of one of its sides (p1) and one of vertices of this side (p2). OX-axis of the local coordinate system of the ellipse will pass through the point p2.
[in] | c | - The center of parallelogram. |
[in] | p1 | - The middle of a side of the parallelogram. |
[in] | p2 | - A vertex of the parallelogram. |
[out] | aa | - The length of semiaxis along X. |
[out] | bb | - The length of semiaxis along Y. |
[out] | angle | - An angle between OX axes of the local and the current coordinate systems. |
void MbArc::Init6 | ( | const MbCartPoint & | p1, |
const MbCartPoint & | p2, | ||
const MbCartPoint & | p3, | ||
double & | aa, | ||
double & | bb, | ||
double & | angle | ||
) |
Initialize an ellipse.
In the result of the operation an ellipse is obtained inscribed into the parallelogram given by three vertices. OX-axis of the local coordinate system of the ellipse will be parallel to the segment [p1 p2].
[in] | p1 | - A vertex of the parallelogram. |
[in] | p2 | - A vertex of the parallelogram. |
[in] | p3 | - A vertex of the parallelogram. |
[out] | aa | - The length of semiaxis along X. |
[out] | bb | - The length of semiaxis along Y. |
[out] | angle | - An angle between OX axes of the local and the current coordinate systems. |
void MbArc::Init7 | ( | const MbCartPoint & | pc, |
MbCartPoint | p1, | ||
MbCartPoint | p2, | ||
MbCartPoint | p3, | ||
double & | aa, | ||
double & | bb, | ||
double & | angle | ||
) |
Initialize an ellipse.
In the result of the operation an ellipse is obtained constructed by the center pc and three points on it p1, p2, p3
[in] | pc | - The ellipse center. |
[in] | p1 | - A point on ellipse. |
[in] | p2 | - A point on ellipse. |
[in] | p3 | - A point on ellipse. |
[out] | aa | - The length of semiaxis along X. |
[out] | bb | - The length of semiaxis along Y. |
[out] | angle | - An angle between OX axes of the local and the current coordinate systems. |
void MbArc::Init8 | ( | const MbCartPoint & | p1, |
const MbDirection & | dir1, | ||
const MbCartPoint & | p2, | ||
const MbDirection & | dir2, | ||
const MbCartPoint & | p3, | ||
double & | aa, | ||
double & | bb, | ||
double & | angle | ||
) |
Initialize an ellipse.
For ellipse construction we have two points on ellipse and tangent lines at these points and the third point on the ellipse.
[in] | p1 | - A point on ellipse. |
[in] | dir1 | - The direction of tangent line to ellipse at point p1. |
[in] | p2 | - A point on ellipse. |
[in] | dir2 | - The direction of tangent line to ellipse at point p2. |
[in] | p3 | - A point on ellipse. |
[out] | aa | - The length of semiaxis along X. |
[out] | bb | - The length of semiaxis along Y. |
[out] | angle | - An angle between OX axes of the local and the current coordinate systems. |
void MbArc::Init | ( | double | aa, |
double | bb, | ||
const MbPlacement & | place, | ||
double | t1, | ||
double | t2, | ||
int | initSense | ||
) |
Initialize an elliptical arc.
In the result of the operation an elliptical arc is obtained with the specified semiaxes and the local coordinate system. t1 and t2 specify the start and the end angles of the arc. The angles are measured from the OX axis counterclockwise. The angles are given in radians. Parameter 'initSense' specifies the arc direction. If initSense > 0, then the orientation is counterclockwise.
[in] | aa | - Radius of semiaxis along X. |
[in] | bb | - Radius of semiaxis along Y. |
[in] | place | - The local coordinate system of the ellipse. |
[in] | t1 | - An angle specifying the beginning of the arc. |
[in] | t2 | - An angle specifying the end of the arc. |
[in] | initSense | - Direction. initSense > 0 - counterclockwise, initSense < 0 - clockwise. initSense can't be equal to zero. |
void MbArc::Init | ( | double | aa, |
double | bb, | ||
const MbPlacement & | place, | ||
const MbCartPoint & | p1, | ||
const MbCartPoint & | p2, | ||
bool | clockwise | ||
) |
Initialize an elliptical arc.
In the result of the operation an elliptical arc is obtained with the specified semiaxes and the local coordinate system. Points 'p1' and 'p2' specify the bounds of arc. The start point of the arc lies on the ray starting from the circle center and passing through point 'p1'. The end point is on the ray passing through the point 'p2'. Parameter 'clockwise' specifies the direction of the arc. If clockwise > 0, then the direction of moving is counterclockwise.
[in] | aa | - Radius of semiaxis along X. |
[in] | bb | - Radius of semiaxis along Y. |
[in] | place | - The local coordinate system of the ellipse. |
[in] | p1 | - A point specifying the beginning of the arc. |
[in] | p2 | - A point specifying the end of the arc. |
[in] | clockwise | - Direction. clockwise > 0 - moving counterclockwise, clockwise < 0 - clockwise. 'clockwise' can't be equal to zero. |
void MbArc::Init4 | ( | const MbCartPoint & | p1, |
const MbCartPoint & | p2, | ||
const MbCartPoint & | pB, | ||
const MbCartPoint & | pE, | ||
bool | clockwise = false |
||
) |
Initialize an elliptical arc.
Ellipse is inscribed into the rectangle given by two diagonal points p1 and p2. Sides of the rectangle are parallel to the axes of the current coordinate system. The projections of points pB and pE onto ellipse determine the start and the end of the arc. 'clockwise' determines moving form the start point to the end point clockwise or counterclockwise.
[in] | p1 | - The rectangle vertex. |
[in] | p2 | - The rectangle vertex. |
[in] | pB | - A point specifying the beginning of the arc. |
[in] | pE | - A point specifying the end of the arc. |
[in] | clockwise | - Direction. clockwise > 0 - moving counterclockwise, clockwise < 0 - clockwise. 'clockwise' can't be equal to zero. |
bool MbArc::OnSector | ( | double | angle | ) | const |
Determine whether the ray hits the arc's sector.
It is analyzed if the ray starting from the center and forming the angle 'angle' with OX-axis of the current coordinate system hits the arc's sector.
[in] | angle | - The angle between the direction being analyzed and the OX-axis of the current coordinate system. |
void MbArc::SetLimitPoint | ( | ptrdiff_t | number, |
const MbCartPoint & | pnt | ||
) |
Replace the arc's point.
The reconstruction of the elliptical arc by the end points is performed keeping the arc opening angle.
[in] | number | - The index of end point of the arc. 1 - start of arc, 2 - end of arc. |
[in] | pnt | - A new point. |
|
inline |
Return the angle of the end point.
The angle of the end point of the arc is measured relative to the OX-axis of the current coordinate system.
[in] | number | - The index of end point of the arc. 1 - start of arc, 2 - end of arc. |
|
inline |
Modify the end angle of the arc.
[in] | number | - The index of end point of the arc. 1 - start of arc, 2 - end of arc. |
[in] | pnt | - The point specifying the direction to the new end of the arc. |
void MbArc::PointOnBaseEllipse | ( | double & | t, |
MbCartPoint & | pnt | ||
) | const |
Evaluate a point on ellipse.
The point is evaluated on a closed ellipse regardless of whether the object is an ellipse or is an elliptical arc.
[in] | t | - Parameter. |
[out] | pnt | - The required point. |
double MbArc::PointProjectionOnBaseEllipse | ( | const MbCartPoint & | pnt | ) | const |
Find the projection of a point onto the ellipse.
A point is projected onto the closed ellipse regardless of whether the object is an ellipse or an elliptical arc.
[in] | pnt | - A point to project. |
bool MbArc::IsSelfIntersectOffset | ( | double | d | ) | const |
Determine whether the ellipse offset has self-intersections.
[in] | d | - Offset distance. |
ptrdiff_t MbArc::EllipticIntersect | ( | const MbLine & | pLine, |
double | cross[2], | ||
double | eps0 = PARAM_PRECISION |
||
) | const |
Determine the parameters of intersection of a line with an ellipse.
[in] | pLine | - Line. |
[out] | cross | - Array with parameters of ellipse at intersection points. |
|
overridevirtual |
Get properties of the object.
Get internal data (properties) of an object for viewing and modification.
[in] | properties | - Container for internal data of an object. |
Implements MbPlaneItem.
|
overridevirtual |
Change properties of the object.
Change internal data (properties) of object is performed by copying of corresponding values from the given object.
[in] | properties | - Container for internal data of an object. |
Implements MbPlaneItem.
|
override |
Determine visibility of an object in rectangle.
Determine whether an object is visible in the given rectangle. There is a possibility to perform a fast check or more thorough check when the second parameter has a corresponding value.
[in] | rect | - A given two-dimensional rectangle. |
[in] | exact | - Whether to perform a more thorough check. |
|
mutableprotected |
Auxiliary data.
Auxiliary data are used for fast calculations.
Bounding rectangle.