artofillusion.ui
Class Compound3DManipulator

java.lang.Object
  extended by EventSource
      extended by artofillusion.ui.Compound3DManipulator
All Implemented Interfaces:
Manipulator

public class Compound3DManipulator
extends EventSource
implements Manipulator

This class displays a set of curves and handles around a selection in a ViewerCanvas. It processes mouse clicks on them, and translates them into higher level events which are dispatched for further processing, most often by an EditingTool. It presents a composite user interface for performing moving, scaling, and rotating operations.


Nested Class Summary
static class Compound3DManipulator.Axis
          Instances of this class represent coordinate axes.
 class Compound3DManipulator.HandleDraggedEvent
          This is the event class generated when the user drags on a handle.
 class Compound3DManipulator.HandleEvent
          This is the superclass of the various events generated by the manipulator.
 class Compound3DManipulator.HandlePressedEvent
          This is the event class generated when the user clicks on a handle.
 class Compound3DManipulator.HandleReleasedEvent
          This is the event class generated when the user releases on a handle.
static class Compound3DManipulator.HandleType
          Instances of this class represent handle types.
static class Compound3DManipulator.ViewMode
          Instances of this class represent the different view modes for the manipulator.
 
Field Summary
static Compound3DManipulator.Axis ALL
           
static short CENTER_INDEX
           
static Compound3DManipulator.HandleType MOVE
           
static Compound3DManipulator.Axis N
           
static Compound3DManipulator.ViewMode NPQ_MODE
           
static Compound3DManipulator.Axis P
           
static Compound3DManipulator.Axis Q
           
static Compound3DManipulator.HandleType ROTATE
           
static short ROTATE_INDEX
           
static Compound3DManipulator.HandleType SCALE
           
static short TOOL_HANDLE
           
static Compound3DManipulator.Axis U
           
static Compound3DManipulator.Axis UV
           
static short UV_EXTRA_INDEX
           
static Compound3DManipulator.ViewMode UV_MODE
           
static Compound3DManipulator.Axis V
           
static Compound3DManipulator.Axis W
           
static Compound3DManipulator.Axis X
           
static short X_MOVE_INDEX
           
static short X_SCALE_INDEX
           
static Compound3DManipulator.ViewMode XYZ_MODE
           
static Compound3DManipulator.Axis Y
           
static short Y_MOVE_INDEX
           
static short Y_SCALE_INDEX
           
static Compound3DManipulator.Axis Z
           
static short Z_MOVE_INDEX
           
static short Z_SCALE_INDEX
           
 
Constructor Summary
Compound3DManipulator()
          Create a new manipulator.
 
Method Summary
 void draw(ViewerCanvas view, BoundingBox selectionBounds)
          Draw the handles onto a ViewerCanvas.
 java.awt.Rectangle findScreenBounds(BoundingBox b, Camera cam)
          Given a bounding box in view coordinates, find the corresponding rectangle in screen coordinates.
 Vec3 getAxisDirection(Compound3DManipulator.Axis axis, ViewerCanvas view)
          Get the direction of a particular axis.
 Compound3DManipulator.HandleType getHandleTypeAtLocation(java.awt.Point location, ViewerCanvas view, BoundingBox selectionBounds)
          Get the type of handle which is displayed at a location.
 boolean getRotateAroundSelectionCenter()
          Get whether rotations should be performed around the select center or around the origin.
 Compound3DManipulator.ViewMode getViewMode()
          Get the current view mode.
 void mouseDragged(WidgetMouseEvent ev, ViewerCanvas view)
          Respond to mouse drags in the canvas.
 boolean mousePressed(WidgetMouseEvent ev, ViewerCanvas view, BoundingBox selectionBounds)
          Respond to mouse presses in the canvas.
 void mousePressedOnHandle(WidgetMouseEvent ev, ViewerCanvas view, BoundingBox selectionBounds, Vec3 handleLocation)
           
 void mouseReleased(WidgetMouseEvent ev, ViewerCanvas view)
          Respond to mouse releases in the canvas.
 void setNPQAxes(Vec3 nDir, Vec3 pDir, Vec3 qDir)
          Set the axis directions to be used in NPQ mode.
 void setRotateAroundSelectionCenter(boolean rotateAroundSelectionCenter)
          Set whether rotations should be performed around the select center or around the origin.
 void setViewMode(Compound3DManipulator.ViewMode mode)
          Set the view mode.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XYZ_MODE

public static final Compound3DManipulator.ViewMode XYZ_MODE

UV_MODE

public static final Compound3DManipulator.ViewMode UV_MODE

NPQ_MODE

public static final Compound3DManipulator.ViewMode NPQ_MODE

X_MOVE_INDEX

public static final short X_MOVE_INDEX
See Also:
Constant Field Values

X_SCALE_INDEX

public static final short X_SCALE_INDEX
See Also:
Constant Field Values

Y_MOVE_INDEX

public static final short Y_MOVE_INDEX
See Also:
Constant Field Values

Y_SCALE_INDEX

public static final short Y_SCALE_INDEX
See Also:
Constant Field Values

Z_MOVE_INDEX

public static final short Z_MOVE_INDEX
See Also:
Constant Field Values

Z_SCALE_INDEX

public static final short Z_SCALE_INDEX
See Also:
Constant Field Values

CENTER_INDEX

public static final short CENTER_INDEX
See Also:
Constant Field Values

ROTATE_INDEX

public static final short ROTATE_INDEX
See Also:
Constant Field Values

TOOL_HANDLE

public static final short TOOL_HANDLE
See Also:
Constant Field Values

UV_EXTRA_INDEX

public static final short UV_EXTRA_INDEX
See Also:
Constant Field Values

X

public static final Compound3DManipulator.Axis X

Y

public static final Compound3DManipulator.Axis Y

Z

public static final Compound3DManipulator.Axis Z

U

public static final Compound3DManipulator.Axis U

V

public static final Compound3DManipulator.Axis V

W

public static final Compound3DManipulator.Axis W

UV

public static final Compound3DManipulator.Axis UV

N

public static final Compound3DManipulator.Axis N

P

public static final Compound3DManipulator.Axis P

Q

public static final Compound3DManipulator.Axis Q

ALL

public static final Compound3DManipulator.Axis ALL

MOVE

public static final Compound3DManipulator.HandleType MOVE

ROTATE

public static final Compound3DManipulator.HandleType ROTATE

SCALE

public static final Compound3DManipulator.HandleType SCALE
Constructor Detail

Compound3DManipulator

public Compound3DManipulator()
Create a new manipulator.

Method Detail

getViewMode

public Compound3DManipulator.ViewMode getViewMode()
Get the current view mode.


setViewMode

public void setViewMode(Compound3DManipulator.ViewMode mode)
Set the view mode.


getRotateAroundSelectionCenter

public boolean getRotateAroundSelectionCenter()
Get whether rotations should be performed around the select center or around the origin.


setRotateAroundSelectionCenter

public void setRotateAroundSelectionCenter(boolean rotateAroundSelectionCenter)
Set whether rotations should be performed around the select center or around the origin.


setNPQAxes

public void setNPQAxes(Vec3 nDir,
                       Vec3 pDir,
                       Vec3 qDir)
Set the axis directions to be used in NPQ mode.


getAxisDirection

public Vec3 getAxisDirection(Compound3DManipulator.Axis axis,
                             ViewerCanvas view)
Get the direction of a particular axis.


getHandleTypeAtLocation

public Compound3DManipulator.HandleType getHandleTypeAtLocation(java.awt.Point location,
                                                                ViewerCanvas view,
                                                                BoundingBox selectionBounds)
Get the type of handle which is displayed at a location.


draw

public void draw(ViewerCanvas view,
                 BoundingBox selectionBounds)
Draw the handles onto a ViewerCanvas.

Specified by:
draw in interface Manipulator
Parameters:
view - the canvas onto which to draw the handles
selectionBounds - a BoundingBox enclosing whatever is selected in the canvas

mousePressed

public boolean mousePressed(WidgetMouseEvent ev,
                            ViewerCanvas view,
                            BoundingBox selectionBounds)
Description copied from interface: Manipulator
Respond to mouse presses in the canvas.

Specified by:
mousePressed in interface Manipulator
Parameters:
ev - the event which has occurred
view - the canvas this manipulator is displayed in
selectionBounds - a bounding box containing everything that is selected in the canvas
Returns:
true if the manipulator has handled the event, false otherwise

mousePressedOnHandle

public void mousePressedOnHandle(WidgetMouseEvent ev,
                                 ViewerCanvas view,
                                 BoundingBox selectionBounds,
                                 Vec3 handleLocation)

mouseDragged

public void mouseDragged(WidgetMouseEvent ev,
                         ViewerCanvas view)
Description copied from interface: Manipulator
Respond to mouse drags in the canvas.

Specified by:
mouseDragged in interface Manipulator
Parameters:
ev - the event which has occurred
view - the canvas this manipulator is displayed in

mouseReleased

public void mouseReleased(WidgetMouseEvent ev,
                          ViewerCanvas view)
Description copied from interface: Manipulator
Respond to mouse releases in the canvas.

Specified by:
mouseReleased in interface Manipulator
Parameters:
ev - the event which has occurred
view - the canvas this manipulator is displayed in

findScreenBounds

public java.awt.Rectangle findScreenBounds(BoundingBox b,
                                           Camera cam)
Given a bounding box in view coordinates, find the corresponding rectangle in screen coordinates.



Copyright © 1999-2011 by Peter Eastman.