Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Geom::Bezier Class Reference

Polynomial in Bernstein-Bezier basis. More...

#include <bezier.h>

Inheritance diagram for Geom::Bezier:

Classes

struct  Order
 

Public Types

typedef Coord output_type
 

Public Member Functions

unsigned order () const
 
unsigned degree () const
 
unsigned size () const
 
 Bezier ()
 
 Bezier (const Bezier &b)
 
Bezieroperator= (Bezier const &other)
 
bool operator== (Bezier const &other) const
 
bool operator!= (Bezier const &other) const
 
 Bezier (Order ord)
 
void resize (unsigned int n, Coord v=0)
 
void clear ()
 
bool isZero (double eps=EPSILON) const
 
bool isConstant (double eps=EPSILON) const
 
bool isFinite () const
 
Coord at0 () const
 
Coordat0 ()
 
Coord at1 () const
 
Coordat1 ()
 
Coord valueAt (double t) const
 
Coord operator() (double t) const
 
SBasis toSBasis () const
 
Coordoperator[] (unsigned ix)
 
Coord const & operator[] (unsigned ix) const
 
void setCoeff (unsigned ix, double val)
 
std::vector< CoordvalueAndDerivatives (Coord t, unsigned n_derivs) const
 
void subdivide (Coord t, Bezier *left, Bezier *right) const
 
std::pair< Bezier, Beziersubdivide (Coord t) const
 
std::vector< Coordroots () const
 
std::vector< Coordroots (Interval const &ivl) const
 
Bezier forward_difference (unsigned k) const
 
Bezier elevate_degree () const
 
Bezier reduce_degree () const
 
Bezier elevate_to_degree (unsigned newDegree) const
 
Bezier deflate () const
 
Bezieroperator+= (double v)
 
Bezieroperator-= (double v)
 
Bezieroperator*= (double v)
 
Bezieroperator/= (double v)
 
Bezieroperator+= (Bezier const &other)
 
Bezieroperator-= (Bezier const &other)
 
Bezier operator- () const
 Unary minus.
 
Construct Bezier polynomials from their control points
 Bezier (Coord c0)
 
 Bezier (Coord c0, Coord c1)
 
 Bezier (Coord c0, Coord c1, Coord c2)
 
 Bezier (Coord c0, Coord c1, Coord c2, Coord c3)
 
 Bezier (Coord c0, Coord c1, Coord c2, Coord c3, Coord c4)
 
 Bezier (Coord c0, Coord c1, Coord c2, Coord c3, Coord c4, Coord c5)
 
 Bezier (Coord c0, Coord c1, Coord c2, Coord c3, Coord c4, Coord c5, Coord c6)
 
 Bezier (Coord c0, Coord c1, Coord c2, Coord c3, Coord c4, Coord c5, Coord c6, Coord c7)
 
 Bezier (Coord c0, Coord c1, Coord c2, Coord c3, Coord c4, Coord c5, Coord c6, Coord c7, Coord c8)
 
 Bezier (Coord c0, Coord c1, Coord c2, Coord c3, Coord c4, Coord c5, Coord c6, Coord c7, Coord c8, Coord c9)
 
template<typename Iter >
 Bezier (Iter first, Iter last)
 
 Bezier (std::vector< Coord > const &vec)
 

Protected Member Functions

 Bezier (Coord const c[], unsigned ord)
 

Private Member Functions

void find_bezier_roots (std::vector< double > &solutions, double l, double r) const
 

Private Attributes

std::valarray< Coordc_
 

Friends

class Bernstein
 
Bezier portion (const Bezier &a, Coord from, Coord to)
 
OptInterval bounds_fast (Bezier const &b)
 
Bezier derivative (const Bezier &a)
 

Detailed Description

Polynomial in Bernstein-Bezier basis.

Definition at line 122 of file bezier.h.

Member Typedef Documentation

◆ output_type

Definition at line 253 of file bezier.h.

Constructor & Destructor Documentation

◆ Bezier() [1/16]

Geom::Bezier::Bezier ( Coord const  c[],
unsigned  ord 
)
inlineprotected

Definition at line 140 of file bezier.h.

◆ Bezier() [2/16]

Geom::Bezier::Bezier ( )
inline

Definition at line 149 of file bezier.h.

◆ Bezier() [3/16]

Geom::Bezier::Bezier ( const Bezier b)
inline

Definition at line 150 of file bezier.h.

◆ Bezier() [4/16]

Geom::Bezier::Bezier ( Order  ord)
inline

Definition at line 186 of file bezier.h.

References order(), and Geom::Bezier::Order::order.

◆ Bezier() [5/16]

Geom::Bezier::Bezier ( Coord  c0)
inlineexplicit

Definition at line 192 of file bezier.h.

References c_.

◆ Bezier() [6/16]

Geom::Bezier::Bezier ( Coord  c0,
Coord  c1 
)
inline

Definition at line 195 of file bezier.h.

References c_.

◆ Bezier() [7/16]

Geom::Bezier::Bezier ( Coord  c0,
Coord  c1,
Coord  c2 
)
inline

Definition at line 198 of file bezier.h.

References c_.

◆ Bezier() [8/16]

Geom::Bezier::Bezier ( Coord  c0,
Coord  c1,
Coord  c2,
Coord  c3 
)
inline

Definition at line 201 of file bezier.h.

References c_.

◆ Bezier() [9/16]

Geom::Bezier::Bezier ( Coord  c0,
Coord  c1,
Coord  c2,
Coord  c3,
Coord  c4 
)
inline

Definition at line 204 of file bezier.h.

References c_.

◆ Bezier() [10/16]

Geom::Bezier::Bezier ( Coord  c0,
Coord  c1,
Coord  c2,
Coord  c3,
Coord  c4,
Coord  c5 
)
inline

Definition at line 207 of file bezier.h.

References c_.

◆ Bezier() [11/16]

Geom::Bezier::Bezier ( Coord  c0,
Coord  c1,
Coord  c2,
Coord  c3,
Coord  c4,
Coord  c5,
Coord  c6 
)
inline

Definition at line 212 of file bezier.h.

References c_.

◆ Bezier() [12/16]

Geom::Bezier::Bezier ( Coord  c0,
Coord  c1,
Coord  c2,
Coord  c3,
Coord  c4,
Coord  c5,
Coord  c6,
Coord  c7 
)
inline

Definition at line 217 of file bezier.h.

References c_.

◆ Bezier() [13/16]

Geom::Bezier::Bezier ( Coord  c0,
Coord  c1,
Coord  c2,
Coord  c3,
Coord  c4,
Coord  c5,
Coord  c6,
Coord  c7,
Coord  c8 
)
inline

Definition at line 222 of file bezier.h.

References c_.

◆ Bezier() [14/16]

Geom::Bezier::Bezier ( Coord  c0,
Coord  c1,
Coord  c2,
Coord  c3,
Coord  c4,
Coord  c5,
Coord  c6,
Coord  c7,
Coord  c8,
Coord  c9 
)
inline

Definition at line 227 of file bezier.h.

References c_.

◆ Bezier() [15/16]

template<typename Iter >
Geom::Bezier::Bezier ( Iter  first,
Iter  last 
)
inline

Definition at line 234 of file bezier.h.

References c_.

◆ Bezier() [16/16]

Geom::Bezier::Bezier ( std::vector< Coord > const &  vec)
inline

Definition at line 240 of file bezier.h.

Member Function Documentation

◆ at0() [1/2]

Coord & Geom::Bezier::at0 ( )
inline

Definition at line 273 of file bezier.h.

References c_.

◆ at0() [2/2]

Coord Geom::Bezier::at0 ( ) const
inline

Definition at line 272 of file bezier.h.

References c_.

Referenced by Geom::bounds_exact(), Geom::Piecewise< T >::integral(), TEST_F(), TEST_F(), and wrap_bezier().

◆ at1() [1/2]

Coord & Geom::Bezier::at1 ( )
inline

Definition at line 275 of file bezier.h.

References c_, and order().

◆ at1() [2/2]

Coord Geom::Bezier::at1 ( ) const
inline

Definition at line 274 of file bezier.h.

References c_, and order().

Referenced by Geom::bounds_exact(), TEST_F(), and wrap_bezier().

◆ clear()

void Geom::Bezier::clear ( )
inline

◆ deflate()

Bezier Geom::Bezier::deflate ( ) const

Definition at line 176 of file bezier.cpp.

References c_, and order().

Referenced by find_bezier_roots(), and TEST_F().

◆ degree()

unsigned Geom::Bezier::degree ( ) const
inline

◆ elevate_degree()

Bezier Geom::Bezier::elevate_degree ( ) const

Definition at line 138 of file bezier.cpp.

References c_, order(), and size().

Referenced by elevate_to_degree(), and TEST_F().

◆ elevate_to_degree()

Bezier Geom::Bezier::elevate_to_degree ( unsigned  newDegree) const

Definition at line 167 of file bezier.cpp.

References degree(), and elevate_degree().

Referenced by operator+=(), operator-=(), and TEST_F().

◆ find_bezier_roots()

void Geom::Bezier::find_bezier_roots ( std::vector< double > &  solutions,
double  l,
double  r 
) const
private

Definition at line 40 of file solve-bezier.cpp.

References deflate(), degree(), isConstant(), Geom::sgn(), and solutions.

Referenced by roots().

◆ forward_difference()

Bezier Geom::Bezier::forward_difference ( unsigned  k) const

Definition at line 121 of file bezier.cpp.

References Geom::binomial_increment_k(), c_, order(), and size().

◆ isConstant()

bool Geom::Bezier::isConstant ( double  eps = EPSILON) const
inline

Definition at line 260 of file bezier.h.

References Geom::are_near(), c_, and order().

Referenced by find_bezier_roots().

