LibreOffice Module chart2 (master) 1
Public Member Functions | Public Attributes | List of all members
chart::PieChart::PieLabelInfo Struct Reference
Collaboration diagram for chart::PieChart::PieLabelInfo:
[legend]

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< SvxShapeTextxTextShape
 
rtl::Reference< SvxShapeGroupAnyDxLabelGroupShape
 
::basegfx::B2IVector aFirstPosition
 
::basegfx::B2IVector aOuterPosition
 
::basegfx::B2IVector aOrigin
 
double fValue
 
bool bMovementAllowed
 
bool bMoved
 
bool bShowLeaderLine
 
rtl::Reference< SvxShapeGroupAnyDxTextTarget
 
PieLabelInfopPrevious
 
PieLabelInfopNext
 
css::awt::Point aPreviousPosition
 

Detailed Description

Definition at line 118 of file PieChart.hxx.

Constructor & Destructor Documentation

◆ PieLabelInfo()

chart::PieChart::PieLabelInfo::PieLabelInfo ( )

Definition at line 914 of file PieChart.cxx.

Member Function Documentation

◆ moveAwayFrom()

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().

Member Data Documentation

◆ aFirstPosition

::basegfx::B2IVector chart::PieChart::PieLabelInfo::aFirstPosition

◆ aOrigin

::basegfx::B2IVector chart::PieChart::PieLabelInfo::aOrigin

◆ aOuterPosition

::basegfx::B2IVector chart::PieChart::PieLabelInfo::aOuterPosition

Definition at line 127 of file PieChart.hxx.

Referenced by chart::PieChart::createTextLabelShape().

◆ aPreviousPosition

css::awt::Point chart::PieChart::PieLabelInfo::aPreviousPosition

Definition at line 136 of file PieChart.hxx.

Referenced by chart::PieChart::detectLabelOverlapsAndMove().

◆ bMoved

bool chart::PieChart::PieLabelInfo::bMoved

Definition at line 131 of file PieChart.hxx.

Referenced by chart::PieChart::createTextLabelShape().

◆ bMovementAllowed

bool chart::PieChart::PieLabelInfo::bMovementAllowed

Definition at line 130 of file PieChart.hxx.

Referenced by chart::PieChart::createTextLabelShape().

◆ bShowLeaderLine

bool chart::PieChart::PieLabelInfo::bShowLeaderLine

Definition at line 132 of file PieChart.hxx.

Referenced by chart::PieChart::createTextLabelShape().

◆ fValue

double chart::PieChart::PieLabelInfo::fValue

Definition at line 129 of file PieChart.hxx.

Referenced by chart::PieChart::createTextLabelShape().

◆ pNext

PieLabelInfo* chart::PieChart::PieLabelInfo::pNext

◆ pPrevious

PieLabelInfo* chart::PieChart::PieLabelInfo::pPrevious

◆ xLabelGroupShape

rtl::Reference< SvxShapeGroupAnyD > chart::PieChart::PieLabelInfo::xLabelGroupShape

◆ xTextShape

rtl::Reference< SvxShapeText > chart::PieChart::PieLabelInfo::xTextShape

Definition at line 124 of file PieChart.hxx.

Referenced by chart::PieChart::createTextLabelShape().

◆ xTextTarget

rtl::Reference<SvxShapeGroupAnyD> chart::PieChart::PieLabelInfo::xTextTarget

Definition at line 133 of file PieChart.hxx.

Referenced by chart::PieChart::createTextLabelShape().


The documentation for this struct was generated from the following files: