EllipticArcSegment.withStartAndEndpoints constructor

EllipticArcSegment.withStartAndEndpoints({
  1. required ArcGISPoint startPoint,
  2. required ArcGISPoint endPoint,
  3. required double rotationAngle,
  4. required bool isMinor,
  5. required bool isCounterClockwise,
  6. required double semiMajorAxis,
  7. required double minorMajorRatio,
  8. SpatialReference? spatialReference,
})

Creates an elliptic arc segment from the given start and end points, and other parameters that define an ellipse.

The z-value and m-value of the start and end points (if present) are used in the EllipticArcSegment.

To maintain the given startPoint and endPoint in the new segment, the other parameters may be adjusted if required. Such adjustments are made according to the Scalable Vector Graphics 1.1 Specification, Appendix F.6.5. If these cannot be adjusted sufficiently, an arc represented with a straight line is returned.

Parameters:

  • startPoint — The start point of the segment.
  • endPoint — The end point of the segment.
  • rotationAngle — The angle in radians by which the major axis of the embedded ellipse is rotated from the x-axis. A positive value corresponds to a counterclockwise rotation from the x-axis.
  • isMinor — True if EllipticArcSegment.centralAngle of the segment is less than PI.
  • isCounterClockwise — True if the direction of the segment, from start point to end point, proceeds in a counterclockwise direction, otherwise false.
  • semiMajorAxis — The length of the semi-major axis of the embedded ellipse in the units of the spatial reference.
  • minorMajorRatio — The ratio of the length of the semi-minor axis to the length of the semi-major axis of the embedded ellipse.
  • spatialReference — A spatial reference to use for the segment if the points do not have spatial references set.

Implementation

factory EllipticArcSegment.withStartAndEndpoints({
  required ArcGISPoint startPoint,
  required ArcGISPoint endPoint,
  required double rotationAngle,
  required bool isMinor,
  required bool isCounterClockwise,
  required double semiMajorAxis,
  required double minorMajorRatio,
  SpatialReference? spatialReference,
}) {
  _initializeArcGISEnvironmentIfNeeded();
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_EllipticArcSegment_createWithStartAndEndpoints(
      startPoint._handle,
      endPoint._handle,
      rotationAngle,
      isMinor,
      isCounterClockwise,
      semiMajorAxis,
      minorMajorRatio,
      spatialReference?._handle ?? ffi.nullptr,
      errorHandler,
    );
  });
  final EllipticArcSegment object = EllipticArcSegment._withHandle(handle);
  object._spatialReference.cache(spatialReference);
  return object;
}