1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include "LabelPositionHelper.hxx"
23 #include <com/sun/star/awt/Point.hpp>
28 class PolarPlottingPositionHelper
;
30 class PolarLabelPositionHelper final
: public LabelPositionHelper
33 PolarLabelPositionHelper(
34 PolarPlottingPositionHelper
* pPosHelper
35 , sal_Int32 nDimensionCount
36 , const rtl::Reference
<SvxShapeGroupAnyD
>& xLogicTarget
);
37 virtual ~PolarLabelPositionHelper() override
;
39 css::awt::Point
getLabelScreenPositionAndAlignmentForLogicValues(
40 LabelAlignment
& rAlignment
41 , double fLogicValueOnAngleAxis
42 , double fLogicValueOnRadiusAxis
44 , sal_Int32 nScreenValueOffsetInRadiusDirection
) const;
46 /** Calculate the anchor point position for a text label.
47 * When the requested label placement is of `INSIDE` or `OUTSIDE` type the
48 * returned anchor point for the text label is the middle point of the
49 * outer arc for the given slice; when the requested label placement is of
50 * `CENTER` type the returned anchor point for the text label is the
51 * middle point of the line segment bisecting the slice.
52 * The text alignment is always centered when the requested label
53 * placement is of `CENTER` type else it is dependent on the value of the
54 * angle defined by the horizontal axis and the ray bisecting the slice.
57 css::awt::Point
getLabelScreenPositionAndAlignmentForUnitCircleValues(
58 LabelAlignment
& rAlignment
, sal_Int32 nLabelPlacement
/*see css::chart::DataLabelPlacement*/
59 , double fUnitCircleStartAngleDegree
, double fUnitCircleWidthAngleDegree
60 , double fUnitCircleInnerRadius
, double fUnitCircleOuterRadius
62 , sal_Int32 nScreenValueOffsetInRadiusDirection
63 , const ::basegfx::B3DVector
& aOffset
= ::basegfx::B3DVector()) const;
66 PolarPlottingPositionHelper
* m_pPosHelper
;
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */