- /**
- * Get an array of DataPoints with data for the charts
- * @param inTrack track object containing points
- * @param inRequireAltitudes true if only points with altitudes are considered
- * @return array of points with contiguous non-null elements (<= size) with timestamps
- */
- private static DataPoint[] getDataPoints(Track inTrack, boolean inRequireAltitudes)
- {
- DataPoint[] points = new DataPoint[inTrack.getNumPoints()];
- DataPoint currPoint = null;
- int pointNum = 0;
- // Loop over all points
- for (int i=0; i<inTrack.getNumPoints(); i++)
- {
- currPoint = inTrack.getPoint(i);
- if (currPoint != null && !currPoint.isWaypoint() && currPoint.hasTimestamp()
- && (!inRequireAltitudes || currPoint.hasAltitude()))
- {
- points[pointNum] = currPoint;
- pointNum++;
- }
- }
- // Any elements at the end of the array will stay null
- // Also note, chronological order is not checked
- return points;
- }
-
-