1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_geometry_AffineMatrix3D_idl__
24#define __com_sun_star_geometry_AffineMatrix3D_idl__
25
26module com {  module sun {  module star {  module geometry {
27
28/** This structure defines a 3 by 4 affine matrix.<p>
29
30    The matrix defined by this structure constitutes an affine mapping
31    of a point in 3D to another point in 3D. The last line of a
32    complete 4 by 4 matrix is omitted, since it is implicitly assumed
33    to be [0,0,0,1].<p>
34
35    An affine mapping, as performed by this matrix, can be written out
36    as follows, where <code>xs, ys</code> and <code>zs</code> are the source, and
37    <code>xd, yd</code> and <code>zd</code> the corresponding result coordinates:
38
39    <code>
40    	xd = m00*xs + m01*ys + m02*zs + m03;
41    	yd = m10*xs + m11*ys + m12*zs + m13;
42    	zd = m20*xs + m21*ys + m22*zs + m23;
43    </code><p>
44
45    Thus, in common matrix language, with M being the
46    <type>AffineMatrix3D</type> and vs=[xs,ys,zs]^T, vd=[xd,yd,zd]^T two 3D
47    vectors, the affine transformation is written as
48    vd=M*vs. Concatenation of transformations amounts to
49    multiplication of matrices, i.e. a translation, given by T,
50    followed by a rotation, given by R, is expressed as vd=R*(T*vs) in
51    the above notation. Since matrix multiplication is associative,
52    this can be shortened to vd=(R*T)*vs=M'*vs. Therefore, a set of
53    consecutive transformations can be accumulated into a single
54    AffineMatrix3D, by multiplying the current transformation with the
55    additional transformation from the left.<p>
56
57    Due to this transformational approach, all geometry data types are
58    points in abstract integer or real coordinate spaces, without any
59    physical dimensions attached to them. This physical measurement
60    units are typically only added when using these data types to
61    render something onto a physical output device. For 3D coordinates
62	there is also a projection from 3D to 2D device coordiantes needed.
63	Only then the total transformation matrix (oncluding projection to 2D)
64	and the device resolution determine the actual measurement unit in 3D.<p>
65
66    @since OpenOffice 2.0
67 */
68struct AffineMatrix3D
69{
70    /// The top, left matrix entry.
71    double m00;
72
73    /// The top, left middle matrix entry.
74    double m01;
75
76    /// The top, right middle matrix entry.
77    double m02;
78
79    /// The top, right matrix entry.
80    double m03;
81
82    /// The middle, left matrix entry.
83    double m10;
84
85    /// The middle, middle left matrix entry.
86    double m11;
87
88    /// The middle, middle right matrix entry.
89    double m12;
90
91    /// The middle, right matrix entry.
92    double m13;
93
94    /// The bottom, left matrix entry.
95    double m20;
96
97    /// The bottom, middle left matrix entry.
98    double m21;
99
100    /// The bottom, middle right matrix entry.
101    double m22;
102
103    /// The bottom, right matrix entry.
104    double m23;
105};
106
107}; }; }; };
108
109#endif
110