LibreOffice Module basegfx (master)
1
include
basegfx
matrix
b3dhommatrix.hxx
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
* This file is part of the LibreOffice project.
4
*
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/.
8
*
9
* This file incorporates work covered by the following license notice:
10
*
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 .
18
*/
19
20
#pragma once
21
22
#include <
sal/types.h
>
23
#include <
basegfx/point/b3dpoint.hxx
>
24
#include <
basegfx/vector/b3dvector.hxx
>
25
#include <
o3tl/cow_wrapper.hxx
>
26
#include <
basegfx/basegfxdllapi.h
>
27
28
namespace
basegfx
29
{
30
class
B3DTuple;
31
class
Impl3DHomMatrix;
32
33
class
BASEGFX_DLLPUBLIC
B3DHomMatrix
34
{
35
public
:
36
typedef
o3tl::cow_wrapper< Impl3DHomMatrix, o3tl::ThreadSafeRefCountingPolicy >
ImplType
;
37
38
private
:
39
ImplType
mpImpl
;
40
41
public
:
42
B3DHomMatrix
();
43
B3DHomMatrix
(
const
B3DHomMatrix
& rMat);
44
B3DHomMatrix
(
B3DHomMatrix
&& rMat);
45
~B3DHomMatrix
();
46
47
double
get
(sal_uInt16 nRow, sal_uInt16 nColumn)
const
;
48
void
set
(sal_uInt16 nRow, sal_uInt16 nColumn,
double
fValue);
49
50
// test if last line is default to see if last line needs to be
51
// involved in calculations
52
bool
isLastLineDefault()
const
;
53
54
bool
isIdentity()
const
;
56
void
identity();
57
59
void
invert();
60
62
double
determinant()
const
;
63
65
void
rotate
(
double
fAngleX,
double
fAngleY,
double
fAngleZ);
66
void
rotate
(
const
B3DTuple
& rRotation);
67
69
void
translate(
double
fX,
double
fY,
double
fZ);
70
void
translate(
const
B3DTuple
& rTranslation);
71
73
void
scale
(
double
fX,
double
fY,
double
fZ);
74
void
scale
(
const
B3DTuple
& rScale);
75
76
// Shearing-Matrices
77
void
shearXY(
double
fSx,
double
fSy);
78
void
shearXZ(
double
fSx,
double
fSz);
79
80
// Projection matrices, used for converting between eye and
81
// clip coordinates
82
void
frustum(
double
fLeft = -1.0,
double
fRight = 1.0,
83
double
fBottom = -1.0,
double
fTop = 1.0,
84
double
fNear = 0.001,
double
fFar = 1.0);
85
86
void
ortho(
double
fLeft = -1.0,
double
fRight = 1.0,
87
double
fBottom = -1.0,
double
fTop = 1.0,
88
double
fNear = 0.0,
double
fFar = 1.0);
89
90
// build orientation matrix
91
void
orientation
(
92
const
B3DPoint
& rVRP =
B3DPoint
(0.0,0.0,1.0),
93
B3DVector
aVPN =
B3DVector
(0.0,0.0,1.0),
94
B3DVector
aVUV =
B3DVector
(0.0,1.0,0.0));
95
96
// addition, subtraction
97
B3DHomMatrix
&
operator+=
(
const
B3DHomMatrix
& rMat);
98
B3DHomMatrix
&
operator-=
(
const
B3DHomMatrix
& rMat);
99
100
// comparison
101
bool
operator==
(
const
B3DHomMatrix
& rMat)
const
;
102
bool
operator!=
(
const
B3DHomMatrix
& rMat)
const
;
103
104
// multiplication, division by constant value
105
B3DHomMatrix
&
operator*=
(
double
fValue);
106
B3DHomMatrix
& operator/=(
double
fValue);
107
108
// matrix multiplication (from the left)
109
B3DHomMatrix
&
operator*=
(
const
B3DHomMatrix
& rMat);
110
111
// assignment operator
112
B3DHomMatrix
&
operator=
(
const
B3DHomMatrix
& rMat);
113
B3DHomMatrix
&
operator=
(
B3DHomMatrix
&& rMat);
114
115
// decomposition
116
void
decompose
(
B3DTuple
& rScale,
B3DTuple
& rTranslate,
B3DTuple
& rRotate,
B3DTuple
& rShear)
const
;
117
};
118
119
inline
B3DHomMatrix
operator*
(
const
B3DHomMatrix
& rMatA,
const
B3DHomMatrix
& rMatB)
120
{
121
B3DHomMatrix
aMul(rMatB);
122
aMul *= rMatA;
123
return
aMul;
124
}
125
}
// end of namespace basegfx
126
127
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
b3dpoint.hxx
b3dvector.hxx
basegfxdllapi.h
BASEGFX_DLLPUBLIC
#define BASEGFX_DLLPUBLIC
Definition:
basegfxdllapi.h:35
basegfx::B3DHomMatrix
Definition:
b3dhommatrix.hxx:34
basegfx::B3DHomMatrix::operator=
B3DHomMatrix & operator=(const B3DHomMatrix &rMat)
basegfx::B3DHomMatrix::B3DHomMatrix
B3DHomMatrix(const B3DHomMatrix &rMat)
basegfx::B3DHomMatrix::mpImpl
ImplType mpImpl
Definition:
b3dhommatrix.hxx:39
basegfx::B3DHomMatrix::ImplType
o3tl::cow_wrapper< Impl3DHomMatrix, o3tl::ThreadSafeRefCountingPolicy > ImplType
Definition:
b3dhommatrix.hxx:36
basegfx::B3DHomMatrix::B3DHomMatrix
B3DHomMatrix()
basegfx::B3DHomMatrix::~B3DHomMatrix
~B3DHomMatrix()
basegfx::B3DHomMatrix::B3DHomMatrix
B3DHomMatrix(B3DHomMatrix &&rMat)
basegfx::B3DHomMatrix::operator=
B3DHomMatrix & operator=(B3DHomMatrix &&rMat)
basegfx::B3DPoint
Base Point class with three double values.
Definition:
b3dpoint.hxx:38
basegfx::B3DTuple
Base class for all Points/Vectors with three double values.
Definition:
b3dtuple.hxx:40
basegfx::B3DVector
Base Point class with three double values.
Definition:
b3dvector.hxx:38
o3tl::cow_wrapper< Impl3DHomMatrix, o3tl::ThreadSafeRefCountingPolicy >
cow_wrapper.hxx
rotate
def rotate(shapename, deg)
basegfx
basegfx::operator*
B2DPoint operator*(const ::basegfx::B2DHomMatrix &rMat, const B2DPoint &rPoint)
Definition:
b2dpoint.cxx:43
set
void set(css::uno::UnoInterfaceReference const &value)
decompose
rtl::OString decompose(rtl::OString const &type, sal_Int32 *rank=nullptr, std::vector< rtl::OString > *arguments=nullptr)
orientation
orientation
get
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
scale
sal_Int32 scale
operator-=
timeval & operator-=(timeval &t1, const timeval &t2)
operator+=
TOOLS_DLLPUBLIC tools::Rectangle & operator+=(tools::Rectangle &rRect, const SvBorder &rBorder)
types.h
operator*=
SmFace & operator*=(SmFace &rFace, const Fraction &rFrac)
operator!=
bool operator!=(const XclExpString &rLeft, const XclExpString &rRight)
operator==
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)
Generated on Sun Jul 30 2023 04:29:58 for LibreOffice Module basegfx (master) by
1.9.3