1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_geometry_AffineMatrix3D_idl__
28#define __com_sun_star_geometry_AffineMatrix3D_idl__
29
30module com {  module sun {  module star {  module geometry {
31
32/** This structure defines a 3 by 4 affine matrix.<p>
33
34    The matrix defined by this structure constitutes an affine mapping
35    of a point in 3D to another point in 3D. The last line of a
36    complete 4 by 4 matrix is omitted, since it is implicitely assumed
37    to be [0,0,0,1].<p>
38
39    An affine mapping, as performed by this matrix, can be written out
40    as follows, where <code>xs, ys</code> and <code>zs</code> are the source, and
41    <code>xd, yd</code> and <code>zd</code> the corresponding result coordinates:
42
43    <code>
44    	xd = m00*xs + m01*ys + m02*zs + m03;
45    	yd = m10*xs + m11*ys + m12*zs + m13;
46    	zd = m20*xs + m21*ys + m22*zs + m23;
47    </code><p>
48
49    Thus, in common matrix language, with M being the
50    <type>AffineMatrix3D</type> and vs=[xs,ys,zs]^T, vd=[xd,yd,zd]^T two 3D
51    vectors, the affine transformation is written as
52    vd=M*vs. Concatenation of transformations amounts to
53    multiplication of matrices, i.e. a translation, given by T,
54    followed by a rotation, given by R, is expressed as vd=R*(T*vs) in
55    the above notation. Since matrix multiplication is associative,
56    this can be shortened to vd=(R*T)*vs=M'*vs. Therefore, a set of
57    consecutive transformations can be accumulated into a single
58    AffineMatrix3D, by multiplying the current transformation with the
59    additional transformation from the left.<p>
60
61    Due to this transformational approach, all geometry data types are
62    points in abstract integer or real coordinate spaces, without any
63    physical dimensions attached to them. This physical measurement
64    units are typically only added when using these data types to
65    render something onto a physical output device. For 3D coordinates
66	there is also a projection from 3D to 2D device coordiantes needed.
67	Only then the total transformation matrix (oncluding projection to 2D)
68	and the device resolution determine the actual measurement unit in 3D.<p>
69
70    @since OOo 2.0
71 */
72struct AffineMatrix3D
73{
74    /// The top, left matrix entry.
75    double m00;
76
77    /// The top, left middle matrix entry.
78    double m01;
79
80    /// The top, right middle matrix entry.
81    double m02;
82
83    /// The top, right matrix entry.
84    double m03;
85
86    /// The middle, left matrix entry.
87    double m10;
88
89    /// The middle, middle left matrix entry.
90    double m11;
91
92    /// The middle, middle right matrix entry.
93    double m12;
94
95    /// The middle, right matrix entry.
96    double m13;
97
98    /// The bottom, left matrix entry.
99    double m20;
100
101    /// The bottom, middle left matrix entry.
102    double m21;
103
104    /// The bottom, middle right matrix entry.
105    double m22;
106
107    /// The bottom, right matrix entry.
108    double m23;
109};
110
111}; }; }; };
112
113#endif
114