diff --git a/pom.xml b/pom.xml index c794ab44..3e1054d8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,13 +5,13 @@ org.scijava pom-scijava - 37.0.0 + 38.0.1 sc.fiji TrakEM2_ - 1.3.11-SNAPSHOT + 2.0.0-SNAPSHOT TrakEM2 TrakEM2 plugin for ImageJ. @@ -147,6 +147,9 @@ sign,deploy-to-scijava + + <_3D_Viewer.version>5.0.0 + 3.0.0 @@ -214,15 +217,15 @@ postgresql - org.scijava - j3dcore + org.jogamp.java3d + java3d-core - org.scijava - j3dutils + org.jogamp.java3d + java3d-utils - org.scijava + org.jogamp.java3d vecmath diff --git a/src/main/java/ini/trakem2/analysis/Compare.java b/src/main/java/ini/trakem2/analysis/Compare.java index 77021330..131d8341 100644 --- a/src/main/java/ini/trakem2/analysis/Compare.java +++ b/src/main/java/ini/trakem2/analysis/Compare.java @@ -54,13 +54,13 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Pattern; -import org.scijava.java3d.Transform3D; -import org.scijava.vecmath.Color3f; -import org.scijava.vecmath.Matrix3d; -import org.scijava.vecmath.Matrix4d; -import org.scijava.vecmath.Point3d; -import org.scijava.vecmath.Tuple3d; -import org.scijava.vecmath.Vector3d; +import org.jogamp.java3d.Transform3D; +import org.jogamp.vecmath.Color3f; +import org.jogamp.vecmath.Matrix3d; +import org.jogamp.vecmath.Matrix4d; +import org.jogamp.vecmath.Point3d; +import org.jogamp.vecmath.Tuple3d; +import org.jogamp.vecmath.Vector3d; import ij.IJ; import ij.ImagePlus; @@ -1883,7 +1883,7 @@ public void run() { continue; } - final Content sphere = d3d.getUniverse().addMesh(ij3d.Mesh_Maker.createSphere(x, y, z, r), new Color3f(heat_table.get(name)), name + "-sphere", 1); + final Content sphere = d3d.getUniverse().addMesh(ij3d.Mesh_Maker.createSphere(x, y, z, r), ij3d.Utils.toColor3f(heat_table.get(name)), name + "-sphere", 1); } } diff --git a/src/main/java/ini/trakem2/display/AreaList.java b/src/main/java/ini/trakem2/display/AreaList.java index 3351be51..07874d16 100644 --- a/src/main/java/ini/trakem2/display/AreaList.java +++ b/src/main/java/ini/trakem2/display/AreaList.java @@ -56,7 +56,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; -import org.scijava.vecmath.Point3f; +import org.jogamp.vecmath.Point3f; import amira.AmiraMeshEncoder; import fiji.geom.AreaCalculations; diff --git a/src/main/java/ini/trakem2/display/AreaTree.java b/src/main/java/ini/trakem2/display/AreaTree.java index 9a3f5993..3161640e 100644 --- a/src/main/java/ini/trakem2/display/AreaTree.java +++ b/src/main/java/ini/trakem2/display/AreaTree.java @@ -50,8 +50,8 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; -import org.scijava.vecmath.Color3f; -import org.scijava.vecmath.Point3f; +import org.jogamp.vecmath.Color3f; +import org.jogamp.vecmath.Point3f; import customnode.CustomTriangleMesh; import fiji.geom.AreaCalculations; @@ -592,7 +592,7 @@ public MeshData generateMesh(final double scale, final int resample) { // Determine colors by proximity to a node, since there isn't any other way. // TODO Utils.log("WARNING: AreaTree multicolor 3D mesh is not yet implemented."); - final Color3f cf = new Color3f(color); + final Color3f cf = ij3d.Utils.toColor3f(color); for (int i=0; i generateTriangles(final double scale, final double[][][] globe) { try { - Class.forName("org.scijava.vecmath.Point3f"); + Class.forName("org.jogamp.vecmath.Point3f"); } catch (final ClassNotFoundException cnfe) { Utils.log("Java3D is not installed."); return null; diff --git a/src/main/java/ini/trakem2/display/Connector.java b/src/main/java/ini/trakem2/display/Connector.java index e4fcd51a..ab7a8054 100644 --- a/src/main/java/ini/trakem2/display/Connector.java +++ b/src/main/java/ini/trakem2/display/Connector.java @@ -39,7 +39,7 @@ import java.util.Map; import java.util.Set; -import org.scijava.vecmath.Point3f; +import org.jogamp.vecmath.Point3f; import ij.measure.Calibration; import ij.measure.ResultsTable; diff --git a/src/main/java/ini/trakem2/display/Display3D.java b/src/main/java/ini/trakem2/display/Display3D.java index 406ffc3b..d469a365 100644 --- a/src/main/java/ini/trakem2/display/Display3D.java +++ b/src/main/java/ini/trakem2/display/Display3D.java @@ -46,11 +46,11 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import org.scijava.java3d.PolygonAttributes; -import org.scijava.java3d.Transform3D; -import org.scijava.java3d.View; -import org.scijava.vecmath.Color3f; -import org.scijava.vecmath.Point3f; +import org.jogamp.java3d.PolygonAttributes; +import org.jogamp.java3d.Transform3D; +import org.jogamp.java3d.View; +import org.jogamp.vecmath.Color3f; +import org.jogamp.vecmath.Point3f; import customnode.CustomLineMesh; import customnode.CustomMesh; @@ -310,7 +310,7 @@ static private boolean hasLibs() { if (check_j3d) { check_j3d = false; try { - Class.forName("org.scijava.vecmath.Point3f"); + Class.forName("org.jogamp.vecmath.Point3f"); has_j3d_3dviewer = true; } catch (final ClassNotFoundException cnfe) { Utils.log("Java 3D not installed."); @@ -895,7 +895,7 @@ public Content call() { Content ct = null; try { - final Color3f c3 = new Color3f(color); + final Color3f c3 = ij3d.Utils.toColor3f(color); // If it exists, remove and add as new: universe.removeContent(title); @@ -996,7 +996,7 @@ public Content asContent(final Display3D d3d) { Utils.log("WARNING: adding a 3D object fully transparent."); } final List triangles = Pipe.generateTriangles(Pipe.makeTube(vs.getPoints(0), vs.getPoints(1), vs.getPoints(2), wi, 1, 12, null), d3d.scale); - final Content ct = d3d.universe.createContent(new CustomTriangleMesh(triangles, new Color3f(color), 0), title); + final Content ct = d3d.universe.createContent(new CustomTriangleMesh(triangles, ij3d.Utils.toColor3f(color), 0), title); ct.setTransparency(transp); ct.setLocked(true); return ct; @@ -1125,7 +1125,7 @@ public Boolean call() { Content content = d3d.universe.getContent(makeTitle(d)); if (null == content) content = getProfileContent(d); if (null != content) { - content.setColor(new Color3f(color)); + content.setColor(ij3d.Utils.toColor3f(color)); return true; } return false; @@ -1237,7 +1237,7 @@ public List createFatPoint(final double wx, final double wy, final doub static public final Future addFatPoint(final String title, final LayerSet ls, final double wx, final double wy, final double wz, final double wr, final Color color) { final Display3D d3d = Display3D.get(ls); d3d.universe.removeContent(title); - final Content ct = d3d.universe.createContent(new CustomTriangleMesh(d3d.createFatPoint(wx, wy, wz, wr, ls.getCalibrationCopy()), new Color3f(color), 0), title); + final Content ct = d3d.universe.createContent(new CustomTriangleMesh(d3d.createFatPoint(wx, wy, wz, wr, ls.getCalibrationCopy()), ij3d.Utils.toColor3f(color), 0), title); ct.setLocked(true); return d3d.addContent(ct); } diff --git a/src/main/java/ini/trakem2/display/DisplayCanvas.java b/src/main/java/ini/trakem2/display/DisplayCanvas.java index e35a8db3..6295a8e8 100644 --- a/src/main/java/ini/trakem2/display/DisplayCanvas.java +++ b/src/main/java/ini/trakem2/display/DisplayCanvas.java @@ -71,9 +71,9 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; -import org.scijava.vecmath.Point2f; -import org.scijava.vecmath.Vector2f; -import org.scijava.vecmath.Vector3d; +import org.jogamp.vecmath.Point2f; +import org.jogamp.vecmath.Vector2f; +import org.jogamp.vecmath.Vector3d; import ij.IJ; import ij.ImagePlus; diff --git a/src/main/java/ini/trakem2/display/Line3D.java b/src/main/java/ini/trakem2/display/Line3D.java index 29d9efbc..dcbfe8a2 100644 --- a/src/main/java/ini/trakem2/display/Line3D.java +++ b/src/main/java/ini/trakem2/display/Line3D.java @@ -26,7 +26,7 @@ import java.awt.Color; import java.util.List; -import org.scijava.vecmath.Point3f; +import org.jogamp.vecmath.Point3f; import ini.trakem2.Project; import ini.trakem2.vector.VectorString3D; diff --git a/src/main/java/ini/trakem2/display/Node.java b/src/main/java/ini/trakem2/display/Node.java index 6fd79265..37b5512d 100644 --- a/src/main/java/ini/trakem2/display/Node.java +++ b/src/main/java/ini/trakem2/display/Node.java @@ -46,7 +46,7 @@ import java.util.Set; import java.util.TreeSet; -import org.scijava.vecmath.Point3f; +import org.jogamp.vecmath.Point3f; import ini.trakem2.Project; import ini.trakem2.utils.IJError; diff --git a/src/main/java/ini/trakem2/display/Pipe.java b/src/main/java/ini/trakem2/display/Pipe.java index 6fa69c69..4d26c717 100644 --- a/src/main/java/ini/trakem2/display/Pipe.java +++ b/src/main/java/ini/trakem2/display/Pipe.java @@ -41,7 +41,7 @@ import java.util.Iterator; import java.util.List; -import org.scijava.vecmath.Point3f; +import org.jogamp.vecmath.Point3f; import ij.measure.Calibration; import ij.measure.ResultsTable; diff --git a/src/main/java/ini/trakem2/display/Polyline.java b/src/main/java/ini/trakem2/display/Polyline.java index 86de4ede..03f54f2b 100644 --- a/src/main/java/ini/trakem2/display/Polyline.java +++ b/src/main/java/ini/trakem2/display/Polyline.java @@ -44,8 +44,8 @@ import java.util.Map; import java.util.Random; -import org.scijava.vecmath.Point3f; -import org.scijava.vecmath.Vector3d; +import org.jogamp.vecmath.Point3f; +import org.jogamp.vecmath.Vector3d; import features.ComputeCurvatures; import ij.IJ; diff --git a/src/main/java/ini/trakem2/display/Profile.java b/src/main/java/ini/trakem2/display/Profile.java index 2a54273b..3260a44f 100644 --- a/src/main/java/ini/trakem2/display/Profile.java +++ b/src/main/java/ini/trakem2/display/Profile.java @@ -42,7 +42,7 @@ import java.util.List; import java.util.Map; -import org.scijava.vecmath.Point3f; +import org.jogamp.vecmath.Point3f; import ij.measure.Calibration; import ij.measure.ResultsTable; diff --git a/src/main/java/ini/trakem2/display/Tree.java b/src/main/java/ini/trakem2/display/Tree.java index 54389c23..7a1e5ba9 100644 --- a/src/main/java/ini/trakem2/display/Tree.java +++ b/src/main/java/ini/trakem2/display/Tree.java @@ -87,8 +87,8 @@ import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableCellRenderer; -import org.scijava.vecmath.Color3f; -import org.scijava.vecmath.Point3f; +import org.jogamp.vecmath.Color3f; +import org.jogamp.vecmath.Point3f; import fiji.geom.AreaCalculations; import ij.ImagePlus; @@ -630,7 +630,7 @@ public MeshData generateSkeleton(final double scale_, final int parallels, final // The method, by the way, is very parallelizable: each is independent. final HashMap cached_colors = new HashMap(); - final Color3f cf = new Color3f(this.color); + final Color3f cf = ij3d.Utils.toColor3f(this.color); cached_colors.put(this.color, cf); boolean go = true; @@ -662,7 +662,7 @@ public MeshData generateSkeleton(final double scale_, final int parallels, final } else { Color3f c = cached_colors.get(node.color); if (null == c) { - c = new Color3f(node.color); + c = ij3d.Utils.toColor3f(node.color); cached_colors.put(node.color, c); } colors.add(c); diff --git a/src/main/java/ini/trakem2/display/Treeline.java b/src/main/java/ini/trakem2/display/Treeline.java index 2fb91ad0..0d0ac330 100644 --- a/src/main/java/ini/trakem2/display/Treeline.java +++ b/src/main/java/ini/trakem2/display/Treeline.java @@ -48,11 +48,11 @@ import java.util.List; import java.util.Set; -import org.scijava.java3d.Transform3D; -import org.scijava.vecmath.AxisAngle4f; -import org.scijava.vecmath.Color3f; -import org.scijava.vecmath.Point3f; -import org.scijava.vecmath.Vector3f; +import org.jogamp.java3d.Transform3D; +import org.jogamp.vecmath.AxisAngle4f; +import org.jogamp.vecmath.Color3f; +import org.jogamp.vecmath.Point3f; +import org.jogamp.vecmath.Vector3f; import ij.gui.GenericDialog; import ij.measure.Calibration; @@ -665,7 +665,7 @@ public MeshData generateMesh(final double scale_, int parallels) { final AxisAngle4f aa = new AxisAngle4f(); final List colors = new ArrayList(); - final Color3f cf = new Color3f(this.color); + final Color3f cf = ij3d.Utils.toColor3f(this.color); final HashMap cached_colors = new HashMap(); cached_colors.put(this.color, cf); @@ -733,7 +733,7 @@ public MeshData generateMesh(final double scale_, int parallels) { } else { c = cached_colors.get(nd.color); if (null == c) { - c = new Color3f(nd.color); + c = ij3d.Utils.toColor3f(nd.color); cached_colors.put(nd.color, c); } } diff --git a/src/main/java/ini/trakem2/display/d3d/ControlClickBehavior.java b/src/main/java/ini/trakem2/display/d3d/ControlClickBehavior.java index 3ee312ce..4022c2c3 100644 --- a/src/main/java/ini/trakem2/display/d3d/ControlClickBehavior.java +++ b/src/main/java/ini/trakem2/display/d3d/ControlClickBehavior.java @@ -23,7 +23,7 @@ import java.awt.event.MouseEvent; -import org.scijava.vecmath.Point3d; +import org.jogamp.vecmath.Point3d; import ij.measure.Calibration; import ij3d.Content; diff --git a/src/main/java/ini/trakem2/display/d3d/Display3DGUI.java b/src/main/java/ini/trakem2/display/d3d/Display3DGUI.java index 1e75c68d..65e7e24e 100644 --- a/src/main/java/ini/trakem2/display/d3d/Display3DGUI.java +++ b/src/main/java/ini/trakem2/display/d3d/Display3DGUI.java @@ -36,8 +36,8 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; -import java.util.Enumeration; import java.util.Hashtable; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.TreeMap; @@ -58,10 +58,10 @@ import javax.swing.table.AbstractTableModel; import javax.swing.table.TableColumn; -import org.scijava.java3d.BranchGroup; -import org.scijava.java3d.Canvas3D; -import org.scijava.java3d.View; -import org.scijava.vecmath.Color3f; +import org.jogamp.java3d.BranchGroup; +import org.jogamp.java3d.Canvas3D; +import org.jogamp.java3d.View; +import org.jogamp.vecmath.Color3f; import ij3d.Content; import ij3d.Image3DUniverse; @@ -149,9 +149,9 @@ public ImageWindow3D init() { */ static private final List getOrderedContents(final Image3DUniverse univ) { final ArrayList cs = new ArrayList(); - final Enumeration seq = univ.getScene().getAllChildren(); - while (seq.hasMoreElements()) { - final Object o = seq.nextElement(); + final Iterator seq = univ.getScene().getAllChildren(); + while (seq.hasNext()) { + final Object o = seq.next(); if (o instanceof Content) cs.add((Content)o); } return cs; diff --git a/src/main/java/ini/trakem2/utils/AreaUtils.java b/src/main/java/ini/trakem2/utils/AreaUtils.java index 2dc47dbc..2bcc0dae 100644 --- a/src/main/java/ini/trakem2/utils/AreaUtils.java +++ b/src/main/java/ini/trakem2/utils/AreaUtils.java @@ -37,7 +37,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; -import org.scijava.vecmath.Point3f; +import org.jogamp.vecmath.Point3f; import ij.ImagePlus; import ij.gui.Roi; diff --git a/src/main/java/ini/trakem2/utils/M.java b/src/main/java/ini/trakem2/utils/M.java index fe4ce4c2..44ea29bb 100644 --- a/src/main/java/ini/trakem2/utils/M.java +++ b/src/main/java/ini/trakem2/utils/M.java @@ -39,10 +39,10 @@ import java.util.Collection; import java.util.List; -import org.scijava.vecmath.Point3f; -import org.scijava.vecmath.Tuple3d; -import org.scijava.vecmath.Vector3d; -import org.scijava.vecmath.Vector3f; +import org.jogamp.vecmath.Point3f; +import org.jogamp.vecmath.Tuple3d; +import org.jogamp.vecmath.Vector3d; +import org.jogamp.vecmath.Vector3f; import ij.gui.PolygonRoi; import ij.gui.Roi; diff --git a/src/main/java/ini/trakem2/utils/MCCube.java b/src/main/java/ini/trakem2/utils/MCCube.java index edbe20e4..800b049c 100644 --- a/src/main/java/ini/trakem2/utils/MCCube.java +++ b/src/main/java/ini/trakem2/utils/MCCube.java @@ -30,7 +30,7 @@ import java.util.HashMap; import java.util.List; -import org.scijava.vecmath.Point3f; +import org.jogamp.vecmath.Point3f; import ij.IJ; import ij3d.Volume; diff --git a/src/main/java/ini/trakem2/utils/MCTriangulator.java b/src/main/java/ini/trakem2/utils/MCTriangulator.java index c6b06751..76afaca7 100644 --- a/src/main/java/ini/trakem2/utils/MCTriangulator.java +++ b/src/main/java/ini/trakem2/utils/MCTriangulator.java @@ -23,7 +23,7 @@ import java.util.List; -import org.scijava.vecmath.Point3f; +import org.jogamp.vecmath.Point3f; import ij.ImagePlus; import ij.ImageStack; diff --git a/src/main/java/ini/trakem2/utils/Utils.java b/src/main/java/ini/trakem2/utils/Utils.java index 8a87e4c9..d7455808 100755 --- a/src/main/java/ini/trakem2/utils/Utils.java +++ b/src/main/java/ini/trakem2/utils/Utils.java @@ -980,7 +980,7 @@ static public final boolean wrongImageJVersion() { static private final boolean isJava3DInstalled() { try { - Class.forName("org.scijava.vecmath.Point3f"); + Class.forName("org.jogamp.vecmath.Point3f"); } catch (final ClassNotFoundException cnfe) { return false; }