Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svx / matrix3d.hxx
blobc61e3e67930bb9310b00c13910f3a574ff599b78
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: matrix3d.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVX_MATRIX3D_HXX
32 #define _SVX_MATRIX3D_HXX
34 #ifndef _B3D_HMATRIX_HXX
35 #include <bf_goodies/hmatrix.hxx>
36 #endif
38 namespace binfilter {
40 /*************************************************************************
42 |* 3D-Transformationsmatrix, bestehend aus 3 Zeilenvektoren und
43 |* einem Spaltenvektor, der die Translation enthaelt:
45 |* |V11 V12 V13 T1|
46 |* M = |V21 V22 C33 T2|
47 |* |V31 V32 V33 T3|
49 |* Vektortransformation durch Postmultiplikation mit Spaltenvektoren:
50 |* V' = M * V
51 |* Matrixverkettung per Postmultiplikation mit Transformation oder
52 |* anderer Matrix:
53 |* M' = [T,S,Rxyz] * M oder
54 |* M' = M2 * M
56 \************************************************************************/
58 class Old_Matrix3D
60 protected:
61 Vector3D M[3];
62 Vector3D aTranslation;
64 public:
65 // default: Einheitsmatrix erstellen (Vektoren sind auf 0 initialisiert)
66 Old_Matrix3D() { M[0][0] = M[1][1] = M[2][2] = 1; }
68 // Zeilenvektor zurueckgeben
69 Vector3D& operator[](int nPos) { return M[nPos]; }
70 const Vector3D& operator[](int nPos) const { return M[nPos]; }
72 // Spaltenvektor zurueckgeben
73 Vector3D GetColumnVector(int nCol) const
74 { return Vector3D(M[0][nCol], M[1][nCol], M[2][nCol]); }
76 friend SvStream& operator>>(SvStream& rIStream, Old_Matrix3D&);
77 friend SvStream& operator<<(SvStream& rOStream, const Old_Matrix3D&);
79 operator Matrix4D();
80 Old_Matrix3D operator=(const Matrix4D&);
83 }//end of namespace binfilter
84 #endif