ini.trakem2.display
Class Display3D

java.lang.Object
  extended by ini.trakem2.display.Display3D

public final class Display3D
extends java.lang.Object

One Display3D instance for each LayerSet (maximum).


Nested Class Summary
protected static class Display3D.ControlClickBehavior
          A class to provide the behavior on control-clicking on content in the 3D viewer.
static class Display3D.VectorStringContent
           
 
Method Summary
 java.util.concurrent.Future<java.util.Collection<java.util.concurrent.Future<ij3d.Content>>> addContent(java.util.Collection<ij3d.Content> col)
           
 java.util.concurrent.Future<ij3d.Content> addContent(ij3d.Content c)
           
static java.util.concurrent.Future<ij3d.Content> addFatPoint(java.lang.String title, LayerSet ls, double wx, double wy, double wz, double wr, java.awt.Color color)
          Expects uncalibrated wx,wy,wz, (i.e.
static java.util.concurrent.Future<java.util.Collection<java.util.concurrent.Future<ij3d.Content>>> addMesh(LayerSet ref_ls, VectorString3D vs, java.lang.String title, java.awt.Color color)
          Creates a mesh from the given VectorString3D, which is unbound to any existing Pipe.
static java.util.concurrent.Future<java.util.Collection<java.util.concurrent.Future<ij3d.Content>>> addMesh(LayerSet ref_ls, VectorString3D vs, java.lang.String title, java.awt.Color color, double[] widths, float alpha)
          Creates a mesh from the given VectorString3D, which is unbound to any existing Pipe.
static boolean contains(LayerSet ls, java.lang.String title)
           
 java.util.List<javax.vecmath.Point3f> createFatPoint(double wx, double wy, double wz, double wr, ij.measure.Calibration cal)
          Creates a calibrated sphere to represent a point at LayerSet pixel coordinates wx, wy, wz, with radius wr.
 java.util.concurrent.Callable<ij3d.Content> createMesh(ProjectThing pt, Displayable displ, int resample)
          Returns a function that returns a Content object.
static void destroy()
           
static void doneWaiting()
           
static Display3D get(LayerSet ls)
          Get an existing Display3D for the given LayerSet, or create a new one for it (and cache it).
static Display3D getDisplay(LayerSet ls)
          Get the Display3D instance that exists for the given LayerSet, if any.
static java.util.Hashtable<LayerSet,Display3D> getMasterTable()
          The sky will fall on your head if you modify any of the objects contained in this table -- which is a copy of the original, but the objects are the originals.
static ij3d.Content getProfileContent(Displayable d)
          Checks if the given Displayable is a Profile, and tries to find a possible Content object in the Image3DUniverse of its LayerSet according to the title as created from its profile_list ProjectThing.
 ij3d.Image3DUniverse getUniverse()
           
static void init()
           
static boolean isDisplayed(Displayable d)
          Checks if there is any Display3D instance currently showing the given Displayable.
static java.lang.String makeTitle(Displayable d)
           
static java.lang.String makeTitle(Patch p)
           
static void remove(ProjectThing pt)
          Considers there is only one Display3D for each LayerSet.
static void resetView(LayerSet ls)
           
static java.util.concurrent.Future<java.lang.Boolean> setColor(Displayable d, java.awt.Color color)
           
static java.util.concurrent.Future<java.lang.Boolean> setTransparency(Displayable d, float alpha)
           
static void setWaitingCursor()
           
static java.util.concurrent.Future<java.util.Collection<java.util.concurrent.Future<ij3d.Content>>> show(LayerSet ref_ls, java.util.Collection<ij3d.Content> col)
           
static java.util.concurrent.Future<java.util.Vector<java.util.concurrent.Future<ij3d.Content>>> show(ProjectThing pt)
           
static java.util.concurrent.Future<java.util.Vector<java.util.concurrent.Future<ij3d.Content>>> show(ProjectThing pt, boolean wait, int resample)
          Scan the ProjectThing children and assign the renderable ones to an existing Display3D for their LayerSet, or open a new one.
static void showAndResetView(ProjectThing pt)
           
static void showOrthoslices(ij.ImagePlus imp, java.lang.String title, int wx, int wy, float scale2D, Layer first)
           
static void showOrthoslices(Patch p)
           
static void showVolume(Patch p)
           
static java.util.concurrent.Future<ij3d.Content> update(Displayable d)
          Remake the mesh for the Displayable in a separate Thread, if it's included in a Display3D (otherwise returns null).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMasterTable

public static java.util.Hashtable<LayerSet,Display3D> getMasterTable()
The sky will fall on your head if you modify any of the objects contained in this table -- which is a copy of the original, but the objects are the originals.


getUniverse

public ij3d.Image3DUniverse getUniverse()

get

public static Display3D get(LayerSet ls)
Get an existing Display3D for the given LayerSet, or create a new one for it (and cache it).


getDisplay

public static Display3D getDisplay(LayerSet ls)
Get the Display3D instance that exists for the given LayerSet, if any.


setWaitingCursor

public static void setWaitingCursor()

doneWaiting

public static void doneWaiting()

show

public static java.util.concurrent.Future<java.util.Vector<java.util.concurrent.Future<ij3d.Content>>> show(ProjectThing pt)

showAndResetView

public static void showAndResetView(ProjectThing pt)

show

public static java.util.concurrent.Future<java.util.Vector<java.util.concurrent.Future<ij3d.Content>>> show(ProjectThing pt,
                                                                                                            boolean wait,
                                                                                                            int resample)
Scan the ProjectThing children and assign the renderable ones to an existing Display3D for their LayerSet, or open a new one. If true == wait && -1 != resample, then the method returns only when the mesh/es have been added.


resetView

public static void resetView(LayerSet ls)

showOrthoslices

public static void showOrthoslices(Patch p)

showVolume

public static void showVolume(Patch p)

showOrthoslices

public static void showOrthoslices(ij.ImagePlus imp,
                                   java.lang.String title,
                                   int wx,
                                   int wy,
                                   float scale2D,
                                   Layer first)

remove

public static void remove(ProjectThing pt)
Considers there is only one Display3D for each LayerSet.


createMesh

public java.util.concurrent.Callable<ij3d.Content> createMesh(ProjectThing pt,
                                                              Displayable displ,
                                                              int resample)
Returns a function that returns a Content object. Does NOT add the Content to the universe; it merely creates it.


addMesh

public static java.util.concurrent.Future<java.util.Collection<java.util.concurrent.Future<ij3d.Content>>> addMesh(LayerSet ref_ls,
                                                                                                                   VectorString3D vs,
                                                                                                                   java.lang.String title,
                                                                                                                   java.awt.Color color)
Creates a mesh from the given VectorString3D, which is unbound to any existing Pipe.


addMesh

public static java.util.concurrent.Future<java.util.Collection<java.util.concurrent.Future<ij3d.Content>>> addMesh(LayerSet ref_ls,
                                                                                                                   VectorString3D vs,
                                                                                                                   java.lang.String title,
                                                                                                                   java.awt.Color color,
                                                                                                                   double[] widths,
                                                                                                                   float alpha)
Creates a mesh from the given VectorString3D, which is unbound to any existing Pipe.


show

public static java.util.concurrent.Future<java.util.Collection<java.util.concurrent.Future<ij3d.Content>>> show(LayerSet ref_ls,
                                                                                                                java.util.Collection<ij3d.Content> col)

addContent

public java.util.concurrent.Future<java.util.Collection<java.util.concurrent.Future<ij3d.Content>>> addContent(java.util.Collection<ij3d.Content> col)

addContent

public java.util.concurrent.Future<ij3d.Content> addContent(ij3d.Content c)

isDisplayed

public static boolean isDisplayed(Displayable d)
Checks if there is any Display3D instance currently showing the given Displayable.


getProfileContent

public static ij3d.Content getProfileContent(Displayable d)
Checks if the given Displayable is a Profile, and tries to find a possible Content object in the Image3DUniverse of its LayerSet according to the title as created from its profile_list ProjectThing.


setColor

public static java.util.concurrent.Future<java.lang.Boolean> setColor(Displayable d,
                                                                      java.awt.Color color)

setTransparency

public static java.util.concurrent.Future<java.lang.Boolean> setTransparency(Displayable d,
                                                                             float alpha)

makeTitle

public static java.lang.String makeTitle(Displayable d)

makeTitle

public static java.lang.String makeTitle(Patch p)

update

public static java.util.concurrent.Future<ij3d.Content> update(Displayable d)
Remake the mesh for the Displayable in a separate Thread, if it's included in a Display3D (otherwise returns null).


contains

public static final boolean contains(LayerSet ls,
                                     java.lang.String title)

destroy

public static void destroy()

init

public static void init()

createFatPoint

public java.util.List<javax.vecmath.Point3f> createFatPoint(double wx,
                                                            double wy,
                                                            double wz,
                                                            double wr,
                                                            ij.measure.Calibration cal)
Creates a calibrated sphere to represent a point at LayerSet pixel coordinates wx, wy, wz, with radius wr.


addFatPoint

public static final java.util.concurrent.Future<ij3d.Content> addFatPoint(java.lang.String title,
                                                                          LayerSet ls,
                                                                          double wx,
                                                                          double wy,
                                                                          double wz,
                                                                          double wr,
                                                                          java.awt.Color color)
Expects uncalibrated wx,wy,wz, (i.e. pixel values), to be calibrated by @param ls calibration.