testtools, wizards, xmlsecurity: fix issues found by Ruff linter
[libreoffice.git] / chart2 / source / inc / ThreeDHelper.hxx
blob2c43fff6c71aa741edf9381223dcd944ba03184b
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 .
20 #pragma once
22 #include <config_options.h>
23 #include <com/sun/star/drawing/CameraGeometry.hpp>
24 #include <rtl/ref.hxx>
25 #include "charttoolsdllapi.hxx"
27 namespace com::sun::star::beans { class XPropertySet; }
28 namespace com::sun::star::chart2 { class XDiagram; }
30 namespace chart
32 class Diagram;
34 enum class ThreeDLookScheme
36 ThreeDLookScheme_Simple,
37 ThreeDLookScheme_Realistic,
38 ThreeDLookScheme_Unknown
41 enum CuboidPlanePosition
43 CuboidPlanePosition_Left,
44 CuboidPlanePosition_Right,
45 CuboidPlanePosition_Top,
46 CuboidPlanePosition_Bottom,
47 CuboidPlanePosition_Front,
48 CuboidPlanePosition_Back
51 class UNLESS_MERGELIBS(OOO_DLLPUBLIC_CHARTTOOLS) ThreeDHelper
53 public:
55 /** Returns the default camera geometry that is set in the Diagram CTOR.
56 This is not the property default!
58 @todo deprecate the hard set camera geometry and use the property
59 default
61 static css::drawing::CameraGeometry getDefaultCameraGeometry( bool bPie=false );
63 static void adaptRadAnglesForRightAngledAxes( double& rfXAngleRad, double& rfYAngleRad );
64 static double getXDegreeAngleLimitForRightAngledAxes() { return 90.0; }
65 static double getYDegreeAngleLimitForRightAngledAxes() { return 45.0; }
67 static double getValueClippedToRange( double fValue, const double& fPositivLimit );
69 static void convertElevationRotationDegToXYZAngleRad(
70 sal_Int32 nElevationDeg, sal_Int32 nRotationDeg
71 , double& rfXAngleRad, double& rfYAngleRad, double& rfZAngleRad );
73 SAL_DLLPRIVATE static void convertXYZAngleRadToElevationRotationDeg(
74 sal_Int32& rnElevationDeg, sal_Int32& rnRotationDeg
75 , double fXRad, double fYRad, double fZRad );
77 SAL_DLLPRIVATE static void ensureCameraDistanceRange( double& rfCameraDistance );
78 SAL_DLLPRIVATE static void getCameraDistanceRange( double& rfMinimumDistance, double& rfMaximumDistance );
80 static double CameraDistanceToPerspective( double fCameraDistance );
81 static double PerspectiveToCameraDistance( double fPerspective );
83 static CuboidPlanePosition getAutomaticCuboidPlanePositionForStandardLeftWall( const rtl::Reference<
84 ::chart::Diagram >& xDiagram );
85 static CuboidPlanePosition getAutomaticCuboidPlanePositionForStandardBackWall(const rtl::Reference<
86 ::chart::Diagram >& xDiagram );
87 static CuboidPlanePosition getAutomaticCuboidPlanePositionForStandardBottom(const rtl::Reference<
88 ::chart::Diagram >& xDiagram );
90 //sal_Int32 nRoundedEdges: <0 or >100 -> mixed state
91 //sal_Int32 nObjectLines: 0->no lines; 1->all lines on; other->mixed state
93 static void getRoundedEdgesAndObjectLines( const rtl::Reference< ::chart::Diagram >& xDiagram
94 , sal_Int32& rnRoundedEdges, sal_Int32& rnObjectLines );
95 static void setRoundedEdgesAndObjectLines( const rtl::Reference< ::chart::Diagram >& xDiagram
96 , sal_Int32 nRoundedEdges, sal_Int32 nObjectLines );
99 } //namespace chart
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */