Hide menu
Loading...
Searching...
No Matches
cadex::ModelData_BSplineCurve2d Class Reference

Defines 2D B-Spline curve. More...

#include <cadex/ModelData_BSplineCurve2d.hxx>

Inheritance diagram for cadex::ModelData_BSplineCurve2d:
cadex::ModelData_Curve2d

Public Types

typedef cadex::internal::ModelData_BSplineCurve2dImpl ImplType
 

Public Member Functions

 ModelData_BSplineCurve2d ()
 Constructor.
 
 ModelData_BSplineCurve2d (const ModelData_Point2d thePoles[], int theNumberOfPoles, const double theKnots[], int theNumberOfKnots, const int theMultiplicities[], int theDegree, bool theIsPeriodic=false)
 Constructor.
 
 ModelData_BSplineCurve2d (const ModelData_Point2d thePoles[], const double thePoleWeights[], int theNumberOfPoles, const double theKnots[], int theNumberOfKnots, const int theMultiplicities[], int theDegree, bool theIsPeriodic=false)
 Constructor.
 
 ModelData_BSplineCurve2d (const Handle_C &)
 Constructor.
 
int Degree () const
 Returns degree.
 
int NumberOfKnots () const
 Returns number of unique knots.
 
int NumberOfPoles () const
 Returns number of poles.
 
double Knot (int theIndex) const
 Returns a knot value.
 
int Knots (double theKnots[]) const
 Populates a vector of knots.
 
int Multiplicity (int theIndex) const
 Returns a knot multiplicity.
 
int Multiplicities (int theMultiplicities[]) const
 Populates a vector of knot multiplicities.
 
ModelData_Point2d Pole (int theIndex) const
 Returns a pole value.
 
int Poles (ModelData_Point2d thePoles[]) const
 Populates a vector of poles.
 
bool IsRational () const
 Returns true if the B-Spline curve is rational (i.e. has weights).
 
double Weight (int theIndex) const
 Returns a weight value.
 
int Weights (double theWeights[]) const
 Populates a vector of weights.
 
- Public Member Functions inherited from cadex::ModelData_Curve2d
 ModelData_Curve2d ()
 Constructor.
 
 ModelData_Curve2d (const ModelData_Curve2d &theOther)
 Constructor.
 
 ModelData_Curve2d (ModelData_Curve2d &&theOther)
 Constructor.
 
 ~ModelData_Curve2d ()
 Destructor.
 
ModelData_Curve2doperator= (const ModelData_Curve2d &theOther)
 Assignment operator.
 
ModelData_Curve2doperator= (ModelData_Curve2d &&theOther)
 Move assignment operator.
 
ModelData_CurveType Type () const
 Returns a curve type.
 
bool IsNull () const
 Returns true if the object has not been initialized yet.
 
void Nullify ()
 Resets the object.
 
 operator bool () const
 Returns if the object has been initialized.
 
bool IsPeriodic () const
 Returns true if the curve is periodic.
 
double UMin () const
 Returns a minimum parameter of a definition domain.
 
double UMax () const
 Returns a maximum parameter of a definition domain.
 
void Domain (double &theUMin, double &theUMax) const
 Returns a definition domain.
 
ModelData_Point2d Value (double theParameter) const
 Evaluates a point on the curve.
 
ModelData_Curve2d Reversed () const
 Returns a curve with reversed orientation.
 
void Transform (const ModelData_Transformation2d &theTransformation)
 Applies transformation matrix to this object.
 
ModelData_Curve2d Transformed (const ModelData_Transformation2d &theTransformation) const
 Returns a copy this object after applying transformation.
 
ModelData_Continuity Continuity () const
 Returns a continuity type of the curve.
 
void D0 (double theParameter, ModelData_Point2d &theValue) const
 Returns the point theValue of parameter theParam.
 
void D1 (double theParameter, ModelData_Point2d &theValue, ModelData_Vector2d &theD1) const
 Returns the point theValue of parameter theParam and the first derivative theD1.
 
void D2 (double theParameter, ModelData_Point2d &theValue, ModelData_Vector2d &theD1, ModelData_Vector2d &theD2) const
 Returns the point theValue of parameter theParam and second derivatives theD1 and theD2.
 
bool DN (double theParameter, size_t theDerivativeOrder, ModelData_Point2d &theValue, ModelData_Vector2d theD[]) const
 
double Curvature (double theParameter) const
 Returns the curvature value of parameter theParam.
 
void Normal (double theParameter, ModelData_Direction2d &theNormal) const
 Returns the normal direction theNormal of parameter theParam.
 

Public Attributes

 operator Handle_C const
 
- Public Attributes inherited from cadex::ModelData_Curve2d
 operator Handle_C const
 

Detailed Description

Defines 2D B-Spline curve.

For detailed description refer to 3D counterpart ModelData_BSplineCurve.

Examples
exploring/brepgeometry/Program.cs, and exploring/brepgeometry/main.cxx.

Constructor & Destructor Documentation

◆ ModelData_BSplineCurve2d() [1/3]

cadex::ModelData_BSplineCurve2d::ModelData_BSplineCurve2d ( )
inline

Constructor.

Empty constructor.

◆ ModelData_BSplineCurve2d() [2/3]

