Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / geometry / AffineMatrix3D.idl
blob4602907c3452f01dea3ed90edcbdeee8509aa225
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_geometry_AffineMatrix3D_idl__
20 #define __com_sun_star_geometry_AffineMatrix3D_idl__
22 module com { module sun { module star { module geometry {
24 /** This structure defines a 3 by 4 affine matrix.<p>
26 The matrix defined by this structure constitutes an affine mapping
27 of a point in 3D to another point in 3D. The last line of a
28 complete 4 by 4 matrix is omitted, since it is implicitly assumed
29 to be [0,0,0,1].<p>
31 An affine mapping, as performed by this matrix, can be written out
32 as follows, where <code>xs, ys</code> and <code>zs</code> are the source, and
33 <code>xd, yd</code> and <code>zd</code> the corresponding result coordinates:
35 <code>
36 xd = m00*xs + m01*ys + m02*zs + m03;
37 yd = m10*xs + m11*ys + m12*zs + m13;
38 zd = m20*xs + m21*ys + m22*zs + m23;
39 </code><p>
41 Thus, in common matrix language, with M being the
42 AffineMatrix3D and vs=[xs,ys,zs]^T, vd=[xd,yd,zd]^T two 3D
43 vectors, the affine transformation is written as
44 vd=M*vs. Concatenation of transformations amounts to
45 multiplication of matrices, i.e. a translation, given by T,
46 followed by a rotation, given by R, is expressed as vd=R*(T*vs) in
47 the above notation. Since matrix multiplication is associative,
48 this can be shortened to vd=(R*T)*vs=M'*vs. Therefore, a set of
49 consecutive transformations can be accumulated into a single
50 AffineMatrix3D, by multiplying the current transformation with the
51 additional transformation from the left.<p>
53 Due to this transformational approach, all geometry data types are
54 points in abstract integer or real coordinate spaces, without any
55 physical dimensions attached to them. This physical measurement
56 units are typically only added when using these data types to
57 render something onto a physical output device. For 3D coordinates
58 there is also a projection from 3D to 2D device coordinates needed.
59 Only then the total transformation matrix (including projection to 2D)
60 and the device resolution determine the actual measurement unit in 3D.<p>
62 @since OOo 2.0
64 struct AffineMatrix3D
66 /// The top, left matrix entry.
67 double m00;
69 /// The top, left middle matrix entry.
70 double m01;
72 /// The top, right middle matrix entry.
73 double m02;
75 /// The top, right matrix entry.
76 double m03;
78 /// The middle, left matrix entry.
79 double m10;
81 /// The middle, middle left matrix entry.
82 double m11;
84 /// The middle, middle right matrix entry.
85 double m12;
87 /// The middle, right matrix entry.
88 double m13;
90 /// The bottom, left matrix entry.
91 double m20;
93 /// The bottom, middle left matrix entry.
94 double m21;
96 /// The bottom, middle right matrix entry.
97 double m22;
99 /// The bottom, right matrix entry.
100 double m23;
103 }; }; }; };
105 #endif
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */