- _startIndex = inStartIndex;
- _endIndex = inEndIndex;
- _numPoints = inEndIndex - inStartIndex + 1;
- _totalAltitudeRange = new AltitudeRange();
- _movingAltitudeRange = new AltitudeRange();
- _gentleAltitudeRange = new AltitudeRange();
- _steepAltitudeRange = new AltitudeRange();
- DataPoint prevPoint = null;
- Altitude prevAltitude = null;
- _totalDistanceRads = _movingDistanceRads = 0.0;
- double radsSinceLastAltitude = 0.0;
- _movingMilliseconds = 0L;
-
- // Loop over the points in the range
- for (int i=inStartIndex; i<= inEndIndex; i++)
+ if (inPoint == null)
+ {
+ return;
+ }
+ _numPoints++;
+ // ignore all waypoints
+ if (inPoint.isWaypoint()) {
+ return;
+ }
+ if (inPoint.getSegmentStart() || !_foundTrackPoint) {
+ _numSegments++;
+ }
+ _foundTrackPoint = true;
+ // Get the distance to the previous track point
+ if (_prevPoint != null)