|
|
| QuadricCurve2Set () |
| | Creates an empty piecewise quadric curve.
|
| | QuadricCurve2Set (const QVector< Vector2 > &) |
| | Creates the piecewise quadric curve given a set of control points.
|
| | QuadricCurve2Set (const QVector< QuadricCurve2 > &) |
| | Create a set of quadric curves.
|
| | QuadricCurve2Set (const QuadricCurveSet &) |
| | Creates a piecewise cubic curve in the plane from a similar curve.
|
|
| ~QuadricCurve2Set () |
| | Destroys a piecewise quadric curve.
|
|
int | Size () const |
| | Returns the number of elements of the piecewise quadric curve.
|
|
QuadricCurve2 | operator() (int) const |
| | Read only access to the elements of the piecewise quadric curve.
|
| void | Translate (const Vector2 &) |
| | Translate the curve.
|
|
Box2 | GetBox () const |
| | Compute the bounding box of the curve.
|
|
double | GetLength () const |
| | Return the length of the curve.
|
| double | GetLength (int) const |
| | Return the length of the sub-curve.
|
| double | Sinuosity () const |
| | Compute the sinuosity.
|
| QVector< Vector2 > | GetDiscretisation (const double &) const |
| | Generates a discretization of the curve with a linear curvilign absisca parameterization.
|
| QVector< Vector2 > | Discretize2 (const double &t) const |
| | Generates a discretization of the curve.
|
| int | U (const double &, double &) const |
| | Compute the parameter of the curve corresponding to the input length.
|
| double | R (const Vector2 &, double &, int &) const |
| | This function returns the squared distance between a point and a set of quadric curves.
|
| Vector2 | Projected (const Vector2 &) const |
| | Compute the Project the point on the curve.
|
| double | UV (const Vector2 &, double &, double &, int &) const |
| | Compute the inverse mapping for a given input point.
|
| bool | Inside (const Vector2 &) const |
| | Check if a point lies inside the piecewise quadric curve closed contour.
|
| bool | Intersect (const Ray2 &, double &) const |
| | Compute the first intersection between a ray and the curve.
|
| int | Intersections (const Ray2 &) const |
| | Compute the number of intersections between a ray and a piecewize quadric curve.
|
| QuadricCurve2Set & | operator+= (const QuadricCurve2Set &) |
| | Appends a piecewise cubic curve to an existing piecewise cubic curve.
|
| QVector< QuadricCurve2 > | GetQuadricCurve2Set () const |
| | Getter for the curve.
|
| void | Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
| | Draw the curve.
|
Piecewise quadric curves.
This class stores an array of quadric curves.
| void QuadricCurve2Set::UpdateBoxes |
( |
| ) |
|
|
protected |
Recompute the bounding box of every curve, used by UV() to skip curves that cannot be the closest.
Must be called by every function that modifies the set of curves.
The boxes are enlarged by a small margin so that they are guaranteed to contain their curve: Quadric::Range() ignores the extremum of a quadric whose second order coefficient is below Quadric::epsilon, so the exact box of a nearly degenerate curve can be off by about that much, and the distance to a box is computed with its own rounding.
| double QuadricCurve2Set::UV |
( |
const Vector2 & | p, |
|
|
double & | u, |
|
|
double & | v, |
|
|
int & | k ) const |
Compute the inverse mapping for a given input point.
The result is the one of a plain scan over every curve, keeping the first curve reaching the smallest squared distance, but most curves are skipped: every point of a curve lies inside its box, so the squared distance to that box is a lower bound of what QuadricCurve2::UV() can return for it. The curve with the nearest box is solved first, and a curve is skipped only if its bound exceeds the distance already reached (with a small slack for rounding), which means the scan could not have selected it. The remaining curves are processed in order with the same strict comparison, so the selected curve, and u and v, are exactly those of the plain scan.
- Parameters
-
| p | Point. |
| u,v | Inverse Coordinates, u will denote the position along the curve and v the signed distance to the curve. |
| k | Index defining the sub-curve element. |