2014-03-31 00:28:14 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "3DChartObjects.hxx"
|
|
|
|
|
|
|
|
namespace chart {
|
|
|
|
|
|
|
|
namespace opengl3D {
|
|
|
|
|
2014-05-05 10:42:20 +08:00
|
|
|
OpenGL3DRenderer* Renderable3DObject::mPrender = NULL;
|
|
|
|
|
2014-04-10 00:02:51 +02:00
|
|
|
Renderable3DObject::Renderable3DObject(sal_uInt32 nId):
|
|
|
|
mnUniqueId(nId)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Renderable3DObject::render()
|
|
|
|
{
|
|
|
|
(void) mnUniqueId;
|
|
|
|
}
|
|
|
|
|
2014-05-05 11:54:26 +08:00
|
|
|
OpenGL3DRenderer* Renderable3DObject::getRender()
|
2014-05-05 10:42:20 +08:00
|
|
|
{
|
|
|
|
if(mPrender==NULL)
|
|
|
|
{
|
|
|
|
mPrender = new OpenGL3DRenderer();
|
|
|
|
mPrender->init();
|
2014-05-05 11:06:30 +08:00
|
|
|
mPrender->Set3DSenceInfo();
|
2014-05-05 10:42:20 +08:00
|
|
|
}
|
2014-05-05 11:54:26 +08:00
|
|
|
return mPrender;
|
2014-05-05 10:42:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-04-15 20:31:56 +01:00
|
|
|
Bar::Bar(const glm::mat4& rPosition, sal_uInt32 nId)
|
|
|
|
: Renderable3DObject(nId)
|
|
|
|
, mbRoundedCorners(false)
|
|
|
|
, maPos(rPosition)
|
2014-03-31 00:28:14 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-04-10 00:04:35 +02:00
|
|
|
void Bar::render()
|
|
|
|
{
|
|
|
|
(void) mbRoundedCorners;
|
|
|
|
}
|
|
|
|
|
2014-04-10 00:02:51 +02:00
|
|
|
Line::Line(sal_uInt32 nId):
|
|
|
|
Renderable3DObject(nId)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Text::Text(sal_uInt32 nId):
|
|
|
|
Renderable3DObject(nId)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle::Rectangle(sal_uInt32 nId):
|
|
|
|
Renderable3DObject(nId)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-04-08 05:06:31 +02:00
|
|
|
Camera::Camera():
|
2014-04-10 00:02:51 +02:00
|
|
|
Renderable3DObject(0),
|
2014-04-08 05:06:31 +02:00
|
|
|
maPos(10,10,-10),
|
|
|
|
maDirection(glm::vec3(0,0,0)-maPos)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-04-08 01:17:16 +02:00
|
|
|
namespace temporary {
|
|
|
|
|
2014-04-08 02:16:08 +02:00
|
|
|
TemporaryContext::TemporaryContext():
|
2014-05-05 11:54:26 +08:00
|
|
|
Renderable3DObject(-1),
|
2014-04-08 02:16:08 +02:00
|
|
|
miWidth(200),
|
|
|
|
miHeight(200)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-04-08 01:17:16 +02:00
|
|
|
void TemporaryContext::init()
|
|
|
|
{
|
|
|
|
maContext.init();
|
2014-05-05 11:54:26 +08:00
|
|
|
Size winSize(miWidth, miHeight);
|
|
|
|
maContext.setWinSize(winSize);
|
|
|
|
getRender()->SetSize(winSize);
|
2014-04-08 01:17:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void TemporaryContext::render()
|
|
|
|
{
|
2014-04-08 02:16:08 +02:00
|
|
|
maContext.renderToFile();
|
2014-04-08 01:17:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-03-31 00:28:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|