eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'DisplayTransform':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: DisplayTransform


Inheritance:

   Object
   |
   +--DisplayTransform
      |
      +--ScaleTransform
      |
      +--TranslationTransform

Package:
stx:libview
Category:
Graphics-Transformations
Version:
rev: 1.5 date: 2018/06/14 08:32:44
user: cg
file: DisplayTransform.st directory: libview
module: stx stc-classLibrary: libview

Description:


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)


Class protocol:

instance creation
o  identity

queries
o  isAbstract
Return if this class is an abstract class.
True is returned here for myself only; false for subclasses.
Abstract subclasses must redefine this again.


Instance protocol:

accessing
o  inverseTransformation
Return the inverse transformation of the receiver

** This method raises an error - it must be redefined in concrete classes **

composing
o  composedWithGlobal: aTransformation
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


o  composedWithLocal: aTransformation
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
o  asCompositeTransform
Represent the receiver as a composite transformation

o  asMatrixTransform2x3
Represent the receiver as a 2x3 matrix transformation

** This method raises an error - it must be redefined in concrete classes **

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

** This method raises an error - it must be redefined in concrete classes **

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

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

** This method raises an error - it must be redefined in concrete classes **

o  isMatrixTransform2x3
Return true if the receiver is 2x3 matrix transformation

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

o  isNoScale
return true if the identity scale is in effect (i.e. saleFactor is 1);
return false, otherwise.

** This method raises an error - it must be redefined in concrete classes **

o  noScale
return true if the identity scale is in effect (i.e. saleFactor is 1);
return false, otherwise.
Obsolete: use isNoScale

** This is an obsolete interface - do not use it (it may vanish in future versions) **

transforming points
o  applyInverseTo: aPoint
^ self invertPoint: aPoint

** This method raises an error - it must be redefined in concrete classes **

o  applyScaleX: aNumber
^ (self transformPoint: aNumber @ 0) x

** This method raises an error - it must be redefined in concrete classes **

o  applyScaleY: aNumber
^ (self transformPoint: 0 @ aNumber) y

** This method raises an error - it must be redefined in concrete classes **

o  applyTo: aPoint
^ self transformPoint: aPoint

** This method raises an error - it must be redefined in concrete classes **

o  globalPointToLocal: aPoint
Transform aPoint from global coordinates into local coordinates

** This method raises an error - it must be redefined in concrete classes **

o  globalPointsToLocal: inArray
Transform all the points of inArray from global into local coordinates

o  localPointToGlobal: aPoint
Transform aPoint from local coordinates into global coordinates

** This method raises an error - it must be redefined in concrete classes **

o  localPointsToGlobal: inArray
Transform all the points of inArray from local into global coordinates

transforming rects
o  globalBoundsToLocal: aRectangle
Transform aRectangle from global coordinates into local coordinates

o  localBoundsToGlobal: aRectangle
Transform aRectangle from local coordinates into global coordinates



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Tue, 16 Apr 2024 16:25:13 GMT