Squeak Class Documentation category index | class index  
 
DisplayTransform
  category: Graphics-Transformations
  superclass: Object
  subclasses: MatrixTransform2x3 CompositeTransform MorphicTransform IdentityTransform

This class represents a base for generic transformations of 2D points between different coordinate systems (including scaling and rotation). The transformations map objects between one coordinate system and another where it is assumed that a nested hierarchy of transformations can be defined.

It is assumed that transformations deal with Integer points. All transformations should return Integer coordinates (even though float points may be passed in as argument).

Compositions of transformations MUST work in the following order. A 'global' transformation (the argument in #composedWithGlobal:) is defined as a transformation that takes place between the receiver (the 'local') transformation and any 'global' point computations, whereas a 'local' transformation (e.g., the argument in #composedWithLocal:) takes place between the receiver ('global') and any 'local' points. For the transformation methods this means that combining a global and a local transformation will result in the following order:

globalPointToLocal: globalPoint
"globalPoint -> globalTransform -> localTransform -> locaPoint"
^localTransform globalPointToLocal:
(globalTransform globalPointToLocal: globalPoint)

localPointToGlobal: localPoint
"localPoint -> localTransform -> globalTransform -> globalPoint"
^globalTransform localPointToGlobal:
(localTransform localPointToGlobal: localPoint)

instance methods
  accessing
  inverseTransformation

  composing
  composedWithGlobal:
composedWithLocal:

  converting
  asCompositeTransform
asMatrixTransform2x3

  encoding
  encodeForRemoteCanvas

  initialize
  setIdentity

  testing
  isCompositeTransform
isIdentity
isMatrixTransform2x3
isMorphicTransform
isPureTranslation

  transforming points
  globalPointToLocal:
globalPointsToLocal:
invertBoundsRect:
localPointToGlobal:
localPointsToGlobal:

  transforming rects
  globalBoundsToLocal:
localBoundsToGlobal:
sourceQuadFor:

class methods
  instance creation
  fromRemoteCanvasEncoding:
identity

instance methods
  accessing top  
 

inverseTransformation

Return the inverse transformation of the receiver


  composing top  
 

composedWithGlobal:

Return the composition of the receiver and the global transformation passed in.
A 'global' transformation is defined as a transformation that takes place
between the receiver (the 'local') transformation and any 'global' point
computations, e.g., for the methods

globalPointToLocal: globalPoint
globalPoint -> globalTransform -> localTransform -> locaPoint

localPointToGlobal: localPoint
localPoint -> localTransform -> globalTransform -> globalPoint


 

composedWithLocal:

Return the composition of the receiver and the local transformation passed in.
A 'local' transformation is defined as a transformation that takes place
between the receiver (the 'global') transformation and any 'local' point
computations, e.g., for the methods

globalPointToLocal: globalPoint
globalPoint -> globalTransform -> localTransform -> locaPoint

localPointToGlobal: localPoint
localPoint -> localTransform -> globalTransform -> globalPoint


  converting top  
 

asCompositeTransform

Represent the receiver as a composite transformation


 

asMatrixTransform2x3

Represent the receiver as a 2x3 matrix transformation


  encoding top  
 

encodeForRemoteCanvas

encode this transform into a string for use by a RemoteCanvas


  initialize top  
 

setIdentity

Initialize the receiver to the identity transformation (e.g., not affecting points)


  testing top  
 

isCompositeTransform

Return true if the receiver is a composite transformation.
Composite transformations may have impact on the accuracy.


 

isIdentity

Return true if the receiver is the identity transform; that is, if applying to a point returns the point itself.


 

isMatrixTransform2x3

Return true if the receiver is 2x3 matrix transformation


 

isMorphicTransform

Return true if the receiver is a MorphicTransform, that is specifies the transformation values explicitly.


 

isPureTranslation

Return true if the receiver specifies no rotation or scaling.


  transforming points top  
 

globalPointToLocal:

Transform aPoint from global coordinates into local coordinates


 

globalPointsToLocal:

Transform all the points of inArray from global into local coordinates


 

invertBoundsRect:

Return a rectangle whose coordinates have been transformed
from local back to global coordinates.


 

localPointToGlobal:

Transform aPoint from local coordinates into global coordinates


 

localPointsToGlobal:

Transform all the points of inArray from local into global coordinates


  transforming rects top  
 

globalBoundsToLocal:

Transform aRectangle from global coordinates into local coordinates


 

localBoundsToGlobal:

Transform aRectangle from local coordinates into global coordinates


 

sourceQuadFor:


class methods
  instance creation top  
 

fromRemoteCanvasEncoding:

decode a transform from the given encoded string


 

identity