LibreOffice Module chart2 (master) 1
|
Public Member Functions | |
PieLabelInfo () | |
bool | moveAwayFrom (const PieLabelInfo *pFix, const css::awt::Size &rPageSize, bool bMoveHalfWay, bool bMoveClockwise) |
In case this label and the passed label overlap the routine moves this label in order to fix the issue. More... | |
Public Attributes | |
rtl::Reference< SvxShapeText > | xTextShape |
rtl::Reference< SvxShapeGroupAnyD > | xLabelGroupShape |
::basegfx::B2IVector | aFirstPosition |
::basegfx::B2IVector | aOuterPosition |
::basegfx::B2IVector | aOrigin |
double | fValue |
bool | bMovementAllowed |
bool | bMoved |
bool | bShowLeaderLine |
rtl::Reference< SvxShapeGroupAnyD > | xTextTarget |
PieLabelInfo * | pPrevious |
PieLabelInfo * | pNext |
css::awt::Point | aPreviousPosition |
Definition at line 118 of file PieChart.hxx.
chart::PieChart::PieLabelInfo::PieLabelInfo | ( | ) |
Definition at line 914 of file PieChart.cxx.
bool chart::PieChart::PieLabelInfo::moveAwayFrom | ( | const PieLabelInfo * | pFix, |
const css::awt::Size & | rPageSize, | ||
bool | bMoveHalfWay, | ||
bool | bMoveClockwise | ||
) |
In case this label and the passed label overlap the routine moves this label in order to fix the issue.
After the label position has been rearranged it is checked that the moved label is still inside the page document, if the test is positive the routine returns true else returns false.
compute the rectangle representing the intersection of the label bounding boxes (aOverlap
).
the label is shifted along the direction orthogonal to the vector starting at the pie/donut center and ending at this label anchor point;
named aTangentialDirection
the unit vector related to such a direction, the magnitude of the shift along such a direction is calculated in this way: if the horizontal component of aTangentialDirection
is greater than the vertical component, the magnitude of the shift is equal to aOverlap.Width
else to aOverlap.Height
;
the magnitude of the shift is also increased by 1/50-th of the width or the height of the document page;
in case the bMoveHalfWay
parameter is true the magnitude of the shift is halved.
in case the bMoveClockwise
parameter is false the direction of aTangentialDirection
is reversed;
a final check is performed in order to be sure that the moved label is still inside the page document;
note that no further test is performed in order to check that the overlap is really fixed: this result is surely achieved if the shift would occur in the horizontal or vertical direction (since, in such a direction, the magnitude of the shift would be greater than the length of the overlap), but in general this is not true; adding a constant term equal to 1/50-th of the width or the height of the document page increases the probability of success, anyway it is worth noting that the method can return true even if the overlap issue is not (completely) fixed;
Definition at line 928 of file PieChart.cxx.
References abs(), basegfx::Range2D< typename TYPE, typename TRAITS >::getHeight(), basegfx::Range2D< typename TYPE, typename TRAITS >::getWidth(), basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), basegfx::Range2D< typename TYPE, typename TRAITS >::intersect(), basegfx::Range2D< typename TYPE, typename TRAITS >::isEmpty(), basegfx::B2IVector::setLength(), and xLabelGroupShape.
Referenced by chart::PieChart::tryMoveLabels().
::basegfx::B2IVector chart::PieChart::PieLabelInfo::aFirstPosition |
Definition at line 126 of file PieChart.hxx.
Referenced by chart::PieChart::createTextLabelShape(), and chart::PieChart::performLabelBestFitInnerPlacement().
::basegfx::B2IVector chart::PieChart::PieLabelInfo::aOrigin |
Definition at line 128 of file PieChart.hxx.
Referenced by chart::PieChart::createTextLabelShape(), and chart::PieChart::performLabelBestFitInnerPlacement().
::basegfx::B2IVector chart::PieChart::PieLabelInfo::aOuterPosition |
Definition at line 127 of file PieChart.hxx.
Referenced by chart::PieChart::createTextLabelShape().
css::awt::Point chart::PieChart::PieLabelInfo::aPreviousPosition |
Definition at line 136 of file PieChart.hxx.
Referenced by chart::PieChart::detectLabelOverlapsAndMove().
bool chart::PieChart::PieLabelInfo::bMoved |
Definition at line 131 of file PieChart.hxx.
Referenced by chart::PieChart::createTextLabelShape().
bool chart::PieChart::PieLabelInfo::bMovementAllowed |
Definition at line 130 of file PieChart.hxx.
Referenced by chart::PieChart::createTextLabelShape().
bool chart::PieChart::PieLabelInfo::bShowLeaderLine |
Definition at line 132 of file PieChart.hxx.
Referenced by chart::PieChart::createTextLabelShape().
double chart::PieChart::PieLabelInfo::fValue |
Definition at line 129 of file PieChart.hxx.
Referenced by chart::PieChart::createTextLabelShape().
PieLabelInfo* chart::PieChart::PieLabelInfo::pNext |
Definition at line 135 of file PieChart.hxx.
Referenced by chart::PieChart::detectLabelOverlapsAndMove(), chart::PieChart::rearrangeLabelToAvoidOverlapIfRequested(), and chart::PieChart::tryMoveLabels().
PieLabelInfo* chart::PieChart::PieLabelInfo::pPrevious |
Definition at line 134 of file PieChart.hxx.
Referenced by chart::PieChart::detectLabelOverlapsAndMove(), chart::PieChart::rearrangeLabelToAvoidOverlapIfRequested(), and chart::PieChart::tryMoveLabels().
rtl::Reference< SvxShapeGroupAnyD > chart::PieChart::PieLabelInfo::xLabelGroupShape |
Definition at line 125 of file PieChart.hxx.
Referenced by chart::PieChart::createTextLabelShape(), chart::PieChart::detectLabelOverlapsAndMove(), moveAwayFrom(), and chart::PieChart::performLabelBestFitInnerPlacement().
rtl::Reference< SvxShapeText > chart::PieChart::PieLabelInfo::xTextShape |
Definition at line 124 of file PieChart.hxx.
Referenced by chart::PieChart::createTextLabelShape().
rtl::Reference<SvxShapeGroupAnyD> chart::PieChart::PieLabelInfo::xTextTarget |
Definition at line 133 of file PieChart.hxx.
Referenced by chart::PieChart::createTextLabelShape().