summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-05-14 09:36:03 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-05-14 09:37:08 -0400
commit9a73719c394049648278203448f7ba91f919e837 (patch)
treef0fc3843dd5f4e7f816badc466134df01bab9496 /chart2
parent4a902e0c59b0dd01e6459c226268bdee4f15489a (diff)
Try to zoom into a bar when clicked. For now we hardcode the object ID of 1.
Just for testing. Change-Id: Ifec15ae0beb0a3c863085e9d43bdebd7bcce4027
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/charttypes/GL3DBarChart.cxx8
-rw-r--r--chart2/source/view/inc/GL3DBarChart.hxx3
2 files changed, 9 insertions, 2 deletions
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 35bcb5180121..04c3cac2caec 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 1741b3d071cf..92a3b6c514c4 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;
};
}