UNIVERS
15.3
UNIVERS base processing software API
|
#include <u3d_bspl3_curve3d.hpp>
Classes | |
struct | Bspl3dCurve |
Public Member Functions | |
U3dBspl3Curve3d (const U3dBspl3AbstractMatrix &bm) | |
U3dBspl3Curve3d (const U3dBspl3AbstractMatrix &bm, const U3dPointsAr &ps) | |
U3dBspl3Curve3d (const U3dBspl3Curve3d &obj) | |
~U3dBspl3Curve3d () | |
void | approximate (const U3dBspl3AbstractMatrix &bm, const U3dPointsAr &ps) |
void | approximate (const U3dPointsAr &ps) |
bool | getPoint (double p, U3dPoint &point) const |
bool | getXYZp (double p, U3dPoint &point) const |
bool | getXYZpp (double p, U3dPoint &point) const |
bool | getCurvature (double p, double &c) |
int | getControlPointsNum () const |
bool | getControlPoint (int ind, U3dPoint &point) const |
U3dBspl3MatrixType | getBMType () const |
void | add (const U3dPoint &point, int id=-1) |
bool | remove (int id) |
bool | isReady () const |
bool | getLineSegments (double ds, std::vector< double > &segs) const |
bool | getLineDeviations (double p1, double p2, double p, U3dPoint &dev) const |
bool | getMaxLineDeviation (double p1, double p2, double &md) const |
void | info () const |
U3dBspl3Curve3d (const U3dBspl3AbstractMatrix &bm, const U3dPointsAr &ps) | |
~U3dBspl3Curve3d () | |
bool | getPoint (double p, U3dPoint &point) const |
bool | getXYZp (double p, U3dPoint &point) const |
bool | getXYZpp (double p, U3dPoint &point) const |
bool | getCurvature (double p, double &c) |
int | getControlPointsNum () const |
bool | getControlPoint (int ind, U3dPoint &point) const |
bool | add (U3dPoint &point, int ind=-1) |
bool | remove (int ind) |
bool | move (int ind) |
bool | isReady () const |
bool | getLineSegments (double ds, std::vector< double > &segs) |
bool | getLineDeviations (double p1, double p2, double p, U3dPoint &dev) |
bool | getMaxLineDeviation (double p1, double p2, double &md) |
void | info () |
Static Public Member Functions | |
static void | update_index (int &i, int m, int bm) |
static int | get_bp_num (U3dBspl3MatrixType type) |
static void | find_element (double p, int n, int &nn, double &pp) |
Protected Member Functions | |
void | clear () |
void | construct_segment (int id, int n, int bpnum, Bspl3dCurve &curve) |
bool | get_line_distance (double pp, int nn, U3dPoint kP, U3dPoint bP, double p1, U3dPoint &dist) const |
bool | construct_isect_line (double p1, double p2, U3dPoint &kP, U3dPoint &bP) const |
void | devs_update (double p, int n, U3dPoint &kP, U3dPoint &bP, double p1, U3dPoint &dev, double &smx, double &smy, double &smz) const |
void | reconstruct () |
void | clear () |
bool | check_add_bps (const U3dPointsAr &ps) |
bool | find_element (double p, int &nn, double &pp) const |
bool | get_line_distance (double pp, int nn, U3dPoint kP, U3dPoint bP, double p1, U3dPoint &dist) |
bool | construct_isect_line (double p1, double p2, U3dPoint &kP, U3dPoint &bP) |
void | devs_update (double p, int n, U3dPoint &kP, U3dPoint &bP, double p1, U3dPoint &dev, double &smx, double &smy, double &smz) |
void | next_segment (double p1, double p2, std::vector< double > &segs) |
Protected Attributes | |
std::vector< Bspl3dCurve > | m_bspls |
U3dBspl3AbstractMatrix * | m_bm |
U3dPointsAr | m_ps |
bool | m_is_ready |
3D third order base spline curve object constructed from Points(x,y,z) and base spline matrix. Natural curve parameter p=[0..1]. Mathematical form of curve is x=x(p), y=y(p), z=z(p).
U3dBspl3Curve3d::U3dBspl3Curve3d | ( | const U3dBspl3AbstractMatrix & | bm | ) |
Generates empty object which will not be ready. Base matrix for type of curve to be constructed is provided.
U3dBspl3Curve3d::U3dBspl3Curve3d | ( | const U3dBspl3AbstractMatrix & | bm, |
const U3dPointsAr & | ps | ||
) |
Constructor with base matrix and points provided. Number of points should be >= 2 for ready object construction.
U3dBspl3Curve3d::U3dBspl3Curve3d | ( | const U3dBspl3Curve3d & | obj | ) |
Copy constructor
U3dBspl3Curve3d::~U3dBspl3Curve3d | ( | ) |
Destruct object
U3dBspl3Curve3d::U3dBspl3Curve3d | ( | const U3dBspl3AbstractMatrix & | bm, |
const U3dPointsAr & | ps | ||
) |
Default constructor with base matrix and points provided. Number of points must be >= 2
U3dBspl3Curve3d::~U3dBspl3Curve3d | ( | ) |
Destruct object
bool U3dBspl3Curve3d::add | ( | U3dPoint & | point, |
int | ind = -1 |
||
) |
Add new point to constructed spline curve after point with index = ind. If ind is -1 then add new last point. In any error return false, otherwise return true
void U3dBspl3Curve3d::add | ( | const U3dPoint & | point, |
int | id = -1 |
||
) |
Add new point to the current spline curve at index = id. If id < 0 or out of range then add new last point.
void U3dBspl3Curve3d::approximate | ( | const U3dBspl3AbstractMatrix & | bm, |
const U3dPointsAr & | ps | ||
) |
Approximate curve from provided points and defined base matrix. Old points and curve are deleting.
void U3dBspl3Curve3d::approximate | ( | const U3dPointsAr & | ps | ) |
Approximate curve from provided points. Old points and curve are deleting.
|
protected |
Check points and add boundary points to current control points, e.g. [1,2,3,4] -> [1,1,1,2,3,4,4,4]. Number of points must be > 2, then return true, otherwise false
|
protected |
Clear all base spline curves {x(t), y(t), z(t)}
|
protected |
Clear internal data
|
protected |
Construct line that intersect spline in parametric points p1 and p2
|
protected |
Construct line that intersect spline in parametric points p1 and p2
|
protected |
Construct simple curve segment for provided id, n - number of initial points, bpnum - number of border points.
|
inlineprotected |
Update coordinates deviations
|
inlineprotected |
Update coordinates deviations
|
static |
Find proper base spline curve element
|
protected |
Find proper base spline curve element
|
static |
Get number of base spline border points from base matrix type
|
protected |
Get distance projections from parametric line to spline in p-point
|
protected |
Get distance projections from parametric line to spline in p-point
U3dBspl3MatrixType U3dBspl3Curve3d::getBMType | ( | ) | const |
Return spline base matrix type. If object is not ready return "Undefined".
bool U3dBspl3Curve3d::getControlPoint | ( | int | ind, |
U3dPoint & | point | ||
) | const |
Get control point of provided index. return false if index is wrong
bool U3dBspl3Curve3d::getControlPoint | ( | int | ind, |
U3dPoint & | point | ||
) | const |
Get control point of provided index. return false if index is wrong
int U3dBspl3Curve3d::getControlPointsNum | ( | ) | const |
Return number of control points
int U3dBspl3Curve3d::getControlPointsNum | ( | ) | const |
Return number of control points
bool U3dBspl3Curve3d::getCurvature | ( | double | p, |
double & | c | ||
) |
Get curvature. True if ok.
bool U3dBspl3Curve3d::getCurvature | ( | double | p, |
double & | c | ||
) |
Get curvature. True if ok.
bool U3dBspl3Curve3d::getLineDeviations | ( | double | p1, |
double | p2, | ||
double | p, | ||
U3dPoint & | dev | ||
) |
Get line deviation between l(p)=kp+b and spline
bool U3dBspl3Curve3d::getLineDeviations | ( | double | p1, |
double | p2, | ||
double | p, | ||
U3dPoint & | dev | ||
) | const |
Get line deviation between l(p)=kp+b and spline
bool U3dBspl3Curve3d::getLineSegments | ( | double | ds, |
std::vector< double > & | segs | ||
) |
Collect array of line segments for current spline. Each segment is near to spline less than provided ds. Return true if spline is defined, otherwise return false.
bool U3dBspl3Curve3d::getLineSegments | ( | double | ds, |
std::vector< double > & | segs | ||
) | const |
Collect array of line segments for current spline. Each segment is "near to spline" less than provided ds. Return true if spline is defined, otherwise return false.
bool U3dBspl3Curve3d::getMaxLineDeviation | ( | double | p1, |
double | p2, | ||
double & | md | ||
) |
Get maximal curve deviation from line constructed on points P1(p1) and P2(p2). Return true if all good
bool U3dBspl3Curve3d::getMaxLineDeviation | ( | double | p1, |
double | p2, | ||
double & | md | ||
) | const |
Get maximal curve deviation from line constructed on points P1(p1) and P2(p2). Return true if all good
bool U3dBspl3Curve3d::getPoint | ( | double | p, |
U3dPoint & | point | ||
) | const |
Return 3d point from constructed spline. Return false if approximation was not made.
bool U3dBspl3Curve3d::getPoint | ( | double | p, |
U3dPoint & | point | ||
) | const |
Return 3d point from constructed spline. Return false if approximation was not made.
bool U3dBspl3Curve3d::getXYZp | ( | double | p, |
U3dPoint & | point | ||
) | const |
Return first derivative 3d point from constructed spline. Return false if approximation was not made.
bool U3dBspl3Curve3d::getXYZp | ( | double | p, |
U3dPoint & | point | ||
) | const |
Return first derivative 3d point from constructed spline. Return false if approximation was not made.
bool U3dBspl3Curve3d::getXYZpp | ( | double | p, |
U3dPoint & | point | ||
) | const |
Return second derivative 3d point from constructed spline. Return false if approximation was not made.
bool U3dBspl3Curve3d::getXYZpp | ( | double | p, |
U3dPoint & | point | ||
) | const |
Return second derivative 3d point from constructed spline. Return false if approximation was not made.
void U3dBspl3Curve3d::info | ( | ) |
Print info about current object condition
void U3dBspl3Curve3d::info | ( | ) | const |
Print info about current object condition
|
inline |
Was approximation made.
|
inline |
Was approximation made.
bool U3dBspl3Curve3d::move | ( | int | ind | ) |
Move control point with index ind. Return true if all correct otherwise return false
|
protected |
Temporary method for recursive spline segments derivation, not used for a while.
|
protected |
Main reconstruction method for whole spline curve
bool U3dBspl3Curve3d::remove | ( | int | ind | ) |
Remove control point with index ind. Return true if all correct otherwise return false
bool U3dBspl3Curve3d::remove | ( | int | id | ) |
Remove control point with index id. Return true if id is correct otherwise return false
|
inlinestatic |
Update index of one corrdinate direction border expanding
|
protected |
Base spline matrix
|
protected |
Array of simple base spline curves for all directions
|
protected |
Flag of approximation was (was not) made is true(false)
|
protected |
Spline control points