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