Kaydet (Commit) 40e22a42 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

we only need one typedef for PointList

Change-Id: Ic64f871e014bd48c5eadb6f92b69c6466d812925
üst 6162e32e
...@@ -240,7 +240,7 @@ int OpenGLRender::RenderLine2FBO(int) ...@@ -240,7 +240,7 @@ int OpenGLRender::RenderLine2FBO(int)
m_MVP = m_Projection * m_View * m_Model; m_MVP = m_Projection * m_View * m_Model;
for (size_t i = 0; i < listNum; i++) for (size_t i = 0; i < listNum; i++)
{ {
Line2DPointList &pointList = m_Line2DShapePointList.front(); PointList &pointList = m_Line2DShapePointList.front();
//fill vertex buffer //fill vertex buffer
glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
CHECK_GL_ERROR(); CHECK_GL_ERROR();
...@@ -371,7 +371,7 @@ OpenGLRender::OpenGLRender() ...@@ -371,7 +371,7 @@ OpenGLRender::OpenGLRender()
, m_SymbolShapeID(0) , m_SymbolShapeID(0)
{ {
//TODO: moggi: use STL //TODO: moggi: use STL
memset(&m_Line2DPointList, 0, sizeof(Line2DPointList)); memset(&m_Line2DPointList, 0, sizeof(PointList));
memset(&m_Bubble2DCircle, 0, sizeof(m_Bubble2DCircle)); memset(&m_Bubble2DCircle, 0, sizeof(m_Bubble2DCircle));
...@@ -858,7 +858,7 @@ int OpenGLRender::SetArea2DShapePoint(float x, float y, int listLength) ...@@ -858,7 +858,7 @@ int OpenGLRender::SetArea2DShapePoint(float x, float y, int listLength)
namespace { namespace {
// only 2D // only 2D
bool checkCCW(const Area2DPointList& rPoints) bool checkCCW(const PointList& rPoints)
{ {
if(rPoints.size() < 3) if(rPoints.size() < 3)
return true; return true;
...@@ -893,7 +893,7 @@ int OpenGLRender::RenderArea2DShape() ...@@ -893,7 +893,7 @@ int OpenGLRender::RenderArea2DShape()
m_MVP = m_Projection * m_View * m_Model; m_MVP = m_Projection * m_View * m_Model;
for (size_t i = 0; i < listNum; ++i) for (size_t i = 0; i < listNum; ++i)
{ {
Area2DPointList &pointList = m_Area2DShapePointList.front(); PointList &pointList = m_Area2DShapePointList.front();
bool bIsCCW = checkCCW(pointList); // is it counter clockwise (CCW) or clockwise (CW) bool bIsCCW = checkCCW(pointList); // is it counter clockwise (CCW) or clockwise (CW)
if(!bIsCCW) if(!bIsCCW)
glFrontFace(GL_CW); glFrontFace(GL_CW);
...@@ -979,7 +979,7 @@ void OpenGLRender::SetChartTransparencyGradient(long transparencyGradient) ...@@ -979,7 +979,7 @@ void OpenGLRender::SetChartTransparencyGradient(long transparencyGradient)
void OpenGLRender::GeneratePieSegment2D(double fInnerRadius, double fOutterRadius, double nAngleStart, double nAngleWidth) void OpenGLRender::GeneratePieSegment2D(double fInnerRadius, double fOutterRadius, double nAngleStart, double nAngleWidth)
{ {
double nAngleStep = 1; double nAngleStep = 1;
PieSegment2DPointList aPointList; PointList aPointList;
// TODO: moggi: GL_TRIANGLE_FAN seems not to work // TODO: moggi: GL_TRIANGLE_FAN seems not to work
bool bInnerRadiusNotZero = true; //!rtl::math::approxEqual(0.0, fInnerRadius); bool bInnerRadiusNotZero = true; //!rtl::math::approxEqual(0.0, fInnerRadius);
size_t nVectorSize = 3*(nAngleWidth/nAngleStep); size_t nVectorSize = 3*(nAngleWidth/nAngleStep);
...@@ -1026,7 +1026,7 @@ int OpenGLRender::RenderPieSegment2DShape(float fSize, float fPosX, float fPosY) ...@@ -1026,7 +1026,7 @@ int OpenGLRender::RenderPieSegment2DShape(float fSize, float fPosX, float fPosY)
for (int i = 0; i < listNum; i++) for (int i = 0; i < listNum; i++)
{ {
PieSegment2DPointList &pointList = m_PieSegment2DShapePointList.back(); PointList &pointList = m_PieSegment2DShapePointList.back();
//fill vertex buffer //fill vertex buffer
glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
glBufferData(GL_ARRAY_BUFFER, pointList.size() * sizeof(float), &pointList[0] , GL_STATIC_DRAW); glBufferData(GL_ARRAY_BUFFER, pointList.size() * sizeof(float), &pointList[0] , GL_STATIC_DRAW);
......
...@@ -38,8 +38,6 @@ struct PosVecf3 ...@@ -38,8 +38,6 @@ struct PosVecf3
float z; float z;
}; };
typedef std::vector<GLfloat> Line2DPointList;
struct Bubble2DPointList struct Bubble2DPointList
{ {
float x; float x;
...@@ -64,8 +62,6 @@ struct TextInfo ...@@ -64,8 +62,6 @@ struct TextInfo
float nDy; float nDy;
}; };
typedef std::vector<GLfloat> Area2DPointList;
typedef std::vector<GLfloat> PieSegment2DPointList;
typedef std::vector<GLfloat> PointList; typedef std::vector<GLfloat> PointList;
// for 3D, use vector to save the points // for 3D, use vector to save the points
...@@ -159,11 +155,11 @@ private: ...@@ -159,11 +155,11 @@ private:
GLuint m_RenderTexCoordBuf; GLuint m_RenderTexCoordBuf;
Line2DPointList m_Line2DPointList; PointList m_Line2DPointList;
float m_fLineWidth; float m_fLineWidth;
std::list <Line2DPointList> m_Line2DShapePointList; std::list <PointList> m_Line2DShapePointList;
glm::vec4 m_2DColor; glm::vec4 m_2DColor;
...@@ -186,8 +182,8 @@ private: ...@@ -186,8 +182,8 @@ private:
GLuint m_TextTexCoordBuf; GLuint m_TextTexCoordBuf;
GLint m_TextTexID; GLint m_TextTexID;
Area2DPointList m_Area2DPointList; PointList m_Area2DPointList;
std::list <Area2DPointList> m_Area2DShapePointList; std::list <PointList> m_Area2DShapePointList;
GLint m_BackgroundProID; GLint m_BackgroundProID;
GLint m_BackgroundMatrixID; GLint m_BackgroundMatrixID;
...@@ -196,7 +192,7 @@ private: ...@@ -196,7 +192,7 @@ private:
float m_BackgroundColor[16]; float m_BackgroundColor[16];
std::list <PieSegment2DPointList> m_PieSegment2DShapePointList; std::list <PointList> m_PieSegment2DShapePointList;
PointList m_Symbol2DPointList; PointList m_Symbol2DPointList;
std::list<PointList> m_Symbol2DShapePointList; std::list<PointList> m_Symbol2DShapePointList;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment