summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-01-01 17:24:17 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-01-29 08:09:25 +0100
commitefaefc2e2ce3a6a14f9064cf77c19d8669ec5a52 (patch)
treed356284a2d3a68b09455c941b8dd56a4fd80973d /chart2
parentd2b065acabf064378a9956ec3bb352dcd78cd06b (diff)
move Circle to OpenGl backend and out of the factory
This finally makes the factory stateless again. Now it is possible again to render more than one chart in the OpenGL backend. Change-Id: I9d1a24dabb2bdf5aacd05cbe2931924f27aafeca
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/inc/DummyXShape.hxx5
-rw-r--r--chart2/source/view/main/DummyXShape.cxx10
-rw-r--r--chart2/source/view/main/OpenglShapeFactory.cxx5
3 files changed, 13 insertions, 7 deletions
diff --git a/chart2/source/view/inc/DummyXShape.hxx b/chart2/source/view/inc/DummyXShape.hxx
index 31ff4850f40d..81a52340a5f2 100644
--- a/chart2/source/view/inc/DummyXShape.hxx
+++ b/chart2/source/view/inc/DummyXShape.hxx
@@ -185,11 +185,11 @@ public:
protected:
std::map<OUString, uno::Any> maProperties;
+ com::sun::star::awt::Point maPosition;
+ com::sun::star::awt::Size maSize;
private:
OUString maName;
- com::sun::star::awt::Point maPosition;
- com::sun::star::awt::Size maSize;
com::sun::star::uno::Reference< com::sun::star::uno::XInterface > mxParent;
DummyXShape* mpParent;
@@ -336,6 +336,7 @@ class DummyCircle : public DummyXShape
public:
DummyCircle(const awt::Point& rPosition, const awt::Size& rSize);
+ virtual void render() SAL_OVERRIDE;
};
class DummyLine3D : public DummyXShape
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 03e1c6ba4f8f..1c4e8b96f0f8 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -353,6 +353,16 @@ DummyCircle::DummyCircle(const awt::Point& rPos, const awt::Size& rSize)
setSize(rSize);
}
+void DummyCircle::render()
+{
+ long color = 0x3465AF;
+ DummyChart* pChart = getRootShape();
+ pChart->m_GLRender.SetColor(color);
+ pChart->m_GLRender.Bubble2DShapePoint(maPosition.X, maPosition.Y,
+ maSize.Width, maSize.Height);
+ pChart->m_GLRender.RenderBubble2FBO(GL_TRUE);
+}
+
namespace {
void setProperties( const VLineProperties& rLineProperties, std::map<OUString, uno::Any>& rTargetProps )
diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx
index 71b19bd731da..041539a53963 100644
--- a/chart2/source/view/main/OpenglShapeFactory.cxx
+++ b/chart2/source/view/main/OpenglShapeFactory.cxx
@@ -322,11 +322,6 @@ uno::Reference< drawing::XShape >
rPosition.PositionY - (rSize.DirectionY / 2.0),
rPosition.PositionZ );
dummy::DummyChart *pChart = (dummy::DummyChart *)m_pChart;
- long color = 0x3465AF;
- pChart->m_GLRender.SetColor(color);
- pChart->m_GLRender.Bubble2DShapePoint(rPosition.PositionX, rPosition.PositionY,
- rSize.DirectionX / 2.0, rSize.DirectionY / 2.0);
- pChart->m_GLRender.RenderBubble2FBO(GL_TRUE);
dummy::DummyCircle* pCircle = new dummy::DummyCircle(Position3DToAWTPoint( aCenterPosition ),
Direction3DToAWTSize( rSize ));
xTarget->add(pCircle);