maspack.geometry
Class ConstrainedTranslator3d

java.lang.Object
  extended by maspack.render.DragToolBase
      extended by maspack.render.Dragger3dBase
          extended by maspack.geometry.ConstrainedTranslator3d
All Implemented Interfaces:
Dragger3d, GLRenderable, GLSelectable

public class ConstrainedTranslator3d
extends Dragger3dBase

A translational dragger that keeps its origin attached to the surface of a PolygonalMesh.

This class is defined in maspack.geometry instead of maspack.render so that the latter will not depend on the former.

Author:
lloyd

Field Summary
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Constructor Summary
ConstrainedTranslator3d()
           
 
Method Summary
 PolygonalMesh getMesh()
           
 void getSelection(java.util.LinkedList<java.lang.Object> list, int qid)
          Append to list the component (or components) associated with the qid-th selection query issued by this component's render method.
 boolean mouseDragged(MouseRayEvent e)
           
 boolean mouseMoved(MouseRayEvent e)
           
 boolean mousePressed(MouseRayEvent e)
           
 boolean mouseReleased(MouseRayEvent e)
           
 void render(GLRenderer renderer, int flags)
          Render this object using Open GL via the JOGL.
 void setLocation(Point3d location)
           
 void setMesh(PolygonalMesh mesh)
           
 
Methods inherited from class maspack.render.Dragger3dBase
addListener, fireDraggerAddedListeners, fireDraggerBeginListeners, fireDraggerEndListeners, fireDraggerMoveListeners, fireDraggerRemovedListeners, getDraggerToWorld, getRenderHints, getSize, getViewer, isSelectable, isVisible, mouseClicked, numSelectionQueriesNeeded, prerender, removeListener, setDraggerToWorld, setPosition, setSize, setViewer, setVisible, updateBounds
 
Methods inherited from class maspack.render.DragToolBase
updateKeyMasks
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstrainedTranslator3d

public ConstrainedTranslator3d()
Method Detail

getSelection

public void getSelection(java.util.LinkedList<java.lang.Object> list,
                         int qid)
Description copied from interface: GLSelectable
Append to list the component (or components) associated with the qid-th selection query issued by this component's render method. This will only be called if this component manages its own selection (i.e., the number nums returned by GLSelectable.numSelectionQueriesNeeded() is positive), and qid will in turn be a number between 0 and nums-1.

Parameters:
list - selected objects are appended to the end of this list
qid - index of the selection query

render

public void render(GLRenderer renderer,
                   int flags)
Description copied from interface: GLRenderable
Render this object using Open GL via the JOGL.

Parameters:
renderer - renderer object which is used to perform the rendering. Provides pointers to GL and GLU, along with helper functions.
flags - supplies flags that may be used to control different aspects of the rendering. Flags are defined in GLRenderer and currently include GLRenderer.SELECTED, GLRenderer.VERTEX_COLORING, GLRenderer.HSV_COLOR_INTERPOLATION, GLRenderer.SORT_FACES, and GLRenderer.CLEAR_MESH_DISPLAY_LISTS.

mousePressed

public boolean mousePressed(MouseRayEvent e)
Specified by:
mousePressed in interface Dragger3d
Overrides:
mousePressed in class Dragger3dBase

mouseReleased

public boolean mouseReleased(MouseRayEvent e)
Specified by:
mouseReleased in interface Dragger3d
Overrides:
mouseReleased in class Dragger3dBase

mouseDragged

public boolean mouseDragged(MouseRayEvent e)
Specified by:
mouseDragged in interface Dragger3d
Overrides:
mouseDragged in class Dragger3dBase

mouseMoved

public boolean mouseMoved(MouseRayEvent e)
Specified by:
mouseMoved in interface Dragger3d
Overrides:
mouseMoved in class Dragger3dBase

getMesh

public PolygonalMesh getMesh()

setMesh

public void setMesh(PolygonalMesh mesh)

setLocation

public void setLocation(Point3d location)