25#include <com/sun/star/chart/DataLabelPlacement.hpp>
34 , sal_Int32 nDimensionCount
37 , m_pPosHelper(pPosHelper)
47 ,
double fLogicValueOnAngleAxis
48 ,
double fLogicValueOnRadiusAxis
50 , sal_Int32 nScreenValueOffsetInRadiusDirection )
const
56 rAlignment, css::chart::DataLabelPlacement::OUTSIDE
57 , fUnitCircleAngleDegree, 0.0
58 , fUnitCircleRadius, fUnitCircleRadius, fLogicZ, nScreenValueOffsetInRadiusDirection );
63 ,
double fUnitCircleStartAngleDegree,
double fUnitCircleWidthAngleDegree
64 ,
double fUnitCircleInnerRadius,
double fUnitCircleOuterRadius
66 , sal_Int32 nScreenValueOffsetInRadiusDirection )
const
68 bool bCenter = (nLabelPlacement != css::chart::DataLabelPlacement::OUTSIDE)
69 && (nLabelPlacement != css::chart::DataLabelPlacement::INSIDE);
71 double fAngleDegree = fUnitCircleStartAngleDegree + fUnitCircleWidthAngleDegree/2.0;
74 fRadius = fUnitCircleOuterRadius;
76 fRadius = fUnitCircleInnerRadius + (fUnitCircleOuterRadius-fUnitCircleInnerRadius)/2.0 ;
81 if(
m_nDimensionCount==3 && nLabelPlacement == css::chart::DataLabelPlacement::OUTSIDE)
103 double fDX = aRet.X-aP0.X;
104 double fDY = aRet.Y-aP0.Y;
113 while (fAngleDegree > 360.0)
114 fAngleDegree -= 360.0;
115 while (fAngleDegree < 0.0)
116 fAngleDegree += 360.0;
118 bool bOutside = nLabelPlacement == css::chart::DataLabelPlacement::OUTSIDE;
120 if (fAngleDegree <= 5 || fAngleDegree >= 355)
122 else if (fAngleDegree < 85)
124 else if (fAngleDegree <= 95)
126 else if (fAngleDegree < 175)
128 else if (fAngleDegree <= 185)
130 else if (fAngleDegree < 265)
132 else if (fAngleDegree <= 275)
143 if( nScreenValueOffsetInRadiusDirection != 0)
148 aDirection.setLength(nScreenValueOffsetInRadiusDirection);
css::awt::Point transformSceneToScreenPosition(const css::drawing::Position3D &rScenePosition3D) const
sal_Int32 m_nDimensionCount
PolarLabelPositionHelper(PolarPlottingPositionHelper *pPosHelper, sal_Int32 nDimensionCount, const rtl::Reference< SvxShapeGroupAnyD > &xLogicTarget)
virtual ~PolarLabelPositionHelper() override
PolarPlottingPositionHelper * m_pPosHelper
css::awt::Point getLabelScreenPositionAndAlignmentForUnitCircleValues(LabelAlignment &rAlignment, sal_Int32 nLabelPlacement, double fUnitCircleStartAngleDegree, double fUnitCircleWidthAngleDegree, double fUnitCircleInnerRadius, double fUnitCircleOuterRadius, double fLogicZ, sal_Int32 nScreenValueOffsetInRadiusDirection) const
Calculate the anchor point position for a text label.
css::awt::Point getLabelScreenPositionAndAlignmentForLogicValues(LabelAlignment &rAlignment, double fLogicValueOnAngleAxis, double fLogicValueOnRadiusAxis, double fLogicZ, sal_Int32 nScreenValueOffsetInRadiusDirection) const
double transformToAngleDegree(double fLogicValueOnAngleAxis, bool bDoScaling=true) const
Given a value in the angle axis scale range (e.g.
css::drawing::Position3D transformUnitCircleToScene(double fUnitAngleDegree, double fUnitRadius, double fLogicZ) const
It returns the scene coordinates of the passed point: this point is described through a normalized cy...
double transformToRadius(double fLogicValueOnRadiusAxis, bool bDoScaling=true) const
Given a value in the radius axis scale range, it returns the normalized value.
constexpr double rad2deg(double v)
@ LABEL_ALIGN_RIGHT_BOTTOM
@ LABEL_ALIGN_LEFT_BOTTOM
css::drawing::Direction3D aDirection