Module imp3d

Class TransformTool

All Implemented Interfaces:
Transformation, Manageable, PersistenceCapable, Shareable, UserFields, XObject, Disposable, EventListener, Map, Serializable, EventListener
Direct Known Subclasses:
Rotate, Scale, Translate

public abstract class TransformTool extends ToolRoot3D
This class is the base class for tool roots which manipulate transformable objects (objects having the attribute Attributes.TRANSFORM). The tool coordinate system (see ToolRoot3D is adjusted such that tool nodes of size 1 have a size of about 150 pixels on a 3D view.
Author:
Ole Kniemeyer
See Also:
  • Field Details

    • local

      protected Matrix4d local
      The local transformation matrix of the transformable object.
  • Constructor Details

    • TransformTool

      public TransformTool()
  • Method Details

    • computeTargetTransformation

      protected void computeTargetTransformation(Matrix4d t, Matrix4d parent)
      This implementation sets the target coordinate system such that is is transformed to the parent coordinate system by the transformation of the transformable tool target.
      Specified by:
      computeTargetTransformation in class ToolRoot3D
      Parameters:
      t - the computed matrix of the target coordinate system
      parent - the provided matrix of the parent coordinate system
    • setTargetTransform

      protected void setTargetTransform(Matrix4d t)
      This utility method may be used by subclasses in order to set the local transformation of the transformable tool target to the given matrix t.
      Parameters:
      t - the new local transformation of the target object
    • adjustToolTransformation

      protected void adjustToolTransformation(Matrix4d t, CameraBase c)
      Description copied from class: ToolRoot3D
      This method is invoked to compute an adjustment of the tool coordinates system. The invoker sets t to the transformation matrix from target coordinates to world coordinates. Implementations of this method may adjust t, e.g., they may set a certain scaling factor between tool coordinates and camera coordinates in order to ensure a fixed size of tool nodes on the 3D view.
      Overrides:
      adjustToolTransformation in class ToolRoot3D
      Parameters:
      t - the tool transformation to be adjusted
      c - the camera of the tool's 3D view
    • initialize

      protected boolean initialize(Tool tool)
      Description copied from class: ToolRoot
      Initializes this tool root. This method initializes the field ToolRoot.tool with the given tool.
      Overrides:
      initialize in class ToolRoot3D
      Parameters:
      tool - the tool to which this tool root is associated
      Returns:
      true if this tool root actually shall be used for the tool, false if it shall not be used (e.g., if the actual tool target cannot be manipulated by the tool graph of this tool root).