cadex::ModelData_BSplineCurve2d::ModelData_BSplineCurve2d ( const ModelData_Point2d  thePoles[],
int  theNumberOfPoles,
const double  theKnots[],
int  theNumberOfKnots,
const int  theMultiplicities[],
int  theDegree,
bool  theIsPeriodic = false 
)

Constructor.

Creates a polynomial B-Spline curve.

Parameters:

  • theNumberOfPoles defines the length of thePoles and must be >=2;
  • theNumberOfKnots defines the length of theKnots and theMultiplicities and must be >=2;
  • theDegree must belong to range [1, 25];
  • theIsPeriodic specifies if the B-Spline is periodic.

theNumberOfPoles must meet the requirements described for ModelData_BSplineCurve.

◆ ModelData_BSplineCurve2d() [3/3]

cadex::ModelData_BSplineCurve2d::ModelData_BSplineCurve2d ( const ModelData_Point2d  thePoles[],
const double  thePoleWeights[],
int  theNumberOfPoles,
const double  theKnots[],
int  theNumberOfKnots,
const int  theMultiplicities[],
int  theDegree,
bool  theIsPeriodic = false 
)

Constructor.

Creates a rational B-Spline curve.

Parameters:

  • theNumberOfPoles defines the length of thePoles and thePoleWeights and must be >=2;
  • theNumberOfKnots defines the length of theKnots and theMultiplicities and must be >=2;
  • theDegree must belong to range [1, 25];
  • theIsPeriodic specifies if the B-Spline is periodic.

theNumberOfPoles must meet the requirements described for ModelData_BSplineCurve.

Poles are to be provided after division by their weights.

Member Function Documentation

◆ Degree()

int cadex::ModelData_BSplineCurve2d::Degree ( ) const

Returns degree.

Returns the value specified in the constructor.

Examples
exploring/brepgeometry/Program.cs, and exploring/brepgeometry/main.cxx.

◆ IsRational()

bool cadex::ModelData_BSplineCurve2d::IsRational ( ) const

Returns true if the B-Spline curve is rational (i.e. has weights).

See also
Weight().

◆ Knot()

double cadex::ModelData_BSplineCurve2d::Knot ( int  theIndex) const

Returns a knot value.

theIndex must be in the range [1, NumberOfKnots()].

See also
Multiplicity().
Examples
exploring/brepgeometry/Program.cs, and exploring/brepgeometry/main.cxx.

◆ Knots()

int cadex::ModelData_BSplineCurve2d::Knots ( double  theKnots[]) const

Populates a vector of knots.

theKnots must point to a buffer in memory with at least NumberOfKnots() preallocated values.

Returns NumberOfKnots().

See also
Multiplicities().

◆ Multiplicities()

int cadex::ModelData_BSplineCurve2d::Multiplicities ( int  theMultiplicities[]) const

Populates a vector of knot multiplicities.

theMultiplicities must point to a buffer in memory with at least NumberOfKnots() preallocated values.

Returns NumberOfKnots().

See also
Knots().

◆ Multiplicity()

int cadex::ModelData_BSplineCurve2d::Multiplicity ( int  theIndex) const

Returns a knot multiplicity.

theIndex must be in the range [1, NumberOfKnots()].

See also
Knot().
Examples
exploring/brepgeometry/Program.cs, and exploring/brepgeometry/main.cxx.

◆ NumberOfKnots()

int cadex::ModelData_BSplineCurve2d::NumberOfKnots ( ) const

Returns number of unique knots.

Returns the value specified in the constructor.

Examples
exploring/brepgeometry/Program.cs, and exploring/brepgeometry/main.cxx.

◆ NumberOfPoles()

int cadex::ModelData_BSplineCurve2d::NumberOfPoles ( ) const

Returns number of poles.

Returns the value specified in the constructor.

Examples
exploring/brepgeometry/Program.cs, and exploring/brepgeometry/main.cxx.

◆ Pole()

ModelData_Point2d cadex::ModelData_BSplineCurve2d::Pole ( int  theIndex) const

Returns a pole value.

theIndex must be in the range [1, NumberOfPoles()].

See also
Weight().
Examples
exploring/brepgeometry/Program.cs, and exploring/brepgeometry/main.cxx.

◆ Poles()

int cadex::ModelData_BSplineCurve2d::Poles ( ModelData_Point2d  thePoles[]) const

Populates a vector of poles.

thePoles must point to a buffer in memory with at least NumberOfPoles() preallocated values.

Returns NumberOfPoles().

See also
Weights().

◆ Weight()

double cadex::ModelData_BSplineCurve2d::Weight ( int  theIndex) const

Returns a weight value.

theIndex must be in the range [1, NumberOfPoles()].

For polynomial B-Spline behavior is undefined.

See also
Pole().
Examples
exploring/brepgeometry/Program.cs, and exploring/brepgeometry/main.cxx.

◆ Weights()

int cadex::ModelData_BSplineCurve2d::Weights ( double  theWeights[]) const

Populates a vector of weights.

theWeights must point to a buffer in memory with at least NumberOfPoles() preallocated values.

Returns NumberOfPoles().

For polynomial B-Spline does nothing and returns 0.

See also
Poles().