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

#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< Bspl3dCurvem_bspls
 
U3dBspl3AbstractMatrixm_bm
 
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

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

Member Function Documentation

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.

bool U3dBspl3Curve3d::check_add_bps ( const 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 U3dBspl3Curve3d::clear ( )
protected

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

void U3dBspl3Curve3d::clear ( )
protected

Clear internal data

bool U3dBspl3Curve3d::construct_isect_line ( double  p1,
double  p2,
U3dPoint kP,
U3dPoint bP 
)
protected

Construct line that intersect spline in parametric points p1 and p2

bool U3dBspl3Curve3d::construct_isect_line ( double  p1,
double  p2,
U3dPoint kP,
U3dPoint bP 
) const
protected

Construct line that intersect spline in parametric points p1 and p2

void U3dBspl3Curve3d::construct_segment ( int  id,
int  n,
int  bpnum,
Bspl3dCurve curve 
)
protected

Construct simple curve segment for provided id, n - number of initial points, bpnum - number of border points.

void U3dBspl3Curve3d::devs_update ( double  p,
int  n,
U3dPoint kP,
U3dPoint bP,
double  p1,
U3dPoint dev,
double &  smx,
double &  smy,
double &  smz 
)
inlineprotected

Update coordinates deviations

void U3dBspl3Curve3d::devs_update ( double  p,
int  n,
U3dPoint kP,
U3dPoint bP,
double  p1,
U3dPoint dev,
double &  smx,
double &  smy,
double &  smz 
) const
inlineprotected

Update coordinates deviations

static void U3dBspl3Curve3d::find_element ( double  p,
int  n,
int &  nn,
double &  pp 
)
static

Find proper base spline curve element

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

Find proper base spline curve element

static int U3dBspl3Curve3d::get_bp_num ( U3dBspl3MatrixType  type)
static

Get number of base spline border points from base matrix type

bool U3dBspl3Curve3d::get_line_distance ( double  pp,
int  nn,
U3dPoint  kP,
U3dPoint  bP,
double  p1,
U3dPoint dist 
)
protected

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

bool U3dBspl3Curve3d::get_line_distance ( double  pp,
int  nn,
U3dPoint  kP,
U3dPoint  bP,
double  p1,
U3dPoint dist 
) const
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

bool U3dBspl3Curve3d::isReady ( ) const
inline

Was approximation made.

bool U3dBspl3Curve3d::isReady ( ) const
inline

Was approximation made.

bool U3dBspl3Curve3d::move ( int  ind)

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

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

static void U3dBspl3Curve3d::update_index ( int &  i,
int  m,
int  bm 
)
inlinestatic

Update index of one corrdinate direction border expanding

Member Data Documentation

U3dBspl3AbstractMatrix * U3dBspl3Curve3d::m_bm
protected

Base spline matrix

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

Array of simple base spline curves for all directions

bool U3dBspl3Curve3d::m_is_ready
protected

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

U3dPointsAr U3dBspl3Curve3d::m_ps
protected

Spline control points


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