35 return CppProxy.distanceBetweenGlobalPoints(from,
57 return CppProxy.distanceBetweenPoints(from,
78 return CppProxy.segmentLength(segment);
98 return CppProxy.polygonArea(polygon);
118 return CppProxy.polygonCenter(polygon);
139 return CppProxy.polygonContainsPoint(polygon,
161 return CppProxy.segmentPointDistance(segment,
183 return CppProxy.segmentIntersectsSegment(segment1,
205 return CppProxy.segmentIntersectionSegment(segment1,
227 return CppProxy.divisionRatioBySegment(segment1,
249 return CppProxy.getRatioPoint(segment,
272 return CppProxy.getProjectionRatio(segment,
278 private final long nativeRef;
279 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
281 private CppProxy(
long nativeRef)
283 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
284 this.nativeRef = nativeRef;
287 private native
void nativeDestroy(
long nativeRef);
288 public void _djinni_private_destroy()
290 boolean destroyed = this.destroyed.getAndSet(
true);
291 if (!destroyed) nativeDestroy(this.nativeRef);
293 protected void finalize() throws java.lang.Throwable
295 _djinni_private_destroy();
303 public static native
float distanceBetweenPoints(
Point from,
Point to);
305 public static native
float segmentLength(
Segment segment);
307 public static native
float polygonArea(
Polygon polygon);
309 public static native
Point polygonCenter(
Polygon polygon);
311 public static native
boolean polygonContainsPoint(
Polygon polygon,
Point point);
313 public static native
float segmentPointDistance(
Segment segment,
Point point);
315 public static native
boolean segmentIntersectsSegment(
Segment segment1,
Segment segment2);
319 public static native
float divisionRatioBySegment(
Segment segment1,
Segment segment2);
321 public static native
Point getRatioPoint(
Segment segment,
double r);
323 public static native
double getProjectionRatio(
Segment segment,
Point point);