summaryrefslogtreecommitdiff
path: root/chart2/source/view/main/PlottingPositionHelper.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-01-11 14:32:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-11 17:35:32 +0100
commitf242cc6d5be5c6f5446976fd6a7c26ad0cee7683 (patch)
treeab49d3894dd60dea324fbf79cea76d7a394af934 /chart2/source/view/main/PlottingPositionHelper.cxx
parent4c3384dd6c4a92404d170f9011c569de045dfbf7 (diff)
use vectors to build up point data, instead of Sequence
which shaves 1% off the load time of a large chart Change-Id: Ieb8f029f760f41c3bef63bbc4cd221c1473f0f49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128283 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/view/main/PlottingPositionHelper.cxx')
-rw-r--r--chart2/source/view/main/PlottingPositionHelper.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/chart2/source/view/main/PlottingPositionHelper.cxx b/chart2/source/view/main/PlottingPositionHelper.cxx
index 350c0942ae78..0c2084aae2e2 100644
--- a/chart2/source/view/main/PlottingPositionHelper.cxx
+++ b/chart2/source/view/main/PlottingPositionHelper.cxx
@@ -238,6 +238,25 @@ void PlottingPositionHelper::transformScaledLogicToScene( drawing::PolyPolygonSh
}
}
+void PlottingPositionHelper::transformScaledLogicToScene( std::vector<std::vector<css::drawing::Position3D>>& rPolygon ) const
+{
+ drawing::Position3D aScenePosition;
+ for( sal_Int32 nS = static_cast<sal_Int32>(rPolygon.size()); nS--;)
+ {
+ auto valuesRange = rPolygon[nS].data();
+ for( sal_Int32 nP = rPolygon[nS].size(); nP--; )
+ {
+ double& fX = valuesRange[nP].PositionX;
+ double& fY = valuesRange[nP].PositionY;
+ double& fZ = valuesRange[nP].PositionZ;
+ aScenePosition = transformScaledLogicToScene( fX,fY,fZ,true );
+ fX = aScenePosition.PositionX;
+ fY = aScenePosition.PositionY;
+ fZ = aScenePosition.PositionZ;
+ }
+ }
+}
+
void PlottingPositionHelper::clipScaledLogicValues( double* pX, double* pY, double* pZ ) const
{
//get logic clip values: