1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
20 #include <basegfx/matrix/b3dhommatrixtools.hxx>
21 #include <com/sun/star/drawing/HomogenMatrix.hpp>
23 namespace basegfx::utils
25 B3DHomMatrix
UnoHomogenMatrixToB3DHomMatrix(const css::drawing::HomogenMatrix
& rMatrixIn
)
29 aRetval
.set(0, 0, rMatrixIn
.Line1
.Column1
);
30 aRetval
.set(0, 1, rMatrixIn
.Line1
.Column2
);
31 aRetval
.set(0, 2, rMatrixIn
.Line1
.Column3
);
32 aRetval
.set(0, 3, rMatrixIn
.Line1
.Column4
);
33 aRetval
.set(1, 0, rMatrixIn
.Line2
.Column1
);
34 aRetval
.set(1, 1, rMatrixIn
.Line2
.Column2
);
35 aRetval
.set(1, 2, rMatrixIn
.Line2
.Column3
);
36 aRetval
.set(1, 3, rMatrixIn
.Line2
.Column4
);
37 aRetval
.set(2, 0, rMatrixIn
.Line3
.Column1
);
38 aRetval
.set(2, 1, rMatrixIn
.Line3
.Column2
);
39 aRetval
.set(2, 2, rMatrixIn
.Line3
.Column3
);
40 aRetval
.set(2, 3, rMatrixIn
.Line3
.Column4
);
41 aRetval
.set(3, 0, rMatrixIn
.Line4
.Column1
);
42 aRetval
.set(3, 1, rMatrixIn
.Line4
.Column2
);
43 aRetval
.set(3, 2, rMatrixIn
.Line4
.Column3
);
44 aRetval
.set(3, 3, rMatrixIn
.Line4
.Column4
);
49 void B3DHomMatrixToUnoHomogenMatrix(const B3DHomMatrix
& rMatrixIn
,
50 css::drawing::HomogenMatrix
& rMatrixOut
)
52 rMatrixOut
.Line1
.Column1
= rMatrixIn
.get(0, 0);
53 rMatrixOut
.Line1
.Column2
= rMatrixIn
.get(0, 1);
54 rMatrixOut
.Line1
.Column3
= rMatrixIn
.get(0, 2);
55 rMatrixOut
.Line1
.Column4
= rMatrixIn
.get(0, 3);
56 rMatrixOut
.Line2
.Column1
= rMatrixIn
.get(1, 0);
57 rMatrixOut
.Line2
.Column2
= rMatrixIn
.get(1, 1);
58 rMatrixOut
.Line2
.Column3
= rMatrixIn
.get(1, 2);
59 rMatrixOut
.Line2
.Column4
= rMatrixIn
.get(1, 3);
60 rMatrixOut
.Line3
.Column1
= rMatrixIn
.get(2, 0);
61 rMatrixOut
.Line3
.Column2
= rMatrixIn
.get(2, 1);
62 rMatrixOut
.Line3
.Column3
= rMatrixIn
.get(2, 2);
63 rMatrixOut
.Line3
.Column4
= rMatrixIn
.get(2, 3);
64 rMatrixOut
.Line4
.Column1
= rMatrixIn
.get(3, 0);
65 rMatrixOut
.Line4
.Column2
= rMatrixIn
.get(3, 1);
66 rMatrixOut
.Line4
.Column3
= rMatrixIn
.get(3, 2);
67 rMatrixOut
.Line4
.Column4
= rMatrixIn
.get(3, 3);
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */