Biarc< Vector > Class Template Reference
[libbiarc]

The Biarc class describes a single biarc. More...

#include <include/Biarc.h>

List of all members.

Public Member Functions

 Biarc ()
 Biarc (const Vector &p, const Vector &t)
 Biarc (const Biarc< Vector > &b)
 ~Biarc ()
const Vector & getPoint () const
const Vector & getTangent () const
const Vector & getMidPoint () const
const Vector & getMidTangent () const
void setPoint (const Vector &p)
void setMidPoint (const Vector &p)
void setMidTangent (const Vector &p)
void setTangentUnnormalized (const Vector &t)
void setTangent (const Vector &t)
void get (Vector &p, Vector &t) const
void set (const Vector &p, const Vector &t)
void clear ()
void reverse ()
int isProper () const
int isBiarc () const
void setBiarc ()
void make (float Gamma)
float arclength0 () const
float arclength1 () const
float biarclength () const
float radius0 () const
float radius1 () const
int id () const
void setId (const int i)
void setCurve (Curve< Vector > *c)
const Curve< Vector > * getCurve ()
void setIdAndCurve (const int i, Curve< Vector > *c)
Vector pointOnArc0 (float s) const
Vector pointOnArc1 (float s) const
Vector pointOnBiarc (float arclength) const
Vector tangentOnBiarc (float arclength) const
void getBezierArc0 (Vector &b0, Vector &b1, Vector &b2) const
void getBezierArc1 (Vector &b0, Vector &b1, Vector &b2) const
void getBezier (Vector &b0_0, Vector &b1_0, Vector &b2_0, Vector &b0_1, Vector &b1_1, Vector &b2_1) const
Vector a0 (float tau) const
Vector a1 (float tau) const
const Biarc< Vector > & getNext () const
const Biarc< Vector > & getPrevious () const
void setNext (const Biarc< Vector > &b)
void setPrevious (const Biarc< Vector > &b)
void setNextNULL ()
void setPreviousNULL ()
Biarc< Vector > operator* (const float s) const
Biarc< Vector > operator+ (const Vector &v) const
Biarc< Vector > operator- (const Vector &v) const
Biarc< Vector > & operator= (const Biarc< Vector > &b)
Biarc< Vector > & operator+= (const Vector &v)
Biarc< Vector > & operator-= (const Vector &v)
Biarc< Vector > & operator/= (const float d)
Biarc< Vector > & operator*= (const float d)
void print (ostream &out) const
int operator== (const Biarc< Vector > &b) const
int operator!= (const Biarc< Vector > &b) const


Detailed Description

template<class Vector>
class Biarc< Vector >

The Biarc class describes a single biarc.

This class is used to store a single data point of an entire space curve in $\mathcal{R}^3$. A biarc object contains a point and the tangent at this particular point. Aligning one biarc after another makes up a biarc approximated space-curve.

The space-curve is a linked-list of Biarc elements. Every biarc element in the "curve list" has two neighbours on its left and right side, reachable by getNext() and getPrevious(). If the point is the start or endpoint of an open curve, then it will only have a single neighbour. The other pointer will be set to NULL.

See also:
Curve

Constructor & Destructor Documentation

template<class Vector>
Biarc< Vector >::Biarc (  )  [inline]

Default constructor. Initializes this instance of a Biarc to <0,0,0> for the point and <0,1,0> for the tangent.

Referenced by Biarc< Vector >::operator*(), Biarc< Vector >::operator+(), and Biarc< Vector >::operator-().

template<class Vector>
Biarc< Vector >::Biarc ( const Vector &  p,
const Vector &  t 
) [inline]

Constructor sets the point to p and the tangent to t. Normalizes the tangent.

template<class Vector>
Biarc< Vector >::Biarc ( const Biarc< Vector > &  b  )  [inline]

Copy Constructor. Copies only the point and the tangent. Doesn't care if we have an interpolated biarc or not.

template<class Vector>
Biarc< Vector >::~Biarc (  )  [inline]

Destructor.


Member Function Documentation

template<class Vector>
const Vector & Biarc< Vector >::getPoint (  )  const [inline]

template<class Vector>
const Vector & Biarc< Vector >::getTangent (  )  const [inline]

Returns the tangent of the biarc as a Vector.

Referenced by Biarc< Vector >::isProper(), Curve< Vector >::radius_pt(), and Biarc< Vector >::tangentOnBiarc().

template<class Vector>
const Vector & Biarc< Vector >::getMidPoint (  )  const [inline]

Returns the matching point of this biarc, if we have interpolated biarcs. Posts a warning message and returns a zero vector if not.

Referenced by Biarc< Vector >::tangentOnBiarc().

template<class Vector>
const Vector & Biarc< Vector >::getMidTangent (  )  const [inline]

