Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
727ea1e4
Kaydet (Commit)
727ea1e4
authored
May 23, 2014
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix spelling of "indices"
Change-Id: I6dc8960d776b809aa701bf8e554e96131b6440c9
üst
7a0069b2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
GL3DRenderer.hxx
chart2/source/view/inc/GL3DRenderer.hxx
+1
-1
GL3DRenderer.cxx
chart2/source/view/main/GL3DRenderer.cxx
+14
-14
No files found.
chart2/source/view/inc/GL3DRenderer.hxx
Dosyayı görüntüle @
727ea1e4
...
@@ -317,7 +317,7 @@ private:
...
@@ -317,7 +317,7 @@ private:
std
::
vector
<
glm
::
vec3
>
m_Normals
;
std
::
vector
<
glm
::
vec3
>
m_Normals
;
std
::
vector
<
unsigned
short
>
m_Ind
e
ices
;
std
::
vector
<
unsigned
short
>
m_Indices
;
RoundBarMesh
m_RoundBarMesh
;
RoundBarMesh
m_RoundBarMesh
;
...
...
chart2/source/view/main/GL3DRenderer.cxx
Dosyayı görüntüle @
727ea1e4
...
@@ -308,7 +308,7 @@ void OpenGL3DRenderer::AddNormalData(GLuint normalBuf)
...
@@ -308,7 +308,7 @@ void OpenGL3DRenderer::AddNormalData(GLuint normalBuf)
void
OpenGL3DRenderer
::
AddIndexData
(
GLuint
indexBuf
)
void
OpenGL3DRenderer
::
AddIndexData
(
GLuint
indexBuf
)
{
{
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
indexBuf
);
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
indexBuf
);
glBufferData
(
GL_ELEMENT_ARRAY_BUFFER
,
m_Ind
eices
.
size
()
*
sizeof
(
unsigned
short
),
&
m_Inde
ices
[
0
],
GL_STATIC_DRAW
);
glBufferData
(
GL_ELEMENT_ARRAY_BUFFER
,
m_Ind
ices
.
size
()
*
sizeof
(
unsigned
short
),
&
m_Ind
ices
[
0
],
GL_STATIC_DRAW
);
CHECK_GL_ERROR
();
CHECK_GL_ERROR
();
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
0
);
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
0
);
}
}
...
@@ -334,20 +334,20 @@ void OpenGL3DRenderer::SetVertex(PackedVertex &packed,
...
@@ -334,20 +334,20 @@ void OpenGL3DRenderer::SetVertex(PackedVertex &packed,
std
::
map
<
PackedVertex
,
unsigned
short
>
&
VertexToOutIndex
,
std
::
map
<
PackedVertex
,
unsigned
short
>
&
VertexToOutIndex
,
std
::
vector
<
glm
::
vec3
>
&
vertex
,
std
::
vector
<
glm
::
vec3
>
&
vertex
,
std
::
vector
<
glm
::
vec3
>
&
normal
,
std
::
vector
<
glm
::
vec3
>
&
normal
,
std
::
vector
<
unsigned
short
>
&
ind
e
ices
)
std
::
vector
<
unsigned
short
>
&
indices
)
{
{
unsigned
short
index
;
unsigned
short
index
;
bool
found
=
GetSimilarVertexIndex
(
packed
,
VertexToOutIndex
,
index
);
bool
found
=
GetSimilarVertexIndex
(
packed
,
VertexToOutIndex
,
index
);
if
(
found
)
if
(
found
)
{
// A similar vertex is already in the VBO, use it instead !
{
// A similar vertex is already in the VBO, use it instead !
ind
e
ices
.
push_back
(
index
);
indices
.
push_back
(
index
);
}
}
else
else
{
// If not, it needs to be added in the output data.
{
// If not, it needs to be added in the output data.
vertex
.
push_back
(
packed
.
position
);
vertex
.
push_back
(
packed
.
position
);
normal
.
push_back
(
packed
.
normal
);
normal
.
push_back
(
packed
.
normal
);
size_t
newindex
=
vertex
.
size
()
-
1
;
size_t
newindex
=
vertex
.
size
()
-
1
;
ind
e
ices
.
push_back
(
newindex
);
indices
.
push_back
(
newindex
);
VertexToOutIndex
[
packed
]
=
newindex
;
VertexToOutIndex
[
packed
]
=
newindex
;
}
}
}
}
...
@@ -367,7 +367,7 @@ void OpenGL3DRenderer::CreateActualRoundedCube(float fRadius, int iSubDivY, int
...
@@ -367,7 +367,7 @@ void OpenGL3DRenderer::CreateActualRoundedCube(float fRadius, int iSubDivY, int
std
::
map
<
PackedVertex
,
unsigned
short
>
VertexToOutIndex
;
std
::
map
<
PackedVertex
,
unsigned
short
>
VertexToOutIndex
;
glm
::
vec3
actualVerteices
[
3
];
glm
::
vec3
actualVerteices
[
3
];
glm
::
vec3
actualNormals
[
3
];
glm
::
vec3
actualNormals
[
3
];
std
::
vector
<
unsigned
short
>
ind
e
ices
[
5
];
std
::
vector
<
unsigned
short
>
indices
[
5
];
glm
::
vec3
externSurNormal
;
glm
::
vec3
externSurNormal
;
glm
::
mat4
corrctCoord
=
glm
::
translate
(
glm
::
vec3
(
width
/
2.0
f
,
height
/
2.0
f
,
depth
/
2.0
f
-
fRadius
));
glm
::
mat4
corrctCoord
=
glm
::
translate
(
glm
::
vec3
(
width
/
2.0
f
,
height
/
2.0
f
,
depth
/
2.0
f
-
fRadius
));
m_RoundBarMesh
.
topThreshold
=
topThreshold
;
m_RoundBarMesh
.
topThreshold
=
topThreshold
;
...
@@ -375,7 +375,7 @@ void OpenGL3DRenderer::CreateActualRoundedCube(float fRadius, int iSubDivY, int
...
@@ -375,7 +375,7 @@ void OpenGL3DRenderer::CreateActualRoundedCube(float fRadius, int iSubDivY, int
m_RoundBarMesh
.
iMeshStartIndices
=
m_Vertices
.
size
();
m_RoundBarMesh
.
iMeshStartIndices
=
m_Vertices
.
size
();
for
(
int
k
=
0
;
k
<
5
;
k
++
)
for
(
int
k
=
0
;
k
<
5
;
k
++
)
{
{
m_RoundBarMesh
.
iElementStartIndices
[
k
]
=
ind
e
ices
[
k
].
size
();
m_RoundBarMesh
.
iElementStartIndices
[
k
]
=
indices
[
k
].
size
();
}
}
for
(
size_t
i
=
0
;
i
<
vertices
.
size
();
i
+=
3
)
for
(
size_t
i
=
0
;
i
<
vertices
.
size
();
i
+=
3
)
{
{
...
@@ -391,7 +391,7 @@ void OpenGL3DRenderer::CreateActualRoundedCube(float fRadius, int iSubDivY, int
...
@@ -391,7 +391,7 @@ void OpenGL3DRenderer::CreateActualRoundedCube(float fRadius, int iSubDivY, int
{
{
{
{
PackedVertex
packed
=
{
actualVerteices
[
k
],
actualNormals
[
k
]};
PackedVertex
packed
=
{
actualVerteices
[
k
],
actualNormals
[
k
]};
SetVertex
(
packed
,
VertexToOutIndex
,
m_Vertices
,
m_Normals
,
ind
e
ices
[
surfaceIndex
]);
SetVertex
(
packed
,
VertexToOutIndex
,
m_Vertices
,
m_Normals
,
indices
[
surfaceIndex
]);
}
}
//add extern
//add extern
...
@@ -401,7 +401,7 @@ void OpenGL3DRenderer::CreateActualRoundedCube(float fRadius, int iSubDivY, int
...
@@ -401,7 +401,7 @@ void OpenGL3DRenderer::CreateActualRoundedCube(float fRadius, int iSubDivY, int
externSurNormal
=
(
surfaceIndex
==
TOP_SURFACE
)
?
glm
::
vec3
(
0.0
,
0.0
,
1.0
)
:
glm
::
vec3
(
0.0
,
0.0
,
-
1.0
);
externSurNormal
=
(
surfaceIndex
==
TOP_SURFACE
)
?
glm
::
vec3
(
0.0
,
0.0
,
1.0
)
:
glm
::
vec3
(
0.0
,
0.0
,
-
1.0
);
int
tmpSurfaceIndex
=
(
surfaceIndex
==
TOP_SURFACE
)
?
FLAT_TOP_SURFACE
:
FLAT_BOTTOM_SURFACE
;
int
tmpSurfaceIndex
=
(
surfaceIndex
==
TOP_SURFACE
)
?
FLAT_TOP_SURFACE
:
FLAT_BOTTOM_SURFACE
;
PackedVertex
packed
=
{
actualVerteices
[
k
],
externSurNormal
};
PackedVertex
packed
=
{
actualVerteices
[
k
],
externSurNormal
};
SetVertex
(
packed
,
VertexToOutIndex
,
m_Vertices
,
m_Normals
,
ind
e
ices
[
tmpSurfaceIndex
]);
SetVertex
(
packed
,
VertexToOutIndex
,
m_Vertices
,
m_Normals
,
indices
[
tmpSurfaceIndex
]);
}
}
}
}
...
@@ -410,13 +410,13 @@ void OpenGL3DRenderer::CreateActualRoundedCube(float fRadius, int iSubDivY, int
...
@@ -410,13 +410,13 @@ void OpenGL3DRenderer::CreateActualRoundedCube(float fRadius, int iSubDivY, int
m_RoundBarMesh
.
iMeshSizes
=
m_Vertices
.
size
()
-
m_RoundBarMesh
.
iMeshStartIndices
;
m_RoundBarMesh
.
iMeshSizes
=
m_Vertices
.
size
()
-
m_RoundBarMesh
.
iMeshStartIndices
;
for
(
int
k
=
0
;
k
<
5
;
k
++
)
for
(
int
k
=
0
;
k
<
5
;
k
++
)
{
{
m_RoundBarMesh
.
iElementSizes
[
k
]
=
ind
e
ices
[
k
].
size
()
-
m_RoundBarMesh
.
iElementStartIndices
[
k
];
m_RoundBarMesh
.
iElementSizes
[
k
]
=
indices
[
k
].
size
()
-
m_RoundBarMesh
.
iElementStartIndices
[
k
];
m_RoundBarMesh
.
iElementStartIndices
[
k
]
=
m_Ind
e
ices
.
size
()
*
sizeof
(
unsigned
short
);
m_RoundBarMesh
.
iElementStartIndices
[
k
]
=
m_Indices
.
size
()
*
sizeof
(
unsigned
short
);
for
(
unsigned
int
IdxCnt
=
0
;
IdxCnt
<
ind
e
ices
[
k
].
size
();
IdxCnt
++
)
for
(
unsigned
int
IdxCnt
=
0
;
IdxCnt
<
indices
[
k
].
size
();
IdxCnt
++
)
{
{
m_Ind
eices
.
push_back
(
inde
ices
[
k
][
IdxCnt
]);
m_Ind
ices
.
push_back
(
ind
ices
[
k
][
IdxCnt
]);
}
}
ind
e
ices
[
k
].
clear
();
indices
[
k
].
clear
();
}
}
vertices
.
clear
();
vertices
.
clear
();
normals
.
clear
();
normals
.
clear
();
...
@@ -1025,7 +1025,7 @@ void OpenGL3DRenderer::AddShape3DExtrudeObject(bool roundedCorner, sal_uInt32 nC
...
@@ -1025,7 +1025,7 @@ void OpenGL3DRenderer::AddShape3DExtrudeObject(bool roundedCorner, sal_uInt32 nC
}
}
m_Vertices
.
clear
();
m_Vertices
.
clear
();
m_Normals
.
clear
();
m_Normals
.
clear
();
m_Ind
e
ices
.
clear
();
m_Indices
.
clear
();
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment