|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.render.GLViewer
public class GLViewer
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
s that
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 |
---|
public static GLViewer.RotationMode DEFAULT_ROTATION_MODE
public static GLViewer.BlendType DEFAULT_S_BLENDING
public static GLViewer.BlendType DEFAULT_D_BLENDING
public static boolean DEFAULT_ALPHA_FACE_CULLING
public static final double AUTO_FIT
public static PropertyList myProps
Constructor Detail |
---|
public GLViewer(int width, int height)
width
- initial width of the viewerheight
- initial height of the viewerpublic GLViewer(GLViewer shareWith, int width, int height)
shareWith
- GLViewer with which resources are to be sharedwidth
- initial width of the viewerheight
- initial height of the viewerpublic GLViewer(javax.media.opengl.GLCapabilities cap, javax.media.opengl.GLAutoDrawable shareWith, int width, int height)
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 viewerheight
- initial height of the viewerMethod Detail |
---|
public static void enableGLSelectSelection(boolean enable)
GL_SELECT
rendering mode mechanism.
enable
- if true, enables select buffer selectionpublic static boolean isGLSelectSelectionEnabled()
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
public Property getProperty(java.lang.String name)
.
' 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.
getProperty
in interface HasProperties
name
- name of the desired property or sub-property
public void setAxisLength(double len)
public double getAxisLength()
public void setGridVisible(boolean visible)
public boolean getGridVisible()
public java.awt.event.KeyListener[] getKeyListeners()
public void addKeyListener(java.awt.event.KeyListener l)
public void removeKeyListener(java.awt.event.KeyListener l)
public java.util.LinkedList<Dragger3d> getDraggers()
public void addSelectionListener(GLSelectionListener l)
public boolean removeSelectionListener(GLSelectionListener l)
public GLSelectionListener[] getSelectionListeners()
public void addViewerListener(GLViewerListener l)
public boolean removeViewerListener(GLViewerListener l)
public GLViewerListener[] getViewerListeners()
public void addRenderable(GLRenderable d)
public void addDragger(Dragger3d d)
public void setDrawTool(Dragger3d d)
public void removeRenderable(GLRenderable d)
public void removeDragger(Dragger3d d)
public void clearDraggers()
public void clearRenderables()
public double getNearClipPlaneZ()
getNearClipPlaneZ
in interface GLRenderer
public double getFarClipPlaneZ()
getFarClipPlaneZ
in interface GLRenderer
public double getVerticalFieldOfView()
autoFitOrtho
.
public void setVerticalFieldOfView(double fov)
autoFitOrtho
.
fov
- vertical field of view (degrees).public void setPick(double x, double y, double w, double h, boolean ignoreDepthTest)
x
- x coordinate of the selection region centery
- y coordinate of the selection region centerw
- selection region widthh
- selection region heightignoreDepthTest
- select all objects in the pick frustum, not just those which are
visible through the viewportpublic void repaint()
public void paint()
public void setExternalRenderList(RenderList list)
public RenderList getExternalRenderList()
public void rerender(int flags)
public boolean isSpecialRenderFlagsSet()
public void rerender()
rerender
in interface GLRenderer
public boolean isVisible()
public void getFrustum(double[] bounds)
bounds
- returns the values of left, right, bottom, top, near and far (in that
order)public void setPerspective(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)public 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)public 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)public boolean isOrthogonal()
isOrthogonal
in interface GLRenderer
public void setOrthographicView(boolean enable)
public boolean getBounds(Point3d pmin, Point3d pmax)
public double estimateRadiusAndCenter(Point3d center)
public void autoFit()
public void autoFitPerspective(int options)
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.
public void autoFitOrtho(int options)
public void setRotateButtonMask(int mask)
mask
- rotation button maskpublic int getRotateButtonMask()
setRotateButtonMask(int)
public void setTranslateButtonMask(int mask)
mask
- translation button maskpublic int getTranslateButtonMask()
setTranslateButtonMask(int)
public void setZoomButtonMask(int mask)
mask
- zooming button maskpublic int getZoomButtonMask()
setZoomButtonMask(int)
public void setMouseWheelZoomScale(double s)
s
- zoomAmountpublic double getMouseWheelZoomScale()
public void setSelectionButtonMask(int mask)
mask
- selection button maskpublic int getSelectionButtonMask()
setSelectionButtonMask(int)
public void setMultipleSelectionMask(int mask)
mask
- multiple selection modifier maskpublic int getMultipleSelectionMask()
setMultipleSelectionMask(int)
public void setDragSelectionMask(int mask)
mask
- selection modifier maskpublic int getDragSelectionMask()
setDragSelectionMask(int)
public int getSelectionModifierMask()
public int getWidth()
getWidth
in interface GLRenderer
public int getHeight()
getHeight
in interface GLRenderer
public javax.media.opengl.GL getGL()
getGL
in interface GLRenderer
public javax.media.opengl.glu.GLU getGLU()
getGLU
in interface GLRenderer
public void setAutoSwapBufferMode(boolean enable)
public boolean getAutoSwapBufferMode()
public javax.media.opengl.GLContext getContext()
public void swapBuffers()
public void zoom(double s)
s
- scale factorpublic double distancePerPixel(Vector3d pnt)
distancePerPixel
in interface GLRenderer
public double centerDistancePerPixel()
centerDistancePerPixel
in interface GLRenderer
public void setDefaultAxialView(AxisAlignedRotation view)
public AxisAlignedRotation getDefaultAxialView()
public void setAxialView(AxisAlignedRotation view)
public AxisAlignedRotation getAxialView()
public javax.media.opengl.awt.GLCanvas getCanvas()
public void setDefaultLights()
public void init(javax.media.opengl.GLAutoDrawable drawable)
init
in interface javax.media.opengl.GLEventListener
public void addMouseInputListener(javax.swing.event.MouseInputListener l)
public void removeMouseInputListener(javax.swing.event.MouseInputListener l)
public javax.swing.event.MouseInputListener[] getMouseInputListeners()
public void addMouseWheelListener(java.awt.event.MouseWheelListener l)
public void removeMouseWheelListener(java.awt.event.MouseWheelListener l)
public java.awt.event.MouseWheelListener[] getMouseWheelListeners()
public void reshape(javax.media.opengl.GLAutoDrawable drawable, int x, int y, int w, int h)
reshape
in interface javax.media.opengl.GLEventListener
public double getViewPlaneHeight()
getViewPlaneHeight
in interface GLRenderer
public double getViewPlaneWidth()
getViewPlaneWidth
in interface GLRenderer
public double getViewPlaneDistance()
public void resetViewVolume(int width, int height)
public void getZRange(Vector2d zRange)
public void setViewVolume(double near, double far)
public void getWorldToEye(RigidTransform3d X)
public RigidTransform3d getEyeToWorld()
getEyeToWorld
in interface GLRenderer
public void getEyeToWorld(RigidTransform3d X)
public void setEyeToWorld(RigidTransform3d X)
X
- new EyeToWorld transformationpublic void setEyeToWorld(Point3d eye, Point3d center, Vector3d up)
lookat
method.
eye
- position of the eye, in world coordinatescenter
- point that the eye is looking at, in world coordinatesup
- up direction, in world coordinatespublic void display(javax.media.opengl.GLAutoDrawable drawable)
display
in interface javax.media.opengl.GLEventListener
public void setBackgroundColor(float r, float g, float b)
public void setBackgroundColor(float r, float g, float b, float a)
public void setBackgroundColor(java.awt.Color color)
public java.awt.Color getBackgroundColor()
public void setLightingEnabled(boolean enable)
GLRenderer
setLightingEnabled
in interface GLRenderer
public boolean isLightingEnabled()
GLRenderer
isLightingEnabled
in interface GLRenderer
public boolean isTransparencyEnabled()
isTransparencyEnabled
in interface GLRenderer
public void setTransparencyEnabled(boolean enable)
setTransparencyEnabled
in interface GLRenderer
public void setUpVector(Vector3d upVector)
public Vector3d getUpVector()
public void displayChanged(javax.media.opengl.GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged)
public static int getNameStackDepth(javax.media.opengl.GL2 gl)
public void mulTransform(RigidTransform3d X)
mulTransform
in interface GLRenderer
public void mulTransform(AffineTransform3d X)
mulTransform
in interface GLRenderer
public void getModelViewMatrix(Matrix4d X)
public void getProjectionMatrix(Matrix4d X)
public void setModelViewMatrix(Matrix4d X)
public void setProjectionMatrix(Matrix4d X)
public static void mulTransform(javax.media.opengl.GL2 gl, RigidTransform3d X)
public static void mulTransform(javax.media.opengl.GL2 gl, AffineTransform3d X)
public boolean isSelecting()
GLRenderer
isSelecting
in interface GLRenderer
public void setSelectionHighlighting(GLRenderer.SelectionHighlighting mode)
public GLRenderer.SelectionHighlighting getSelectionHighlighting()
getSelectionHighlighting
in interface GLRenderer
public void setSelectionColor(java.awt.Color color)
public java.awt.Color getSelectionColor()
getSelectionColor
in interface GLRenderer
public Material getSelectionMaterial()
getSelectionMaterial
in interface GLRenderer
public void setColor(float[] rgb, boolean selected)
setColor
in interface GLRenderer
public void setColor(float[] rgb)
setColor
in interface GLRenderer
public void setColor(java.awt.Color color)
setColor
in interface GLRenderer
public void updateColor(float[] rgb, boolean selected)
updateColor
in interface GLRenderer
public void setColor(float r, float g, float b)
setColor
in interface GLRenderer
public void setColor(float r, float g, float b, float a)
setColor
in interface GLRenderer
public void setMaterial(Material material, boolean selected)
setMaterial
in interface GLRenderer
public void setMaterial(Material material, float[] diffuseColor, boolean selected)
public void setMaterialAndShading(RenderProps props, Material mat, boolean selected)
setMaterialAndShading
in interface GLRenderer
public void setMaterialAndShading(RenderProps props, Material mat, float[] diffuseColor, boolean selected)
setMaterialAndShading
in interface GLRenderer
public void restoreShading(RenderProps props)
restoreShading
in interface GLRenderer
public void updateMaterial(RenderProps props, Material material, boolean selected)
updateMaterial
in interface GLRenderer
public void updateMaterial(RenderProps props, Material mat, float[] diffuseColor, boolean selected)
updateMaterial
in interface GLRenderer
public void drawSphere(RenderProps props, float[] coords)
drawSphere
in interface GLRenderer
public void drawSphere(RenderProps props, float[] coords, double r)
drawSphere
in interface GLRenderer
public void drawHex(RenderProps props, double scale, float[] v0, float[] v1, float[] v2, float[] v3, float[] v4, float[] v5, float[] v6, float[] v7)
drawHex
in interface GLRenderer
public void drawWedge(RenderProps props, double scale, float[] v0, float[] v1, float[] v2, float[] v3, float[] v4, float[] v5)
drawWedge
in interface GLRenderer
public void drawPyramid(RenderProps props, double scale, float[] v0, float[] v1, float[] v2, float[] v3, float[] v4)
drawPyramid
in interface GLRenderer
public void drawTet(RenderProps props, double scale, float[] v0, float[] v1, float[] v2, float[] v3)
drawTet
in interface GLRenderer
public void drawTaperedEllipsoid(RenderProps props, float[] coords0, float[] coords1)
drawTaperedEllipsoid
in interface GLRenderer
public void drawSolidArrow(RenderProps props, float[] coords0, float[] coords1)
drawSolidArrow
in interface GLRenderer
public void drawSolidArrow(RenderProps props, float[] coords0, float[] coords1, boolean capped)
drawSolidArrow
in interface GLRenderer
public void drawCylinder(RenderProps props, float[] coords0, float[] coords1)
drawCylinder
in interface GLRenderer
public void drawCylinder(RenderProps props, float[] coords0, float[] coords1, boolean capped)
drawCylinder
in interface GLRenderer
public void drawCylinder(RenderProps props, float[] coords0, float[] coords1, boolean capped, double base, double top)
public void drawLine(RenderProps props, float[] coords0, float[] coords1, boolean selected)
drawLine
in interface GLRenderer
public void drawLine(RenderProps props, float[] coords0, float[] coords1, boolean capped, boolean selected)
drawLine
in interface GLRenderer
public void drawLine(RenderProps props, float[] coords0, float[] coords1, boolean capped, float[] color, boolean selected)
drawLine
in interface GLRenderer
public void drawArrow(RenderProps props, float[] coords0, float[] coords1, boolean capped, boolean selected)
drawArrow
in interface GLRenderer
public void drawPoint(RenderProps props, float[] coords, boolean selected)
drawPoint
in interface GLRenderer
public void drawPoints(RenderProps props, java.util.Iterator<? extends RenderablePoint> iterator)
drawPoints
in interface GLRenderer
public static void drawLineStrip(GLRenderer renderer, java.lang.Iterable<float[]> vertexList, RenderProps props, boolean isSelected)
public void drawLines(RenderProps props, java.util.Iterator<? extends RenderableLine> iterator)
drawLines
in interface GLRenderer
public void drawAxes(RenderProps props, RigidTransform3d X, double len, boolean selected)
drawAxes
in interface GLRenderer
public void drawAxes(RenderProps props, RigidTransform3d X, double[] len, boolean selected)
drawAxes
in interface GLRenderer
public void setFaceMode(RenderProps.Faces mode)
setFaceMode
in interface GLRenderer
public void setDefaultFaceMode()
setDefaultFaceMode
in interface GLRenderer
public void setSelectionEnabled(boolean selection)
public boolean isSelectionEnabled()
public void setSelectOnPress(boolean enable)
public boolean getSelectOnPress()
public Point3d getCenter()
public void setCenter(Point3d c)
c
- new center location, in world coordinatesgetUpVector()
public Point3d getEye()
public void setEye(Point3d eye)
eye
- new eye location, in world coordinatesgetCenter()
,
getUpVector()
public RigidTransform3d getCenterToWorld()
public int allocGlClipPlane()
public void freeGlClipPlane(int glClipPlane)
public int numFreeGlClipPlanes()
public GLClipPlane addClipPlane()
public GLClipPlane addClipPlane(RigidTransform3d X, double size)
public boolean addClipPlane(GLClipPlane clipPlane)
public GLClipPlane getClipPlane(int idx)
public int getNumClipPlanes()
public GLClipPlane[] getClipPlanes()
public boolean removeClipPlane(GLClipPlane clipPlane)
public boolean clipPlanesAvailable()
public int getMaxClipPlanes()
public int getCellDivisions()
public double getCellSize()
public GLGridPlane getGrid()
public GLLight addLight(float[] position, float[] ambient, float[] diffuse, float[] specular)
public void removeLight(int i)
public void removeLight(GLLight light)
public GLLight getLight(int i)
public int numLights()
public void setupScreenShot(int w, int h, int samples, java.io.File file, java.lang.String format)
w
- width of shoth
- height of shotsamples
- number of samples to use for the
multisample FBO (does antialiasing)file
- format
- public void setResizeEnabled(boolean enabled)
public boolean isResizeEnabled()
public void setupScreenShot(int w, int h, java.io.File file, java.lang.String format)
public boolean grabPending()
public void clearOffscreenBuffer()
public GLViewer.BlendType getSBlending()
public void setSBlending(GLViewer.BlendType glBlendValue)
public GLViewer.BlendType getDBlending()
public void setDBlending(GLViewer.BlendType glBlendValue)
public void setRotationMode(GLViewer.RotationMode mode)
public GLViewer.RotationMode getRotationMode()
public void setAlphaFaceCulling(boolean enable)
public boolean getAlphaFaceCulling()
public Vector3d getZDirection()
GLRenderer
getZDirection
in interface GLRenderer
public void setGlobalRenderFlags(int flags)
public void begin2DRendering()
GLRenderer
begin2DRendering
in interface GLRenderer
public void begin2DRendering(double w, double h)
GLRenderer
begin2DRendering
in interface GLRenderer
public void end2DRendering()
GLRenderer
end2DRendering
in interface GLRenderer
public boolean is2DRendering()
GLRenderer
is2DRendering
in interface GLRenderer
public boolean isMultiSampleEnabled()
public int numSelectionQueriesNeeded()
public void beginSelectionQuery(int idx)
GLRenderer
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.
beginSelectionQuery
in interface GLRenderer
idx
- identifier for the selection queryGLRenderer.endSelectionQuery()
public void endSelectionQuery()
GLRenderer
GLRenderer.beginSelectionQuery(int)
.
endSelectionQuery
in interface GLRenderer
GLRenderer.beginSelectionQuery(int)
public void beginSubSelection(GLSelectable s, int idx)
GLRenderer
GLSelectable
s
that
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
.
beginSubSelection
in interface GLRenderer
s
- Selectable that is managing its own sub-selectionidx
- current selection query identifierpublic void endSubSelection()
GLRenderer
GLRenderer.beginSubSelection(maspack.render.GLSelectable, int)
.
endSubSelection
in interface GLRenderer
GLRenderer.endSubSelection()
public void setSelectionFilter(GLSelectionFilter filter)
GLRenderer
setSelectionFilter
in interface GLRenderer
filter
- Selection filter to be appliedpublic GLSelectionFilter getSelectionFilter()
GLRenderer
getSelectionFilter
in interface GLRenderer
null
if there is none.public boolean isSelectable(GLSelectable s)
GLRenderer
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.
isSelectable
in interface GLRenderer
public void dispose(javax.media.opengl.GLAutoDrawable arg0)
dispose
in interface javax.media.opengl.GLEventListener
public javax.media.opengl.GL2 getGL2()
getGL2
in interface GLRenderer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |