[Libreoffice-commits] core.git: chart2/source

Kohei Yoshida kohei.yoshida at collabora.com
Wed May 14 06:36:52 PDT 2014


 chart2/source/view/charttypes/GL3DBarChart.cxx |    8 ++++++--
 chart2/source/view/inc/GL3DBarChart.hxx        |    3 +++
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 9a73719c394049648278203448f7ba91f919e837
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed May 14 09:36:03 2014 -0400

    Try to zoom into a bar when clicked.  For now we hardcode the object ID of 1.
    
    Just for testing.
    
    Change-Id: Ifec15ae0beb0a3c863085e9d43bdebd7bcce4027

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 35bcb51..04c3cac 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -28,7 +28,8 @@ GL3DBarChart::GL3DBarChart(
     OpenGLWindow& rWindow) :
     mxChartType(xChartType),
     mpRenderer(new opengl3D::OpenGL3DRenderer()),
-    mrWindow(rWindow)
+    mrWindow(rWindow),
+    mpCamera(NULL)
 {
     mrWindow.setRenderer(this);
     mpRenderer->init();
@@ -65,6 +66,8 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
 
     maShapes.clear();
     maShapes.push_back(new opengl3D::Camera(mpRenderer.get()));
+    mpCamera = static_cast<opengl3D::Camera*>(&maShapes.back());
+
     sal_Int32 nSeriesIndex = 0;
     for (boost::ptr_vector<VDataSeries>::const_iterator itr = rDataSeriesContainer.begin(),
             itrEnd = rDataSeriesContainer.end(); itr != itrEnd; ++itr)
@@ -185,7 +188,8 @@ void GL3DBarChart::update()
 
 void GL3DBarChart::clickedAt(const Point& )
 {
-
+    if (mpCamera)
+        mpCamera->zoom(1);
 }
 
 }
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index 1741b3d..92a3b6c 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -26,6 +26,7 @@ namespace opengl3D {
 
 class Renderable3DObject;
 class OpenGL3DRenderer;
+class Camera;
 
 }
 
@@ -53,6 +54,8 @@ private:
 
     boost::scoped_ptr<opengl3D::OpenGL3DRenderer> mpRenderer;
     OpenGLWindow& mrWindow;
+
+    opengl3D::Camera* mpCamera;
 };
 
 }


More information about the Libreoffice-commits mailing list