Avoid potential negative array index access to cached text.
[LibreOffice.git] / chart2 / source / inc / BaseGFXHelper.hxx
blob18481031e2ef3c80c92d6ad8afd12e6b3dc81dff
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 #pragma once
21 #include <basegfx/matrix/b3dhommatrix.hxx>
22 #include <basegfx/range/b2irectangle.hxx>
23 #include <basegfx/tuple/b3dtuple.hxx>
24 #include <basegfx/vector/b3dvector.hxx>
25 #include <basegfx/range/b3drange.hxx>
26 #include <com/sun/star/awt/Point.hpp>
27 #include <com/sun/star/awt/Size.hpp>
28 #include <com/sun/star/drawing/HomogenMatrix.hpp>
29 #include <com/sun/star/drawing/Direction3D.hpp>
30 #include <com/sun/star/drawing/Position3D.hpp>
31 #include "charttoolsdllapi.hxx"
33 namespace com::sun::star::awt { struct Rectangle; }
34 namespace com::sun::star::drawing { struct PolyPolygonShape3D; }
36 namespace chart::BaseGFXHelper
39 OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DRange getBoundVolume( const css::drawing::PolyPolygonShape3D& rPolyPoly );
41 OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DRange getBoundVolume( const std::vector<std::vector<css::drawing::Position3D>>& rPolyPoly );
43 OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B2IRectangle makeRectangle(
44 const css::awt::Point& rPosition,
45 const css::awt::Size& rSize );
47 OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B2IRectangle makeRectangle( const css::awt::Rectangle& rRect );
49 OOO_DLLPUBLIC_CHARTTOOLS css::awt::Point B2IRectangleToAWTPoint(
50 const ::basegfx::B2IRectangle& rB2IRectangle );
52 OOO_DLLPUBLIC_CHARTTOOLS css::awt::Size B2IRectangleToAWTSize(
53 const ::basegfx::B2IRectangle& rB2IRectangle );
55 OOO_DLLPUBLIC_CHARTTOOLS css::awt::Rectangle toAwtRectangle(const basegfx::B2IRectangle& rB2IRectangle);
57 ::basegfx::B3DVector Direction3DToB3DVector(
58 const css::drawing::Direction3D& rDirection );
60 css::drawing::Direction3D B3DVectorToDirection3D(
61 const ::basegfx::B3DVector& rB3DVector );
63 ::basegfx::B3DVector Position3DToB3DVector(
64 const css::drawing::Position3D& rPosition );
66 css::drawing::Position3D B3DVectorToPosition3D(
67 const ::basegfx::B3DVector& rB3DVector );
69 OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DHomMatrix HomogenMatrixToB3DHomMatrix(
70 const css::drawing::HomogenMatrix & rHomogenMatrix );
72 OOO_DLLPUBLIC_CHARTTOOLS
73 css::drawing::HomogenMatrix B3DHomMatrixToHomogenMatrix(
74 const ::basegfx::B3DHomMatrix & rB3DMatrix );
76 OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DTuple GetRotationFromMatrix(
77 const ::basegfx::B3DHomMatrix & rB3DMatrix );
79 OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DTuple GetScaleFromMatrix(
80 const ::basegfx::B3DHomMatrix & rB3DMatrix );
82 void ReduceToRotationMatrix( ::basegfx::B3DHomMatrix & rB3DMatrix );
84 } // namespace chart::BaseGFXHelper
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */