CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
OdGeNurbCurve2d Class Reference

#include <GeNurbCurve2d.h>

Inheritance diagram for OdGeNurbCurve2d:
OdGeSplineEnt2d OdGeCurve2d OdGeEntity2d

Public Member Functions

 OdGeNurbCurve2d ()
 
 OdGeNurbCurve2d (const OdGeNurbCurve2d &source)
 
 OdGeNurbCurve2d (int degree, const OdGeKnotVector &knots, const OdGePoint2dArray &controlPoints, bool isPeriodic=false)
 
 OdGeNurbCurve2d (int degree, const OdGeKnotVector &knots, const OdGePoint2dArray &controlPoints, const OdGeDoubleArray &weights, bool isPeriodic=false)
 
 OdGeNurbCurve2d (int degree, const OdGePolyline2d &fitPolyline, bool isPeriodic=false)
 
 OdGeNurbCurve2d (const OdGePoint2dArray &fitPoints, const OdGeVector2d &startTangent, const OdGeVector2d &endTangent, bool startTangentDefined=true, bool endTangentDefined=true, const OdGeTol &fitTolerance=OdGeContext::gTol)
 
 OdGeNurbCurve2d (const OdGePoint2dArray &fitPoints, const OdGeTol &fitTolerance=OdGeContext::gTol)
 
 OdGeNurbCurve2d (const OdGePoint2dArray &fitPoints, const OdGeVector2dArray &fitTangents, const OdGeTol &fitTolerance=OdGeContext::gTol, bool isPeriodic=false)
 
 OdGeNurbCurve2d (const OdGeEllipArc2d &ellipse)
 
 OdGeNurbCurve2d (const OdGeLineSeg2d &linSeg)
 
 OdGeNurbCurve2d (const OdGePoint2dArray &fitPoints, const OdGeVector2d &startTangent, const OdGeVector2d &endTangent, bool startTangentDefined, bool endTangentDefined, OdGeKnotParameterization knotParam, const OdGeTol &fitTol=OdGeContext::gTol)
 
int numFitPoints () const
 
bool getFitKnotParameterization (OdGeKnotParameterization &knotParam) const
 
bool getFitPointAt (int fitPointIndex, OdGePoint2d &point) const
 
bool getFitTolerance (OdGeTol &fitTolerance) const
 
bool getFitTangents (OdGeVector2d &startTangent, OdGeVector2d &endTangent) const
 
bool getFitData (OdGePoint2dArray &fitPoints, OdGeTol &fitTolerance, bool &tangentsExist, OdGeVector2d &startTangent, OdGeVector2d &endTangent) const
 
bool getFitData (OdGePoint2dArray &fitPoints, OdGeTol &fitTolerance, bool &tangentsExist, OdGeVector2d &startTangent, OdGeVector2d &endTangent, OdGeKnotParameterization &knotParam) const
 
void getDefinitionData (int &degree, bool &rational, bool &periodic, OdGeKnotVector &knots, OdGePoint2dArray &controlPoints, OdGeDoubleArray &weights) const
 
int numWeights () const
 
double weightAt (int weightIndex) const
 
OdGeNurbCurve2dsetWeightAt (int weightIndex, double weight)
 
bool evalMode () const
 
bool getParamsOfC1Discontinuity (OdGeDoubleArray &params, const OdGeTol &tol=OdGeContext::gTol) const
 
bool getParamsOfG1Discontinuity (OdGeDoubleArray &params, const OdGeTol &tol=OdGeContext::gTol) const
 
bool setFitPointAt (int fitPointIndex, const OdGePoint2d &point)
 
bool addFitPointAt (int fitPointIndex, const OdGePoint2d &point)
 
bool deleteFitPointAt (int fitPointIndex)
 
bool addControlPointAt (double newKnot, const OdGePoint2d &point, double weight=1.0)
 
bool deleteControlPointAt (int index)
 
bool setFitKnotParameterization (OdGeKnotParameterization knotParam)
 
bool setFitTolerance (const OdGeTol &fitTol=OdGeContext::gTol)
 
bool setFitTangents (const OdGeVector2d &startTangent, const OdGeVector2d &endTangent)
 
OdGeNurbCurve2dsetFitData (const OdGePoint2dArray &fitPoints, const OdGeVector2d &startTangent, const OdGeVector2d &endTangent, const OdGeTol &fitTol=OdGeContext::gTol)
 
OdGeNurbCurve2dsetFitData (const OdGeKnotVector &fitKnots, const OdGePoint2dArray &fitPoints, const OdGeVector2d &startTangent, const OdGeVector2d &endTangent, const OdGeTol &fitTol=OdGeContext::gTol, bool isPeriodic=false)
 
OdGeNurbCurve2dsetFitData (int degree, const OdGePoint2dArray &fitPoints, const OdGeTol &fitTol=OdGeContext::gTol)
 
OdGeNurbCurve2dsetFitData (const OdGePoint2dArray &fitPoints, const OdGeVector2d &startTangent, const OdGeVector2d &endTangent, OdGeKnotParameterization knotParam, const OdGeTol &fitTol=OdGeContext::gTol)
 
bool purgeFitData ()
 
OdGeNurbCurve2daddKnot (double newKnot)
 
OdGeNurbCurve2dinsertKnot (double newKnot)
 
OdGeNurbCurve2dsetEvalMode (bool evalMode=false)
 
OdGeNurbCurve2djoinWith (const OdGeNurbCurve2d &curve)
 
OdGeNurbCurve2dhardTrimByParams (double newStartParam, double newEndParam)
 
OdGeNurbCurve2dmakeRational (double weight=1.0)
 
OdGeNurbCurve2dmakeClosed ()
 
OdGeNurbCurve2dmakePeriodic ()
 
OdGeNurbCurve2dmakeNonPeriodic ()
 
OdGeNurbCurve2dmakeOpen ()
 
OdGeNurbCurve2delevateDegree (int plusDegree)
 
OdGeNurbCurve2doperator= (const OdGeNurbCurve2d &spline)
 
bool intersectWith (const OdGeLine2d &line2d, OdGePoint2dArray &pnts2d, const OdGeTol &tol=OdGeContext::gTol, OdGeDoubleArray *params=NULL) const
 
OdGeNurbCurve2dset (int degree, const OdGeKnotVector &knots, const OdGePoint2dArray &controlPoints, const OdGeDoubleArray &weights, bool isPeriodic=false)
 
- Public Member Functions inherited from OdGeSplineEnt2d
bool isRational () const
 
int degree () const
 
int order () const
 
int numKnots () const
 
const OdGeKnotVectorknots () const
 
int numControlPoints () const
 
int continuityAtKnot (int knotIndex, const OdGeTol &tol=OdGeContext::gTol) const
 
double startParam () const
 
double endParam () const
 
OdGePoint2d startPoint () const
 
OdGePoint2d endPoint () const
 
bool hasFitData () const
 
double knotAt (int knotIndex) const
 
OdGeSplineEnt2dsetKnotAt (int knotIndex, double val)
 
OdGePoint2d controlPointAt (int controlPointIndex) const
 
OdGeSplineEnt2dsetControlPointAt (int controlPointIndex, const OdGePoint2d &point)
 
OdGeSplineEnt2doperator= (const OdGeSplineEnt2d &spline)
 
- Public Member Functions inherited from OdGeCurve2d
OdGeCurve3dconvertTo3d () const
 
void convertTo3d (OdGeCurve3d &curve3d) const
 
void getInterval (OdGeInterval &interval) const
 
void getInterval (OdGeInterval &interval, OdGePoint2d &start, OdGePoint2d &end) const
 
OdGeCurve2dreverseParam ()
 
OdGeCurve2dsetInterval ()
 
bool setInterval (const OdGeInterval &interval)
 
double distanceTo (const OdGePoint2d &point, const OdGeTol &tol=OdGeContext::gTol) const
 
double distanceTo (const OdGeCurve2d &otherCur, const OdGeTol &tol=OdGeContext::gTol) const
 
OdGePoint2d closestPointTo (const OdGePoint2d &point, const OdGeTol &tol=OdGeContext::gTol) const
 
OdGePoint2d closestPointTo (const OdGePoint2d &point, double &param, const OdGeInterval *range, const OdGeTol &tol=OdGeContext::gTol) const
 
OdGePoint2d closestPointTo (const OdGeCurve2d &curve2d, OdGePoint2d &pntOnOtherCrv, const OdGeTol &tol=OdGeContext::gTol) const
 
void getClosestPointTo (const OdGePoint2d &point, OdGePointOnCurve2d &pntOnCrv, const OdGeTol &tol=OdGeContext::gTol) const
 
void getClosestPointTo (const OdGeCurve2d &curve2d, OdGePointOnCurve2d &pntOnThisCrv, OdGePointOnCurve2d &pntOnOtherCrv, const OdGeTol &tol=OdGeContext::gTol) const
 
bool getNormalPoint (const OdGePoint2d &point, OdGePointOnCurve2d &pntOnCrv, const OdGeTol &tol=OdGeContext::gTol) const
 
 TD_USING (OdGeEntity2d::isOn)
 
bool isOn (const OdGePoint2d &point, double &param, const OdGeTol &tol=OdGeContext::gTol) const
 
bool isOn (double param, const OdGeTol &tol=OdGeContext::gTol) const
 
double paramOf (const OdGePoint2d &point, const OdGeTol &tol=OdGeContext::gTol) const
 
double paramOf (const OdGePoint2d &point, const OdGeInterval *range, const OdGeTol &tol) const
 
void getTrimmedOffset (double distance, OdGeCurve2dPtrArray &offsetCurveList, OdGe::OffsetCrvExtType extensionType=OdGe::kFillet, const OdGeTol &tol=OdGeContext::gTol) const
 
bool isClosed (const OdGeTol &tol=OdGeContext::gTol) const
 
bool isPeriodic (double &period) const
 
bool isLinear (OdGeLine2d &line, const OdGeTol &tol=OdGeContext::gTol) const
 
double length (double fromParam, double toParam, double tol=OdGeContext::gTol.equalPoint()) const
 
double length (double tol=OdGeContext::gTol.equalPoint()) const
 
double paramAtLength (double datumParam, double length, bool posParamDir=true, double tol=OdGeContext::gTol.equalPoint()) const
 
bool area (double startParam, double endParam, double &value, const OdGeTol &tol=OdGeContext::gTol) const
 
bool isDegenerate (OdGe::EntityId &degenerateType, const OdGeTol &tol=OdGeContext::gTol) const
 
bool isDegenerate (OdGeEntity2d *&pConvertedEntity, const OdGeTol &tol=OdGeContext::gTol) const
 
void getSplitCurves (double param, OdGeCurve2d *&piece1, OdGeCurve2d *&piece2) const
 
bool explode (OdGeCurve2dPtrArray &explodedCurves, OdGeIntArray &newExplodedCurve, const OdGeInterval *interval=NULL) const
 
void getLocalClosestPoints (const OdGePoint2d &point, OdGePointOnCurve2d &approxPnt, const OdGeInterval *nbhd=NULL, const OdGeTol &tol=OdGeContext::gTol) const
 
void getLocalClosestPoints (const OdGeCurve2d &otherCurve, OdGePointOnCurve2d &approxPntOnThisCrv, OdGePointOnCurve2d &approxPntOnOtherCrv, const OdGeInterval *nbhd1=NULL, const OdGeInterval *nbhd2=NULL, const OdGeTol &tol=OdGeContext::gTol) const
 
OdGeBoundBlock2d boundBlock () const
 