Returns the matching tangent of this biarc, if we have interpolated biarcs. Posts a warning message and returns a zero vector if this is not a valid biarc.

Referenced by Biarc< Vector >::tangentOnBiarc().

template<class Vector>
void Biarc< Vector >::setPoint ( const Vector &  p  )  [inline]

Set point to p.

template<class Vector>
void Biarc< Vector >::setMidPoint ( const Vector &  p  )  [inline]

Set midpoint to p.

template<class Vector>
void Biarc< Vector >::setMidTangent ( const Vector &  p  )  [inline]

Set midtangent to p.

References Biarc< Vector >::getNext().

template<class Vector>
void Biarc< Vector >::setTangentUnnormalized ( const Vector &  t  )  [inline]

Set tangent of the biarc. No normalization of the tangent is done.

template<class Vector>
void Biarc< Vector >::setTangent ( const Vector &  t  )  [inline]

Set tangent of the biarc to t. Tangent automatically normalized.

template<class Vector>
void Biarc< Vector >::get ( Vector &  p,
Vector &  t 
) const [inline]

Recover point/tangent data from this biarc and put it into p and t.

template<class Vector>
void Biarc< Vector >::set ( const Vector &  p,
const Vector &  t 
) [inline]

Set point/tangent data for this biarc to p and t.

template<class Vector>
void Biarc< Vector >::clear (  )  [inline]

Sets the biarc data to : point <0,0,0> and tangent <0,1,0>.

template<class Vector>
void Biarc< Vector >::reverse (  )  [inline]

Sets the biarc point P to -P.

template<class Vector>
int Biarc< Vector >::isProper (  )  const [inline]

Checks if the Biarc is proper. Returns 1 if this is true. Posts a warning message and returns 0 if the biarc is not proper.

A biarc is proper, if the point-tangent data pair $((p_0,t_0),(p_1,t_1))$ satifies

$(p_1-p_0)\cdot t_0 > 0,$ and $(p_1-p_0)\cdot t_1 > 0.$

This implies that for a Biarc b with point p and tangent t and its following biarc (obtained with Biarc::getNext()), with point p' and tangent t', the previous condition must hold.

See also:
getNext(), getPrevious().

References Biarc< Vector >::getNext(), Biarc< Vector >::getPoint(), and Biarc< Vector >::getTangent().

Referenced by Biarc< Vector >::make().

template<class Vector>
int Biarc< Vector >::isBiarc (  )  const [inline]

Returns true (=1) if the current biarc is interpolated, and 0 if not. Here interpolated means, that a valid matching point has been computed using this biarc and its following neighbour.

Referenced by Biarc< Vector >::getBezierArc0(), and Biarc< Vector >::getBezierArc1().

template<class Vector>
void Biarc< Vector >::setBiarc (  )  [inline]

Sets the "interpolated" flag to be true.

template<class Vector>
void Biarc< Vector >::make ( float  Gamma  )  [inline]

This function computes the matching point of this biarc. It uses the point/tangent data of current biarc as starting point and the point/tangent data of the next biarc as the end point.

Giving a value for Gamma, it is possible to compute a point (matching point), that links the two data points by two circular arcs of circles. For each arc the control points of a Bezier curve are computed and can be recovered by getBezier().

The appropriate rule that computes the matching point is still an open question (since the matching point of a biarc is not unique but located on a particular arc of circle defined by the data points and tangents).

For now, this function takes as input Gamma, where Gamma is a parameter related to the ratio of the Bezier triangles over the two arcs of circles.

More details can be found in Jana Smutny's PhD Thesis at

http://lcvmwww.epfl.ch/~lcvm/articles/thesis.html

See also:
getBezier(),getBezierArc0(),getBezierArc1(),Curve::make()

References Biarc< Vector >::getNext(), and Biarc< Vector >::isProper().

template<class Vector>
float Biarc< Vector >::arclength0 (  )  const [inline]

Returns the arclength of the first arc of circle.

See also:
arclength1(), biarclength().

Referenced by Biarc< Vector >::tangentOnBiarc().

template<class Vector>
float Biarc< Vector >::arclength1 (  )  const [inline]

Returns the arclength of the second arc of circle.

See also:
arclength0(), biarclength().

Referenced by Biarc< Vector >::tangentOnBiarc().

template<class Vector>
float Biarc< Vector >::biarclength (  )  const [inline]

Returns the arclength of the current biarc. This is the sum of the arcs one and two.

See also:
arclength0(), arclength1().

template<class Vector>
float Biarc< Vector >::radius0 (  )  const [inline]

Compute and return the radius of the first arc.

template<class Vector>
float Biarc< Vector >::radius1 (  )  const [inline]

Compute and return the radius of the second arc.

template<class Vector>
int Biarc< Vector >::id (  )  const [inline]

