diff options
author | weigao <weigao@multicorewareinc.com> | 2014-08-03 14:03:48 +0800 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-08-06 20:45:12 +0200 |
commit | af01f14c8752c38b900f3536cd6791778dd2d209 (patch) | |
tree | 827e2172d42a8369dab8bbb70a63c5f291cd1fc5 /chart2 | |
parent | 2597da2de74620162a9931860ac8b96529f94204 (diff) |
add scene edge function
Change-Id: Id64e3dc06d0d853bc7cece2337dcc927e15a49b6
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/charttypes/GL3DBarChart.cxx | 5 | ||||
-rw-r--r-- | chart2/source/view/inc/GL3DRenderer.hxx | 3 | ||||
-rw-r--r-- | chart2/source/view/main/GL3DRenderer.cxx | 8 |
3 files changed, 15 insertions, 1 deletions
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx index 0e6057b7d8d6..69003e2c37b3 100644 --- a/chart2/source/view/charttypes/GL3DBarChart.cxx +++ b/chart2/source/view/charttypes/GL3DBarChart.cxx @@ -589,7 +589,10 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer pRect->setPosition(aTopLeft, aTopRight, aBottomRight); pRect->setFillColor(COL_BLACK); pRect->setLineColor(COL_BLUE); - + if (mbScrollFlg) + mpRenderer->SetSceneEdge(BAR_DISTANCE_X - 0.001f, aTopRight.x - BAR_DISTANCE_X); + else + mpRenderer->SetSceneEdge(-0.001f, aTopRight.x); // Create category texts along X-axis at the bottom. uno::Sequence<OUString> aCats = rCatProvider.getSimpleCategories(); for (sal_Int32 i = 0; i < aCats.getLength(); ++i) diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx index 3698b716edb5..856d0796e33b 100644 --- a/chart2/source/view/inc/GL3DRenderer.hxx +++ b/chart2/source/view/inc/GL3DRenderer.hxx @@ -212,6 +212,7 @@ public: void SetScroll(); void SetScrollSpeed(float scrollSpeed); void SetScrollDistance(float scrollDistance); + void SetSceneEdge(float minCoordX, float maxCoordX); private: void MoveModelf( const PosVecf3& trans, const PosVecf3& angle, const PosVecf3& scale); @@ -457,6 +458,8 @@ private: sal_uInt32 m_uiSelectID; float m_fScrollSpeed; float m_fScrollDistance; + float m_fMinCoordX; + float m_fMaxCoordX; }; } diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx index a3a9edf5774c..74318e28bf11 100644 --- a/chart2/source/view/main/GL3DRenderer.cxx +++ b/chart2/source/view/main/GL3DRenderer.cxx @@ -111,6 +111,8 @@ OpenGL3DRenderer::OpenGL3DRenderer(): , m_uiSelectID(0) , m_fScrollSpeed(0.0f) , m_fScrollDistance(0.0f) + , m_fMinCoordX(0.0f) + , m_fMaxCoordX(0.0f) { m_Polygon3DInfo.lineOnly = false; m_Polygon3DInfo.twoSidesLighting = false; @@ -2292,6 +2294,12 @@ void OpenGL3DRenderer::SetScrollDistance(float scrollDistance) m_fScrollDistance = scrollDistance; } +void OpenGL3DRenderer::SetSceneEdge(float minCoordX, float maxCoordX) +{ + m_fMinCoordX = minCoordX * 0.01; + m_fMaxCoordX = maxCoordX * 0.01; +} + void OpenGL3DRenderer::RenderBatchBars(bool bNewScene) { if(bNewScene) |