1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: matrix3d.hxx,v $
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>
40 /*************************************************************************
42 |* 3D-Transformationsmatrix, bestehend aus 3 Zeilenvektoren und
43 |* einem Spaltenvektor, der die Translation enthaelt:
46 |* M = |V21 V22 C33 T2|
49 |* Vektortransformation durch Postmultiplikation mit Spaltenvektoren:
51 |* Matrixverkettung per Postmultiplikation mit Transformation oder
53 |* M' = [T,S,Rxyz] * M oder
56 \************************************************************************/
62 Vector3D aTranslation
;
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
&);
80 Old_Matrix3D
operator=(const Matrix4D
&);
83 }//end of namespace binfilter