de.grogra.imp3d.edit
Class TransformTool

java.lang.Object
  extended by de.grogra.graph.impl.Edge
      extended by de.grogra.graph.impl.Node
          extended by de.grogra.imp.edit.ToolRoot
              extended by de.grogra.imp3d.edit.ToolRoot3D
                  extended by de.grogra.imp3d.edit.TransformTool
All Implemented Interfaces:
Transformation, Manageable, PersistenceCapable, Shareable, UserFields, XObject, Disposable, Map, java.io.Serializable, java.util.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:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class de.grogra.graph.impl.Node
Node.AccessorBridge, Node.FieldAttributeAccessor, Node.NType
 
Nested classes/interfaces inherited from interface de.grogra.util.EventListener
EventListener.Bicast, EventListener.Multicaster
 
Nested classes/interfaces inherited from interface de.grogra.util.Map
Map.Chain
 
Field Summary
protected  Matrix4d local
          The local transformation matrix of the transformable object.
 
Fields inherited from class de.grogra.imp3d.edit.ToolRoot3D
$TYPE
 
Fields inherited from class de.grogra.imp.edit.ToolRoot
tool
 
Fields inherited from class de.grogra.graph.impl.Node
ADDITIONAL_FIELDS, bits, DELETED, EXTENT_BIT, EXTENT_MASK, extentIndex$FIELD, extentTail$FIELD, HAS_OBSERVERS, IS_INTERPRETIVE, isInterpretive$FIELD, LAST_EXTENT_INDEX, layer$FIELD, MARK, mark$FIELD, MIME_TYPE, MIN_UNUSED_SPECIAL_OF_SOURCE, MIN_UNUSED_SPECIAL_OF_TARGET, name$FIELD, USED_BITS
 
Fields inherited from interface de.grogra.util.Map
DEFAULT_VALUE, EMPTY_MAP
 
Constructor Summary
TransformTool()
           
 
Method Summary
protected  void adjustToolTransformation(Matrix4d t, CameraBase c)
          This method is invoked to compute an adjustment of the tool coordinates system.
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.
protected  boolean initialize(Tool tool)
          Initializes this tool root.
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.
 
Methods inherited from class de.grogra.imp3d.edit.ToolRoot3D
adjustScale, attributeChanged, dispose, eventOccured, getAdjustment, getParentTransformation, getTargetTransformation, getToolTransformation, postTransform, preTransform
 
Methods inherited from class de.grogra.imp.edit.ToolRoot
executeWithWriteLock, getToolTarget, isTargetNode
 
Methods inherited from class de.grogra.graph.impl.Node
addEdgeBitsTo, addReference, appendBranchNode, appendBranchNode, appendReferencesTo, clone, clone, cloneGraph, dump, dumpTree, dup, dupUnmanagedFields, edgeChanged, fieldModified, findAdjacent, get, getAccessor, getAccessor, getAttributes, getAxisParent, getBoolean, getBranch, getBranchLength, getBranchNode, getBranchTail, getByte, getChar, getCommonAncestor, getCurrentGraphState, getDirectChildCount, getDouble, getEdgeAttributeAccessor, getEdgeAttributes, getEdgeBitsTo, getEdgeTo, getExtentIndex, getFirst, getFirstEdge, getFloat, getGraph, getId, getIndex, getInstantiator, getInt, getLayer, getLong, getManageableType, getName, getNeighbor, getNext, getNType, getNTypeImpl, getObject, getOrCreateEdgeTo, getOrNull, getPersistenceManager, getPredecessor, getProvider, getShort, getSource, getStamp, getSuccessor, getSymbol, getSymbolColor, getTarget, getTransaction, getUserField, getUserFieldCount, getXClass, getXData, hasName, initProvider, initXClass, insertBranchNode, insertBranchNode, instantiateGraph, isAncestorOf, isDirection, isManagingInstance, isMarked, isRoot, isSource, isTarget, manageableReadResolve, manageableWriteReplace, newInstance, paramString, removeAll, removeEdgeBitsTo, removeFromChain, removeFromChain, removeReference, setBranch, setBranch, setExtentIndex, setGraphForDeserialization, setLayer, setMark, setName, setSuccessor, setSuccessor, specialEdgeAdded, specialEdgeRefModified, specialEdgeRemoved, toString, writeReplace
 
Methods inherited from class de.grogra.graph.impl.Edge
addEdgeBits, getBitMark, getEdgeBits, getObjectMark, getSpecialEdgeDescriptor, parseEdgeKeys, remove, removeEdgeBits, setBitMark, setEdgeBits, setObjectMark, testEdgeBits
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.grogra.persistence.PersistenceCapable
getBitMark, getObjectMark, setBitMark, setObjectMark
 

Field Detail

local

protected Matrix4d local
The local transformation matrix of the transformable object.

Constructor Detail

TransformTool

public TransformTool()
Method Detail

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

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

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).

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