3930
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1999 by Claus Gittinger
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
"{ Package: 'stx:libview2' }"
|
|
13 |
|
|
14 |
"{ NameSpace: Smalltalk }"
|
|
15 |
|
1250
|
16 |
DisplayTransform subclass:#CompositeTransform
|
|
17 |
instanceVariableNames:'globalTransform localTransform'
|
|
18 |
classVariableNames:''
|
|
19 |
poolDictionaries:''
|
|
20 |
category:'Graphics-Transformations'
|
|
21 |
!
|
|
22 |
|
3930
|
23 |
CompositeTransform comment:'A composite transform provides the effect of several levels of coordinate transformations.'
|
|
24 |
!
|
|
25 |
|
|
26 |
!CompositeTransform class methodsFor:'documentation'!
|
1250
|
27 |
|
3930
|
28 |
copyright
|
|
29 |
"
|
|
30 |
COPYRIGHT (c) 1999 by Claus Gittinger
|
|
31 |
All Rights Reserved
|
|
32 |
|
|
33 |
This software is furnished under a license and may be used
|
|
34 |
only in accordance with the terms of that license and with the
|
|
35 |
inclusion of the above copyright notice. This software may not
|
|
36 |
be provided or otherwise made available to, or used by, any
|
|
37 |
other person. No title to or ownership of the software is
|
|
38 |
hereby transferred.
|
|
39 |
"
|
|
40 |
! !
|
1250
|
41 |
|
|
42 |
!CompositeTransform methodsFor:'accessing'!
|
|
43 |
|
|
44 |
inverseTransformation
|
|
45 |
"Return the inverse transformation of the receiver"
|
|
46 |
^self species new
|
|
47 |
globalTransform: localTransform inverseTransformation
|
3930
|
48 |
localTransform: globalTransform inverseTransformation
|
|
49 |
! !
|
1250
|
50 |
|
|
51 |
!CompositeTransform methodsFor:'converting'!
|
|
52 |
|
|
53 |
asCompositeTransform
|
3930
|
54 |
^self
|
|
55 |
!
|
1250
|
56 |
|
|
57 |
asMatrixTransform2x3
|
|
58 |
^globalTransform asMatrixTransform2x3
|
3930
|
59 |
composedWithLocal: localTransform asMatrixTransform2x3
|
|
60 |
! !
|
1250
|
61 |
|
|
62 |
!CompositeTransform methodsFor:'initialization'!
|
|
63 |
|
|
64 |
globalTransform: gt localTransform: lt
|
|
65 |
globalTransform _ gt.
|
3930
|
66 |
localTransform _ lt
|
|
67 |
! !
|
1250
|
68 |
|
|
69 |
!CompositeTransform methodsFor:'testing'!
|
|
70 |
|
|
71 |
isCompositeTransform
|
3930
|
72 |
^true
|
|
73 |
!
|
1250
|
74 |
|
|
75 |
isIdentity
|
3930
|
76 |
^ globalTransform isIdentity and: [localTransform isIdentity]
|
|
77 |
!
|
1250
|
78 |
|
|
79 |
isPureTranslation
|
3930
|
80 |
^ globalTransform isPureTranslation and: [localTransform isPureTranslation]
|
|
81 |
! !
|
1250
|
82 |
|
|
83 |
!CompositeTransform methodsFor:'transformations'!
|
|
84 |
|
|
85 |
invert: aPoint
|
3930
|
86 |
^ globalTransform invert: (localTransform invert: aPoint)
|
|
87 |
!
|
1250
|
88 |
|
|
89 |
scale
|
3930
|
90 |
^ localTransform scale * globalTransform scale
|
|
91 |
!
|
1250
|
92 |
|
|
93 |
transform: aPoint
|
3930
|
94 |
^ localTransform transform: (globalTransform transform: aPoint)
|
|
95 |
! !
|
1250
|
96 |
|
|
97 |
!CompositeTransform methodsFor:'transforming points'!
|
|
98 |
|
|
99 |
globalPointToLocal: aPoint
|
|
100 |
"Transform aPoint from global coordinates into local coordinates"
|
|
101 |
^localTransform globalPointToLocal:
|
3930
|
102 |
(globalTransform globalPointToLocal: aPoint)
|
|
103 |
!
|
1250
|
104 |
|
|
105 |
localPointToGlobal: aPoint
|
|
106 |
"Transform aPoint from global coordinates into local coordinates"
|
|
107 |
^globalTransform localPointToGlobal:
|
3930
|
108 |
(localTransform localPointToGlobal: aPoint)
|
|
109 |
! !
|
1250
|
110 |
|
|
111 |
!CompositeTransform class methodsFor:'documentation'!
|
|
112 |
|
|
113 |
version
|
3930
|
114 |
^ '$Header$'
|
1250
|
115 |
! !
|
3930
|
116 |
|