public abstract class DefaultUniverse extends SimpleUniverse implements BehaviorCallback
Modifier and Type | Class and Description |
---|---|
static class |
DefaultUniverse.GlobalTransform
Stores the list of Transform3D that describe the view.
|
Modifier and Type | Field and Description |
---|---|
static int |
ANIMATE_TG
The index of the transform group in the viewing platform's
MultiTransformGroup which is responsible for animation
|
static int |
ATTRIBUTE_COORD_SYSTEM
Constant used in showAttribute() specifying whether a global coordinate
system should be displayed or not.
|
static int |
ATTRIBUTE_SCALEBAR
Constant used in showAttribute() specifying whether a scalebar should be
displayed or not.
|
protected Switch |
attributesSwitch
Switch which holds the optionally displayable scalebar and coordinate
system.
|
protected BoundingSphere |
bounds
The shared Bounds object which is needed for Java3D's scheduling mechanism.
|
static int |
CENTER_TG
The index of the transform group in the viewing platform's
MultiTransformGroup which is responsible for centering
|
protected ContentTransformer |
contentTransformer
Reference to the ContentTransformer.
|
protected WaitForNextFrameBehavior |
frameBehavior
Reference to the WaitForNextFrameBehavior.
|
protected Point3d |
globalCenter
The global center point
|
protected CoordinateSystem |
globalCoord
Reference to the global coordinate system, which is optionally displayable.
|
protected Point3d |
globalMax
The global maximum point
|
protected Point3d |
globalMin
The global minimum point
|
protected PointLight |
light |
protected InteractiveBehavior |
mouseBehavior
Reference to the InteractiveBehavior.
|
protected Picker |
picker
Reference to the Picker.
|
static int |
ROTATION_TG
The index of the transform group in the viewing platform's
MultiTransformGroup which is responsible for rotation
|
protected Scalebar |
scalebar
Reference to the optionally displayable scale bar.
|
protected BranchGroup |
scene
Reference to root BranchGroup.
|
static int |
TRANSLATE_TG
The index of the transform group in the viewing platform's
MultiTransformGroup which is responsible for translation
|
UIAdapter |
ui
UIAdapter to handle calls to the ImageJ main window.
|
protected boolean |
useToFront
Flag indicating if the window of this universe should be brought to front
when
|
protected InteractiveViewPlatformTransformer |
viewTransformer
Reference to the InteractiveViewPlatformTransformer.
|
protected ImageWindow3D |
win
A reference to the window in which this universe is shown.
|
static int |
ZOOM_TG
The index of the transform group in the viewing platform's
MultiTransformGroup which is responsible for zooming
|
locale, viewer
ROTATE, TRANSLATE
Constructor and Description |
---|
DefaultUniverse(int width,
int height)
Constructor.
|
DefaultUniverse(int width,
int height,
UIAdapter uia) |
Modifier and Type | Method and Description |
---|---|
void |
addInteractiveBehavior(InteractiveBehavior b) |
void |
addUniverseListener(UniverseListener l)
Register the specified UniverseListener
|
void |
cleanup() |
void |
close()
Close this universe and cleanup resources.
|
abstract Iterator |
contents() |
void |
fireCanvasResized()
Invokes the canvasResized() method of all registered UniverseListeners.
|
void |
fireContentAdded(Content c)
Invokes the contentAdded() method of all registered UniverseListeners.
|
void |
fireContentChanged(Content c)
Invokes the contentChanged() method of all registered UniverseListeners.
|
void |
fireContentRemoved(Content c)
Invokes the contentRemoved() method of all registered UniverseListeners.
|
void |
fireContentSelected(Content c)
Invokes the contentSelected() method of all registered UniverseListeners.
|
void |
fireTransformationFinished()
Invokes the transformationFinished() method of all registered
UniverseListeners.
|
void |
fireTransformationStarted()
Invokes the transformationStarted() method of all registered
UniverseListeners.
|
void |
fireTransformationUpdated()
Invokes the transformationUpdated() method of all registered
UniverseListeners.
|
void |
fireUniverseClosed()
Invokes the univeresClosed() method of all registered UniverseListeners.
|
TransformGroup |
getAnimationTG()
Returns the TransformGroup of the viewing platform's MultiTransformGroup
which is responsible for animation.
|
TransformGroup |
getCenterTG()
Returns the TransformGroup of the viewing platform's MultiTransformGroup
which is responsible for centering the universe.
|
ContentTransformer |
getContentTransformer()
Returns a reference to the ContentTransformer which is used by this
universe to handle mouse and keyboard input which aims to transform
individual Contents.
|
void |
getGlobalTransform(DefaultUniverse.GlobalTransform transform)
Obtain a copy of all the Transform3D that describe the view such as zoom,
pan, and rotation.
|
PointLight |
getLight()
Returns the point light source of this universe.
|
Picker |
getPicker()
Returns a reference to the Picker which is used by this universe to handle
mouse input which aims to pick Contents and change landmark sets.
|
TransformGroup |
getRotationTG()
Returns the TransformGroup of the viewing platform's MultiTransformGroup
which is responsible for rotation.
|
Scalebar |
getScalebar()
Returns a reference to the optionally displayable scale bar.
|
BranchGroup |
getScene()
Returns a reference to the root BranchGroup of this universe.
|
abstract Content |
getSelected() |
Dimension |
getSize()
Returns the dimensions of this universe.
|
TransformGroup |
getTranslateTG()
Returns the TransformGroup of the viewing platform's MultiTransformGroup
which is responsible for translation.
|
boolean |
getUseToFront()
Returns the value of the useToFront flag.
|
InteractiveViewPlatformTransformer |
getViewPlatformTransformer()
Returns a reference to the InteractiveViewPlatformTransformer which is used
by this universe to handle mouse and keyboard input which aims to transform
the viewing platform.
|
void |
getVworldToCamera(Transform3D transform)
Copy the whole transformation, which transforms any point from the vworld
coordinate system to the observer coordinate system.
|
void |
getVworldToCameraInverse(Transform3D transform)
Copy the inverse vworld to camera transformation, which transforms any
point from the observer coordinate system to vworld coordinate system to
the
|
ImageWindow3D |
getWindow()
Returns a reference to the window in which this universe is displayed.
|
TransformGroup |
getZoomTG()
Returns the TransformGroup of the viewing platform's MultiTransformGroup
which is responsible for zooming.
|
boolean |
isAttributeVisible(int attribute)
Returns whether the specified attribute is visible or not.
|
void |
removeUniverseListener(UniverseListener l)
Remove the specified UniverseListener
|
void |
setGlobalTransform(DefaultUniverse.GlobalTransform transform)
Set the transforms for zoom, pan, and rotation.
|
void |
setInteractiveBehavior(InteractiveBehavior b)
Deprecated.
This method should not be used any more from outside this
class. Use addInteractiveBehavior() instead.
|
void |
setSize(int w,
int h)
Set the dimensions of this universe.
|
void |
setUseToFront(boolean useToFront)
For some interactive applications, the use of toFront() in ImageWindow3D
creates usability problems, so these methods allow one to supress this
behaviour by calling setUseToFront(false).
|
void |
show()
Show this universe in a new window.
|
void |
showAttribute(int attribute,
boolean flag)
Show or hide the specified attribute.
|
ij.ImagePlus |
takeSnapshot()
Returns a snapshot of the current viewer image.
|
ij.ImagePlus |
takeSnapshot(int w,
int h)
Returns a snapshot of the given size.
|
void |
transformChanged(int type,
Transform3D xf)
Implements the BehaviorCallback interface of the behavior objects used by
this universe.
|
void |
waitForNextFrame()
Waits until the next frame is rendered.
|
addBranchGraph, getCanvas, getCanvas, getLocale, getPreferredConfiguration, getViewer, getViewingPlatform
addGraphStructureChangeListener, addRenderingErrorListener, addShaderErrorListener, getAllLocales, getJ3DThreadPriority, getProperties, numLocales, removeAllLocales, removeGraphStructureChangeListener, removeLocale, removeRenderingErrorListener, removeShaderErrorListener, setJ3DThreadPriority
public static final int CENTER_TG
public static final int ZOOM_TG
public static final int TRANSLATE_TG
public static final int ANIMATE_TG
public static final int ROTATION_TG
public static final int ATTRIBUTE_SCALEBAR
public static final int ATTRIBUTE_COORD_SYSTEM
protected BranchGroup scene
protected Scalebar scalebar
protected CoordinateSystem globalCoord
protected BoundingSphere bounds
protected ImageWindow3D win
protected final Point3d globalMin
protected final Point3d globalMax
protected final Point3d globalCenter
protected InteractiveBehavior mouseBehavior
protected final ContentTransformer contentTransformer
protected final Picker picker
protected final InteractiveViewPlatformTransformer viewTransformer
protected final WaitForNextFrameBehavior frameBehavior
protected final PointLight light
public final UIAdapter ui
protected final Switch attributesSwitch
protected boolean useToFront
public DefaultUniverse(int width, int height)
width
- height
- public DefaultUniverse(int width, int height, UIAdapter uia)
public abstract Content getSelected()
public abstract Iterator contents()
@Deprecated public void setInteractiveBehavior(InteractiveBehavior b)
public void addInteractiveBehavior(InteractiveBehavior b)
public void getVworldToCamera(Transform3D transform)
public void getVworldToCameraInverse(Transform3D transform)
public TransformGroup getZoomTG()
public TransformGroup getCenterTG()
public TransformGroup getRotationTG()
public TransformGroup getTranslateTG()
public TransformGroup getAnimationTG()
public void getGlobalTransform(DefaultUniverse.GlobalTransform transform)
public void setGlobalTransform(DefaultUniverse.GlobalTransform transform)
public PointLight getLight()
public Scalebar getScalebar()
public ContentTransformer getContentTransformer()
public Picker getPicker()
public InteractiveViewPlatformTransformer getViewPlatformTransformer()
public void showAttribute(int attribute, boolean flag)
attribute,
- one of ATTRIBUTE_SCALEBAR or ATTRIBUTE_COORD_SYSTEMflag,
- indicating whether it should be displayed or hided.public boolean isAttributeVisible(int attribute)
attribute,
- one of ATTRIBUTE_SCALEBAR or ATTRIBUTE_COORD_SYSTEM.public BranchGroup getScene()
public void transformChanged(int type, Transform3D xf)
transformChanged
in interface BehaviorCallback
public void waitForNextFrame()
public void setUseToFront(boolean useToFront)
public boolean getUseToFront()
public Dimension getSize()
public void setSize(int w, int h)
w
- the new widthh
- the new heightpublic void show()
public void close()
public void cleanup()
cleanup
in class SimpleUniverse
public ImageWindow3D getWindow()
public ij.ImagePlus takeSnapshot()
public ij.ImagePlus takeSnapshot(int w, int h)
public void addUniverseListener(UniverseListener l)
public void removeUniverseListener(UniverseListener l)
public void fireUniverseClosed()
public void fireTransformationStarted()
public void fireTransformationUpdated()
public void fireTransformationFinished()
public void fireContentAdded(Content c)
public void fireContentChanged(Content c)
public void fireContentRemoved(Content c)
public void fireContentSelected(Content c)
public void fireCanvasResized()
Copyright © 2015–2021 Fiji. All rights reserved.