UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Spl_U3dBspl3Curve3d Class Reference

#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< Bspl3dCurvem_bspls
 
Spl_U3dBspl3AbstractMatrixm_bm
 
Spl_U3dPointsAr m_ps
 
bool m_is_ready
 

Detailed Description

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).

Constructor & Destructor Documentation

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

Member Function Documentation

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

bool Spl_U3dBspl3Curve3d::check_add_bps ( const Spl_U3dPointsAr &  ps)
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

void Spl_U3dBspl3Curve3d::clear ( )
protected

Clear all base spline curves {x(t), y(t), z(t)}

bool Spl_U3dBspl3Curve3d::construct_isect_line ( double  p1,
double  p2,
Spl_U3dPoint kP,
Spl_U3dPoint bP 
)
protected

Construct line that intersect spline in parametric points p1 and p2

void Spl_U3dBspl3Curve3d::devs_update ( double  p,
int  n,
Spl_U3dPoint kP,
Spl_U3dPoint bP,
Spl_U3dPoint dev,
double &  smx,
double &  smy,
double &  smz 
)
inlineprotected

Update coordinates deviations

bool Spl_U3dBspl3Curve3d::find_element ( double  p,
int &  nn,
double &  pp 
) const
protected

Find proper base spline curve element

bool Spl_U3dBspl3Curve3d::get_line_distance ( double  p,
Spl_U3dPoint  kP,
Spl_U3dPoint  bP,
Spl_U3dPoint dist 
)
protected

Get distance projections from parametric line to spline in p-point

bool Spl_U3dBspl3Curve3d::get_line_distance ( double  pp,
int  nn,
Spl_U3dPoint  kP,
Spl_U3dPoint  bP,
Spl_U3dPoint dist 
)
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

bool Spl_U3dBspl3Curve3d::isReady ( ) const
inline

Was approximation made.

bool Spl_U3dBspl3Curve3d::move ( int  ind)

Move control point with index ind. Return true if all correct otherwise return false

void Spl_U3dBspl3Curve3d::next_segment ( double  p1,
double  p2,
std::vector< double > &  segs 
)
protected

Temporary method for recursive spline segments derivation, not used for a while.

void Spl_U3dBspl3Curve3d::reconstruct ( )
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

Member Data Documentation

Spl_U3dBspl3AbstractMatrix* Spl_U3dBspl3Curve3d::m_bm
protected

Base spline matrix

std::vector<Bspl3dCurve> Spl_U3dBspl3Curve3d::m_bspls
protected

Array of simple base spline curves for all directions

bool Spl_U3dBspl3Curve3d::m_is_ready
protected

Flag of approximation was (was not) made is true(false)

Spl_U3dPointsAr Spl_U3dBspl3Curve3d::m_ps
protected

Spline control points


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