summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-05-10 22:51:32 +0200
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-05-12 03:00:07 +0200
commita29e1c5cfd734bdff66fac5f0a324665f8c321d7 (patch)
treed70cdfefc62e35a41013f55037ef360aaa1de8ad /chart2
parent3729f6ca6abe83b8f6b2a712b286e7ba57442302 (diff)
remove unused methods
Change-Id: Id9e35e171d4235d863a09f6d1d8083d7dbab59c6
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/inc/GL3DRenderer.hxx2
-rw-r--r--chart2/source/view/main/GL3DRenderer.cxx105
2 files changed, 0 insertions, 107 deletions
diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index 7e407db33abe..89e9f184c863 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -204,8 +204,6 @@ private:
void RenderExtrudeFlatSurface(const Extrude3DInfo& extrude3D, int surIndex);
glm::vec4 GetColorByIndex(int index);
sal_uInt32 GetIndexByColor(sal_uInt32 r, sal_uInt32 g, sal_uInt32 b);
- void ProcessPickingBox();
- int ProcessExtrude3DPickingBox();
void RenderCoordinateAxis();
void AddVertexData(GLuint vertexBuf);
void AddNormalData(GLuint normalBuf);
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index e581d230a8c2..343f17475aaa 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -20,8 +20,6 @@
#include <StaticGeometry.h>
#include "glm/gtc/matrix_inverse.hpp"
-#define RGB_WHITE (0xFF | (0xFF << 8) | (0xFF << 16))
-
#define DEBUG_FBO 0
using namespace com::sun::star;
@@ -1467,109 +1465,6 @@ sal_uInt32 OpenGL3DRenderer::GetIndexByColor(sal_uInt32 r, sal_uInt32 g, sal_uIn
return r | (g << 8) | (b << 16);
}
-void OpenGL3DRenderer::ProcessPickingBox()
-{
- glViewport(0, 0, m_iWidth, m_iHeight);
- glClearDepth(1.0f);
- glClearColor(1.0, 1.0, 1.0, 1.0);
- if(ProcessExtrude3DPickingBox() == 1)
- {
- //the picked object has been processed, return
- return ;
- }
-}
-
-int OpenGL3DRenderer::ProcessExtrude3DPickingBox()
-{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- //render the bounding box
- Extrude3DInfo extrude3DInfo;
- glUseProgram(m_CommonProID);
-
- // 1rst attribute buffer : vertices
- glEnableVertexAttribArray(m_2DVertexID);
- glBindBuffer(GL_ARRAY_BUFFER, m_BoundBox);
- glVertexAttribPointer(m_2DVertexID, // attribute. No particular reason for 0, but must match the layout in the shader.
- 3, // size
- GL_FLOAT, // type
- GL_FALSE, // normalized?
- 0, // stride
- (void*)0 // array buffer offset
- );
- for (unsigned int i = 0; i < m_Extrude3DList.size(); i++)
- {
- extrude3DInfo = m_Extrude3DList[i];
- extrude3DInfo.yTransform *= m_fHeightWeight;
- extrude3DInfo.yScale *= m_fHeightWeight;
- PosVecf3 trans = {extrude3DInfo.xTransform,//m_Extrude3DInfo.xTransform + 140,
- -extrude3DInfo.yTransform,
- extrude3DInfo.zTransform};
- PosVecf3 angle = {0.0f, 0.0f, 0.0f};
- PosVecf3 scale = {extrude3DInfo.xScale,
- extrude3DInfo.yScale,
- extrude3DInfo.xScale};
- MoveModelf(trans, angle, scale);
- glm::mat4 boundMVP = m_3DProjection * m_3DView * m_Model;
- glm::vec4 boundColor = GetColorByIndex(i);
- int reverse = 1;
- if (reverse < 0)
- {
- glm::mat4 reverseMatrix = glm::translate(glm::vec3(0.0, -1.0, 0.0));
- boundMVP = boundMVP * reverseMatrix;
- }
- glUniform4fv(m_2DColorID, 1, &boundColor[0]);
- glUniformMatrix4fv(m_MatrixID, 1, GL_FALSE, &boundMVP[0][0]);
-
- glDrawArrays(GL_TRIANGLES, 0, sizeof(boundBox) / sizeof(GLfloat) / 3);
- }
- glDisableVertexAttribArray(m_2DVertexID);
- glUseProgram(0);
- //read pixel to get the index
- Point select = Point(m_aMPos.X(), m_aMPos.Y());
- sal_uInt8 selectColor[4] = {0};
-
- glReadPixels(select.X(), select.Y(), 1, 1, GL_RGB, GL_UNSIGNED_BYTE, selectColor);
- int selectID = GetIndexByColor(selectColor[0], selectColor[1], selectColor[2]);
-
- if (selectID == RGB_WHITE)
- {
- if (m_uiSelectFrameCounter <= 0)
- {
- m_3DView = m_3DViewBack;
- m_uiSelectFrameCounter = 0;
- m_coordinateAxisinfo.pickingFlg = 0;
- }
- else
- {
- m_uiSelectFrameCounter--;
- }
- return 0;
- }
-
- extrude3DInfo = m_Extrude3DList[selectID];
- extrude3DInfo.yTransform *= m_fHeightWeight;
- extrude3DInfo.yScale *= m_fHeightWeight;
- int reverse = 1;
- m_3DView = glm::lookAt(m_CameraInfo.cameraPos, // Camera is at (0,0,3), in World Space
- m_CameraInfo.cameraOrg, // and looks at the origin
- m_CameraInfo.cameraUp // Head is up (set to 0,-1,0 to look upside-down)
- );
- m_uiSelectFrameCounter = 5;
-
- m_coordinateAxisinfo.pickingFlg = 1;
- m_coordinateAxisinfo.reverse = reverse;
- m_coordinateAxisinfo.trans.x = extrude3DInfo.xTransform + extrude3DInfo.xScale / 2;
- m_coordinateAxisinfo.trans.y = -extrude3DInfo.yTransform + (extrude3DInfo.yScale + 1.5) * reverse;
- m_coordinateAxisinfo.trans.z = extrude3DInfo.zTransform + extrude3DInfo.xScale / 2;
-
- m_coordinateAxisinfo.scale.x = 4 * extrude3DInfo.xScale;
- m_coordinateAxisinfo.scale.y = 4 * extrude3DInfo.xScale;
- m_coordinateAxisinfo.scale.z = 4 * extrude3DInfo.xScale;
- m_coordinateAxisinfo.color = glm::vec4(0.5, 1.0, 0.8, 1.0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
- return 1;
-}
-
void OpenGL3DRenderer::RenderCoordinateAxis()
{
if (!m_coordinateAxisinfo.pickingFlg)