|
1 <?xml version="1.0" encoding="UTF-8"?> |
|
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> |
|
3 |
|
4 <!--======================================================================--> |
|
5 <!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =--> |
|
6 <!--= Institute of Technology, Institut National de Recherche en =--> |
|
7 <!--= Informatique et en Automatique, Keio University). All Rights =--> |
|
8 <!--= Reserved. See http://www.w3.org/Consortium/Legal/. =--> |
|
9 <!--======================================================================--> |
|
10 <!-- ===================================================================== --> |
|
11 <!-- --> |
|
12 <!-- coords-transforms-BE-02.svg --> |
|
13 <!-- Author : Vincent Hardy --> |
|
14 <!-- renamed for 1.1 suite to coords-trans-01-b.svg --> |
|
15 <!-- Modified for svg 1.1 by Ola Andersson, 07-Mar-2002 --> |
|
16 <!-- --> |
|
17 <!-- History: --> |
|
18 <!-- 24-Feb-2000, VH: created --> |
|
19 <!-- 27-Feb-2000, LH: minor adjustments to TC name, ser#3. --> |
|
20 <!-- 02-Mar-2000, LH: fix names, legend, ser#4. --> |
|
21 <!-- 09-Mar-2000, LH: fix framing rect, ser#5. --> |
|
22 <!-- 30-Apr-2000, VH=" fix stroke properties bug" ser#5. --> |
|
23 <!-- 12-May-2000, LH: rmv text-anchor and integrate, ser#6. --> |
|
24 <!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . --> |
|
25 <!-- 16-Aug-2000, LH="rename" ser#7. --> |
|
26 <!-- --> |
|
27 <!-- ===================================================================== --> |
|
28 <!--======================================================================--> |
|
29 <!--= Note. After October 2000, revision history is kept as CVS 'commit' =--> |
|
30 <!--= log messages, and therefore is no longer in the preceding preamble.=--> |
|
31 <!--======================================================================--> |
|
32 <svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360"> |
|
33 |
|
34 <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/"> |
|
35 <OperatorScript version="$Revision: 1.5 $" testname="coords-trans-01-b.svg"> |
|
36 <Paragraph> |
|
37 This test verifies the implementation of transforms. It tests elementary transforms |
|
38 and transform nesting. |
|
39 Note that for layout purposes, this test uses nesting of translation with the elementary transforms. |
|
40 </Paragraph> |
|
41 <Paragraph> |
|
42 The rendered picture should match the reference image exactly except for variations in the labeling text. |
|
43 </Paragraph> |
|
44 <Paragraph> |
|
45 The test uses the rect element, the fill color (solid primary colors) and transforms. |
|
46 </Paragraph> |
|
47 </OperatorScript> |
|
48 </SVGTestCase> |
|
49 |
|
50 <title id="test-title">coords-trans-01-b</title> |
|
51 <desc id="test-desc">Validates elementary transforms and transformation nesting</desc> |
|
52 <!--======================================================================--> |
|
53 <!--Content of Test Case follows... =====================--> |
|
54 <!--======================================================================--> |
|
55 <g id="test-body-content" transform="translate(0, 30)"> |
|
56 <!-- ====================================================================== --> |
|
57 <!-- First, draw a test grid ============================================== --> |
|
58 <!-- ====================================================================== --> |
|
59 <g id="test-grid" stroke="#cccccc" stroke-width="1" > |
|
60 <line x1="10" y1="10.5" x2="470" y2="10.5"/> |
|
61 <line x1="10" y1="20.5" x2="470" y2="20.5"/> |
|
62 <line x1="10" y1="30.5" x2="470" y2="30.5"/> |
|
63 <line x1="10" y1="40.5" x2="470" y2="40.5"/> |
|
64 <line x1="10" y1="50.5" x2="470" y2="50.5"/> |
|
65 <line x1="10" y1="60.5" x2="470" y2="60.5"/> |
|
66 <line x1="10" y1="70.5" x2="470" y2="70.5"/> |
|
67 <line x1="10" y1="80.5" x2="470" y2="80.5"/> |
|
68 <line x1="10" y1="90.5" x2="470" y2="90.5"/> |
|
69 <line x1="10" y1="100.5" x2="470" y2="100.5"/> |
|
70 <line x1="10" y1="110.5" x2="470" y2="110.5"/> |
|
71 <line x1="10" y1="120.5" x2="470" y2="120.5"/> |
|
72 <line x1="10" y1="130.5" x2="470" y2="130.5"/> |
|
73 <line x1="10" y1="140.5" x2="470" y2="140.5"/> |
|
74 <line x1="10" y1="150.5" x2="470" y2="150.5"/> |
|
75 <line x1="10" y1="160.5" x2="470" y2="160.5"/> |
|
76 <line x1="10" y1="170.5" x2="470" y2="170.5"/> |
|
77 <line x1="10" y1="180.5" x2="470" y2="180.5"/> |
|
78 <line x1="10" y1="190.5" x2="470" y2="190.5"/> |
|
79 <line x1="10" y1="200.5" x2="470" y2="200.5"/> |
|
80 <line x1="10" y1="210.5" x2="470" y2="210.5"/> |
|
81 <line x1="10" y1="220.5" x2="470" y2="220.5"/> |
|
82 <line x1="10" y1="230.5" x2="470" y2="230.5"/> |
|
83 <line x1="10" y1="240.5" x2="470" y2="240.5"/> |
|
84 <line x1="10" y1="250.5" x2="470" y2="250.5"/> |
|
85 <line x1="10" y1="260.5" x2="470" y2="260.5"/> |
|
86 <line y1="10" x1="10.5" y2="260.5" x2="10.5"/> |
|
87 <line y1="10" x1="20.5" y2="260.5" x2="20.5"/> |
|
88 <line y1="10" x1="30.5" y2="260.5" x2="30.5"/> |
|
89 <line y1="10" x1="40.5" y2="260.5" x2="40.5"/> |
|
90 <line y1="10" x1="50.5" y2="260.5" x2="50.5"/> |
|
91 <line y1="10" x1="60.5" y2="260.5" x2="60.5"/> |
|
92 <line y1="10" x1="70.5" y2="260.5" x2="70.5"/> |
|
93 <line y1="10" x1="80.5" y2="260.5" x2="80.5"/> |
|
94 <line y1="10" x1="90.5" y2="260.5" x2="90.5"/> |
|
95 <line y1="10" x1="100.5" y2="260.5" x2="100.5"/> |
|
96 <line y1="10" x1="110.5" y2="260.5" x2="110.5"/> |
|
97 <line y1="10" x1="120.5" y2="260.5" x2="120.5"/> |
|
98 <line y1="10" x1="130.5" y2="260.5" x2="130.5"/> |
|
99 <line y1="10" x1="140.5" y2="260.5" x2="140.5"/> |
|
100 <line y1="10" x1="150.5" y2="260.5" x2="150.5"/> |
|
101 <line y1="10" x1="160.5" y2="260.5" x2="160.5"/> |
|
102 <line y1="10" x1="170.5" y2="260.5" x2="170.5"/> |
|
103 <line y1="10" x1="180.5" y2="260.5" x2="180.5"/> |
|
104 <line y1="10" x1="190.5" y2="260.5" x2="190.5"/> |
|
105 <line y1="10" x1="200.5" y2="260.5" x2="200.5"/> |
|
106 <line y1="10" x1="210.5" y2="260.5" x2="210.5"/> |
|
107 <line y1="10" x1="220.5" y2="260.5" x2="220.5"/> |
|
108 <line y1="10" x1="230.5" y2="260.5" x2="230.5"/> |
|
109 <line y1="10" x1="240.5" y2="260.5" x2="240.5"/> |
|
110 <line y1="10" x1="250.5" y2="260.5" x2="250.5"/> |
|
111 <line y1="10" x1="260.5" y2="260.5" x2="260.5"/> |
|
112 <line y1="10" x1="270.5" y2="260.5" x2="270.5"/> |
|
113 <line y1="10" x1="280.5" y2="260.5" x2="280.5"/> |
|
114 <line y1="10" x1="290.5" y2="260.5" x2="290.5"/> |
|
115 <line y1="10" x1="300.5" y2="260.5" x2="300.5"/> |
|
116 <line y1="10" x1="310.5" y2="260.5" x2="310.5"/> |
|
117 <line y1="10" x1="320.5" y2="260.5" x2="320.5"/> |
|
118 <line y1="10" x1="330.5" y2="260.5" x2="330.5"/> |
|
119 <line y1="10" x1="340.5" y2="260.5" x2="340.5"/> |
|
120 <line y1="10" x1="350.5" y2="260.5" x2="350.5"/> |
|
121 <line y1="10" x1="360.5" y2="260.5" x2="360.5"/> |
|
122 <line y1="10" x1="370.5" y2="260.5" x2="370.5"/> |
|
123 <line y1="10" x1="380.5" y2="260.5" x2="380.5"/> |
|
124 <line y1="10" x1="390.5" y2="260.5" x2="390.5"/> |
|
125 <line y1="10" x1="400.5" y2="260.5" x2="400.5"/> |
|
126 <line y1="10" x1="410.5" y2="260.5" x2="410.5"/> |
|
127 <line y1="10" x1="420.5" y2="260.5" x2="420.5"/> |
|
128 <line y1="10" x1="430.5" y2="260.5" x2="430.5"/> |
|
129 <line y1="10" x1="440.5" y2="260.5" x2="440.5"/> |
|
130 <line y1="10" x1="450.5" y2="260.5" x2="450.5"/> |
|
131 <line y1="10" x1="460.5" y2="260.5" x2="460.5"/> |
|
132 <line y1="10" x1="470.5" y2="260.5" x2="470.5"/> |
|
133 </g> |
|
134 <!-- ====================================================================== --> |
|
135 <!-- Now, test elementary transforms. For each transform, 3 markers are --> |
|
136 <!-- placed where the user space is expected after transformations for the --> |
|
137 <!-- origin (black) and the points in (20, 0) (blue) and (0, 20) (red). --> |
|
138 <!-- Then, a blue line going from (0, 0) to (20, 0) is drawn and a red line --> |
|
139 <!-- going from (0, 0) to (0, 20), after applying the elementary --> |
|
140 <!-- transformation. If the test succeeds, the red line should join the --> |
|
141 <!-- black marker to the red marker and the blue line the black marker to --> |
|
142 <!-- the blue marker. --> |
|
143 <!-- ====================================================================== --> |
|
144 <g id="elementary-transforms-test" transform="translate(0, 10)"> |
|
145 <g id="elementary-transforms"> |
|
146 <!-- Translate --> |
|
147 <g transform="translate(50, 50)"> |
|
148 <rect x="0" y="0" width="20" height="2" fill="blue" /> |
|
149 <rect x="0" y="0" width="2" height="20" fill="red" /> |
|
150 </g> |
|
151 <!-- Rotate -90 deg about (150, 70) --> |
|
152 <g transform="translate(150, 70) rotate(-90)"> |
|
153 <rect x="0" y="0" width="20" height="2" fill="blue" /> |
|
154 <rect x="0" y="0" width="2" height="20" fill="red" /> |
|
155 </g> |
|
156 <!-- Skew X --> |
|
157 <g transform="translate(250, 50) skewX(45)"> |
|
158 <rect x="0" y="0" width="20" height="2" fill="blue" /> |
|
159 <rect x="0" y="0" width="2" height="20" fill="red" /> |
|
160 </g> |
|
161 <!-- Skew Y --> |
|
162 <g transform="translate(350, 50) skewY(45)"> |
|
163 <rect x="0" y="0" width="20" height="2" fill="blue" /> |
|
164 <rect x="0" y="0" width="2" height="20" fill="red" /> |
|
165 </g> |
|
166 <!-- Scale 2 --> |
|
167 <g transform="translate(210, 120) scale(2)"> |
|
168 <rect x="0" y="0" width="20" height="1" fill="blue" /> |
|
169 <rect x="0" y="0" width="1" height="20" fill="red" /> |
|
170 </g> |
|
171 </g> |
|
172 <!-- elementary-transforms --> |
|
173 <!-- Draw all the markers --> |
|
174 <g id="elementary-transforms-test-markers"> |
|
175 <!-- Translate --> |
|
176 <text x="40" y="40">translate (50, 50)</text> |
|
177 <rect x="48" y="48" width="5" height="5" fill="black" /> |
|
178 <rect x="68" y="48" width="5" height="5" fill="blue" /> |
|
179 <rect x="48" y="68" width="5" height="5" fill="red" /> |
|
180 <!-- Rotate -90 deg about (150, 70) --> |
|
181 <text x="140" y="40">rotate(-90)</text> |
|
182 <rect x="148" y="68" width="5" height="5" fill="black" /> |
|
183 <rect x="148" y="48" width="5" height="5" fill="blue" /> |
|
184 <rect x="168" y="68" width="5" height="5" fill="red" /> |
|
185 <!-- Skew X --> |
|
186 <text x="240" y="40">skew x (45)</text> |
|
187 <rect x="248" y="48" width="5" height="5" fill="black" /> |
|
188 <rect x="268" y="48" width="5" height="5" fill="blue" /> |
|
189 <rect x="268" y="68" width="5" height="5" fill="red" /> |
|
190 <!-- Skew Y --> |
|
191 <text x="340" y="40">skew y (45)</text> |
|
192 <rect x="348" y="48" width="5" height="5" fill="black" /> |
|
193 <rect x="368" y="68" width="5" height="5" fill="blue" /> |
|
194 <rect x="348" y="68" width="5" height="5" fill="red" /> |
|
195 <!-- Scale 2 --> |
|
196 <text x="200" y="110">scale (2)</text> |
|
197 <rect x="208" y="118" width="5" height="5" fill="black" /> |
|
198 <rect x="248" y="118" width="5" height="5" fill="blue" /> |
|
199 <rect x="208" y="158" width="5" height="5" fill="red" /> |
|
200 </g> |
|
201 <!-- elementary-transforms-test-markers --> |
|
202 </g> |
|
203 <g id="nested-transforms-test"> |
|
204 <g id="nested-transforms"> |
|
205 <!-- scale/translate in transform attribute --> |
|
206 <g transform="scale(3, 2) translate(16.666667, 105)"> |
|
207 <rect x="0" y="0" width="20" height="1" fill="blue" /> |
|
208 <rect x="0" y="0" width="0.67" height="20" fill="red" /> |
|
209 </g> |
|
210 <!-- scale/translate in successive elements --> |
|
211 <g transform="translate(200, 0)"> |
|
212 <g transform="scale(3, 2)"> |
|
213 <g transform="translate(16.666667, 105)"> |
|
214 <rect x="0" y="0" width="20" height="1" fill="blue" /> |
|
215 <rect x="0" y="0" width="0.67" height="20" fill="red" /> |
|
216 </g> |
|
217 </g> |
|
218 </g> |
|
219 </g> |
|
220 <!-- nested-transforms --> |
|
221 <g id="nested-transforms-test-markers"> |
|
222 <!-- scale and translate --> |
|
223 <text x="40" y="200">scale(25, 95) and translate(2, 2)</text> |
|
224 <rect x="48" y="208" width="5" height="5" fill="black" /> |
|
225 <rect x="108" y="208" width="5" height="5" fill="blue" /> |
|
226 <rect x="48" y="248" width="5" height="5" fill="red" /> |
|
227 <!-- scale then translate --> |
|
228 <text x="240" y="200">scale(25, 95) then translate(2, 2)</text> |
|
229 <rect x="248" y="208" width="5" height="5" fill="black" /> |
|
230 <rect x="308" y="208" width="5" height="5" fill="blue" /> |
|
231 <rect x="248" y="248" width="5" height="5" fill="red" /> |
|
232 </g> |
|
233 <!-- nested-transforms-test-markers --> |
|
234 </g> |
|
235 <!-- nested-transforms test --> |
|
236 </g> |
|
237 <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.5 $</text> |
|
238 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
|
239 </svg> |
|
240 |