Returns the position if this Biarcs is in a Curve object. -1 otherwise.

template<class Vector>
void Biarc< Vector >::setId ( const int  i  )  [inline]

Private routine. Sets _BiarcInCurve value.

template<class Vector>
void Biarc< Vector >::setCurve ( Curve< Vector > *  c  )  [inline]

Private routine. Sets _Curve value.

template<class Vector>
const Curve< Vector > * Biarc< Vector >::getCurve (  )  [inline]

Private routine. Get curve pointer.

template<class Vector>
void Biarc< Vector >::setIdAndCurve ( const int  i,
Curve< Vector > *  c 
) [inline]

Private routine. Sets _BiarcInCurve and _Curve values.

template<class Vector>
Vector Biarc< Vector >::pointOnArc0 ( float  s  )  const [inline]

Returns point $a(s)$ on arc one of the biarc, here s is arc-length parametrization.

We have $s\in [0,l_0]$, where $l_0$ is the arc-length of the current biarc's first arc.

No check is done if we have a valid biarc interpolation!

See also:
pointOnBiarc(),pointOnArc1().

References Biarc< Vector >::a0(), Vector3::dot(), Vector3::norm(), and Vector3::normalize().

Referenced by Biarc< Vector >::pointOnBiarc().

template<class Vector>
Vector Biarc< Vector >::pointOnArc1 ( float  s  )  const [inline]

Returns point $a(s)$ on arc one of the biarc, here s is arc-length parametrization.

We have $s\in [0,l_1]$, where $l_1$ is the arc-length of the current biarc's second arc.

No check is done if we have a valid biarc interpolation!

See also:
pointOnBiarc(),pointOnArc0().

References Biarc< Vector >::a1(), Vector3::dot(), Biarc< Vector >::getNext(), Vector3::norm(), and Vector3::normalize().

Referenced by Biarc< Vector >::pointOnBiarc().

template<class Vector>
Vector Biarc< Vector >::pointOnBiarc ( float  arclength  )  const [inline]

Returns the point $a(s)$ on the biarc. Here s is arc-length parametrization.

We have $s\in [0,l]$, where $l$ is the total arc-length of the current biarc.

See also:
pointOnArc0(),pointOnArc1().

References Biarc< Vector >::getNext(), Biarc< Vector >::getPoint(), Biarc< Vector >::pointOnArc0(), and Biarc< Vector >::pointOnArc1().

Referenced by Biarc< Vector >::tangentOnBiarc().

template<class Vector>
Vector Biarc< Vector >::tangentOnBiarc ( float  arclength  )  const [inline]

template<class Vector>
void Biarc< Vector >::getBezierArc0 ( Vector &  b0,
Vector &  b1,
Vector &  b2 
) const [inline]

This function is used to extract the Bezier curve control points of the first arc of circle of the biarc and put them into b0,b1,b2.

See also:
getBezier(),getBezierArc1()

References Biarc< Vector >::isBiarc().

Referenced by Biarc< Vector >::getBezier().

template<class Vector>
void Biarc< Vector >::getBezierArc1 ( Vector &  b0,
Vector &  b1,
Vector &  b2 
) const [inline]

This function is used to extract the Bezier curve control points of the second arc of circle of the biarc and put them into b0,b1,b2.

See also:
getBezier(),getBezierArc0()

References Biarc< Vector >::getNext(), and Biarc< Vector >::isBiarc().

Referenced by Biarc< Vector >::getBezier().

template<class Vector>
void Biarc< Vector >::getBezier ( Vector &  b0_0,
Vector &  b1_0,
Vector &  b2_0,
Vector &  b0_1,
Vector &  b1_1,
Vector &  b2_1 
) const [inline]

This method is used to get the Bezier representation of the biarc. The corners of an isosceles triangle over a circular arc are known as the Bezier points.

From a biarc interpolated curve it is easy to compute the Bezier curve control points for each particular arc.

The Bezier points of arc one comes into the Vector objects b0_0,b1_0,b2_0 and arc two comes in b0_1,b1_1,b2_1.

See also:
getBezierArc0(),getBezierArc1()

References Biarc< Vector >::getBezierArc0(), and Biarc< Vector >::getBezierArc1().

template<class Vector>
Vector Biarc< Vector >::a0 ( float  tau  )  const [inline]

Given a value tau between 0 and 1, this function returns the point $a(\tau)$ on the first arc of circle of the biarc. Where $a(\tau)$ is a non-arclength parametrization of an arc of circle.

For arc-length parametrized arcs use one of the pointOn* functions.

See also:
pointOnArc0(),pointOnArc1(),pointOnBiarc(),a1().

Referenced by Biarc< Vector >::pointOnArc0().

template<class Vector>
Vector Biarc< Vector >::a1 ( float  tau  )  const [inline]

Given a value tau between 0 and 1, this function returns the point $a(\tau)$ on the second arc of circle of the biarc. Where $a(\tau)$ is a non-arclength parametrization of an arc of circle.

For arc-length parametrized arcs use one of the pointOn* functions.

See also:
pointOnArc0(),pointOnArc1(),pointOnBiarc(),a0().

References Biarc< Vector >::getNext(), and Biarc< Vector >::getPoint().

Referenced by Biarc< Vector >::pointOnArc1().

template<class Vector>
const Biarc< Vector > & Biarc< Vector >::getNext (  )  const [inline]

template<class Vector>
const Biarc< Vector > & Biarc< Vector >::getPrevious (  )  const [inline]

Returns a pointer to the previous biarc. We get NULL if the current biarc is the first point of the curve (i.e. the first element of the linked-list).

See also:
getNext(),setNext(),setPrevious(),setNextNULL(),setPreviousNULL().

template<class Vector>
void Biarc< Vector >::setNext ( const Biarc< Vector > &  b  )  [inline]

Sets the next neighbour of this biarc to b.

See also:
getNext(),getPrevious(),setPrevious(),setNextNULL(),setPreviousNULL().

template<class Vector>
void Biarc< Vector >::setPrevious ( const Biarc< Vector > &  b  )  [inline]

Sets the previous neighbour of this biarc to b.

See also:
getNext(),getPrevious(),setPrevious(),setNextNULL(),setPreviousNULL().

template<class Vector>
void Biarc< Vector >::setNextNULL (  )  [inline]

Deletes the link to the next neighbour by setting the pointer to NULL.

See also:
getNext(),getPrevious(),setNext(),setPrevious(),setPreviousNULL().

template<class Vector>
void Biarc< Vector >::setPreviousNULL (  )  [inline]

Deletes the link to the previous neighbour by setting the pointer to NULL.

See also:
getNext(),getPrevious(),setNext(),setPrevious(),setNextNULL().

template<class Vector>
Biarc< Vector > Biarc< Vector >::operator* ( const float  s  )  const [inline]

Returns a biarc whose point value is multiplied by s.

References Biarc< Vector >::Biarc().

template<class Vector>
Biarc< Vector > Biarc< Vector >::operator+ ( const Vector &  v  )  const [inline]

Returns a by v translated biarc. Tangent remains unchanged.

References Biarc< Vector >::Biarc().

template<class Vector>
Biarc< Vector > Biarc< Vector >::operator- ( const Vector &  v  )  const [inline]

Returns a by -v translated biarc. Tangent remains unchanged.

References Biarc< Vector >::Biarc().

template<class Vector>
Biarc< Vector > & Biarc< Vector >::operator= ( const Biarc< Vector > &  b  )  [inline]

Assign operator. Copies the values of the point and the tangent and sets the biarc flag _BIARC_ to zero.

References Biarc< Vector >::_BIARC_, Biarc< Vector >::_Curve, Biarc< Vector >::_Point, and Biarc< Vector >::_Tangent.

template<class Vector>
Biarc< Vector > & Biarc< Vector >::operator+= ( const Vector &  v  )  [inline]

Adds v to the point value of this biarc and returns an instance to itself.

template<class Vector>
Biarc< Vector > & Biarc< Vector >::operator-= ( const Vector &  v  )  [inline]

Subtracts v from the point value of this biarc and returns an instance to itself.

template<class Vector>
Biarc< Vector > & Biarc< Vector >::operator/= ( const float  d  )  [inline]

Divides the point value of this biarc by d and returns an instance to itself.

template<class Vector>
Biarc< Vector > & Biarc< Vector >::operator*= ( const float  d  )  [inline]

Multiplies the point value of this biarc by d and returns an instance to itself.

template<class Vector>
void Biarc< Vector >::print ( ostream &  out  )  const [inline]

Prints starting point, tangent, matching point and matching tangent onto the stream out. If the biarc is not valid, it only prints the point/tangent data of this biarc and if this biarc data point is the last of the curve, then the tag --NULL-- is printed at the end.

template<class Vector>
int Biarc< Vector >::operator== ( const Biarc< Vector > &  b  )  const [inline]

Compares this instance to a biarc b. Returns 1 if both biarcs agree in point and tangent, 0 otherwise.

References Biarc< Vector >::_Point, and Biarc< Vector >::_Tangent.

template<class Vector>
int Biarc< Vector >::operator!= ( const Biarc< Vector > &  b  )  const [inline]

Compares this instance to a biarc b. Returns 1 if the biarcs disagree in point or tangent or both, 0 otherwise.


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

Generated on Mon Feb 8 17:22:36 2010 for libbiarc by  doxygen 1.5.6