OdGeBoundBlock2d boundBlock (const OdGeInterval &range) const
 
OdGeBoundBlock2d orthoBoundBlock () const
 
OdGeBoundBlock2d orthoBoundBlock (const OdGeInterval &range) const
 
OdGeExtents2d getGeomExtents (const OdGeInterval &range=OdGeInterval(), const OdGeMatrix2d *coordSystem=NULL) const
 
bool hasStartPoint (OdGePoint2d &startPoint) const
 
bool hasEndPoint (OdGePoint2d &endPoint) const
 
bool hasMidPoint (OdGePoint2d &point, double coef=0.5) const
 
OdGePoint2d midPoint (double coef=0.5) const
 
OdGePoint2d evalPoint (double param) const
 
OdGePoint2d evalPoint (double param, int numDeriv, OdGeVector2dArray &derivatives) const
 
void getSamplePoints (double fromParam, double toParam, double approxEps, OdGePoint2dArray &pointArray, OdGeDoubleArray &paramArray) const
 
void getSamplePoints (int numSample, OdGePoint2dArray &pointArray) const
 
OdGeCurve2doperator= (const OdGeCurve2d &curve)
 
void getSamplePoints (double fromParam, double toParam, double approxEps, OdGePoint2dArray &pointArray, OdGeDoubleArray *pParamArray=NULL) const
 
void appendSamplePoints (double fromParam, double toParam, double approxEps, OdGePoint2dArray &pointArray, OdGeDoubleArray *pParamArray=NULL) const
 
void appendSamplePoints (int numSample, OdGePoint2dArray &pointArray) const
 
- Public Member Functions inherited from OdGeEntity2d
 ODRX_HEAP_OPERATORS ()
 
 ~OdGeEntity2d ()
 
bool isKindOf (OdGe::EntityId entType) const
 
OdGe::EntityId type () const
 
OdGeEntity2dcopy () const
 
OdGeEntity2doperator= (const OdGeEntity2d &entity)
 
bool operator== (const OdGeEntity2d &entity) const
 
bool operator!= (const OdGeEntity2d &entity) const
 
bool isEqualTo (const OdGeEntity2d &other, const OdGeTol &tol=OdGeContext::gTol) const
 
OdGeEntity2dtransformBy (const OdGeMatrix2d &xfm)
 
OdGeEntity2dtranslateBy (const OdGeVector2d &translateVec)
 
OdGeEntity2drotateBy (double angle, const OdGePoint2d &basePoint=OdGePoint2d::kOrigin)
 
OdGeEntity2dmirror (const OdGeLine2d &line)
 
OdGeEntity2dscaleBy (double scaleFactor, const OdGePoint2d &basePoint=OdGePoint2d::kOrigin)
 
bool isOn (const OdGePoint2d &point, const OdGeTol &tol=OdGeContext::gTol) const
 

Static Public Member Functions

static OdGeNurbCurve2dconvertFrom (const OdGeCurve2d *source, const OdGeInterval &domain, const OdGeTol &tol=OdGeContext::gTol, bool sameParametrization=false)
 
static OdGeNurbCurve2dconvertFrom (const OdGeCurve2d *source, const OdGeTol &tol=OdGeContext::gTol, bool sameParametrization=false)
 
- Static Public Member Functions inherited from OdGeCurve2d
static OdGeCurve2drestoreUvCurve (const OdGeCurve3d *curve, const OdGeSurface *surface, const OdGeTol &tol=OdGeContext::gTol)
 

Protected Member Functions

OdGeNurbCurve2dsetData (int degree, const OdGeKnotVector &knots, const OdGePoint2dArray &controlPoints, const OdGeDoubleArray &weights, bool isPeriodic, const OdGePoint2dArray &fitPoints, const OdGeVector2d &startTangent, const OdGeVector2d &endTangent)
 
- Protected Member Functions inherited from OdGeSplineEnt2d
 OdGeSplineEnt2d ()
 
 OdGeSplineEnt2d (const OdGeSplineEnt2d &spline)
 
- Protected Member Functions inherited from OdGeCurve2d
 OdGeCurve2d ()
 
 OdGeCurve2d (const OdGeCurve2d &source)
 
- Protected Member Functions inherited from OdGeEntity2d
 OdGeEntity2d ()
 
 OdGeEntity2d (const OdGeEntity2d &)
 
void connectTo (OdGeEntity2dImpl *)
 

Friends

class OdDbGeEdgesDwgIO
 
class OdDbGeEdgesDxfIO
 

Detailed Description

This class represents non-uniform rational B-splines (NURBS) in 2D space.

Corresponding C++ library: TD_Ge

<group OdGe_Classes>

See also
<link ge_OdGeNurbCurve3d, Working with NURBS curves>

Definition at line 49 of file GeNurbCurve2d.h.

Constructor & Destructor Documentation

◆ OdGeNurbCurve2d() [1/11]

OdGeNurbCurve2d::OdGeNurbCurve2d ( )

Default constructor for objects of the OdGeNurbCurve2d class. Constructs an empty NURB curve.

◆ OdGeNurbCurve2d() [2/11]

OdGeNurbCurve2d::OdGeNurbCurve2d ( const OdGeNurbCurve2d source)

Copy constructor for objects of the OdGeNurbCurve2d class.

Parameters
source[in] Object to be copied.

◆ OdGeNurbCurve2d() [3/11]

OdGeNurbCurve2d::OdGeNurbCurve2d ( int  degree,
const OdGeKnotVector knots,
const OdGePoint2dArray controlPoints,
bool  isPeriodic = false 
)

Constructor for objects of the OdGeNurbCurve2d class.

Parameters
degree[in] Degree of the curve.
knots[in] Knot vector.
controlPoints[in] Array of 2D control points.
isPeriodic[in] true if and only if the curve is periodic.
Remarks
High degree values make a curve more flexible. For example degree 1 is used to define a segment, degree 2 is used to define a NURB circle, etc.

A knot vector defines a sequence of parameter values that determine where and how the control points affect the curve. The knot vector is a sequence of parameter values and divides the parametric space into intervals, usually called knot spans. Values of knot vector must be provided in ascending order, for example: (0, 0, 0, 1, 2, 3, 3, 3) can be valid while (0, 0, 2, 0, 3, 1, 3, 3) cannot be valid.

The control points specify the placement of the curve and adjust its shape. The quantity of control points must be at least the degree + 1.

If isPeriodic is false, then knots.length() must be equal to controlPoints.length() + degree + 1. If isPeriodic is true, then knots.length() must be equal to controlPoints.length(), the first and the last controlPoints must be equal.

◆ OdGeNurbCurve2d() [4/11]

OdGeNurbCurve2d::OdGeNurbCurve2d ( int  degree,
const OdGeKnotVector knots,
const OdGePoint2dArray controlPoints,
const OdGeDoubleArray weights,
bool  isPeriodic = false 
)

Constructor for objects of the OdGeNurbCurve2d class.

Parameters
degree[in] Degree of the curve.
knots[in] Knot vector.
controlPoints[in] Array of 2D control points.
weights[in] Array of weight values.
isPeriodic[in] true if and only if the curve is periodic.
Remarks
High degree values make a curve more flexible. For example degree 1 is used to define a polyline, degree 2 is used to define a NURB circle, etc.

A knot vector defines a sequence of parameter values that determine where and how the control points affect the curve. The knot vector is a sequence of parameter values and divides the parametric space into intervals, usually called knot spans. Values of knot vector must be provided in ascending order, for example: (0, 0, 0, 1, 2, 3, 3, 3) can be valid while (0, 0, 2, 0, 3, 1, 3, 3) cannot be valid.

The control points specify the placement of the curve and adjust its shape. The quantity of control points must be at least the degree + 1.

The closer the weight value is to zero, the closer the curve is to a straight line near the corresponding control point. If the weight increases, the curve pulls toward the corresponding control point. If the weight decreases, the curve pushes from the corresponding control point.

If isPeriodic is false, then knots.length() must be equal to controlPoints.length() + degree + 1. If isPeriodic is true, then knots.length() must be equal to controlPoints.length(), the first and last controlPoints must be equal.

◆ OdGeNurbCurve2d() [5/11]

OdGeNurbCurve2d::OdGeNurbCurve2d ( int  degree,
const OdGePolyline2d fitPolyline,
bool  isPeriodic = false 
)

Constructor for objects of the OdGeNurbCurve2d class.

Parameters
degree[in] Degree of the curve.
fitPolyline[in] Input polyline fit points of which are interpolated by the curve.
isPeriodic[in] true if and only if the curve is periodic (closed curve).
Remarks
High degree values make a curve more flexible. For example degree 1 is used to define a polyline, degree 2 is used to define a NURB circle, etc.

◆ OdGeNurbCurve2d() [6/11]

OdGeNurbCurve2d::OdGeNurbCurve2d ( const OdGePoint2dArray fitPoints,
const OdGeVector2d startTangent,
const OdGeVector2d endTangent,
bool  startTangentDefined = true,
bool  endTangentDefined = true,
const OdGeTol fitTolerance = OdGeContext::gTol 
)

Constructor for objects of the OdGeNurbCurve2d class.

Parameters
fitPoints[in] Array of 2D points through which to fit the curve.
startTangent[in] Input start tangent vector.
endTangent[in] Input end tangent vector.
startTangentDefined[in] Input flag indicating whether startTangent should be used.
endTangentDefined[in] Input flag indicating whether endTangent should be used.
fitTolerance[in] Tolerance to which the curve should approximate fitPoints.
Remarks
Constructs a 2D curve interpolating a given array of 2D points within the given tolerance and having given derivatives at the start point and end point. If startTangentDefined is 0, then startTangent will be ignored and the constructor will compute the start tangent vector. The same is true for endTangentDefined.

◆ OdGeNurbCurve2d() [7/11]

OdGeNurbCurve2d::OdGeNurbCurve2d ( const OdGePoint2dArray fitPoints,
const OdGeTol fitTolerance = OdGeContext::gTol 
)

Constructor for objects of the OdGeNurbCurve2d class.

Parameters
fitPoints[in] Array of 2D points through which to fit the curve.
fitTolerance[in] Input maximal deviation of the curve from the fitPoints.
Remarks
Constructs a 2D curve interpolating a given array of 2D points within the given tolerance.

◆ OdGeNurbCurve2d() [8/11]

OdGeNurbCurve2d::OdGeNurbCurve2d ( const OdGePoint2dArray fitPoints,
const OdGeVector2dArray fitTangents,
const OdGeTol fitTolerance = OdGeContext::gTol,
bool  isPeriodic = false 
)

Constructor for objects of the OdGeNurbCurve2d class.

Parameters
fitPoints[in] Array of 2D points through which to fit the curve.
fitTangents[in] Input vectors interpolating the curve's derivatives at fitPoints.
fitTolerance[in] Input maximal deviation of the curve from the fitPoints.
isPeriodic[in] true if and only if the curve is periodic (closed curve).
Remarks
Constructs a 2D polynomial curve interpolating a given array if 2D points within the given tolerance. If isPeriodic is true, then the first and the last fitPoints must be identical. The same must be true for fitTangents.

◆ OdGeNurbCurve2d() [9/11]

OdGeNurbCurve2d::OdGeNurbCurve2d ( const OdGeEllipArc2d ellipse)

Constructor for objects of the OdGeNurbCurve2d class.

Parameters
ellipse[in] Input elliptical arc from which a NURB curve is constructed.
Remarks
Constructs a 2D curve from a passed 2D elliptical arc.

◆ OdGeNurbCurve2d() [10/11]

OdGeNurbCurve2d::OdGeNurbCurve2d ( const OdGeLineSeg2d linSeg)

Constructor for objects of the OdGeNurbCurve2d class.

Parameters
linSeg[in] Input line segment from which a NURB curve is constructed.
Remarks
Constructs a 2D curve from a passed 2D line segment.

◆ OdGeNurbCurve2d() [11/11]

OdGeNurbCurve2d::OdGeNurbCurve2d ( const OdGePoint2dArray fitPoints,
const OdGeVector2d startTangent,
const OdGeVector2d endTangent,
bool  startTangentDefined,
bool  endTangentDefined,
OdGeKnotParameterization  knotParam,
const OdGeTol fitTol = OdGeContext::gTol 
)

Constructor for objects of the OdGeNurbCurve2d class.

Parameters
fitPoints[in] Array of 2D points through which to fit the curve.
startTangent[in] Input start tangent vector.
endTangent[in] Input end tangent vector.
startTangentDefined[in] Input flag indicating whether startTangent should be used.
endTangentDefined[in] Input flag indicating whether endTangent should be used.
knotParam[in] Knot parameterization which define the knot values.
fitTol[in] Tolerance to which the spline should approximate fitPoints.
Remarks
Constructs a 2D curve interpolating a given array of 2D points within the given tolerance and knot parameterization, and having given derivatives at the start point and end point. If startTangentDefined is 0, then startTangent is ignored and the constructor computes the start tangent vector. Similarly for endTangentDefined.

Member Function Documentation

◆ addControlPointAt()

bool OdGeNurbCurve2d::addControlPointAt ( double  newKnot,
const OdGePoint2d point,
double  weight = 1.0 
)

Adds a control point at the specified knot.

Parameters
newKnot[in] Knot parameter to add the control point at.
point[in] Coordinates of the control point to be added.
weight[in] Weight to be assigned to the control point.
Returns
true if and only if the control point is added successfully.
Remarks
If called for a non-rational spline, the weight is ignored.

◆ addFitPointAt()

bool OdGeNurbCurve2d::addFitPointAt ( int  fitPointIndex,
const OdGePoint2d point 
)

Inserts the fit point at the specified index.

Parameters
fitPointIndex[in] Fit point index.
point[in] Fit point.
Returns
true if and only if the this spline was created with fit data and the fit point is set successfully.

◆ addKnot()

OdGeNurbCurve2d & OdGeNurbCurve2d::addKnot ( double  newKnot)

Adds a new knot to the spline knot array.

Parameters
newKnot[in] New knot value.
Returns
Reference to this OdGeNurbCurve2d object.

◆ convertFrom() [1/2]

static OdGeNurbCurve2d * OdGeNurbCurve2d::convertFrom ( const OdGeCurve2d source,
const OdGeInterval domain,
const OdGeTol tol = OdGeContext::gTol,
bool  sameParametrization = false 
)
static

Converts a source curve to a spline with the given tolerance and parametrization settings.

Parameters
source[in] Source curve to convert.
domain[in] Interval of source curve to convert.
tol[in] Accuracy of conversion.
sameParametrization[in] Necessity of parametrization preserving during conversion.
Returns
Raw pointer to the converted spline or the NULL pointer if conversion failed.
Remarks
If the source curve is already a spline, a copy is returned. If a NULL-pointer to the source curve is provided or the curve has no analytic representation, a NULL-pointer is returned.

◆ convertFrom() [2/2]

static OdGeNurbCurve2d * OdGeNurbCurve2d::convertFrom ( const OdGeCurve2d source,
const OdGeTol tol = OdGeContext::gTol,
bool  sameParametrization = false 
)
static

Converts a source curve to a spline with the given tolerance and parametrization settings in the native range of the source curve.

Parameters
source[in] Source curve to convert.
tol[in] Accuracy of conversion.
sameParametrization[in] Necessity of parametrization preserving during conversion.
Returns
Raw pointer to the converted spline or a NULL pointer if conversion failed.
Remarks
If the source curve is already a spline, a copy is returned. If a NULL-pointer to the source curve is provided or the curve has no analytic representation, a NULL-pointer is returned.

◆ deleteControlPointAt()

bool OdGeNurbCurve2d::deleteControlPointAt ( int  index)

Deletes a control point at the specified index.

Parameters
index[in] Index of the control point to be deleted.
Returns
true if and only if the control point is deleted successfully.

◆ deleteFitPointAt()

bool OdGeNurbCurve2d::deleteFitPointAt ( int  fitPointIndex)

Removes a fit point with the specified index.

Parameters
fitPointIndex[in] Index of the fit point to be removed.
Returns
true if and only if the fit point is deleted successfully.
Remarks
The index must be greater than or equal to 0 and less than or equal to the number of fit points.

◆ elevateDegree()

OdGeNurbCurve2d & OdGeNurbCurve2d::elevateDegree ( int  plusDegree)

Increases the spline degree by the specified value and returns a reference to this spline object.

Parameters
plusDegree[in] Degree increment value.
Returns
Reference to this OdGeNurbCurve2d object.

◆ evalMode()

bool OdGeNurbCurve2d::evalMode ( ) const

Returns the current evaluation mode.

Returns
true if and only if the evaluator optimization is turned on.
Remarks
If the method returns false, there is no optimization of an internal evaluator. This mode generally should be used if only one or two values per interval between two consecutive knots are evaluated.

If the method returns true, then the evaluator optimization is turned on. This provides better performance if three or more values per knot interval are computed.

◆ getDefinitionData()

void OdGeNurbCurve2d::getDefinitionData ( int &  degree,
bool &  rational,
bool &  periodic,
OdGeKnotVector knots,
OdGePoint2dArray controlPoints,
OdGeDoubleArray weights 
) const

Retrieves all the data that define the spline.

Parameters
degree[out] Receives the degree of spline.
knots[out] Receives the knot vector.
controlPoints[out] Receives an array of 2D control points.
weights[out] Receives an array of weights.
rational[out] Receives true if and only if the spline is rational.
periodic[out] Receives true if and only if the spline is periodic.
Remarks
High degree values represent flexible curves. For example degree 1 is used to define a polyline, degree 2 is used to define a NURB circle, etc.

A knot vector defines a sequence of parameter values that determine where and how the control points affect the curve. The knot vector is a sequence of parameter values and divides the parametric space into intervals, usually called knot spans. Values of knot vector must be provided in ascending order, for example: (0, 0, 0, 1, 2, 3, 3, 3) can be valid while (0, 0, 2, 0, 3, 1, 3, 3) cannot be valid. Knot vector does not affect the form of the NURB curve, it only affects its parameterization.

The closer the weight value is to zero, the closer the curve is to a straight line near the corresponding control point. If the weight increases, the curve pulls toward the corresponding control point. If the weight decreases, the curve pushes from the corresponding control point. The weights array will be empty if the spline is not rational.

◆ getFitData() [1/2]

bool OdGeNurbCurve2d::getFitData ( OdGePoint2dArray fitPoints,
OdGeTol fitTolerance,
bool &  tangentsExist,
OdGeVector2d startTangent,
OdGeVector2d endTangent 
) const

Retrieves all the fit data used to construct this spline if this spline was constructed with fit data.

Parameters
fitPoints[out] Receives the interpolation points.
fitTolerance[out] Receives the geometric tolerance.
tangentsExist[out] Receives true if and only if tangents were used in constructing this spline.
startTangent[out] Receives the starting tangent.
endTangent[out] Receives the ending tangent.
Returns
true if and only if this spline was constructed with fit data.
Remarks
startTangent and endTangent parameters are meaningful if and only if tangentsExist == true.

◆ getFitData() [2/2]

bool OdGeNurbCurve2d::getFitData ( OdGePoint2dArray fitPoints,
OdGeTol fitTolerance,
bool &  tangentsExist,
OdGeVector2d startTangent,
OdGeVector2d endTangent,
OdGeKnotParameterization knotParam 
) const

Retrieves all the fit data used to construct this spline if this spline was constructed with fit data.

Parameters
fitPoints[out] Receives the interpolation points.
fitTolerance[out] Receives the geometric tolerance.
tangentsExist[out] Receives true if and only if tangents were used in constructing this spline.
startTangent[out] Receives the starting tangent.
endTangent[out] Receives the ending tangent.
knotParam[out] Receives the knot parameterization.
Returns
true if and only if this spline was constructed with fit data.
Remarks
startTangent and endTangent parameters are meaningful if and only if tangentsExist == true.

◆ getFitKnotParameterization()

bool OdGeNurbCurve2d::getFitKnotParameterization ( OdGeKnotParameterization knotParam) const

Gets the knot parametrization of the spline created with fit points.

Parameters
knotParam[out] Receives the knot parametrization.
Returns
true if and only if knot parametrization is retrieved successfully.

◆ getFitPointAt()

bool OdGeNurbCurve2d::getFitPointAt ( int  fitPointIndex,
OdGePoint2d point 
) const

Retrieves the fit point at the specified index.

Parameters
fitPointIndex[in] Fit point index.
point[out] Receives the fit point.
Returns
true if and only if 0 <= fitPointIndex < numFitPoints().

◆ getFitTangents()

bool OdGeNurbCurve2d::getFitTangents ( OdGeVector2d startTangent,
OdGeVector2d endTangent 
) const

Retrieves the starting and ending tangents if this spline was constructed with fit data.

Parameters
startTangent[out] Receives the starting tangent.
endTangent[out] Receives the ending tangent.
Returns
true if and only if this spline was constructed with fit data.

◆ getFitTolerance()

bool OdGeNurbCurve2d::getFitTolerance ( OdGeTol fitTolerance) const

Retrieves the fit tolerance that is used to construct this spline if this spline was constructed with fit points.

Parameters
fitTolerance[out] Recieves the geometric tolerance.
Returns
true if and only if this spline was constructed with fit points.

◆ getParamsOfC1Discontinuity()

bool OdGeNurbCurve2d::getParamsOfC1Discontinuity ( OdGeDoubleArray params,
const OdGeTol tol = OdGeContext::gTol 
) const

Gets the parameters of C1 discontinuity.

Parameters
params[out] Parameters of C1 discontinuity.
tol[in] Geometric tolerance.
Returns
true if any parameters are returned; false otherwise.
Remarks
Currently not implemented.

◆ getParamsOfG1Discontinuity()

bool OdGeNurbCurve2d::getParamsOfG1Discontinuity ( OdGeDoubleArray params,
const OdGeTol tol = OdGeContext::gTol 
) const

Gets the parameters of G1 discontinuity.

Parameters
params[out] Parameters of discontinuity.
tol[in] Geometric tolerance.
Returns
true if any parameters are returned; false otherwise.
Remarks
Currently not implemented.

◆ hardTrimByParams()

OdGeNurbCurve2d & OdGeNurbCurve2d::hardTrimByParams ( double  newStartParam,
double  newEndParam 
)

Trims the OdGeNurbCurve2d by the new start and end parameters.

Parameters
newStartParam[in] New start parameter.
newEndParam[in] New end parameter.
Returns
Reference to this OdGeNurbCurve2d object.

◆ insertKnot()

OdGeNurbCurve2d & OdGeNurbCurve2d::insertKnot ( double  newKnot)

Inserts a new knot to the spline knot array.

Parameters
newKnot[in] New knot.
Returns
Reference to this OdGeNurbCurve2d object.
Remarks
If there is already such knot, then the multiplicity of the knot is increased by 1.

◆ intersectWith()

bool OdGeNurbCurve2d::intersectWith ( const OdGeLine2d line2d,
OdGePoint2dArray pnts2d,
const OdGeTol tol = OdGeContext::gTol,
OdGeDoubleArray params = NULL 
) const

Retrieves the intersection points as well as the parameters of this spline said points.

Parameters
line2d[in] 2D linear entity that intersects with this NURB curve.
pnts2d[out] Receives an array of 2D points.
tol[in] Geometric tolerance.
params[out] Receives an array of parameters.
Returns
true if and only if this spline intersects with the specified linear entity.

◆ joinWith()

OdGeNurbCurve2d & OdGeNurbCurve2d::joinWith ( const OdGeNurbCurve2d curve)

Joins the specified OdGeNurbCurve2d with this spline and returns a reference to the recomputed spline.

Parameters
curve[in] Spline to be joined with this spline.
Returns
Reference to this recomputed OdGeNurbCurve2d object.
Remarks
Both splines must be open and the start point of the input spline must be equal to the endpoint of the initial spline.

◆ makeClosed()

OdGeNurbCurve2d & OdGeNurbCurve2d::makeClosed ( )

Makes the opened spline closed and returns a reference to this spline.

Returns
Reference to this OdGeNurbCurve2d object.
Remarks
If this spline is already closed, then the method does nothing. Closed spline is made by creating a smooth spline between the first and the last points and joining it with the initial spline.

◆ makeNonPeriodic()

OdGeNurbCurve2d & OdGeNurbCurve2d::makeNonPeriodic ( )

Makes a periodic spline non-periodic.

Returns
Reference to this OdGeNurbCurve2d object.
Remarks
Currently not implemented.

◆ makeOpen()

OdGeNurbCurve2d & OdGeNurbCurve2d::makeOpen ( )

Makes a closed spline open.

Returns
Reference to this OdGeNurbCurve2d object.

◆ makePeriodic()

OdGeNurbCurve2d & OdGeNurbCurve2d::makePeriodic ( )

Makes this spline periodic (if it is not).

Returns
Reference to this OdGeNurbCurve2d object.

◆ makeRational()

OdGeNurbCurve2d & OdGeNurbCurve2d::makeRational ( double  weight = 1.0)

Makes this spline rational (if it is not).

Parameters
weight[in] Weight to be applied to each control point.
Returns
Reference to this OdGeNurbCurve2d object.
Remarks
If this spline is already rational, the weight at each control point is multiplied by the specified weight.

◆ numFitPoints()

int OdGeNurbCurve2d::numFitPoints ( ) const

Returns the number of fit points.

Returns
Number of fit points as an integer value.

◆ numWeights()

int OdGeNurbCurve2d::numWeights ( ) const

Returns the number of weights in the spline.

Returns
Number of weights in the spline as an integer value.
Remarks
Returns numControlPoints() if this spline is rational, 0 if it is not.

◆ operator=()

OdGeNurbCurve2d & OdGeNurbCurve2d::operator= ( const OdGeNurbCurve2d spline)

Assignment operator for the OdGeNurbCurve2d object.

Parameters
spline[in] Another OdGeNurbCurve2d object to be assigned to this OdGeNurbCurve2d object.
Returns
Reference to this OdGeNurbCurve2d object.

◆ purgeFitData()

bool OdGeNurbCurve2d::purgeFitData ( )

Purges the fit data defining this spline.

Returns
true if and only if this spline was constructed with fit data.
Remarks
The fit data consists of the fit points, fit tolerance, start tangent and end tangent. The definition of the spline is unchanged.

◆ set()

OdGeNurbCurve2d & OdGeNurbCurve2d::set ( int  degree,
const OdGeKnotVector knots,
const OdGePoint2dArray controlPoints,
const OdGeDoubleArray weights,
bool  isPeriodic = false 
)

Sets the parameters for this spline according to the arguments.

Parameters
degree[in] Degree of spline.
knots[in] Knot vector.
controlPoints[in] Array of 2D control points.
weights[in] Array of weights.
isPeriodic[in] true if and only if the spline is to be periodic (closed).
Returns
Reference to this OdGeNurbCurve2d object.
Remarks
If the weights parameter is not specified, a non-rational spline is constructed. If the weights parameter is specified, then a rational spline is constructed, and controlPoints.length() must be equal to weights.length(). If isPeriodic is false, then knots.length() must be equal to controlPoints.length() + degree + 1. If isPeriodic is true, then knots.length() must be equal to controlPoints.length(), the first and the last controlPoints must be equal, and the first and the last weights (if provided) must be equal.

◆ setData()

OdGeNurbCurve2d & OdGeNurbCurve2d::setData ( int  degree,
const OdGeKnotVector knots,
const OdGePoint2dArray controlPoints,
const OdGeDoubleArray weights,
bool  isPeriodic,
const OdGePoint2dArray fitPoints,
const OdGeVector2d startTangent,
const OdGeVector2d endTangent 
)
protected

Sets the parameters for this spline according to the arguments.

Parameters
degree[in] Degree of spline.
knots[in] Knot vector.
controlPoints[in] Array of 2D control points.
weights[in] Array of weights.
isPeriodic[in] true if and only if this spline is to be periodic.
fitPoints[in] Interpolation points.
startTangent[in] Starting tangent.
endTangent[in] Ending tangent.
Returns
Reference to this OdGeNurbCurve2d object.

◆ setEvalMode()

OdGeNurbCurve2d & OdGeNurbCurve2d::setEvalMode ( bool  evalMode = false)

Sets the evaluation mode.

Parameters
evalMode[in] Input state of the evaluation mode.
Returns
Reference to this OdGeNurbCurve2d object.
Remarks
If evalMode is false, there is no optimization of an internal evaluator. This mode generally should be used if only one or two values per interval between two consecutive knots are evaluated.

If evalMode is true, then the evaluator optimization is turned on. This provides better performance if three or more values per knot interval are computed.

◆ setFitData() [1/4]

OdGeNurbCurve2d & OdGeNurbCurve2d::setFitData ( const OdGeKnotVector fitKnots,
const OdGePoint2dArray fitPoints,
const OdGeVector2d startTangent,
const OdGeVector2d endTangent,
const OdGeTol fitTol = OdGeContext::gTol,
bool  isPeriodic = false 
)

Sets the fit data for this spline.

Parameters
fitKnots[in] Fit knots.
fitPoints[in] Interpolation points.
startTangent[in] Starting tangent.
endTangent[in] Ending tangent.
fitTol[in] Geometric tolerance.
isPeriodic[in] true if and only if this spline is to be periodic.
Returns
Reference to this OdGeNurbCurve2d object.
Remarks
Recomputes the spline from the input fit points, start and end tangents, and fit tolerance. The first parameter specifies the knot vector for the new spline. If fitTol is not 0, then the constructed spline may not pass through the fit points but the maximum distance from any fit point to the constructed spline will be no greater than fitTol.

◆ setFitData() [2/4]

OdGeNurbCurve2d & OdGeNurbCurve2d::setFitData ( const OdGePoint2dArray fitPoints,
const OdGeVector2d startTangent,
const OdGeVector2d endTangent,
const OdGeTol fitTol = OdGeContext::gTol 
)

Sets the fit data for this spline.

Parameters
fitPoints[in] Interpolation points.
fitTol[in] Geometric tolerance.
startTangent[in] Starting tangent.
endTangent[in] Ending tangent.
Returns
Reference to this OdGeNurbCurve2d object.
Remarks
Recomputes the spline from the input fit points, start and end tangents, and fit tolerance. If fitTol is not 0, then the constructed spline may not pass through the fit points, but the maximum distance from any fit point to the constructed spline will be no greater than fitTol.

◆ setFitData() [3/4]

OdGeNurbCurve2d & OdGeNurbCurve2d::setFitData ( const OdGePoint2dArray fitPoints,
const OdGeVector2d startTangent,
const OdGeVector2d endTangent,
OdGeKnotParameterization  knotParam,
const OdGeTol fitTol = OdGeContext::gTol 
)

Sets the fit data for this spline.

Parameters
fitPoints[in] Interpolation points.
startTangent[in] Starting tangent.
endTangent[in] Ending tangent.
knotParam[in] The knot parameterization method to be set.
fitTol[in] Geometric tolerance.
Returns
Reference to this OdGeNurbCurve2d object.
Remarks
Replaces any existing spline data (fit or NURBS) with the fit data fitPoints, startTangent, endTangent, knot parameterization, fitTolerance. fitPoints must contain 2 or more points.

◆ setFitData() [4/4]

OdGeNurbCurve2d & OdGeNurbCurve2d::setFitData ( int  degree,
const OdGePoint2dArray fitPoints,
const OdGeTol fitTol = OdGeContext::gTol 
)

Sets the fit data for this spline.

Parameters
degree[in] Degree of curve.
fitPoints[in] Interpolation points.
fitTol[in] Geometric tolerance.
Returns
Reference to this OdGeNurbCurve2d object.
Remarks
Recomputes the spline from the input fit points and makes it of the specified degree. If fitTol is not 0, then the constructed spline may not pass through the fit points. But the maximum distance from any fit point to the constructed spline will be no greater than fitTol.

High degree values make a curve more flexible. For example degree 1 is used to define a polyline, degree 2 is used to define a NURB circle, etc.

◆ setFitKnotParameterization()

bool OdGeNurbCurve2d::setFitKnotParameterization ( OdGeKnotParameterization  knotParam)

Sets the specified knot parameterization if the spline is created by fit points.

Parameters
knotParam[in] Knot parameterization to be set.
Returns
true if and only if the knot parameterization is set successfully.

◆ setFitPointAt()

bool OdGeNurbCurve2d::setFitPointAt ( int  fitPointIndex,
const OdGePoint2d point 
)

Sets the fit point at the specified index.

Parameters
fitPointIndex[in] Fit point index.
point[in] Fit point.
Returns
true if and only if the fit point is set successfully.

◆ setFitTangents()

bool OdGeNurbCurve2d::setFitTangents ( const OdGeVector2d startTangent,
const OdGeVector2d endTangent 
)

Sets the fit tangents for this spline.

Parameters
startTangent[in] Starting tangent.
endTangent[in] Ending tangent.
Returns
true if and only if this spline was constructed with fit data.

◆ setFitTolerance()

bool OdGeNurbCurve2d::setFitTolerance ( const OdGeTol fitTol = OdGeContext::gTol)

Sets the fit tolerance that is used for interpolating fit points.

Parameters
fitTol[in] Geometric tolerance.
Returns
true if and only if this spline was constructed with fit data.

◆ setWeightAt()

OdGeNurbCurve2d & OdGeNurbCurve2d::setWeightAt ( int  weightIndex,
double  weight 
)

Sets the weight at the specified index.

Parameters
weightIndex[in] Weight index.
weight[in] Weight value at the fit point with the specified index.
Returns
Reference to this OdGeNurbCurve2d object.
Remarks
The closer the weight value is to zero, the closer the curve is to a straight line near the corresponding control point. If the weight increases, the curve pulls toward the corresponding control point. If the weight decreases, the curve pushes from the corresponding control point.

◆ weightAt()

double OdGeNurbCurve2d::weightAt ( int  weightIndex) const

Returns the weight at the specified index.

Parameters
weightIndex[in] Weight index.
Returns
Weight at the specified index as a double value.

Friends And Related Function Documentation

◆ OdDbGeEdgesDwgIO

friend class OdDbGeEdgesDwgIO
friend

Definition at line 958 of file GeNurbCurve2d.h.

◆ OdDbGeEdgesDxfIO

friend class OdDbGeEdgesDxfIO
friend

Definition at line 959 of file GeNurbCurve2d.h.


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