diff options
author | weigao <weigao@multicorewareinc.com> | 2014-08-03 13:32:36 +0800 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-08-06 20:45:12 +0200 |
commit | 2597da2de74620162a9931860ac8b96529f94204 (patch) | |
tree | 0f953346421d9a1881ce64576aeee9b759effb3b /chart2/source/view | |
parent | cc20cedcbcad2fd08d48b6ce687de7e3471a7ba3 (diff) |
add functions of setting the speed and distance of bars
Change-Id: Id44adf11d445b9c30467e220465528a80ee31b18
Diffstat (limited to 'chart2/source/view')
-rw-r--r-- | chart2/source/view/charttypes/GL3DBarChart.cxx | 6 | ||||
-rw-r--r-- | chart2/source/view/inc/GL3DRenderer.hxx | 4 | ||||
-rw-r--r-- | chart2/source/view/main/GL3DRenderer.cxx | 11 |
3 files changed, 21 insertions, 0 deletions
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx index 47706aed9bb1..0e6057b7d8d6 100644 --- a/chart2/source/view/charttypes/GL3DBarChart.cxx +++ b/chart2/source/view/charttypes/GL3DBarChart.cxx @@ -654,6 +654,12 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer } if (BENCH_MARK_MODE && (!mpRenderThread.is())) { + //if scroll the bars, set the speed and distance first + if (mbScrollFlg) + { + mpRenderer->SetScrollSpeed((float)(BAR_SIZE_X + BAR_DISTANCE_X) / (float)miScrollRate); + mpRenderer->SetScrollDistance((float)(BAR_SIZE_X + BAR_DISTANCE_X)); + } Size aSize = mrWindow.GetSizePixel(); mrWindow.getContext().setWinSize(aSize); mpRenderThread = rtl::Reference<RenderThread>(new RenderBenchMarkThread(this)); diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx index a82b1bf0cf7f..3698b716edb5 100644 --- a/chart2/source/view/inc/GL3DRenderer.hxx +++ b/chart2/source/view/inc/GL3DRenderer.hxx @@ -210,6 +210,8 @@ public: void StartClick(sal_uInt32 &selectID); void EndClick(); void SetScroll(); + void SetScrollSpeed(float scrollSpeed); + void SetScrollDistance(float scrollDistance); private: void MoveModelf( const PosVecf3& trans, const PosVecf3& angle, const PosVecf3& scale); @@ -453,6 +455,8 @@ private: std::vector<GLuint> m_Texturelist; bool m_bHighLighting; sal_uInt32 m_uiSelectID; + float m_fScrollSpeed; + float m_fScrollDistance; }; } diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx index 20b88a7eef85..a3a9edf5774c 100644 --- a/chart2/source/view/main/GL3DRenderer.cxx +++ b/chart2/source/view/main/GL3DRenderer.cxx @@ -109,6 +109,8 @@ OpenGL3DRenderer::OpenGL3DRenderer(): , m_iLightNum(0) , m_bHighLighting(false) , m_uiSelectID(0) + , m_fScrollSpeed(0.0f) + , m_fScrollDistance(0.0f) { m_Polygon3DInfo.lineOnly = false; m_Polygon3DInfo.twoSidesLighting = false; @@ -2281,6 +2283,15 @@ void OpenGL3DRenderer::SetScroll() maResources.m_bScrollFlag = true; } +void OpenGL3DRenderer::SetScrollSpeed(float scrollSpeed) +{ + m_fScrollSpeed = scrollSpeed; +} +void OpenGL3DRenderer::SetScrollDistance(float scrollDistance) +{ + m_fScrollDistance = scrollDistance; +} + void OpenGL3DRenderer::RenderBatchBars(bool bNewScene) { if(bNewScene) |