25 return CppProxy.distanceBetweenGlobalPoints(from,
37 return CppProxy.distanceBetweenPoints(from,
48 return CppProxy.segmentLength(segment);
58 return CppProxy.polygonArea(polygon);
68 return CppProxy.polygonCenter(polygon);
79 return CppProxy.polygonContainsPoint(polygon,
91 return CppProxy.segmentPointDistance(segment,
103 return CppProxy.segmentIntersectsSegment(segment1,
115 return CppProxy.segmentIntersectionSegment(segment1,
127 return CppProxy.divisionRatioBySegment(segment1,
139 return CppProxy.getRatioPoint(segment,
152 return CppProxy.getProjectionRatio(segment,
158 private final long nativeRef;
159 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
161 private CppProxy(
long nativeRef)
163 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
164 this.nativeRef = nativeRef;
167 private native
void nativeDestroy(
long nativeRef);
168 public void _djinni_private_destroy()
170 boolean destroyed = this.destroyed.getAndSet(
true);
171 if (!destroyed) nativeDestroy(this.nativeRef);
173 protected void finalize() throws java.lang.Throwable
175 _djinni_private_destroy();
183 public static native
float distanceBetweenPoints(
Point from,
Point to);
185 public static native
float segmentLength(
Segment segment);
187 public static native
float polygonArea(
Polygon polygon);
189 public static native
Point polygonCenter(
Polygon polygon);
191 public static native
boolean polygonContainsPoint(
Polygon polygon,
Point point);
193 public static native
float segmentPointDistance(
Segment segment,
Point point);
195 public static native
boolean segmentIntersectsSegment(
Segment segment1,
Segment segment2);
199 public static native
float divisionRatioBySegment(
Segment segment1,
Segment segment2);
201 public static native
Point getRatioPoint(
Segment segment,
double r);
203 public static native
double getProjectionRatio(
Segment segment,
Point point);