gnu.gleem
Class Manip

java.lang.Object
  |
  +--gnu.gleem.Manip
Direct Known Subclasses:
HandleBoxManip, Translate1Manip, Translate2Manip

public abstract class Manip
extends java.lang.Object

The base class for all manipulators. Fundamentally a manipulator must support a ray cast operation with itself and logic to understand what to do when that ray cast actually made the manipulator active.


Constructor Summary
Manip()
           
 
Method Summary
 boolean addMotionListener(ManipMotionListener l)
          Returns true if the addition was successful, false otherwise
abstract  void clearHighlight()
          Tell the manipulator to clear the current highlight
 void drag(Vec3f rayStart, Vec3f rayDirection)
          When a manipulator is active, drags of the live portion cause motion of the manipulator.
abstract  void highlight(HitPoint hit)
          Tell the manipulator to highlight the current portion of itself.
abstract  void intersectRay(Vec3f rayStart, Vec3f rayDirection, java.util.List results)
          Cast a ray in 3-space from the camera start position in the specified direction and test for intersections against all live portions of this manipulator.
abstract  void makeActive(HitPoint hit)
          If the ManipManager decides that this manipulator is to become active, it will pass back the HitPoint which made it make its decision.
abstract  void makeInactive()
          When the mouse button is released, makeInactive() is called.
 boolean removeMotionListener(ManipMotionListener l)
          Returns true if the removal was successful, false otherwise
abstract  void render(gl4java.GLFunc gl)
          Render this Manipulator now using the given OpenGL routines and assuming an OpenGL context is current.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Manip

public Manip()
Method Detail

addMotionListener

public boolean addMotionListener(ManipMotionListener l)
Returns true if the addition was successful, false otherwise


removeMotionListener

public boolean removeMotionListener(ManipMotionListener l)
Returns true if the removal was successful, false otherwise


intersectRay

public abstract void intersectRay(Vec3f rayStart,
                                  Vec3f rayDirection,
                                  java.util.List results)
Cast a ray in 3-space from the camera start position in the specified direction and test for intersections against all live portions of this manipulator. Add all hits, in arbitrary order, to the end of the given list in the form of HitPoints. Must not modify the results vector in any other way (i.e., must not remove any existing HitPoints from the results vector).


highlight

public abstract void highlight(HitPoint hit)
Tell the manipulator to highlight the current portion of itself. This is merely visual feedback to the user.


clearHighlight

public abstract void clearHighlight()
Tell the manipulator to clear the current highlight


makeActive

public abstract void makeActive(HitPoint hit)
If the ManipManager decides that this manipulator is to become active, it will pass back the HitPoint which made it make its decision. The manipulator can then change its state to look for drags of this portion of the manipulator.


drag

public void drag(Vec3f rayStart,
                 Vec3f rayDirection)
When a manipulator is active, drags of the live portion cause motion of the manipulator. The ManipManager keeps track of which manipulator (if any) is active and takes care of calling the drag() method with the current ray start and direction. The manipulator must keep enough state to understand how it should position and/or rotate itself. NOTE that the base class provides an implementation for this method which you must call at the end of your overriding method.


makeInactive

public abstract void makeInactive()
When the mouse button is released, makeInactive() is called. The manipulator should reset its state in preparation for the next drag.


render

public abstract void render(gl4java.GLFunc gl)
Render this Manipulator now using the given OpenGL routines and assuming an OpenGL context is current.