34 return CppProxy.distanceBetweenGlobalPoints(from,
55 return CppProxy.distanceBetweenPoints(from,
75 return CppProxy.segmentLength(segment);
94 return CppProxy.polygonArea(polygon);
113 return CppProxy.polygonCenter(polygon);
133 return CppProxy.polygonContainsPoint(polygon,
154 return CppProxy.segmentPointDistance(segment,
175 return CppProxy.segmentIntersectsSegment(segment1,
196 return CppProxy.segmentIntersectionSegment(segment1,
217 return CppProxy.divisionRatioBySegment(segment1,
238 return CppProxy.getRatioPoint(segment,
260 return CppProxy.getProjectionRatio(segment,
266 private final long nativeRef;
267 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
269 private CppProxy(
long nativeRef)
271 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
272 this.nativeRef = nativeRef;
275 private native
void nativeDestroy(
long nativeRef);
276 public void _djinni_private_destroy()
278 boolean destroyed = this.destroyed.getAndSet(
true);
279 if (!destroyed) nativeDestroy(this.nativeRef);
281 protected void finalize() throws java.lang.Throwable
283 _djinni_private_destroy();
291 public static native
float distanceBetweenPoints(
Point from,
Point to);
293 public static native
float segmentLength(
Segment segment);
295 public static native
float polygonArea(
Polygon polygon);
297 public static native
Point polygonCenter(
Polygon polygon);
299 public static native
boolean polygonContainsPoint(
Polygon polygon,
Point point);
301 public static native
float segmentPointDistance(
Segment segment,
Point point);
303 public static native
boolean segmentIntersectsSegment(
Segment segment1,
Segment segment2);
307 public static native
float divisionRatioBySegment(
Segment segment1,
Segment segment2);
309 public static native
Point getRatioPoint(
Segment segment,
double r);
311 public static native
double getProjectionRatio(
Segment segment,
Point point);