aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-02-11 19:48:48 +0100
committerSven Göthel <[email protected]>2024-02-11 19:48:48 +0100
commit499d8474247053f47e1f217f5e78fc0f5397f2d9 (patch)
treed982f181ded0b964bce9f15a14aba59c57bce968
parent1e6b604393509e631d46fe72053ca813aee33a74 (diff)
Graph: Outline[Shape]: Add print()
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java15
-rw-r--r--src/jogl/classes/com/jogamp/graph/geom/Outline.java11
2 files changed, 26 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
index eb6548838..805db522b 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
@@ -27,6 +27,7 @@
*/
package com.jogamp.graph.curve;
+import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -1135,4 +1136,18 @@ public final class OutlineShape implements Comparable<OutlineShape> {
// Avoid calling this.hashCode() !
return getClass().getName() + "@" + Integer.toHexString(super.hashCode());
}
+
+ public void print(final PrintStream out) {
+ final int oc = getOutlineCount();
+ for (int oi = 0; oi < oc; oi++) {
+ final Outline outline = getOutline(oi);
+ final int vc = outline.getVertexCount();
+ out.printf("- OL[%d]: %s%n", vc, outline.getWinding());
+ for(int vi=0; vi < vc; vi++) {
+ final Vertex v = outline.getVertex(vi);
+ out.printf("-- OS[%d][%d]: %s%n", oi, vi, v);
+ }
+ }
+ }
+
}
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Outline.java b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
index b593c20be..522919cc6 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Outline.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
@@ -27,6 +27,7 @@
*/
package com.jogamp.graph.geom;
+import java.io.PrintStream;
import java.util.ArrayList;
import com.jogamp.math.FloatUtil;
@@ -362,4 +363,14 @@ public class Outline implements Comparable<Outline> {
// Avoid calling this.hashCode() !
return getClass().getName() + "@" + Integer.toHexString(super.hashCode());
}
+
+ public void print(final PrintStream out) {
+ final int vc = getVertexCount();
+ out.printf("Outline: %d, %s%n", vc, getWinding());
+ for(int vi=0; vi < vc; vi++) {
+ final Vertex v = getVertex(vi);
+ out.printf("- OL[%d]: %s%n", vi, v);
+ }
+ }
+
}