maspack.render
Class GLViewer

java.lang.Object
  extended by maspack.render.GLViewer
All Implemented Interfaces:
java.util.EventListener, javax.media.opengl.GLEventListener, HasProperties, GLRenderer

public class GLViewer
extends java.lang.Object
implements javax.media.opengl.GLEventListener, GLRenderer, HasProperties

Author:
John E Lloyd and ArtiSynth team members

Nested Class Summary
static class GLViewer.BlendType
           
static class GLViewer.DraggerType
           
static class GLViewer.RotationMode
           
 
Nested classes/interfaces inherited from interface maspack.render.GLRenderer
GLRenderer.SelectionHighlighting
 
Field Summary
static double AUTO_FIT
           
static boolean DEFAULT_ALPHA_FACE_CULLING
           
static GLViewer.BlendType DEFAULT_D_BLENDING
           
static GLViewer.RotationMode DEFAULT_ROTATION_MODE
           
static GLViewer.BlendType DEFAULT_S_BLENDING
           
static PropertyList myProps
           
 
Fields inherited from interface maspack.render.GLRenderer
CLEAR_MESH_DISPLAY_LISTS, HSV_COLOR_INTERPOLATION, REFRESH, SELECTED, SORT_FACES, VERTEX_COLORING
 
Constructor Summary
GLViewer(javax.media.opengl.GLCapabilities cap, javax.media.opengl.GLAutoDrawable shareWith, int width, int height)
          Creates a new GLViewer with specified capabilities and size.
GLViewer(GLViewer shareWith, int width, int height)
          Creates a new GLViewer with default capabilities that shares resources (e.g., diplay lists and textures) with an existing GLViewer.
GLViewer(int width, int height)
          Creates a new GLViewer with default capabilities.
 
Method Summary
 GLClipPlane addClipPlane()
           
 boolean addClipPlane(GLClipPlane clipPlane)
           
 GLClipPlane addClipPlane(RigidTransform3d X, double size)
           
 void addDragger(Dragger3d d)
           
 void addKeyListener(java.awt.event.KeyListener l)
           
 GLLight addLight(float[] position, float[] ambient, float[] diffuse, float[] specular)
           
 void addMouseInputListener(javax.swing.event.MouseInputListener l)
           
 void addMouseWheelListener(java.awt.event.MouseWheelListener l)
           
 void addRenderable(GLRenderable d)
           
 void addSelectionListener(GLSelectionListener l)
           
 void addViewerListener(GLViewerListener l)
           
 int allocGlClipPlane()
           
 void autoFit()
          author: andrei autodetect the GLViewer size
 void autoFitOrtho(int options)
          Fits an orthogonal projection to the bounding box of the current set of renderables.
 void autoFitPerspective(int options)
          Fits a perspective projection to the bounding box of the current set of renderables, using the default vertical field of view ( as returned by getVerticalFieldOfView).
 void begin2DRendering()
          Start displaying 2D objects, dimensions given by pixels
 void begin2DRendering(double w, double h)
          Start displaying 2D objects, dimensions governed by supplied width/height
 void beginSelectionQuery(int idx)
          Begins a selection query with the {\it query identifier} qid.
 void beginSubSelection(GLSelectable s, int idx)
          Begins selection for a GLSelectable sthat manages its own selection; this call should be used in place of GLRenderer.beginSelectionQuery(int) for such objects.
 double centerDistancePerPixel()
          Computes the distance per pixel at the viewpoint center.
 void clearDraggers()
           
 void clearOffscreenBuffer()
           
 void clearRenderables()
           
 boolean clipPlanesAvailable()
           
 void display(javax.media.opengl.GLAutoDrawable drawable)
           
 void displayChanged(javax.media.opengl.GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged)
           
 void dispose(javax.media.opengl.GLAutoDrawable arg0)
           
 double distancePerPixel(Vector3d pnt)
          Computes the distance per pixel for a point specified with respect to world coordinates.
 void drawArrow(RenderProps props, float[] coords0, float[] coords1, boolean capped, boolean selected)
           
 void drawAxes(RenderProps props, RigidTransform3d X, double[] len, boolean selected)
           
 void drawAxes(RenderProps props, RigidTransform3d X, double len, boolean selected)
           
 void drawCylinder(RenderProps props, float[] coords0, float[] coords1)
           
 void drawCylinder(RenderProps props, float[] coords0, float[] coords1, boolean capped)
           
 void drawCylinder(RenderProps props, float[] coords0, float[] coords1, boolean capped, double base, double top)
           
 void drawHex(RenderProps props, double scale, float[] v0, float[] v1, float[] v2, float[] v3, float[] v4, float[] v5, float[] v6, float[] v7)
           
 void drawLine(RenderProps props, float[] coords0, float[] coords1, boolean selected)
           
 void drawLine(RenderProps props, float[] coords0, float[] coords1, boolean capped, boolean selected)
           
 void drawLine(RenderProps props, float[] coords0, float[] coords1, boolean capped, float[] color, boolean selected)
           
 void drawLines(RenderProps props, java.util.Iterator<? extends RenderableLine> iterator)
           
static void drawLineStrip(GLRenderer renderer, java.lang.Iterable<float[]> vertexList, RenderProps props, boolean isSelected)
           
 void drawPoint(RenderProps props, float[] coords, boolean selected)
           
 void drawPoints(RenderProps props, java.util.Iterator<? extends RenderablePoint> iterator)
           
 void drawPyramid(RenderProps props, double scale, float[] v0, float[] v1, float[] v2, float[] v3, float[] v4)
           
 void drawSolidArrow(RenderProps props, float[] coords0, float[] coords1)
           
 void drawSolidArrow(RenderProps props, float[] coords0, float[] coords1, boolean capped)
           
 void drawSphere(RenderProps props, float[] coords)
           
 void drawSphere(RenderProps props, float[] coords, double r)
           
 void drawTaperedEllipsoid(RenderProps props, float[] coords0, float[] coords1)
           
 void drawTet(RenderProps props, double scale, float[] v0, float[] v1, float[] v2, float[] v3)
           
 void drawWedge(RenderProps props, double scale, float[] v0, float[] v1, float[] v2, float[] v3, float[] v4, float[] v5)
           
static void enableGLSelectSelection(boolean enable)
          Enable selection via the (now deprecated) OpenGL select buffer and GL_SELECT rendering mode mechanism.
 void end2DRendering()
          Finalize 2D rendering, returning to default 3D mode
 void endSelectionQuery()
          Ends a selection query that was initiated with a call to GLRenderer.beginSelectionQuery(int).
 void endSubSelection()
          Ends object sub-selection that was initiated with a call to GLRenderer.beginSubSelection(maspack.render.GLSelectable, int).
 double estimateRadiusAndCenter(Point3d center)
          Size is the diameter of the bounding box.
 void freeGlClipPlane(int glClipPlane)
           
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 boolean getAlphaFaceCulling()
           
 boolean getAutoSwapBufferMode()
           
 AxisAlignedRotation getAxialView()
           
 double getAxisLength()
           
 java.awt.Color getBackgroundColor()
           
 boolean getBounds(Point3d pmin, Point3d pmax)
           
 javax.media.opengl.awt.GLCanvas getCanvas()
           
 int getCellDivisions()
           
 double getCellSize()
           
 Point3d getCenter()
           
 RigidTransform3d getCenterToWorld()
          Returns a transform from world coordinates to center coordinates, with the axes aligned to match the current eyeToWorld transform.
 GLClipPlane getClipPlane(int idx)
           
 GLClipPlane[] getClipPlanes()
           
 javax.media.opengl.GLContext getContext()
           
 GLViewer.BlendType getDBlending()
           
 AxisAlignedRotation getDefaultAxialView()
           
 java.util.LinkedList<Dragger3d> getDraggers()
           
 int getDragSelectionMask()
          Gets the modifier mask that enables drag selection.
 RenderList getExternalRenderList()
           
 Point3d getEye()
           
 RigidTransform3d getEyeToWorld()
           
 void getEyeToWorld(RigidTransform3d X)
           
 double getFarClipPlaneZ()
           
 void getFrustum(double[] bounds)
          Returns the bounds for the current frustum.
 javax.media.opengl.GL getGL()
           
 javax.media.opengl.GL2 getGL2()
           
 javax.media.opengl.glu.GLU getGLU()
           
 GLGridPlane getGrid()
           
 boolean getGridVisible()
           
 int getHeight()
           
 java.awt.event.KeyListener[] getKeyListeners()
           
 GLLight getLight(int i)
           
 int getMaxClipPlanes()
           
 void getModelViewMatrix(Matrix4d X)
           
 javax.swing.event.MouseInputListener[] getMouseInputListeners()
           
 java.awt.event.MouseWheelListener[] getMouseWheelListeners()
           
 double getMouseWheelZoomScale()
          get the mouse wheel zoom amount default: 100
 int getMultipleSelectionMask()
          Gets the modifier mask that enables multiple selection.
static int getNameStackDepth(javax.media.opengl.GL2 gl)
           
 double getNearClipPlaneZ()
           
 int getNumClipPlanes()
           
 void getProjectionMatrix(Matrix4d X)
           
 Property getProperty(java.lang.String name)
          Returns a property associated with a specified path name.
 int getRotateButtonMask()
          Gets the mouse button mask that enables rotation.
 GLViewer.RotationMode getRotationMode()
           
 GLViewer.BlendType getSBlending()
           
 int getSelectionButtonMask()
          Gets the mouse button mask that enables selection.
 java.awt.Color getSelectionColor()
           
 GLSelectionFilter getSelectionFilter()
          Returns the current selection filter for the renderer, if any.
 GLRenderer.SelectionHighlighting getSelectionHighlighting()
           
 GLSelectionListener[] getSelectionListeners()
           
 Material getSelectionMaterial()
           
 int getSelectionModifierMask()
          Returns the mouse button modifiers that may accompany selection.
 boolean getSelectOnPress()
           
 int getTranslateButtonMask()
          Gets the mouse button mask that enables translation.
 Vector3d getUpVector()
           
 double getVerticalFieldOfView()
          Returns the default vertical field of view in degrees.
 GLViewerListener[] getViewerListeners()
           
 double getViewPlaneDistance()
           
 double getViewPlaneHeight()
           
 double getViewPlaneWidth()
           
 int getWidth()
           
 void getWorldToEye(RigidTransform3d X)
           
 Vector3d getZDirection()
          Direction pointing out of monitor
 int getZoomButtonMask()
          Gets the mouse button mask that enables zooming.
 void getZRange(Vector2d zRange)
           
 boolean grabPending()
           
 void init(javax.media.opengl.GLAutoDrawable drawable)
           
 boolean is2DRendering()
          Check whether renderer is currently in 2D mode
static boolean isGLSelectSelectionEnabled()
           
 boolean isLightingEnabled()
          Returns whether or not GL_LIGHTING is enabled.
 boolean isMultiSampleEnabled()
           
 boolean isOrthogonal()
          Returns true if the current viewing projection is orthogonal.
 boolean isResizeEnabled()
           
 boolean isSelectable(GLSelectable s)
          Returns true if s is selectable in the current selection context.
 boolean isSelecting()
          Returns true if the renderer is currently performing a selection render.
 boolean isSelectionEnabled()
           
 boolean isSpecialRenderFlagsSet()
          Used to see if rendering with special flags has been performed yet.
 boolean isTransparencyEnabled()
           
 boolean isVisible()
           
 void mulTransform(AffineTransform3d X)
           
static void mulTransform(javax.media.opengl.GL2 gl, AffineTransform3d X)
           
