diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-17 08:37:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-17 09:56:19 +0200 |
commit | ce92b5da976122a9120fbb499f7a823ed67a4d01 (patch) | |
tree | d429a1c9fd11425a4f7e5d2e42030ba5ad92e16d /chart2 | |
parent | 1ac9f8ddd7d4126a138b84143f48abdc5c41d0ff (diff) |
drop enum NormalAxis
since we only ever use the Z enumerator
Change-Id: Ia162a6be650704649f5232fff0fa229c7b346450
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/charttypes/PieChart.cxx | 9 | ||||
-rw-r--r-- | chart2/source/view/inc/PlottingPositionHelper.hxx | 11 | ||||
-rw-r--r-- | chart2/source/view/main/PlottingPositionHelper.cxx | 40 |
3 files changed, 8 insertions, 52 deletions
diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx index 34001ef1f9f0..3549ceacdf8b 100644 --- a/chart2/source/view/charttypes/PieChart.cxx +++ b/chart2/source/view/charttypes/PieChart.cxx @@ -97,7 +97,7 @@ struct PieChart::ShapeParam class PiePositionHelper : public PolarPlottingPositionHelper { public: - PiePositionHelper( NormalAxis eNormalAxis, double fAngleDegreeOffset ); + PiePositionHelper( double fAngleDegreeOffset ); bool getInnerAndOuterRadius( double fCategoryX, double& fLogicInnerRadius, double& fLogicOuterRadius, bool bUseRings, double fMaxOffset ) const; @@ -106,9 +106,8 @@ public: double m_fRingDistance; //>=0 m_fRingDistance=1 --> distance == width }; -PiePositionHelper::PiePositionHelper( NormalAxis eNormalAxis, double fAngleDegreeOffset ) - : PolarPlottingPositionHelper(eNormalAxis) - , m_fRingDistance(0.0) +PiePositionHelper::PiePositionHelper( double fAngleDegreeOffset ) + : m_fRingDistance(0.0) { m_fRadiusOffset = 0.0; m_fAngleDegreeOffset = fAngleDegreeOffset; @@ -166,7 +165,7 @@ PieChart::PieChart( const uno::Reference<XChartType>& xChartTypeModel , sal_Int32 nDimensionCount , bool bExcludingPositioning ) : VSeriesPlotter( xChartTypeModel, nDimensionCount ) - , m_pPosHelper( new PiePositionHelper( NormalAxis_Z, (m_nDimension==3)?0.0:90.0 ) ) + , m_pPosHelper( new PiePositionHelper( (m_nDimension==3) ? 0.0 : 90.0 ) ) , m_bUseRings(false) , m_bSizeExcludesLabelsAndExplodedSegments(bExcludingPositioning) { diff --git a/chart2/source/view/inc/PlottingPositionHelper.hxx b/chart2/source/view/inc/PlottingPositionHelper.hxx index 19c341b061ce..39a3757e5596 100644 --- a/chart2/source/view/inc/PlottingPositionHelper.hxx +++ b/chart2/source/view/inc/PlottingPositionHelper.hxx @@ -134,18 +134,10 @@ protected: //member bool m_bAllowShiftZAxisPos; }; -//describes which axis of the drawinglayer scene or screen axis are the normal axis -enum NormalAxis -{ - NormalAxis_X - , NormalAxis_Y - , NormalAxis_Z -}; - class PolarPlottingPositionHelper : public PlottingPositionHelper { public: - PolarPlottingPositionHelper( NormalAxis eNormalAxis=NormalAxis_Z ); + PolarPlottingPositionHelper(); PolarPlottingPositionHelper( const PolarPlottingPositionHelper& rSource ); virtual ~PolarPlottingPositionHelper() override; @@ -217,7 +209,6 @@ public: private: ::basegfx::B3DHomMatrix m_aUnitCartesianToScene; - NormalAxis m_eNormalAxis; ::basegfx::B3DHomMatrix impl_calculateMatrixUnitCartesianToScene( const ::basegfx::B3DHomMatrix& rMatrixScreenToScene ) const; }; diff --git a/chart2/source/view/main/PlottingPositionHelper.cxx b/chart2/source/view/main/PlottingPositionHelper.cxx index b074d858c086..02ada77897a5 100644 --- a/chart2/source/view/main/PlottingPositionHelper.cxx +++ b/chart2/source/view/main/PlottingPositionHelper.cxx @@ -316,11 +316,10 @@ drawing::Direction3D PlottingPositionHelper::getScaledLogicWidth() const return aRet; } -PolarPlottingPositionHelper::PolarPlottingPositionHelper( NormalAxis eNormalAxis ) +PolarPlottingPositionHelper::PolarPlottingPositionHelper() : m_fRadiusOffset(0.0) , m_fAngleDegreeOffset(90.0) , m_aUnitCartesianToScene() - , m_eNormalAxis(eNormalAxis) { m_bMaySkipPointsInRegressionCalculation = false; } @@ -330,7 +329,6 @@ PolarPlottingPositionHelper::PolarPlottingPositionHelper( const PolarPlottingPos , m_fRadiusOffset( rSource.m_fRadiusOffset ) , m_fAngleDegreeOffset( rSource.m_fAngleDegreeOffset ) , m_aUnitCartesianToScene( rSource.m_aUnitCartesianToScene ) - , m_eNormalAxis( rSource.m_eNormalAxis ) { } @@ -390,27 +388,8 @@ void PolarPlottingPositionHelper::setScales( const std::vector< ExplicitScaleDat double fScaleY = fScale; double fScaleZ = fScale; - switch(m_eNormalAxis) - { - case NormalAxis_X: - { - fTranslateX = fTranslateLogicZ; - fScaleX = fScaleLogicZ; - } - break; - case NormalAxis_Y: - { - fTranslateY = fTranslateLogicZ; - fScaleY = fScaleLogicZ; - } - break; - default: //NormalAxis_Z: - { - fTranslateZ = fTranslateLogicZ; - fScaleZ = fScaleLogicZ; - } - break; - } + fTranslateZ = fTranslateLogicZ; + fScaleZ = fScaleLogicZ; aRet.translate(fTranslateX, fTranslateY, fTranslateZ);//x first aRet.scale(fScaleX, fScaleY, fScaleZ);//x first @@ -645,19 +624,6 @@ drawing::Position3D PolarPlottingPositionHelper::transformUnitCircleToScene( dou double fY=fUnitRadius*rtl::math::sin(fAnglePi); double fZ=fLogicZ; - switch(m_eNormalAxis) - { - case NormalAxis_X: - std::swap(fX,fZ); - break; - case NormalAxis_Y: - std::swap(fY,fZ); - fZ*=-1; - break; - default: //NormalAxis_Z - break; - } - //!! applying matrix to vector does ignore translation, so it is important to use a B3DPoint here instead of B3DVector ::basegfx::B3DPoint aPoint(fX,fY,fZ); ::basegfx::B3DPoint aRet = m_aUnitCartesianToScene * aPoint; |