UNIVERS
15.3
UNIVERS base processing software API
|
#include <base_splines.hpp>
Classes | |
struct | Bspl3dCurve |
Public Member Functions | |
Spl_U3dBspl3Curve3d (const Spl_U3dBspl3AbstractMatrix &bm, const Spl_U3dPointsAr &ps) | |
~Spl_U3dBspl3Curve3d () | |
bool | getPoint (double p, Spl_U3dPoint &point) const |
bool | getXYZp (double p, Spl_U3dPoint &point) const |
bool | getXYZpp (double p, Spl_U3dPoint &point) const |
bool | getCurvature (double p, double &c) |
int | getControlPointsNum () const |
bool | getControlPoint (int ind, Spl_U3dPoint &point) const |
bool | add (Spl_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, Spl_U3dPoint &dev) |
bool | getMaxLineDeviation (double p1, double p2, double &md) |
void | info () |
Protected Member Functions | |
void | reconstruct () |
void | clear () |
bool | check_add_bps (const Spl_U3dPointsAr &ps) |
bool | find_element (double p, int &nn, double &pp) const |
bool | get_line_distance (double p, Spl_U3dPoint kP, Spl_U3dPoint bP, Spl_U3dPoint &dist) |
bool | get_line_distance (double pp, int nn, Spl_U3dPoint kP, Spl_U3dPoint bP, Spl_U3dPoint &dist) |
bool | construct_isect_line (double p1, double p2, Spl_U3dPoint &kP, Spl_U3dPoint &bP) |
void | devs_update (double p, int n, Spl_U3dPoint &kP, Spl_U3dPoint &bP, Spl_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 |
Spl_U3dBspl3AbstractMatrix * | m_bm |
Spl_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).
Spl_U3dBspl3Curve3d::Spl_U3dBspl3Curve3d | ( | const Spl_U3dBspl3AbstractMatrix & | bm, |
const Spl_U3dPointsAr & | ps | ||
) |
Default constructor with base matrix and points provided. Number of points must be >= 2
Spl_U3dBspl3Curve3d::~Spl_U3dBspl3Curve3d | ( | ) |
Destruct object
bool Spl_U3dBspl3Curve3d::add | ( | Spl_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
|
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 |
Construct line that intersect spline in parametric points p1 and p2
|
inlineprotected |
Update coordinates deviations
|
protected |
Find proper base spline curve element
|
protected |
Get distance projections from parametric line to spline in p-point
|
protected |
Get distance projections from parametric line to spline in p-point
bool Spl_U3dBspl3Curve3d::getControlPoint | ( | int | ind, |
Spl_U3dPoint & | point | ||
) | const |
Get control point of provided index. return false if index is wrong
int Spl_U3dBspl3Curve3d::getControlPointsNum | ( | ) | const |
Return number of control points
bool Spl_U3dBspl3Curve3d::getCurvature | ( | double | p, |
double & | c | ||
) |
Get curvature. True if ok.
bool Spl_U3dBspl3Curve3d::getLineDeviations | ( | double | p1, |
double | p2, | ||
double | p, | ||
Spl_U3dPoint & | dev | ||
) |
Get line deviation between l(p)=kp+b and spline
bool Spl_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 Spl_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 Spl_U3dBspl3Curve3d::getPoint | ( | double | p, |
Spl_U3dPoint & | point | ||
) | const |
Return 3d point from constructed spline. Return false if approximation was not made.
bool Spl_U3dBspl3Curve3d::getXYZp | ( | double | p, |
Spl_U3dPoint & | point | ||
) | const |
Return first derivative 3d point from constructed spline. Return false if approximation was not made.
bool Spl_U3dBspl3Curve3d::getXYZpp | ( | double | p, |
Spl_U3dPoint & | point | ||
) | const |
Return second derivative 3d point from constructed spline. Return false if approximation was not made.
void Spl_U3dBspl3Curve3d::info | ( | ) |
Print info about current object condition
|
inline |
Was approximation made.
bool Spl_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 Spl_U3dBspl3Curve3d::remove | ( | int | ind | ) |
Remove control point with index ind. Return true if all correct otherwise return false
|
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