Coverage Report

Created: 2025-12-31 10:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/chart2/source/inc/ThreeDHelper.hxx
Line
Count
Source
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 <com/sun/star/drawing/CameraGeometry.hpp>
23
#include <rtl/ref.hxx>
24
25
namespace chart
26
{
27
class Diagram;
28
29
enum class ThreeDLookScheme
30
{
31
    ThreeDLookScheme_Simple,
32
    ThreeDLookScheme_Realistic,
33
    ThreeDLookScheme_Unknown
34
};
35
36
enum CuboidPlanePosition
37
{
38
    CuboidPlanePosition_Left,
39
    CuboidPlanePosition_Right,
40
    CuboidPlanePosition_Top,
41
    CuboidPlanePosition_Bottom,
42
    CuboidPlanePosition_Front,
43
    CuboidPlanePosition_Back
44
};
45
46
class ThreeDHelper
47
{
48
public:
49
50
    /** Returns the default camera geometry that is set in the Diagram CTOR.
51
        This is not the property default!
52
53
        @todo deprecate the hard set camera geometry and use the property
54
              default
55
     */
56
    static css::drawing::CameraGeometry getDefaultCameraGeometry( bool bPie=false );
57
58
    static void adaptRadAnglesForRightAngledAxes( double& rfXAngleRad, double& rfYAngleRad );
59
0
    static double getXDegreeAngleLimitForRightAngledAxes() { return 90.0; }
60
0
    static double getYDegreeAngleLimitForRightAngledAxes() { return 45.0; }
61
62
    static double getValueClippedToRange( double fValue, const double& fPositivLimit );
63
64
    static void convertElevationRotationDegToXYZAngleRad(
65
        sal_Int32 nElevationDeg, sal_Int32 nRotationDeg
66
        , double& rfXAngleRad, double& rfYAngleRad, double& rfZAngleRad );
67
68
    static void convertXYZAngleRadToElevationRotationDeg(
69
        sal_Int32& rnElevationDeg, sal_Int32& rnRotationDeg
70
        , double fXRad, double fYRad, double fZRad );
71
72
    static void ensureCameraDistanceRange( double& rfCameraDistance );
73
    static void getCameraDistanceRange( double& rfMinimumDistance, double& rfMaximumDistance );
74
75
    static double CameraDistanceToPerspective( double fCameraDistance );
76
    static double PerspectiveToCameraDistance( double fPerspective );
77
78
    static CuboidPlanePosition getAutomaticCuboidPlanePositionForStandardLeftWall( const rtl::Reference<
79
            ::chart::Diagram >& xDiagram );
80
    static CuboidPlanePosition getAutomaticCuboidPlanePositionForStandardBackWall(const rtl::Reference<
81
            ::chart::Diagram >& xDiagram );
82
    static CuboidPlanePosition getAutomaticCuboidPlanePositionForStandardBottom(const rtl::Reference<
83
            ::chart::Diagram >& xDiagram );
84
85
    //sal_Int32 nRoundedEdges:  <0 or >100 -> mixed state
86
    //sal_Int32 nObjectLines:  0->no lines; 1->all lines on; other->mixed state
87
88
    static void getRoundedEdgesAndObjectLines( const rtl::Reference< ::chart::Diagram >& xDiagram
89
            , sal_Int32& rnRoundedEdges, sal_Int32& rnObjectLines );
90
    static void setRoundedEdgesAndObjectLines( const rtl::Reference< ::chart::Diagram >& xDiagram
91
            , sal_Int32 nRoundedEdges, sal_Int32 nObjectLines );
92
};
93
94
} //namespace chart
95
96
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */