camera3d.action
Class TranslationAction

java.lang.Object
  extended bycamera3d.action.VcAction
      extended bycamera3d.action.VcObjectChangeAction
          extended bycamera3d.action.TransformAction
              extended bycamera3d.action.TranslationAction
All Implemented Interfaces:
camera3d.action.OptimizableAction

public class TranslationAction
extends TransformAction

Action for translating a VcObject.

Version:
1.0
Author:
Fábio Roberto de Miranda

Field Summary
 
Fields inherited from class camera3d.action.VcAction
MULTIPLE_OBJECT_ACTION, SINGLE_OBJECT_ACTION
 
Constructor Summary
TranslationAction(VcObject v, TransformMode mode)
           
TranslationAction(VcObject v, TransformMode mode, javax.vecmath.Point3d trans)
           
 
Method Summary
 void doAction(ActionExecutor executor)
          Performs the translation.
 boolean optimize(VcAction inputAction)
          Tries to eliminate the Action given as input, when possible.
 void setTranslationValues(double x, double y, double z)
          Sets the values by which the VcObject will be translated.
 
Methods inherited from class camera3d.action.TransformAction
canOptimize, getTransformMode, getVcObject, setTransformMode, setVcObject
 
Methods inherited from class camera3d.action.VcAction
debugln, getMultiplicityType, isUndoable, setMultiplicityType, undoAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TranslationAction

public TranslationAction(VcObject v,
                         TransformMode mode)

TranslationAction

public TranslationAction(VcObject v,
                         TransformMode mode,
                         javax.vecmath.Point3d trans)
Method Detail

setTranslationValues

public void setTranslationValues(double x,
                                 double y,
                                 double z)
Sets the values by which the VcObject will be translated.


doAction

public void doAction(ActionExecutor executor)
Performs the translation.

Specified by:
doAction in class VcAction
Parameters:
executor - provides any resource necessary for the action execution, such as references to other objects.

optimize

public boolean optimize(VcAction inputAction)
Tries to eliminate the Action given as input, when possible. In case inputAction is not a TranslationAction, then no optimization can be performed and the method returns false. If inputAction is a set to an absolute translation its parameters are simply copied into this object, so inputAction no longer need to be performed. Finally, if inputAction is set to a relative translation, this object's parameters are set to reflect the combined effects of this object and inputAction, which is no longer necessary. In both former cases the method returns true.

Specified by:
optimize in interface camera3d.action.OptimizableAction
Specified by:
optimize in class TransformAction


Copyright © 2001-2003 F.R. Miranda, C.S. Santos, J.E. Kogler Jr.. All Rights Reserved.