static void mulTransform(javax.media.opengl.GL2 gl, RigidTransform3d X)
           
 void mulTransform(RigidTransform3d X)
           
 int numFreeGlClipPlanes()
           
 int numLights()
           
 int numSelectionQueriesNeeded()
           
 void paint()
           
 boolean removeClipPlane(GLClipPlane clipPlane)
           
 void removeDragger(Dragger3d d)
           
 void removeKeyListener(java.awt.event.KeyListener l)
           
 void removeLight(GLLight light)
           
 void removeLight(int i)
           
 void removeMouseInputListener(javax.swing.event.MouseInputListener l)
           
 void removeMouseWheelListener(java.awt.event.MouseWheelListener l)
           
 void removeRenderable(GLRenderable d)
           
 boolean removeSelectionListener(GLSelectionListener l)
           
 boolean removeViewerListener(GLViewerListener l)
           
 void repaint()
           
 void rerender()
           
 void rerender(int flags)
          Request a render with special flags that will be used only for the duration of that render.
 void resetViewVolume(int width, int height)
           
 void reshape(javax.media.opengl.GLAutoDrawable drawable, int x, int y, int w, int h)
           
 void restoreShading(RenderProps props)
           
 void setAlphaFaceCulling(boolean enable)
           
 void setAutoSwapBufferMode(boolean enable)
           
 void setAxialView(AxisAlignedRotation view)
           
 void setAxisLength(double len)
           
 void setBackgroundColor(java.awt.Color color)
           
 void setBackgroundColor(float r, float g, float b)
           
 void setBackgroundColor(float r, float g, float b, float a)
           
 void setCenter(Point3d c)
          Sets the center point for the viewer, and adjusts the eye coordinates so that the eye's -z axis is directed at the center point.
 void setColor(java.awt.Color color)
           
 void setColor(float[] rgb)
           
 void setColor(float[] rgb, boolean selected)
           
 void setColor(float r, float g, float b)
           
 void setColor(float r, float g, float b, float a)
           
 void setDBlending(GLViewer.BlendType glBlendValue)
           
 void setDefaultAxialView(AxisAlignedRotation view)
           
 void setDefaultFaceMode()
           
 void setDefaultLights()
           
 void setDragSelectionMask(int mask)
          Sets the modifier mask to enable drag selection.
 void setDrawTool(Dragger3d d)
           
 void setExternalRenderList(RenderList list)
           
 void setEye(Point3d eye)
          Moves the eye coordinates to a specifed location in world coordinates, and adjusts the orientation so that the eye's -z axis is directed at the center point.
 void setEyeToWorld(Point3d eye, Point3d center, Vector3d up)
          Sets the eyeToWorld transform for this viewer, using the canonical parameters used by the GL lookat method.
 void setEyeToWorld(RigidTransform3d X)
          Directly sets the eye coordinate frame.
 void setFaceMode(RenderProps.Faces mode)
           
 void setGlobalRenderFlags(int flags)
           
 void setGridVisible(boolean visible)
           
 void setLightingEnabled(boolean enable)
          Enables or disables GL_LIGHTING.
 void setMaterial(Material material, boolean selected)
           
 void setMaterial(Material material, float[] diffuseColor, boolean selected)
           
 void setMaterialAndShading(RenderProps props, Material mat, boolean selected)
           
 void setMaterialAndShading(RenderProps props, Material mat, float[] diffuseColor, boolean selected)
           
 void setModelViewMatrix(Matrix4d X)
           
 void setMouseWheelZoomScale(double s)
          set the mouse wheel zoom amount modified by Charles Krzysik on Apr 11th 2008 default: 100
 void setMultipleSelectionMask(int mask)
          Sets the modifier mask that enables multiple selection.
 void setOrthogonal(double fieldHeight, double near, double far)
          Sets the viewing frustum to an orthogonal projection centered about the -z axis.
 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 setPick(double x, double y, double w, double h, boolean ignoreDepthTest)
          Performs a selection operation on a sub-region of the viewport.
 void setProjectionMatrix(Matrix4d X)
           
 void setResizeEnabled(boolean enabled)
          Allows you explicitly enable or disable resizing of viewer (may want to disable while recording video)
 void setRotateButtonMask(int mask)
          Sets the mouse button mask that enables rotation.
 void setRotationMode(GLViewer.RotationMode mode)
           
 void setSBlending(GLViewer.BlendType glBlendValue)
           
 void setSelectionButtonMask(int mask)
          Sets the mouse button mask that enables selection.
 void setSelectionColor(java.awt.Color color)
           
 void setSelectionEnabled(boolean selection)
           
 void setSelectionFilter(GLSelectionFilter filter)
          Sets a selection filter for the renderer.
 void setSelectionHighlighting(GLRenderer.SelectionHighlighting mode)
           
 void setSelectOnPress(boolean enable)
           
 void setTranslateButtonMask(int mask)
          Sets the mouse button mask that enables translation.
 void setTransparencyEnabled(boolean enable)
           
 void setupScreenShot(int w, int h, java.io.File file, java.lang.String format)
           
 void setupScreenShot(int w, int h, int samples, java.io.File file, java.lang.String format)
          Setup for a screenshot during the next render cycle
 void setUpVector(Vector3d upVector)
           
 void setVerticalFieldOfView(double fov)
          Sets the default vertical field of view in degrees.
 void setViewVolume(double near, double far)
           
 void setZoomButtonMask(int mask)
          Sets the mouse button mask that enables zooming.
 void swapBuffers()
           
 void updateColor(float[] rgb, boolean selected)
           
 void updateMaterial(RenderProps props, Material material, boolean selected)
           
 void updateMaterial(RenderProps props, Material mat, float[] diffuseColor, boolean selected)
           
 void zoom(double s)
          Zoom in or out by a specified scale factor.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ROTATION_MODE

public static GLViewer.RotationMode DEFAULT_ROTATION_MODE

DEFAULT_S_BLENDING

public static GLViewer.BlendType DEFAULT_S_BLENDING

DEFAULT_D_BLENDING

public static GLViewer.BlendType DEFAULT_D_BLENDING

DEFAULT_ALPHA_FACE_CULLING

public static boolean DEFAULT_ALPHA_FACE_CULLING

AUTO_FIT

public static final double AUTO_FIT
See Also:
Constant Field Values

myProps

public static PropertyList myProps
Constructor Detail

GLViewer

public GLViewer(int width,
                int height)
Creates a new GLViewer with default capabilities.

Parameters:
width - initial width of the viewer
height - initial height of the viewer

GLViewer

public GLViewer(GLViewer shareWith,
                int width,
                int height)
Creates a new GLViewer with default capabilities that shares resources (e.g., diplay lists and textures) with an existing GLViewer.

Parameters:
shareWith - GLViewer with which resources are to be shared
width - initial width of the viewer
height - initial height of the viewer

GLViewer

public GLViewer(javax.media.opengl.GLCapabilities cap,
                javax.media.opengl.GLAutoDrawable shareWith,
                int width,
                int height)
Creates a new GLViewer with specified capabilities and size.

Parameters:
cap - Desired GL capabilities. Can be specified as null, which will create default capabilities.
shareWith - a GL drawable with which the GLCanvas is to share resources (e.g., display lists and textures). Can be specified as null.
width - initial width of the viewer
height - initial height of the viewer
Method Detail

enableGLSelectSelection

public static void enableGLSelectSelection(boolean enable)
Enable selection via the (now deprecated) OpenGL select buffer and GL_SELECT rendering mode mechanism.

Parameters:
enable - if true, enables select buffer selection