◆ isFinite()

bool Geom::Bezier::isFinite ( ) const
inline

Definition at line 266 of file bezier.h.

References c_, and order().

Referenced by wrap_bezier().

◆ isZero()

bool Geom::Bezier::isZero ( double  eps = EPSILON) const
inline

Definition at line 254 of file bezier.h.

References Geom::are_near(), c_, and order().

Referenced by wrap_bezier().

◆ operator!=()

bool Geom::Bezier::operator!= ( Bezier const &  other) const
inline

Definition at line 173 of file bezier.h.

◆ operator()()

Coord Geom::Bezier::operator() ( double  t) const
inline

Definition at line 280 of file bezier.h.

References valueAt().

◆ operator*=()

Bezier & Geom::Bezier::operator*= ( double  v)
inline

Definition at line 313 of file bezier.h.

References c_.

◆ operator+=() [1/2]

Bezier & Geom::Bezier::operator+= ( Bezier const &  other)

Definition at line 195 of file bezier.cpp.

References c_, degree(), elevate_to_degree(), and size().

◆ operator+=() [2/2]

Bezier & Geom::Bezier::operator+= ( double  v)
inline

Definition at line 305 of file bezier.h.

References c_.

◆ operator-()

Bezier Geom::Bezier::operator- ( ) const
inline

Unary minus.

Definition at line 325 of file bezier.h.

References c_, and result.

◆ operator-=() [1/2]

Bezier & Geom::Bezier::operator-= ( Bezier const &  other)

Definition at line 208 of file bezier.cpp.

References c_, degree(), elevate_to_degree(), and size().

◆ operator-=() [2/2]

Bezier & Geom::Bezier::operator-= ( double  v)
inline

Definition at line 309 of file bezier.h.

References c_.

◆ operator/=()

Bezier & Geom::Bezier::operator/= ( double  v)
inline

Definition at line 317 of file bezier.h.

References c_.

◆ operator=()

Bezier & Geom::Bezier::operator= ( Bezier const &  other)
inline

Definition at line 151 of file bezier.h.

References c_, and resize().

◆ operator==()

bool Geom::Bezier::operator== ( Bezier const &  other) const
inline

Definition at line 159 of file bezier.h.

References c_, and degree().

◆ operator[]() [1/2]

Coord & Geom::Bezier::operator[] ( unsigned  ix)
inline

Definition at line 284 of file bezier.h.

References c_.

◆ operator[]() [2/2]

Coord const & Geom::Bezier::operator[] ( unsigned  ix) const
inline

Definition at line 285 of file bezier.h.

References c_.

◆ order()

◆ reduce_degree()

Bezier Geom::Bezier::reduce_degree ( ) const

Definition at line 150 of file bezier.cpp.

References c_, order(), and size().

◆ resize()

void Geom::Bezier::resize ( unsigned int  n,
Coord  v = 0 
)
inline

Definition at line 245 of file bezier.h.

References c_.

Referenced by operator=(), and Geom::sbasis_to_bezier().

◆ roots() [1/2]

◆ roots() [2/2]

std::vector< Coord > Geom::Bezier::roots ( Interval const &  ivl) const

◆ setCoeff()

void Geom::Bezier::setCoeff ( unsigned  ix,
double  val 
)
inline

Definition at line 287 of file bezier.h.

References c_.

Referenced by TEST_F().

◆ size()

◆ subdivide() [1/2]

std::pair< Bezier, Bezier > Geom::Bezier::subdivide ( Coord  t) const

Definition at line 98 of file bezier.cpp.

References subdivide().

◆ subdivide() [2/2]

void Geom::Bezier::subdivide ( Coord  t,
Bezier left,
Bezier right 
) const

Definition at line 79 of file bezier.cpp.

References c_, order(), and size().

Referenced by subdivide(), and TEST_F().

◆ toSBasis()

SBasis Geom::Bezier::toSBasis ( ) const

Definition at line 187 of file bezier.cpp.

References Geom::bezier_to_sbasis().

Referenced by wrap_bezier().

◆ valueAndDerivatives()

std::vector< Coord > Geom::Bezier::valueAndDerivatives ( Coord  t,
unsigned  n_derivs 
) const

Definition at line 51 of file bezier.cpp.

References Geom::bernstein_value_at(), c_, order(), and size().

Referenced by TEST_F().

◆ valueAt()

Coord Geom::Bezier::valueAt ( double  t) const
inline

Friends And Related Symbol Documentation

◆ Bernstein

friend class Bernstein
friend

Definition at line 133 of file bezier.h.

◆ bounds_fast

OptInterval bounds_fast ( Bezier const &  b)
friend

Definition at line 305 of file bezier.cpp.

◆ derivative

Bezier derivative ( const Bezier a)
friend

Definition at line 282 of file bezier.cpp.

◆ portion

Bezier portion ( const Bezier a,
Coord  from,
Coord  to 
)
friend

Member Data Documentation

◆ c_


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