maspack.render
Class Dragger3dBase

java.lang.Object
  extended by maspack.render.DragToolBase
      extended by maspack.render.Dragger3dBase
All Implemented Interfaces:
Dragger3d, GLRenderable, GLSelectable
Direct Known Subclasses:
ConstrainedTranslator3d, Jack3d, Rotator3d, Scaler3d, Translator3d, Transrotator3d

public abstract class Dragger3dBase
extends DragToolBase
implements Dragger3d


Field Summary
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Method Summary
 void addListener(Dragger3dListener l)
           
 void fireDraggerAddedListeners()
           
 void fireDraggerBeginListeners(AffineTransform3dBase X, AffineTransform3dBase Xinc, int modifiersEx)
           
 void fireDraggerEndListeners(AffineTransform3dBase X, AffineTransform3dBase Xinc, int modifiersEx)
           
 void fireDraggerMoveListeners(AffineTransform3dBase X, AffineTransform3dBase Xinc, int modifiersEx)
           
 void fireDraggerRemovedListeners()
           
 RigidTransform3d getDraggerToWorld()
           
 int getRenderHints()
          Returns a bit code giving rendering hints about this renderable.
 double getSize()
           
 GLViewer getViewer()
          Returns a reference to the viewer which is handling this dragger.
 boolean isSelectable()
          Returns true if this object is in fact selectable.
 boolean isVisible()
           
 boolean mouseClicked(MouseRayEvent e)
           
 boolean mouseDragged(MouseRayEvent e)
           
 boolean mouseMoved(MouseRayEvent e)
           
 boolean mousePressed(MouseRayEvent e)
           
 boolean mouseReleased(MouseRayEvent e)
           
 int numSelectionQueriesNeeded()
          If this selectable manages its own selection (by issuing selection queries within its render method), then this method should return the maximum number of selection queries that will be required.
 void prerender(RenderList list)
          Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer.
 boolean removeListener(Dragger3dListener l)
           
 void setDraggerToWorld(RigidTransform3d X)
           
 void setPosition(Vector3d pos)
           
 void setSize(double s)
           
 void setViewer(GLViewer viewer)
          Used by the viewer to set a reference to itself when the dragger is added.
 void setVisible(boolean visible)
           
 void updateBounds(Point3d pmin, Point3d pmax)
          Update the minimum and maximum points for this object.
 
Methods inherited from class maspack.render.DragToolBase
updateKeyMasks
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface maspack.render.GLSelectable
getSelection
 
Methods inherited from interface maspack.render.GLRenderable
render
 

Method Detail

addListener

public void addListener(Dragger3dListener l)

removeListener

public boolean removeListener(Dragger3dListener l)

fireDraggerAddedListeners

public void fireDraggerAddedListeners()

fireDraggerBeginListeners

public void fireDraggerBeginListeners(AffineTransform3dBase X,
                                      AffineTransform3dBase Xinc,
                                      int modifiersEx)

fireDraggerMoveListeners

public void fireDraggerMoveListeners(AffineTransform3dBase X,
                                     AffineTransform3dBase Xinc,
                                     int modifiersEx)

fireDraggerEndListeners

public void fireDraggerEndListeners(AffineTransform3dBase X,
                                    AffineTransform3dBase Xinc,
                                    int modifiersEx)

fireDraggerRemovedListeners

public void fireDraggerRemovedListeners()

isVisible

public boolean isVisible()
Specified by:
isVisible in interface Dragger3d

setVisible

public void setVisible(boolean visible)

setSize

public void setSize(double s)

getSize

public double getSize()

mouseClicked

public boolean mouseClicked(MouseRayEvent e)
Specified by:
mouseClicked in interface Dragger3d

mousePressed

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

mouseReleased

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

mouseDragged

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

mouseMoved

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

getDraggerToWorld

public RigidTransform3d getDraggerToWorld()

setDraggerToWorld

public void setDraggerToWorld(RigidTransform3d X)

setPosition

public void setPosition(Vector3d pos)

updateBounds

public void updateBounds(Point3d pmin,
                         Point3d pmax)
Description copied from interface: GLRenderable
Update the minimum and maximum points for this object. In an x-y-z coordinate system with x directed to the right and y directed upwards, the minimum and maximum points can be thought of as defining the left-lower-far and right-upper-near corners of a bounding cube. This method should only reduce the elements of the minimum point and increase the elements of the maximum point, since it may be used as part of an iteration to determine the bounding cube for several different objects.

Specified by:
updateBounds in interface GLRenderable
Parameters:
pmin - minimum point
pmax - maximum point

isSelectable

public boolean isSelectable()
Returns true if this object is in fact selectable.

Specified by:
isSelectable in interface GLSelectable
Returns:
true if this object is selectable

numSelectionQueriesNeeded

public int numSelectionQueriesNeeded()
Description copied from interface: GLSelectable
If this selectable manages its own selection (by issuing selection queries within its render method), then this method should return the maximum number of selection queries that will be required. Otherwise, this method should return -1.

Specified by:
numSelectionQueriesNeeded in interface GLSelectable
Returns:
maximum number of selection queries needed by this component, or -1 if this component does not manage its own selection.

prerender

public void prerender(RenderList list)
Description copied from interface: GLRenderable
Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer.

Specified by:
prerender in interface GLRenderable

getRenderHints

public int getRenderHints()
Description copied from interface: GLRenderable
Returns a bit code giving rendering hints about this renderable. Current bit codes include TRANSLUCENT.

Specified by:
getRenderHints in interface GLRenderable
Returns:
bit code of rendering hints.

setViewer

public void setViewer(GLViewer viewer)
Used by the viewer to set a reference to itself when the dragger is added.


getViewer

public GLViewer getViewer()
Returns a reference to the viewer which is handling this dragger. Used mainly to determine the size and alignment of constrained motions. Should not be modified in any way.