isGLSelectSelectionEnabled

public static boolean isGLSelectSelectionEnabled()

getAllPropertyInfo

public PropertyList getAllPropertyInfo()
Description copied from interface: HasProperties
Returns a list giving static information about all properties exported by this object.

Specified by:
getAllPropertyInfo in interface HasProperties
Returns:
static information for all exported properties

getProperty

public Property getProperty(java.lang.String name)
Returns a property associated with a specified path name. All properties exported by this object must have a name which is a valid Java identifier. Specifying one of these names causes the corresponding Property to be returned. Handles to sub-properties can also be obtained by delimiting the sub-property name(s) by '.' characters. A sub-property exists if the value of a property is itself an object which exports properties. It is only possible to obtain a sub-property handle if each of its ancestor properties exports their values by reference.

Specified by:
getProperty in interface HasProperties
Parameters:
name - name of the desired property or sub-property
Returns:
handle to the property

setAxisLength

public void setAxisLength(double len)

getAxisLength

public double getAxisLength()

setGridVisible

public void setGridVisible(boolean visible)

getGridVisible

public boolean getGridVisible()

getKeyListeners

public java.awt.event.KeyListener[] getKeyListeners()

addKeyListener

public void addKeyListener(java.awt.event.KeyListener l)

removeKeyListener

public void removeKeyListener(java.awt.event.KeyListener l)

getDraggers

public java.util.LinkedList<Dragger3d> getDraggers()

addSelectionListener

public void addSelectionListener(GLSelectionListener l)

removeSelectionListener

public boolean removeSelectionListener(GLSelectionListener l)

getSelectionListeners

public GLSelectionListener[] getSelectionListeners()

addViewerListener

public void addViewerListener(GLViewerListener l)

removeViewerListener

public boolean removeViewerListener(GLViewerListener l)

getViewerListeners

public GLViewerListener[] getViewerListeners()

addRenderable

public void addRenderable(GLRenderable d)

addDragger

public void addDragger(Dragger3d d)

setDrawTool

public void setDrawTool(Dragger3d d)

removeRenderable

public void removeRenderable(GLRenderable d)

removeDragger

public void removeDragger(Dragger3d d)

clearDraggers

public void clearDraggers()

clearRenderables

public void clearRenderables()

getNearClipPlaneZ

public double getNearClipPlaneZ()
Specified by:
getNearClipPlaneZ in interface GLRenderer

getFarClipPlaneZ

public double getFarClipPlaneZ()
Specified by:
getFarClipPlaneZ in interface GLRenderer

getVerticalFieldOfView

public double getVerticalFieldOfView()
Returns the default vertical field of view in degrees. This is used by autoFitOrtho.

Returns:
default vertical field of view.

setVerticalFieldOfView

public void setVerticalFieldOfView(double fov)
Sets the default vertical field of view in degrees. This is used by autoFitOrtho.

Parameters:
fov - vertical field of view (degrees).

setPick

public void setPick(double x,
                    double y,
                    double w,
                    double h,
                    boolean ignoreDepthTest)
Performs a selection operation on a sub-region of the viewport.

Parameters:
x - x coordinate of the selection region center
y - y coordinate of the selection region center
w - selection region width
h - selection region height
ignoreDepthTest - select all objects in the pick frustum, not just those which are visible through the viewport

repaint

public void repaint()

paint

public void paint()

setExternalRenderList

public void setExternalRenderList(RenderList list)

getExternalRenderList

public RenderList getExternalRenderList()

rerender

public void rerender(int flags)
Request a render with special flags that will be used only for the duration of that render.


isSpecialRenderFlagsSet

public boolean isSpecialRenderFlagsSet()
Used to see if rendering with special flags has been performed yet.


rerender

public void rerender()
Specified by:
rerender in interface GLRenderer

isVisible

public boolean isVisible()

getFrustum

public void getFrustum(double[] bounds)
Returns the bounds for the current frustum. These consist of the quantities left, right, bottom, and top that describe the edge locations of the near clipping plane (in eye coordinates), and near and far, which describe the positions of the near and far clipping planes along the -z axis (again in eye coordinates).

Parameters:
bounds - returns the values of left, right, bottom, top, near and far (in that order)

setPerspective

public void setPerspective(double left,
                           double right,
                           double bottom,
                           double top,
                           double near,
                           double far)
Sets the viewing frustum to a general perspective projection.

Parameters:
left - left edge position of the near clipping plane
right - right edge position of the near clipping plane
bottom - bottom edge position of the near clipping plane
top - top position of the near clipping plane
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)

setPerspective

public void setPerspective(double fieldOfView,
                           double near,
                           double far)
Sets the viewing frustum to a perspective projection centered about the -z axis. Also sets the default field of view returned by getVerticalFieldOfView.

Parameters:
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)

setOrthogonal

public void setOrthogonal(double fieldHeight,
                          double near,
                          double far)
Sets the viewing frustum to an orthogonal projection centered about the -z axis.

Parameters:
fieldHeight - vertical height of the field of view
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)

isOrthogonal

public boolean isOrthogonal()
Returns true if the current viewing projection is orthogonal.

Specified by:
isOrthogonal in interface GLRenderer
Returns:
true if viewing projection is orthogonal

setOrthographicView

public void setOrthographicView(boolean enable)

getBounds

public boolean getBounds(Point3d pmin,
                         Point3d pmax)

estimateRadiusAndCenter

public double estimateRadiusAndCenter(Point3d center)
Size is the diameter of the bounding box.


autoFit

public void autoFit()
author: andrei autodetect the GLViewer size


autoFitPerspective

public void autoFitPerspective(int options)
Fits a perspective projection to the bounding box of the current set of renderables, using the default vertical field of view ( as returned by getVerticalFieldOfView). The eye orientation is left unchanged, and the frustum is centered along the z axis. The center point is set to the middle of the bounding box.


autoFitOrtho

public void autoFitOrtho(int options)
Fits an orthogonal projection to the bounding box of the current set of renderables. The eye orientation is left unchanged, and the frustum is centered along the z axis. The center point is set to the middle of the bounding box. The eye placed away from the center, along the -z axis.


setRotateButtonMask

public void setRotateButtonMask(int mask)
Sets the mouse button mask that enables rotation. This should be a combination of the following mouse buttons and extended modifiers defined in java.awt.event.InputEvent: BUTTON1_DOWN_MASK, BUTTON2_DOWN_MASK, BUTTON2_DOWN_MASK, SHIFT_DOWN_MASK, ALT_DOWN_MASK, META_DOWN_MASK, and CTRL_DOWN_MASK.

Parameters:
mask - rotation button mask

getRotateButtonMask

public int getRotateButtonMask()
Gets the mouse button mask that enables rotation.

Returns:
rotation button mask
See Also:
setRotateButtonMask(int)

setTranslateButtonMask

public void setTranslateButtonMask(int mask)
Sets the mouse button mask that enables translation. This should be a combination of the following mouse buttons and extended modifiers defined in java.awt.event.InputEvent: BUTTON1_DOWN_MASK, BUTTON2_DOWN_MASK, BUTTON2_DOWN_MASK, SHIFT_DOWN_MASK, ALT_DOWN_MASK, META_DOWN_MASK, and CTRL_DOWN_MASK.

Parameters:
mask - translation button mask

getTranslateButtonMask

public int getTranslateButtonMask()
Gets the mouse button mask that enables translation.

Returns:
translation button mask
See Also:
setTranslateButtonMask(int)

setZoomButtonMask

public void setZoomButtonMask(int mask)
Sets the mouse button mask that enables zooming. This should be a combination of the following mouse buttons and extended modifiers defined in java.awt.event.InputEvent: BUTTON1_DOWN_MASK, BUTTON2_DOWN_MASK, BUTTON2_DOWN_MASK, SHIFT_DOWN_MASK, ALT_DOWN_MASK, META_DOWN_MASK, and CTRL_DOWN_MASK.

Parameters:
mask - zooming button mask

getZoomButtonMask

public int getZoomButtonMask()
Gets the mouse button mask that enables zooming.

Returns:
zooming button mask
See Also:
setZoomButtonMask(int)

setMouseWheelZoomScale

public void setMouseWheelZoomScale(double s)
set the mouse wheel zoom amount modified by Charles Krzysik on Apr 11th 2008 default: 100

Parameters:
s - zoomAmount

getMouseWheelZoomScale

public double getMouseWheelZoomScale()
get the mouse wheel zoom amount default: 100

Returns:
zoomAmount

setSelectionButtonMask

public void setSelectionButtonMask(int mask)
Sets the mouse button mask that enables selection. This should be a combination of the following mouse buttons and extended modifiers defined in java.awt.event.InputEvent: BUTTON1_DOWN_MASK, BUTTON2_DOWN_MASK, BUTTON2_DOWN_MASK, SHIFT_DOWN_MASK, ALT_DOWN_MASK, META_DOWN_MASK, and CTRL_DOWN_MASK.

Parameters:
mask - selection button mask

getSelectionButtonMask

public int getSelectionButtonMask()
Gets the mouse button mask that enables selection.

Returns:
selection button mask
See Also:
setSelectionButtonMask(int)

setMultipleSelectionMask

public void setMultipleSelectionMask(int mask)
Sets the modifier mask that enables multiple selection. This should be a combination of the following extended modifiers defined in java.awt.event.InputEvent: SHIFT_DOWN_MASK, ALT_DOWN_MASK, META_DOWN_MASK, and CTRL_DOWN_MASK.

Parameters:
mask - multiple selection modifier mask

getMultipleSelectionMask

public int getMultipleSelectionMask()
Gets the modifier mask that enables multiple selection.

Returns:
multiple selection modifier mask
See Also:
setMultipleSelectionMask(int)

setDragSelectionMask

public void setDragSelectionMask(int mask)
Sets the modifier mask to enable drag selection. This mask should be a combination of the following extended modifiers defined in java.awt.event.InputEvent: SHIFT_DOWN_MASK, ALT_DOWN_MASK, META_DOWN_MASK, and CTRL_DOWN_MASK.

Parameters:
mask - selection modifier mask

getDragSelectionMask

public int getDragSelectionMask()
Gets the modifier mask that enables drag selection.

Returns:
drag selection modifier mask
See Also:
setDragSelectionMask(int)

getSelectionModifierMask

public int getSelectionModifierMask()
Returns the mouse button modifiers that may accompany selection.

Returns:
selection modifier mask

getWidth

public int getWidth()
Specified by:
getWidth in interface GLRenderer

getHeight

public int getHeight()
Specified by:
getHeight in interface GLRenderer

getGL

public javax.media.opengl.GL getGL()
Specified by:
getGL in interface GLRenderer

getGLU

public javax.media.opengl.glu.GLU getGLU()
Specified by:
getGLU in interface GLRenderer

setAutoSwapBufferMode

public void setAutoSwapBufferMode(boolean enable)

getAutoSwapBufferMode

public boolean getAutoSwapBufferMode()

getContext

public javax.media.opengl.GLContext getContext()

swapBuffers

public void swapBuffers()

zoom

public void zoom(double s)
Zoom in or out by a specified scale factor. A factor larger than one zooms out, while a factor less than one zooms in. In orthographic projection, zoom is accomplished changing the frustum size. In perspective projection, it is accomplished by moving the eye position along the z axis of the eye frame.

Parameters:
s - scale factor

distancePerPixel

public double distancePerPixel(Vector3d pnt)
Computes the distance per pixel for a point specified with respect to world coordinates.

Specified by:
distancePerPixel in interface GLRenderer

centerDistancePerPixel

public double centerDistancePerPixel()
Computes the distance per pixel at the viewpoint center.

Specified by:
centerDistancePerPixel in interface GLRenderer

setDefaultAxialView

public void setDefaultAxialView(AxisAlignedRotation view)

getDefaultAxialView

public AxisAlignedRotation getDefaultAxialView()

setAxialView

public void setAxialView(AxisAlignedRotation view)

getAxialView

public AxisAlignedRotation getAxialView()

getCanvas

public javax.media.opengl.awt.GLCanvas getCanvas()

setDefaultLights

public void setDefaultLights()

init

public void init(javax.media.opengl.GLAutoDrawable drawable)
Specified by:
init in interface javax.media.opengl.GLEventListener

addMouseInputListener

public void addMouseInputListener(javax.swing.event.MouseInputListener l)

removeMouseInputListener

public void removeMouseInputListener(javax.swing.event.MouseInputListener l)

getMouseInputListeners

public javax.swing.event.MouseInputListener[] getMouseInputListeners()

addMouseWheelListener

public void addMouseWheelListener(java.awt.event.MouseWheelListener l)

removeMouseWheelListener

public void removeMouseWheelListener(java.awt.event.MouseWheelListener l)

