KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
kjb::Nurbs_curve Class Reference

#include <m2_spline.h>

Inheritance diagram for kjb::Nurbs_curve:
kjb::Spline_curve kjb::Cloneable

Public Member Functions

 Nurbs_curve ()
 
 Nurbs_curve (uint num_knots, const float *knots, uint degree, const std::vector< Vector > &ctl_points)
 
 Nurbs_curve (const Nurbs_curve &src)
 
virtual ~Nurbs_curve ()
 
void insert_at (int index, const Vector &control_point)
 
virtual Nurbs_curveoperator= (const Nurbs_curve &src)
 
virtual Nurbs_curveclone () const
 Processes an Option from program command-line arguments. More...
 
kjb::Vector evaluate (double u) const
 
kjb::Vector gradient (double u) const
 
bool has_zero_length () const
 
- Public Member Functions inherited from kjb::Cloneable
virtual ~Cloneable ()
 Deletes this Cloneable. More...
 

Protected Attributes

uint _order
 
uint _num_knots
 
float * _knots
 
std::vector< Vector_ctl_points
 

Detailed Description

Non-rational B-spline class.

See Also
Gl_nurbs_curve
Author
Kyle Simek

Constructor & Destructor Documentation

kjb::Nurbs_curve::Nurbs_curve ( )
kjb::Nurbs_curve::Nurbs_curve ( uint  num_knots,
const float *  knots,
uint  degree,
const std::vector< Vector > &  ctl_points 
)
kjb::Nurbs_curve::Nurbs_curve ( const Nurbs_curve src)
kjb::Nurbs_curve::~Nurbs_curve ( )
virtual

Member Function Documentation

Nurbs_curve * kjb::Nurbs_curve::clone ( ) const
virtual

Processes an Option from program command-line arguments.

Implements kjb::Cloneable.

Vector kjb::Nurbs_curve::evaluate ( double  u) const
virtual

Evaluate the curve at some point along its length.

Parameters
uThe position along the curve the evaluate. Valid values are in [0.1].

TODO: test non-uniform weights case

Implements kjb::Spline_curve.

Vector kjb::Nurbs_curve::gradient ( double  u) const
virtual

Evaluate the curve at some point along its length.

Parameters
uThe position along the curve the evaluate. Valid values are in [0.1].

Implements kjb::Spline_curve.

bool kjb::Nurbs_curve::has_zero_length ( ) const

Returns true if the curve has zero length, i.e. all control points are identical. Utility method, used in gradient_*() method of Nurbs_surface

void kjb::Nurbs_curve::insert_at ( int  index,
const Vector control_point 
)
Nurbs_curve & kjb::Nurbs_curve::operator= ( const Nurbs_curve src)
virtual

Member Data Documentation

std::vector<Vector> kjb::Nurbs_curve::_ctl_points
protected
float* kjb::Nurbs_curve::_knots
protected
uint kjb::Nurbs_curve::_num_knots
protected
uint kjb::Nurbs_curve::_order
protected

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