provide bar color for 3D OGL chart
Change-Id: Ia41748cabba89a0257c62f66a280810adc56960e
This commit is contained in:
@@ -17,6 +17,8 @@
|
|||||||
#include "3DChartObjects.hxx"
|
#include "3DChartObjects.hxx"
|
||||||
#include "GL3DRenderer.hxx"
|
#include "GL3DRenderer.hxx"
|
||||||
|
|
||||||
|
using namespace com::sun::star;
|
||||||
|
|
||||||
namespace chart {
|
namespace chart {
|
||||||
|
|
||||||
GL3DBarChart::GL3DBarChart(const std::vector<VDataSeries*>& rDataSeries,
|
GL3DBarChart::GL3DBarChart(const std::vector<VDataSeries*>& rDataSeries,
|
||||||
@@ -53,11 +55,13 @@ void GL3DBarChart::create3DShapes()
|
|||||||
float nXPos = nIndex * (nBarSizeX + nBarDistanceX);
|
float nXPos = nIndex * (nBarSizeX + nBarDistanceX);
|
||||||
float nYPos = nSeriesIndex * (nBarSizeY + nBarDistanceY);
|
float nYPos = nSeriesIndex * (nBarSizeY + nBarDistanceY);
|
||||||
|
|
||||||
|
sal_Int32 nColor = COL_BLUE;
|
||||||
|
|
||||||
glm::mat4 aBarPosition;
|
glm::mat4 aBarPosition;
|
||||||
aBarPosition = glm::scale(aBarPosition, nBarSizeX, nBarSizeY, nVal);
|
aBarPosition = glm::scale(aBarPosition, nBarSizeX, nBarSizeY, nVal);
|
||||||
aBarPosition = glm::translate(aBarPosition, nXPos, nYPos, nVal/2);
|
aBarPosition = glm::translate(aBarPosition, nXPos, nYPos, nVal/2);
|
||||||
|
|
||||||
maShapes.push_back(new opengl3D::Bar(mpRenderer.get(), aBarPosition, nId++));
|
maShapes.push_back(new opengl3D::Bar(mpRenderer.get(), aBarPosition, nColor, nId++));
|
||||||
}
|
}
|
||||||
|
|
||||||
++nSeriesIndex;
|
++nSeriesIndex;
|
||||||
|
@@ -37,7 +37,7 @@ protected:
|
|||||||
class Bar : public Renderable3DObject
|
class Bar : public Renderable3DObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Bar(OpenGL3DRenderer* pRenderer, const glm::mat4& rPosition, sal_uInt32 nId);
|
Bar(OpenGL3DRenderer* pRenderer, const glm::mat4& rPosition, sal_Int32 nColor, sal_uInt32 nId);
|
||||||
|
|
||||||
virtual void render() SAL_OVERRIDE;
|
virtual void render() SAL_OVERRIDE;
|
||||||
private:
|
private:
|
||||||
|
@@ -24,10 +24,11 @@ void Renderable3DObject::render()
|
|||||||
(void) mnUniqueId;
|
(void) mnUniqueId;
|
||||||
}
|
}
|
||||||
|
|
||||||
Bar::Bar(OpenGL3DRenderer* pRenderer, const glm::mat4& rPosition, sal_uInt32 nId)
|
Bar::Bar(OpenGL3DRenderer* pRenderer, const glm::mat4& rPosition, sal_Int32 aColor, sal_uInt32 nId)
|
||||||
: Renderable3DObject(pRenderer, nId)
|
: Renderable3DObject(pRenderer, nId)
|
||||||
, mbRoundedCorners(false)
|
, mbRoundedCorners(false)
|
||||||
, maPos(rPosition)
|
, maPos(rPosition)
|
||||||
|
, maColor(aColor)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user