getMouseWheelListeners

public java.awt.event.MouseWheelListener[] getMouseWheelListeners()

reshape

public void reshape(javax.media.opengl.GLAutoDrawable drawable,
                    int x,
                    int y,
                    int w,
                    int h)
Specified by:
reshape in interface javax.media.opengl.GLEventListener

getViewPlaneHeight

public double getViewPlaneHeight()
Specified by:
getViewPlaneHeight in interface GLRenderer

getViewPlaneWidth

public double getViewPlaneWidth()
Specified by:
getViewPlaneWidth in interface GLRenderer

getViewPlaneDistance

public double getViewPlaneDistance()

resetViewVolume

public void resetViewVolume(int width,
                            int height)

getZRange

public void getZRange(Vector2d zRange)

setViewVolume

public void setViewVolume(double near,
                          double far)

getWorldToEye

public void getWorldToEye(RigidTransform3d X)

getEyeToWorld

public RigidTransform3d getEyeToWorld()
Specified by:
getEyeToWorld in interface GLRenderer

getEyeToWorld

public void getEyeToWorld(RigidTransform3d X)

setEyeToWorld

public void setEyeToWorld(RigidTransform3d X)
Directly sets the eye coordinate frame.

Parameters:
X - new EyeToWorld transformation

setEyeToWorld

public void setEyeToWorld(Point3d eye,
                          Point3d center,
                          Vector3d up)
Sets the eyeToWorld transform for this viewer, using the canonical parameters used by the GL lookat method.

Parameters:
eye - position of the eye, in world coordinates
center - point that the eye is looking at, in world coordinates
up - up direction, in world coordinates

display

public void display(javax.media.opengl.GLAutoDrawable drawable)
Specified by:
display in interface javax.media.opengl.GLEventListener

setBackgroundColor

public void setBackgroundColor(float r,
                               float g,
                               float b)

setBackgroundColor

public void setBackgroundColor(float r,
                               float g,
                               float b,
                               float a)

setBackgroundColor

public void setBackgroundColor(java.awt.Color color)

getBackgroundColor

public java.awt.Color getBackgroundColor()

setLightingEnabled

public void setLightingEnabled(boolean enable)
Description copied from interface: GLRenderer
Enables or disables GL_LIGHTING. The reason for doing this through the renderer, rather than calling GL directly, is so that the renderer can discard the request when performing a selection render.

Specified by:
setLightingEnabled in interface GLRenderer

isLightingEnabled

public boolean isLightingEnabled()
Description copied from interface: GLRenderer
Returns whether or not GL_LIGHTING is enabled.

Specified by:
isLightingEnabled in interface GLRenderer

isTransparencyEnabled

public boolean isTransparencyEnabled()
Specified by:
isTransparencyEnabled in interface GLRenderer

setTransparencyEnabled

public void setTransparencyEnabled(boolean enable)
Specified by:
setTransparencyEnabled in interface GLRenderer

setUpVector

public void setUpVector(Vector3d upVector)

getUpVector

public Vector3d getUpVector()

displayChanged

public void displayChanged(javax.media.opengl.GLAutoDrawable drawable,
                           boolean modeChanged,
                           boolean deviceChanged)

getNameStackDepth

public static int getNameStackDepth(javax.media.opengl.GL2 gl)

mulTransform

public void mulTransform(RigidTransform3d X)
Specified by:
mulTransform in interface GLRenderer

mulTransform

public void mulTransform(AffineTransform3d X)
Specified by:
mulTransform in interface GLRenderer

getModelViewMatrix

public void getModelViewMatrix(Matrix4d X)

getProjectionMatrix

public void getProjectionMatrix(Matrix4d X)

setModelViewMatrix

public void setModelViewMatrix(Matrix4d X)

setProjectionMatrix

public void setProjectionMatrix(Matrix4d X)

mulTransform

public static void mulTransform(javax.media.opengl.GL2 gl,
                                RigidTransform3d X)

mulTransform

public static void mulTransform(javax.media.opengl.GL2 gl,
                                AffineTransform3d X)

isSelecting

public boolean isSelecting()
Description copied from interface: GLRenderer
Returns true if the renderer is currently performing a selection render. When this is the case, the application should avoid GL calls affecting color and lighting.

Specified by:
isSelecting in interface GLRenderer
Returns:
true if the renderer is in selection mode.

setSelectionHighlighting

public void setSelectionHighlighting(GLRenderer.SelectionHighlighting mode)

getSelectionHighlighting

public GLRenderer.SelectionHighlighting getSelectionHighlighting()
Specified by:
getSelectionHighlighting in interface GLRenderer

setSelectionColor

public void setSelectionColor(java.awt.Color color)

getSelectionColor

public java.awt.Color getSelectionColor()
Specified by:
getSelectionColor in interface GLRenderer

getSelectionMaterial

public Material getSelectionMaterial()
Specified by:
getSelectionMaterial in interface GLRenderer

setColor

public void setColor(float[] rgb,
                     boolean selected)
Specified by:
setColor in interface GLRenderer

setColor

public void setColor(float[] rgb)
Specified by:
setColor in interface GLRenderer

setColor

public void setColor(java.awt.Color color)
Specified by:
setColor in interface GLRenderer

updateColor

public void updateColor(float[] rgb,
                        boolean selected)
Specified by:
updateColor in interface GLRenderer

setColor

public void setColor(float r,
                     float g,
                     float b)
Specified by:
setColor in interface GLRenderer

setColor

public void setColor(float r,
                     float g,
                     float b,
                     float a)
Specified by:
setColor in interface GLRenderer

setMaterial

public void setMaterial(Material material,
                        boolean selected)
Specified by:
setMaterial in interface GLRenderer

setMaterial

public void setMaterial(Material material,
                        float[] diffuseColor,
                        boolean selected)

setMaterialAndShading

public void setMaterialAndShading(RenderProps props,
                                  Material mat,
                                  boolean selected)
Specified by:
setMaterialAndShading in interface GLRenderer

setMaterialAndShading

public void setMaterialAndShading(RenderProps props,
                                  Material mat,
                                  float[] diffuseColor,
                                  boolean selected)
Specified by:
setMaterialAndShading in interface GLRenderer

restoreShading

public void restoreShading(RenderProps props)
Specified by:
restoreShading in interface GLRenderer

updateMaterial

public void updateMaterial(RenderProps props,
                           Material material,
                           boolean selected)
