21 double pointsInterval)
const
23 LOG4CPP_INFO_S ((*mainCat)) <<
"ExportOrdinalsStraight::ordinalsAtIntervalsGraph";
26 ExportValuesOrdinal ordinals;
29 double distanceAlongSegment = 0;
30 QPointF posLast (points [0].posScreen().x(),
31 points [0].posScreen().y());
32 double ordinalLast = 0;
37 for (
int iP = 0; iP < points.count(); iP++) {
39 const Point &pointNew = points.at (iP);
42 QPointF posDelta = posNew - posLast;
43 double segmentLength = qSqrt (posDelta.x() * posDelta.x() + posDelta.y() * posDelta.y());
45 while (distanceAlongSegment < segmentLength) {
47 double sLocal = distanceAlongSegment / segmentLength;
49 ordinals.push_back (ordinalLast + sLocal);
51 distanceAlongSegment += pointsInterval;
54 distanceAlongSegment -= segmentLength;
55 ordinalLast = pointNew.
ordinal();
64 double pointsInterval)
const
66 LOG4CPP_INFO_S ((*mainCat)) <<
"ExportOrdinalsStraight::ordinalsAtIntervalsGraph";
69 ExportValuesOrdinal ordinals;
72 double distanceAlongSegment = 0;
76 double ordinalLast = 0;
81 for (
int iP = 0; iP < points.count(); iP++) {
83 const Point &pointNew = points.at (iP);
88 QPointF posDelta = posNew - posLast;
89 double segmentLength = qSqrt (posDelta.x() * posDelta.x() + posDelta.y() * posDelta.y());
91 while (distanceAlongSegment < segmentLength) {
93 double sLocal = distanceAlongSegment / segmentLength;
95 ordinals.push_back (ordinalLast + sLocal);
97 distanceAlongSegment += pointsInterval;
100 ordinalLast = pointNew.
ordinal();
ExportValuesOrdinal ordinalsAtIntervalsGraphWithTransformation(const Points &points, const Transformation &transformation, double pointsInterval) const
Compute ordinals, converting screen coordinates to graph coordinates.