10 defaultLineStyle(
SOLID),
21 for(
int i=0; i < n-1; ++i) {
31 Q_ASSERT (defaultStyle !=
DEFAULT);
37 Q_ASSERT(i >= 0 && i <= size());
48 return back().upper();
50 Q_ASSERT(i >= 0 && i < size());
51 return (*
this)[i].mapFromUnitInterval(x-i);
61 return back().upper();
72 _hor.empty() ? 0.0 :
_hor.back().upper(),
77 Q_ASSERT(i>=0 && i <
_hor.size());
78 Q_ASSERT(j>=0 && j <
_vert.size());
102 return QRectF(topleft,bottomright);
114 QLineF line (i,0.0, i,
vert().
size());
120 QLineF line (0.0,j,
hor().
size(),j);
132 Q_ASSERT(C.isClosed() || (x >= 0.0) && (x <= (C.size()-1)));
134 x = std::fmod(x,C.size()-1);
135 int i = (int)floor(x);
137 Point p = C[i % C.size()];
138 if (x==0.0)
return p;
140 Point q = C[(i+1) % C.size()];
141 return (1-x)*p + x*q;
156 for( ; i1 < x2; i1 += 1)
166 for(
int i=0; i < seq.size(); ++i)
static Curve mapToSequence(const Curve &C, double x1, double x2)
given a polygonal curve and two offsets, compute the sequence of line segment connecting both offsets
double map(double x) const
maps a value from [0..n] onto the axis [0..|P|]
GridAxis _vert
arc lengths of Q == vertical grid coordinates
LineStyle lineStyle(int i) const
const GridAxis & vert() const
static Point mapToPoint(const Curve &C, double x)
given a polygonal curve and an offset, compute the point on the curve
global definitions for all algorithms.
std::vector< LineStyle > LineStyleVector
LineStyle defaultLineStyle
default line style for drawing a grid line
LineStyleVector lineStyles
custom line styles for grid lines
static QLineF mapToSegment(const Curve &C, double x1, double x2)
given a polygonal curve and two offsets, compute the corresponding line segment
void setCurve(const Curve &P)
compute the length of each polygon segment
void setLineStyles(const LineStyleVector &linesStyles, LineStyle defaultLineStyle)
assign line styles for visualisation
QLineF verticalGridLine(int i)
map a vertical line
QRectF mapRect(QRectF r)
map a rectangle from [0..n]x[0..m] to the grid coordinates [0..|P|]x[0..|Q|]
QPointF Point
a point in the plane; with double floating point precision. This type is heavily used throughout all ...
void setCurves(const Curve &P, const Curve &Q)
calculate grid from input curves
QPolygonF Curve
a polygonal curve in the plane; with double floating point precision. This type is heavily used throu...
Curve mapCurve(Curve c)
map a sequence of line segments from [0..n]x[0..m] to the grid coordinates [0..|P|]x[0....
double segment_length(const Curve &c, int i)
compute the length of a polygon segment
GridAxis()
empty constructor
Point mapPoint(Point p)
map a point from [0..n]x[0..m] to the grid coordinates [0..|P|]x[0..|Q|]
const GridAxis & hor() const
LineStyle
display style of grid lines in free-space diagram
QRectF cellBounds(int i, int j) const
GridAxis _hor
arc lengths of P == horizontal grid coordinates
QLineF horizontalGridLine(int j)
map a horizontal line
an interval of two double values.
QLineF mapLine(QLineF l)
map a line segment from [0..n]x[0..m] to the grid coordinates [0..|P|]x[0..|Q|]