Specified by:
updateMaterial in interface GLRenderer

updateMaterial

public void updateMaterial(RenderProps props,
                           Material mat,
                           float[] diffuseColor,
                           boolean selected)
Specified by:
updateMaterial in interface GLRenderer

drawSphere

public void drawSphere(RenderProps props,
                       float[] coords)
Specified by:
drawSphere in interface GLRenderer

drawSphere

public void drawSphere(RenderProps props,
                       float[] coords,
                       double r)
Specified by:
drawSphere in interface GLRenderer

drawHex

public void drawHex(RenderProps props,
                    double scale,
                    float[] v0,
                    float[] v1,
                    float[] v2,
                    float[] v3,
                    float[] v4,
                    float[] v5,
                    float[] v6,
                    float[] v7)
Specified by:
drawHex in interface GLRenderer

drawWedge

public void drawWedge(RenderProps props,
                      double scale,
                      float[] v0,
                      float[] v1,
                      float[] v2,
                      float[] v3,
                      float[] v4,
                      float[] v5)
Specified by:
drawWedge in interface GLRenderer

drawPyramid

public void drawPyramid(RenderProps props,
                        double scale,
                        float[] v0,
                        float[] v1,
                        float[] v2,
                        float[] v3,
                        float[] v4)
Specified by:
drawPyramid in interface GLRenderer

drawTet

public void drawTet(RenderProps props,
                    double scale,
                    float[] v0,
                    float[] v1,
                    float[] v2,
                    float[] v3)
Specified by:
drawTet in interface GLRenderer

drawTaperedEllipsoid

public void drawTaperedEllipsoid(RenderProps props,
                                 float[] coords0,
                                 float[] coords1)
Specified by:
drawTaperedEllipsoid in interface GLRenderer

drawSolidArrow

public void drawSolidArrow(RenderProps props,
                           float[] coords0,
                           float[] coords1)
Specified by:
drawSolidArrow in interface GLRenderer

drawSolidArrow

public void drawSolidArrow(RenderProps props,
                           float[] coords0,
                           float[] coords1,
                           boolean capped)
Specified by:
drawSolidArrow in interface GLRenderer

drawCylinder

public void drawCylinder(RenderProps props,
                         float[] coords0,
                         float[] coords1)
Specified by:
drawCylinder in interface GLRenderer

drawCylinder

public void drawCylinder(RenderProps props,
                         float[] coords0,
                         float[] coords1,
                         boolean capped)
Specified by:
drawCylinder in interface GLRenderer

drawCylinder

public void drawCylinder(RenderProps props,
                         float[] coords0,
                         float[] coords1,
                         boolean capped,
                         double base,
                         double top)

drawLine

public void drawLine(RenderProps props,
                     float[] coords0,
                     float[] coords1,
                     boolean selected)
Specified by:
drawLine in interface GLRenderer

drawLine

public void drawLine(RenderProps props,
                     float[] coords0,
                     float[] coords1,
                     boolean capped,
                     boolean selected)
Specified by:
drawLine in interface GLRenderer

drawLine

public void drawLine(RenderProps props,
                     float[] coords0,
                     float[] coords1,
                     boolean capped,
                     float[] color,
                     boolean selected)
Specified by:
drawLine in interface GLRenderer

drawArrow

public void drawArrow(RenderProps props,
                      float[] coords0,
                      float[] coords1,
                      boolean capped,
                      boolean selected)
Specified by:
drawArrow in interface GLRenderer

drawPoint

public void drawPoint(RenderProps props,
                      float[] coords,
                      boolean selected)
Specified by:
drawPoint in interface GLRenderer

drawPoints

public void drawPoints(RenderProps props,
                       java.util.Iterator<? extends RenderablePoint> iterator)
Specified by:
drawPoints in interface GLRenderer

drawLineStrip

public static void drawLineStrip(GLRenderer renderer,
                                 java.lang.Iterable<float[]> vertexList,
                                 RenderProps props,
                                 boolean isSelected)

drawLines

public void drawLines(RenderProps props,
                      java.util.Iterator<? extends RenderableLine> iterator)
Specified by:
drawLines in interface GLRenderer

drawAxes

public void drawAxes(RenderProps props,
                     RigidTransform3d X,
                     double len,
                     boolean selected)
Specified by:
drawAxes in interface GLRenderer

drawAxes

public void drawAxes(RenderProps props,
                     RigidTransform3d X,
                     double[] len,
                     boolean selected)
Specified by:
drawAxes in interface GLRenderer

setFaceMode

public void setFaceMode(RenderProps.Faces mode)
Specified by:
setFaceMode in interface GLRenderer

setDefaultFaceMode

public void setDefaultFaceMode()
Specified by:
setDefaultFaceMode in interface GLRenderer

setSelectionEnabled

public void setSelectionEnabled(boolean selection)

isSelectionEnabled

public boolean isSelectionEnabled()

setSelectOnPress

public void setSelectOnPress(boolean enable)

getSelectOnPress

public boolean getSelectOnPress()

getCenter

public Point3d getCenter()

setCenter

public void setCenter(Point3d c)
Sets the center point for the viewer, and adjusts the eye coordinates so that the eye's -z axis is directed at the center point. The vertical direction is specified by the current up vector.

Parameters:
c - new center location, in world coordinates
See Also:
getUpVector()

getEye

public Point3d getEye()

setEye

public void setEye(Point3d eye)
Moves the eye coordinates to a specifed location in world coordinates, and adjusts the orientation so that the eye's -z axis is directed at the center point. The vertical direction is specified by the current up vector.

Parameters:
eye - new eye location, in world coordinates
See Also:
getCenter(), getUpVector()

getCenterToWorld

public RigidTransform3d getCenterToWorld()
Returns a transform from world coordinates to center coordinates, with the axes aligned to match the current eyeToWorld transform. Seen through the viewer, this will appear centered on the view frame with z pointing toward the view, y pointing up, and x pointing to the right.


allocGlClipPlane

public int allocGlClipPlane()

freeGlClipPlane

public void freeGlClipPlane(int glClipPlane)

numFreeGlClipPlanes

public int numFreeGlClipPlanes()

addClipPlane

public GLClipPlane addClipPlane()

addClipPlane

public GLClipPlane addClipPlane(RigidTransform3d X,
                                double size)

addClipPlane

public boolean addClipPlane(GLClipPlane clipPlane)

getClipPlane

public GLClipPlane getClipPlane(int idx)

getNumClipPlanes

public int getNumClipPlanes()

getClipPlanes

public GLClipPlane[] getClipPlanes()

removeClipPlane

public boolean removeClipPlane(GLClipPlane clipPlane)

clipPlanesAvailable

public boolean clipPlanesAvailable()

getMaxClipPlanes

public int getMaxClipPlanes()

getCellDivisions

public int getCellDivisions()

getCellSize

public double getCellSize()

getGrid

public GLGridPlane getGrid()

addLight

public GLLight addLight(float[] position,
                        float[] ambient,
                        float[] diffuse,
                        float[] specular)

removeLight

public void removeLight(int i)

removeLight

public void removeLight(GLLight light)

getLight

public GLLight getLight(int i)

numLights

public int numLights()

setupScreenShot

public void setupScreenShot(int w,
                            int h,
                            int samples,
                            java.io.File file,
                            java.lang.String format)
Setup for a screenshot during the next render cycle

Parameters:
w - width of shot
h - height of shot
samples - number of samples to use for the multisample FBO (does antialiasing)
file -
format -

setResizeEnabled

public void setResizeEnabled(boolean enabled)
Allows you explicitly enable or disable resizing of viewer (may want to disable while recording video)


isResizeEnabled

public boolean isResizeEnabled()

setupScreenShot

public void setupScreenShot(int w,
                            int h,
                            java.io.File file,
                            java.lang.String format)

grabPending

public boolean grabPending()

clearOffscreenBuffer

public void clearOffscreenBuffer()

getSBlending

public GLViewer.BlendType getSBlending()

setSBlending

public void setSBlending(GLViewer.BlendType glBlendValue)

getDBlending

public GLViewer.BlendType getDBlending()

setDBlending

public void setDBlending(GLViewer.BlendType glBlendValue)

setRotationMode

public void setRotationMode(GLViewer.RotationMode mode)

getRotationMode

public GLViewer.RotationMode getRotationMode()

setAlphaFaceCulling

public void setAlphaFaceCulling(boolean enable)

getAlphaFaceCulling

public boolean getAlphaFaceCulling()

getZDirection

public Vector3d getZDirection()
Description copied from interface: GLRenderer
Direction pointing out of monitor

Specified by:
getZDirection in interface GLRenderer

setGlobalRenderFlags

public void setGlobalRenderFlags(int flags)

begin2DRendering

public void begin2DRendering()
Description copied from interface: GLRenderer
Start displaying 2D objects, dimensions given by pixels

Specified by:
begin2DRendering in interface GLRenderer

begin2DRendering

public void begin2DRendering(double w,
                             double h)
Description copied from interface: GLRenderer
Start displaying 2D objects, dimensions governed by supplied width/height

Specified by:
begin2DRendering in interface GLRenderer

end2DRendering

public void end2DRendering()
Description copied from interface: GLRenderer
Finalize 2D rendering, returning to default 3D mode

Specified by:
end2DRendering in interface GLRenderer

is2DRendering

public boolean is2DRendering()
Description copied from interface: GLRenderer
Check whether renderer is currently in 2D mode

Specified by:
is2DRendering in interface GLRenderer

isMultiSampleEnabled

public boolean isMultiSampleEnabled()

numSelectionQueriesNeeded

public int numSelectionQueriesNeeded()

beginSelectionQuery

public void beginSelectionQuery(int idx)
Description copied from interface: GLRenderer
Begins a selection query with the {\it query identifier} qid. If the rendering that occurs between this call and the subsequent call to GLRenderer.endSelectionQuery() results in anything being rendered within the selection window, a {\it selection hit} will be generated for qid. If called within the render method for a GLSelectable, then qid must lie in the range 0 to numq-1, where numq is the value returned by GLSelectable.numSelectionQueriesNeeded(). Selection queries cannot be nested, and a given query identifier should be used only once.

Specified by:
beginSelectionQuery in interface GLRenderer
Parameters:
idx - identifier for the selection query
See Also:
GLRenderer.endSelectionQuery()

endSelectionQuery

public void endSelectionQuery()
Description copied from interface: GLRenderer
Ends a selection query that was initiated with a call to GLRenderer.beginSelectionQuery(int).

Specified by:
endSelectionQuery in interface GLRenderer
See Also:
GLRenderer.beginSelectionQuery(int)

beginSubSelection

public void beginSubSelection(GLSelectable s,
                              int idx)
Description copied from interface: GLRenderer
Begins selection for a GLSelectable sthat manages its own selection; this call should be used in place of GLRenderer.beginSelectionQuery(int) for such objects. Selectables that manage their own selection are identified by having a value numq >= 0, where numq is the value returned by GLSelectable#numSelectionQueriesNeeded{}. The argument qid is the current selection query identifier, which after the call should be increased by numq.

Specified by:
beginSubSelection in interface GLRenderer
Parameters:
s - Selectable that is managing its own sub-selection
idx - current selection query identifier

endSubSelection

public void endSubSelection()
Description copied from interface: GLRenderer
Ends object sub-selection that was initiated with a call to GLRenderer.beginSubSelection(maspack.render.GLSelectable, int).

Specified by:
endSubSelection in interface GLRenderer
See Also:
GLRenderer.endSubSelection()

setSelectionFilter

public void setSelectionFilter(GLSelectionFilter filter)
Description copied from interface: GLRenderer
Sets a selection filter for the renderer. This restricts which objects are actually rendered when a selection render is performed, and therefore restricts which objects can actually be selected. This allows selection of objects that might otherwise be occluded within a scene.

Specified by:
setSelectionFilter in interface GLRenderer
Parameters:
filter - Selection filter to be applied

getSelectionFilter

public GLSelectionFilter getSelectionFilter()
Description copied from interface: GLRenderer
Returns the current selection filter for the renderer, if any.

Specified by:
getSelectionFilter in interface GLRenderer
Returns:
current selection filter, or null if there is none.

isSelectable

public boolean isSelectable(GLSelectable s)
Description copied from interface: GLRenderer
Returns true if s is selectable in the current selection context. This will be the case if s.isSelectable() returns true, and s also passes whatever selection filter might currently be set in the renderer.

Specified by:
isSelectable in interface GLRenderer

dispose

public void dispose(javax.media.opengl.GLAutoDrawable arg0)
Specified by:
dispose in interface javax.media.opengl.GLEventListener

getGL2

public javax.media.opengl.GL2 getGL2()
Specified by:
getGL2 in interface GLRenderer