public interface Viewer extends Renderer
Renderable
, which provides
the primary functionality by which renderables can render themselves.Modifier and Type | Interface and Description |
---|---|
static class |
Viewer.RotationMode
Controls how the viewer responds to rotation control inputs specified as
horizontal and vertical angular displacements in the viewing plane.
|
static class |
Viewer.ViewControlMask
Constrains view control motions along either x or y.
|
Renderer.AxisDrawStyle, Renderer.ColorInterpolation, Renderer.ColorMixing, Renderer.DrawMode, Renderer.FaceStyle, Renderer.HighlightStyle, Renderer.LineStyle, Renderer.PointStyle, Renderer.Shading
HIGHLIGHT, SORT_FACES
Modifier and Type | Method and Description |
---|---|
GLClipPlane |
addClipPlane()
Creates and add a clip plane to this viewer.
|
void |
addClipPlane(GLClipPlane clipPlane)
Adds a clip plane to this viewer.
|
GLClipPlane |
addClipPlane(RigidTransform3d TPW,
double size)
Creates and add a clip plane to this viewer.
|
void |
addDragger(Dragger3d d)
Adds an application-defined dragger fixture to this viewer.
|
void |
addKeyListener(java.awt.event.KeyListener l)
Adds a key listener to this viewer.
|
int |
addLight(Light light)
Adds a specified light to this viewer and enables it.
|
void |
addMouseInputListener(javax.swing.event.MouseInputListener l)
Adds a mouse input listener to this viewer.
|
void |
addRenderable(IsRenderable r)
Adds a renderable to this viewer.
|
void |
addRenderListener(RenderListener l)
Adds a render listener to this viewer.
|
void |
addSelectionListener(ViewerSelectionListener l)
Adds a selection listener to this viewer that will fire whenever objects
are selected.
|
void |
autoFit()
Calls either
autoFitOrtho() or autoFitPerspective() ,
depending on whether the current view is orthogonal or perspective. |
void |
autoFitOrtho()
Auto computes the eye and center positions and an orthogonal viewing
frustum to fit the current scence.
|
void |
autoFitPerspective()
Auto computes the eye and center positions and an perpective viewing
frustum to fit the current scence.
|
void |
clearClipPlanes()
Removes all clip planes from this viewer.
|
void |
clearDraggers()
Removes all application-defined dragger fixtures from this viewer.
|
void |
clearRenderables()
Removes all renderables from this viewer.
|
void |
dispose()
Disposes of the resources used by this viewer.
|
java.util.List<Dragger3d> |
getAllDraggers()
Returns a list of all draggers currently active for this viewer,
including those that are application-defined as well as those those that
are created internally.
|
AxisAlignedRotation |
getAxialView()
Returns the current axis-aligned view.
|
double |
getAxisLength()
Queries the length used for rendering coordinate axes in this viewer.
|
java.awt.Color |
getBackgroundColor()
Returns the background color for this viewer.
|
float[] |
getBackgroundColor(float[] rgba)
Returns the background color for this viewer.
|
RigidTransform3d |
getCenterToWorld()
Returns a transform from world coordinates to center coordinates.
|
void |
getCenterToWorld(RigidTransform3d TCW)
Returns a transform from world coordinates to center coordinates, with the
axes aligned to match the current eyeToWorld transform.
|
GLClipPlane |
getClipPlane(int idx)
Returns the
idx -th clip plane held by this viewer. |
GLClipPlane[] |
getClipPlanes()
Returns all the clip planes currently held by this viewer.
|
java.awt.Component |
getComponent()
Queries the AWT component associated with this viewer.
|
java.awt.Rectangle |
getDragBox()
Queries information about any drag box currently being displayed.
|
java.util.LinkedList<Dragger3d> |
getDraggers()
Returns a list of all application-defined draggers currently added to
this viewer.
|
Dragger3d |
getDrawTool()
Queries the draw tool, if any, for this viewer.
|
boolean |
getEllipticCursorActive()
Queries whether an elliptic cursor is active for this viewer.
|
Vector2d |
getEllipticCursorSize()
Queries the elliptic cursor size for this viewer.
|
boolean |
getEllipticSelection()
Queries whether elliptic selection is enabled for this viewer.
|
RenderList |
getExternalRenderList()
Returns the external render list for this viewer, or
null
if the viewer does not have an external render list. |
Point3d |
getEye()
Returns the eye position.
|
void |
getEyeToWorld(RigidTransform3d TEW)
Gets the eye-to-world transform for this viewer.
|
GridPlane |
getGrid()
Returns this viewer's grid.
|
boolean |
getGridVisible()
Queries whether the viewer grid is visible.
|
java.awt.Color |
getHighlightColor()
Queries the highlight color used by this viewer.
|
Renderer.HighlightStyle |
getHighlightStyle()
Queries the highlighting style for this viewer.
|
int |
getIndexOfLight(Light light)
Get the index of a specified light in this viewer.
|
java.awt.event.KeyListener[] |
getKeyListeners()
Returns the key listeners currently added to this viewer.
|
Light |
getLight(int idx)
Get a specified light by index in this viewer.
|
javax.swing.event.MouseInputListener[] |
getMouseInputListeners()
Returns the mouse input listeners currently added to this viewer.
|
int |
getNumClipPlanes()
Queries the number of clip planes currently held by this viewer.
|
RenderListener[] |
getRenderListeners()
Returns an array of all render listeners held by this viewer.
|
Viewer.RotationMode |
getRotationMode()
Queries the rotation mode that controls how the viewer responds to
interactive rotation requests.
|
java.awt.Cursor |
getScreenCursor()
Queries the screen cursor for this viewer.
|
int |
getScreenX()
Returns the x component of the origin of the component implementing this
viewer.
|
int |
getScreenY()
Returns the y component of the origin of the component implementing this
viewer.
|
ViewerSelectionFilter |
getSelectionFilter()
Returns the current selection filter for the viewer, if any.
|
ViewerSelectionListener[] |
getSelectionListeners()
Returns a list of all the selection listener in this viewer.
|
boolean |
getSelectOnPress()
Returns true if "select on press" is enabled for the viewers.
|
Vector3d |
getUpVector()
Returns the ``up'' vector which this viewer uses in some instances to
determine the direction of the y axis of the eye coordinate system.
|
double |
getVerticalFieldOfView()
Returns the default vertical field of view in degrees.
|
Viewer.ViewControlMask |
getViewControlMask()
Queries the view control mask.
|
boolean |
hasHighlightStyle(Renderer.HighlightStyle style)
Returns
true if this viewer supports the indicated
highlighting style. |
boolean |
isOrthogonal()
Returns true if the current viewing projection is orthogonal.
|
boolean |
isSelectionEnabled()
Returns
true if viewer-based selection is enabled. |
int |
maxClipSurfaces()
Queries the maximum number of clip surfaces available to this viewer.
|
int |
numFreeClipSurfaces()
Queries the number of clip surfaces currently available to this viewer.
|
int |
numLights()
Returns the number of lights in this viewer.
|
boolean |
removeClipPlane(GLClipPlane clipPlane)
Removes a clip plane from this viewer.
|
void |
removeDragger(Dragger3d d)
Removes an application-defined dragger fixture from this viewer.
|
void |
removeKeyListener(java.awt.event.KeyListener l)
Removes a key listener from this viewer.
|
void |
removeLight(int idx)
Removes the light with the specified index from this viewer.
|
boolean |
removeLight(Light light)
Removes the indicated light from this viewer.
|
void |
removeMouseInputListener(javax.swing.event.MouseInputListener l)
Removes a mouse input listener from this viewer.
|
boolean |
removeRenderable(IsRenderable r)
Removes a renderable from this viewer.
|
boolean |
removeRenderListener(RenderListener l)
Removes a render listener from this viewer.
|
boolean |
removeSelectionListener(ViewerSelectionListener l)
Removes a selection listener from this viewer.
|
void |
repaint()
Request a repaint operation for this viewer.
|
void |
rerender()
Convenience methods that calls
rerender(int) with
flags = 0. |
void |
rerender(int flags)
Performs a rerender for this viewer.
|
void |
resetEllipticCursorSize()
Resets the elliptic cursor size for this viewer to its default value.
|
void |
rotate(double xang,
double yang)
Rotate the eye coordinate frame about the center point.
|
void |
setAxialView(AxisAlignedRotation REW)
Sets an axial (or axis-aligned) view.
|
void |
setAxisLength(double len)
Sets the length used for rendering coordinate axes in this viewer.
|
void |
setBackgroundColor(java.awt.Color color)
Sets the background color for this viewer.
|
void |
setBackgroundColor(float[] rgba)
Sets the background color for this viewer.
|
void |
setBackgroundColor(float r,
float g,
float b)
Sets the background color for this viewer.
|
void |
setCenter(Point3d center)
Sets the center point for the viewer, and adjusts the eye-to-world
transform so that the eye's -z axis is directed at the center point.
|
void |
setDragBox(java.awt.Rectangle box)
Sets a drag box to be displayed by the viewer.
|
void |
setDrawTool(Dragger3d d)
Sets the draw tool for this viewer.
|
void |
setEllipticCursorActive(boolean active)
Sets whether an elliptic cursor is active for this viewer.
|
void |
setEllipticCursorSize(Vector2d size)
Sets the elliptic cursor size for this viewer.
|
void |
setEllipticSelection(boolean enable)
Set whether elliptic selection is enabled for this viewer.
|
void |
setExternalRenderList(RenderList list)
Sets the external render list for this viewer.
|
void |
setEye(Point3d eye)
Sets the eye coordinates to a specified location in world coordinates,
and adjusts the eye-to-world transform so that the eye's -z axis is
directed at the center point.
|
void |
setEyeToWorld(Point3d eye,
Point3d center,
Vector3d up)
Sets the eye-to-world transform for this viewer, using the canonical
parameters used by the GL
lookat method. |
void |
setEyeToWorld(RigidTransform3d TEW)
Sets the eye-to-world transform for this viewer.
|
void |
setGridSizeAndPosition(Point3d pcenter,
double r)
Sets the position and minimum size of the viewer grid.1`
|
void |
setGridVisible(boolean visible)
Sets the viewer grid to be visible.
|
void |
setHighlightColor(java.awt.Color color)
Sets the highlight color used by this viewer.
|
boolean |
setHighlightStyle(Renderer.HighlightStyle style)
Sets the highlighting style for this viewer.
|
void |
setOrthogonal(double fieldHeight,
double near,
double far)
Sets the viewing frustum to an orthogonal projection centered about the
-z axis.
|
void |
setOrthogonal(double left,
double right,
double bottom,
double top,
double near,
double far)
Sets the viewing frustum to a general orthogonal projection.
|
void |
setOrthographicView(boolean enable)
|
void |
setPerspective(double fieldOfView,
double near,
double far)
Sets the viewing frustum to a perspective projection centered about the -z
axis.
|
void |
setPerspective(double left,
double right,
double bottom,
double top,
double near,
double far)
Sets the viewing frustum to a general perspective projection.
|
void |
setRotationMode(Viewer.RotationMode mode)
Sets the rotation mode that controls how the viewer responds to
interactive rotation requests specified as horizontal and vertical
angular displacements in the view plane.
|
void |
setScreenCursor(java.awt.Cursor cursor)
Sets the screen cursor for this viewer.
|
void |
setSelectionEnabled(boolean enable)
Enables or disables viewer-based selection.
|
void |
setSelectionFilter(ViewerSelectionFilter filter)
Sets a selection filter for the viewer.
|
void |
setSelectOnPress(boolean enable)
Set whether or not selection is done when the mouse is pressed.
|
void |
setUpVector(Vector3d up)
Sets the ``up'' vector for this viewer to a specified value, and adjusts
the eye-to-world transform to account for this new vertical direction,
while the eye's -z axis is directed at the
center point.
|
void |
setVerticalFieldOfView(double fov)
Sets the default vertical field of view in degrees.
|
void |
setViewControlMask(Viewer.ViewControlMask mask)
Sets the view control mask that constrains view control motions
to either the x or y screens axes.
|
void |
setViewMatrix(RigidTransform3d TWE)
Sets the view matrix for this viewer.
|
void |
translate(double delx,
double dely)
Translate the eye position with respect to the x-y plane of the eye
frame.
|
void |
zoom(double s)
Zoom in or out by a specified scale factor.
|
addVertex, addVertex, addVertex, addVertex, begin2DRendering, begin2DRendering, beginDraw, beginSelectionQuery, beginSubSelection, centerDistancePerPixel, distancePerPixel, draw, drawArrow, drawArrow, drawArrow, drawArrow, drawAxes, drawAxes, drawAxes, drawAxes, drawBox, drawBox, drawBox, drawCone, drawCone, drawCube, drawCube, drawCylinder, drawCylinder, drawLine, drawLine, drawLine, drawLine, drawLine, drawLine, drawLine, drawLines, drawLines, drawLines, drawLines, drawLines, drawLines, drawLineStrip, drawPoint, drawPoint, drawPoint, drawPoint, drawPoint, drawPoints, drawPoints, drawPoints, drawPoints, drawPoints, drawPoints, drawRay, drawSolidAxes, drawSolidAxes, drawSphere, drawSphere, drawSpindle, drawSpindle, drawText, drawText, drawText, drawText, drawTriangle, drawTriangle, drawTriangles, drawTriangles, drawTriangles, drawTriangles, drawVertices, drawVertices, drawVertices, end2DRendering, endDraw, endSelectionQuery, endSubSelection, getAxisRadiusRatio, getBackColor, getBumpMap, getCenter, getColorInterpolation, getColorMap, getDefaultFont, getDepthOffset, getEmission, getEyeZDirection, getFaceStyle, getFarPlaneDistance, getFrontColor, getHighlightColor, getHighlighting, getLineWidth, getModelMatrix, getModelMatrix, getNormalMap, getPointSize, getScreenHeight, getScreenWidth, getShading, getShininess, getSpecular, getSurfaceResolution, getTextBounds, getTextureMatrix, getTextureMatrix, getVertexColorMixing, getViewMatrix, getViewMatrix, getViewPlaneDistance, getViewPlaneHeight, getViewPlaneWidth, has2DRendering, hasBumpMapping, hasColorMapMixing, hasColorMapping, hasNormalMapping, hasSelection, hasTextRendering, hasVertexColorMixing, is2DRendering, isSelectable, isSelecting, mulModelMatrix, popModelMatrix, pushModelMatrix, restoreDefaultState, rotateModelMatrix, scaleModelMatrix, setAxisRadiusRatio, setBackColor, setBumpMap, setColor, setColor, setColor, setColor, setColor, setColorInterpolation, setColorMap, setDefaultFont, setDepthOffset, setEdgeColoring, setEmission, setFaceColoring, setFaceColoring, setFaceStyle, setFrontAlpha, setFrontColor, setHighlighting, setLineColoring, setLineShading, setLineWidth, setModelMatrix, setModelMatrix2d, setNormal, setNormal, setNormal, setNormalMap, setPointColoring, setPointShading, setPointSize, setPropsColoring, setPropsShading, setShading, setShininess, setSpecular, setSurfaceResolution, setTextureCoord, setTextureCoord, setTextureCoord, setTextureMatrix, setVertexColorMixing, translateModelMatrix
void addRenderable(IsRenderable r)
r
- renderable to addboolean removeRenderable(IsRenderable r)
r
- renderable to removetrue
if r
was present and removedvoid clearRenderables()
void setExternalRenderList(RenderList list)
addRenderable(maspack.render.IsRenderable)
, removeRenderable(maspack.render.IsRenderable)
, etc.
Generally, if an application specifies an external render list, it
should rebuild that list prior to each invocation of this viewer's rerender(int)
method. This is typically dones as follows:
RenderList extList; ... extList.clear(); for (every external renderable r) { extList.addIfVisible (r); }The call to
addIfVisible()
will place r
onto the render list (if it is visible)
and also call its prerender()
method.
Note in particular that prerender()
will not be
called by the viewer.
External render lists are designed for situations where a set of
renderables is being rendered simultaneously by multiple viewers, and
consequently we don't want prerender()
to be called multiple
times by different viewers.
list
- new external render list, or null
to clear
the external listRenderList getExternalRenderList()
null
if the viewer does not have an external render list.void rerender()
rerender(int)
with
flags
= 0.void rerender(int flags)
prerender()
method
for all renderables in the viewer and collects them into an
internal render list;render()
method for all renderables in
both the internal render list and the external render list (if
specified).render()
methods are called with this viewer as the
renderer and the flags
argument as the flags.flags
- rendering flagsvoid repaint()
void addRenderListener(RenderListener l)
l
- render listener to add.boolean removeRenderListener(RenderListener l)
l
- render listener to removetrue
if l
was present and removed.RenderListener[] getRenderListeners()
Renderer.HighlightStyle getHighlightStyle()
getHighlightStyle
in interface Renderer
boolean setHighlightStyle(Renderer.HighlightStyle style)
Renderer.HighlightStyle.NONE
,
then highlighting is deactivated.
Not all highlighting styles may be supported; if the specified
style is not supported this method does nothing and returns
false
.style
- highlighting style to be settrue
if the highlighting style is supported.hasHighlightStyle(maspack.render.Renderer.HighlightStyle)
boolean hasHighlightStyle(Renderer.HighlightStyle style)
true
if this viewer supports the indicated
highlighting style.true
if style
is supportedvoid setHighlightColor(java.awt.Color color)
color
- new highlight colorjava.awt.Color getHighlightColor()
void setSelectionEnabled(boolean enable)
Renderer.hasSelection()
returns
false
, then this method does nothing.enable
- if true
, enables selectionboolean isSelectionEnabled()
true
if viewer-based selection is enabled.false
if selection is disabled or not supported.void setEllipticSelection(boolean enable)
enable
- if true
, enables elliptic selectiongetEllipticSelection()
boolean getEllipticSelection()
true
if elliptic selection is enabledsetEllipticSelection(boolean)
void setSelectOnPress(boolean enable)
enable
- Whether or not selection is enabled.boolean getSelectOnPress()
void setSelectionFilter(ViewerSelectionFilter filter)
filter
- Selection filter to be appliedViewerSelectionFilter getSelectionFilter()
null
if there is none.int addLight(Light light)
Changes to the lighting caused by adding or removing lights, or by changing the properties of existing lights, will take effect at the beginning of the next repaint step.
light
- light to add to the viewerint numLights()
Light getLight(int idx)
idx
- index of the lightint getIndexOfLight(Light light)
light
- light for which an index is soughtboolean removeLight(Light light)
Changes to the lighting caused by adding or removing lights, or by changing the properties of existing lights, will take effect at the beginning of the next repaint step.
light
- light to be removedtrue
if the viewer contained the light
and it was removedvoid removeLight(int idx)
Changes to the lighting caused by adding or removing lights, or by changing the properties of existing lights, will take effect at the beginning of the next repaint step.
idx
- index of the light to be removedjava.lang.IndexOutOfBoundsException
- if the specified index was not in the
range 0 to numLights()
-1.java.awt.Color getBackgroundColor()
float[] getBackgroundColor(float[] rgba)
rgba
.
Otherwise, if this argument is null
, an array is allocated
internally.rgba
- optional array for returning the valuesvoid setBackgroundColor(java.awt.Color color)
color
- new background colorvoid setBackgroundColor(float r, float g, float b)
r
- red color componentg
- red color componentb
- red color componentvoid setBackgroundColor(float[] rgba)
rgba
- RGB (if length 3) or RGBA values (if length 4) for the
background colorvoid setEyeToWorld(Point3d eye, Point3d center, Vector3d up)
lookat
method. The eye-to-world
transform is the inverse of the view matrix.eye
- position of the eye, in world coordinatescenter
- point that the eye is looking at, in world coordinatesup
- up direction, in world coordinatesvoid setEyeToWorld(RigidTransform3d TEW)
TEW
- new eye-to-world transformvoid getEyeToWorld(RigidTransform3d TEW)
TEW
- returns the eye-to-world transformvoid getCenterToWorld(RigidTransform3d TCW)
TCW
- returns the center-to-world transformRigidTransform3d getCenterToWorld()
getCenterToWorld(RigidTransform3d)
, only with transform allocated and
returned.void rotate(double xang, double yang)
setRotationMode(maspack.render.Viewer.RotationMode)
and getRotationMode()
.xang
- amount of horizontal rotation (in radians)yang
- amount of vertical rotation (in radians)void translate(double delx, double dely)
delx
- x translation amountdely
- y translation amountvoid zoom(double s)
s
- scale factorvoid setRotationMode(Viewer.RotationMode mode)
Viewer.RotationMode.FIXED_VERTICAL
.mode
- new rotation modeViewer.RotationMode getRotationMode()
setRotationMode(maspack.render.Viewer.RotationMode)
.void setViewControlMask(Viewer.ViewControlMask mask)
mask
- new view control maskViewer.ViewControlMask getViewControlMask()
setViewControlMask(maspack.render.Viewer.ViewControlMask)
.void setAxialView(AxisAlignedRotation REW)
REW
, and then moving the eye position so that
the center position lies along the new -z axis of the eye frame,
while maintaining the current distance between the eye and the center.
The method also sets this viewer's `up'' vector to the y axis of
REW
, and saves REW
itself as the current
axis-aligned view, which can be retrieved using getAxialView()
.
REW
- axis-aligned rotational component for
the eye-to-world transformgetAxialView()
,
setUpVector(maspack.matrix.Vector3d)
,
getUpVector()
AxisAlignedRotation getAxialView()
setAxialView(maspack.matrix.AxisAlignedRotation)
.setAxialView(maspack.matrix.AxisAlignedRotation)
void setViewMatrix(RigidTransform3d TWE)
TWE
- transform from world to eye coordinates.Point3d getEye()
void setCenter(Point3d center)
setEyeToWorld (getEye(), center, getUpVector());
center
- new center location, in world coordinatesgetUpVector()
void setEye(Point3d eye)
setEyeToWorld (eye, getCenter(), getUpVector());
eye
- new eye location, in world coordinatesRenderer.getCenter()
,
getUpVector()
void setUpVector(Vector3d up)
setEyeToWorld (getEye(), getCenter(), up);
up
- new up vector, in world coordinatesgetEye()
,
Renderer.getCenter()
Vector3d getUpVector()
setUpVector(maspack.matrix.Vector3d)
,
setCenter(maspack.matrix.Point3d)
,
setEye(maspack.matrix.Point3d)
void setPerspective(double left, double right, double bottom, double top, double near, double far)
left
- left edge position of the view planeright
- right edge position of the view planebottom
- bottom edge position of the near clipping planetop
- top position of the near clipping planenear
- near clipping plane position (along the -z axis; must be a positive
number)far
- far clipping plane position (along the -z axis; must be a positive number)void setPerspective(double fieldOfView, double near, double far)
getVerticalFieldOfView
.fieldOfView
- vertial field of view (in degrees)near
- near clipping plane position (along the -z axis; must be a positive
number)far
- far clipping plane position (along the -z axis; must be a positive number)void setOrthogonal(double left, double right, double bottom, double top, double near, double far)
left
- left edge position of the near clipping planeright
- right edge position of the near clipping planebottom
- bottom edge position of the near clipping planetop
- top position of the near clipping planenear
- near clipping plane position (along the -z axis; must be a positive
number)far
- far clipping plane position (along the -z axis; must be a positive number)void setOrthogonal(double fieldHeight, double near, double far)
fieldHeight
- vertical height of the field of viewnear
- near clipping plane position (along the -z axis; must be a positive
number)far
- far clipping plane position (along the -z axis; must be a positive number)void autoFit()
autoFitOrtho()
or autoFitPerspective()
,
depending on whether the current view is orthogonal or perspective.void autoFitOrtho()
IsRenderable.updateBounds(maspack.matrix.Vector3d, maspack.matrix.Vector3d)
method of all the renderables to estimate
the scene center and an approximate radius r. It then computes a distance
d from the center to the eye using r = d tan(fov/2), where fov is the
field of view returned by getVerticalFieldOfView()
and
converted to radians. The eye frame orientation is adjusted so that
its $y$ axis is parallel to the current value of the ``up'' vector.void autoFitPerspective()
IsRenderable.updateBounds(maspack.matrix.Vector3d, maspack.matrix.Vector3d)
method of all the renderables to estimate
the scene center and an approximate radius r. It then computes a distance
d from the center to the eye using r = d tan(fov/2), where fov is the
field of view returned by getVerticalFieldOfView()
and
converted to radians. This field of view also used to used to compute the
perspective frustum. The eye frame orientation is adjusted so that
its $y$ axis is parallel to the current value of the ``up'' vector.void setOrthographicView(boolean enable)
enable
- enables (and auto-fits) orthographic view if true
and
perspective view if false
boolean isOrthogonal()
isOrthogonal
in interface Renderer
double getVerticalFieldOfView()
autoFitOrtho()
and autoFitPerspective()
.void setVerticalFieldOfView(double fov)
autoFitOrtho()
and autoFitPerspective()
.fov
- new default vertical field of view (degrees).void addSelectionListener(ViewerSelectionListener l)
l
- selection listener to addremoveSelectionListener(maspack.render.ViewerSelectionListener)
boolean removeSelectionListener(ViewerSelectionListener l)
l
- selection listener to removeaddSelectionListener(maspack.render.ViewerSelectionListener)
ViewerSelectionListener[] getSelectionListeners()
addSelectionListener(maspack.render.ViewerSelectionListener)
,
removeSelectionListener(maspack.render.ViewerSelectionListener)
double getAxisLength()
void setAxisLength(double len)
<= 0
implies that coordinate axes will not be rendered.len
- axis rendering lengthvoid setGridVisible(boolean visible)
visible
- if true
, makes the grid visiblevoid setGridSizeAndPosition(Point3d pcenter, double r)
pcenter
- position of the grid centerr
- radius value, which equals 1/4 the minimum sizeboolean getGridVisible()
true
if the grid is visibleGridPlane getGrid()
int maxClipSurfaces()
int numFreeClipSurfaces()
maxClipSurfaces()
minus the
number required by all the currently held clip planes, with the result
set to 0 if negative. Clipping will be curtailed if the number of
available surfaces is 0.GLClipPlane addClipPlane()
addClipPlane(null,0)
.GLClipPlane addClipPlane(RigidTransform3d TPW, double size)
TPW
- transform specifying the clip plane pose with respect to world
coordinates. If null
, the pose is centered on the origin and
aligned with the current axial view.size
- visible width of the clip plane in each direction. If
<= 0
, this is set to a default value based on the current
viewing frustum.void addClipPlane(GLClipPlane clipPlane)
clipPlane
- clip plane to addGLClipPlane getClipPlane(int idx)
idx
-th clip plane held by this viewer. idx
must be <
#getNumClipPlanes
.idx
- index of the desired clip planeidx
-th clip planeint getNumClipPlanes()
GLClipPlane[] getClipPlanes()
boolean removeClipPlane(GLClipPlane clipPlane)
clipPlane
- clip plane to removetrue
if the clip plane was found and removedvoid clearClipPlanes()
void addMouseInputListener(javax.swing.event.MouseInputListener l)
l
- listener to be addedvoid removeMouseInputListener(javax.swing.event.MouseInputListener l)
l
- listener to be removedjavax.swing.event.MouseInputListener[] getMouseInputListeners()
void addKeyListener(java.awt.event.KeyListener l)
l
- listener to be addedvoid removeKeyListener(java.awt.event.KeyListener l)
l
- listener to be removedjava.awt.event.KeyListener[] getKeyListeners()
void setDrawTool(Dragger3d d)
d
- draw tool to setDragger3d getDrawTool()
null
if there is nonevoid addDragger(Dragger3d d)
d
- dragger to addvoid removeDragger(Dragger3d d)
d
- dragger to removevoid clearDraggers()
java.util.LinkedList<Dragger3d> getDraggers()
java.util.List<Dragger3d> getAllDraggers()
This method is intended for use by the mouse input handler that manages dragger activity.
int getScreenX()
int getScreenY()
void setScreenCursor(java.awt.Cursor cursor)
cursor
- new screen cursorjava.awt.Cursor getScreenCursor()
boolean getEllipticCursorActive()
true
if an elliptic cursor is activevoid setEllipticCursorActive(boolean active)
active
- de true}, activates an elliptic cursorVector2d getEllipticCursorSize()
void setEllipticCursorSize(Vector2d size)
size
- new elliptic cursor sizevoid resetEllipticCursorSize()
void setDragBox(java.awt.Rectangle box)
null
value means that no drag box should be
displayed.box
- drag box in screen coordinates, or null
if the drag box is to be removedjava.awt.Rectangle getDragBox()
null
if no box is currently being displayed.java.awt.Component getComponent()
void dispose()