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
7f28c821
Kaydet (Commit)
7f28c821
authored
Nis 30, 2014
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
more type correctness in new code
Change-Id: If6ba00dd10ef0c565c63d559e63ea4135ab4eea4
üst
f49f5e16
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
21 deletions
+17
-21
GL3DRenderer.cxx
chart2/source/view/main/GL3DRenderer.cxx
+17
-21
No files found.
chart2/source/view/main/GL3DRenderer.cxx
Dosyayı görüntüle @
7f28c821
...
...
@@ -193,8 +193,8 @@ void OpenGL3DRenderer::SetVertex(PackedVertex &packed,
{
// If not, it needs to be added in the output data.
vertex
.
push_back
(
packed
.
position
);
normal
.
push_back
(
packed
.
normal
);
unsigned
short
newindex
=
(
unsigned
short
)
vertex
.
size
()
-
1
;
indeices
.
push_back
(
newindex
);
size_t
newindex
=
vertex
.
size
()
-
1
;
indeices
.
push_back
(
newindex
);
VertexToOutIndex
[
packed
]
=
newindex
;
}
}
...
...
@@ -224,7 +224,7 @@ void OpenGL3DRenderer::CreateActualRoundedCube(float fRadius, int iSubDivY, int
{
m_RoundBarMesh
.
iElementStartIndices
[
k
]
=
indeices
[
k
].
size
();
}
for
(
unsigned
in
t
i
=
0
;
i
<
vertices
.
size
();
i
+=
3
)
for
(
size_
t
i
=
0
;
i
<
vertices
.
size
();
i
+=
3
)
{
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
...
...
@@ -538,7 +538,6 @@ int OpenGL3DRenderer::GenerateRoundCornerBar(std::vector<glm::vec3> &vertices, s
return
iFacesAdded
;
}
void
OpenGL3DRenderer
::
GetFreq
()
{
#if 0
...
...
@@ -560,10 +559,9 @@ double OpenGL3DRenderer::GetTime()
int
OpenGL3DRenderer
::
RenderLine3D
(
Polygon3DInfo
&
polygon
)
{
int
listNum
;
listNum
=
polygon
.
verticesList
.
size
();
size_t
listNum
=
polygon
.
verticesList
.
size
();
glUseProgram
(
m_CommonProID
);
for
(
in
t
i
=
0
;
i
<
listNum
;
i
++
)
for
(
size_
t
i
=
0
;
i
<
listNum
;
i
++
)
{
//move the circle to the pos, and scale using the xScale and Y scale
Vertices3D
*
pointList
=
polygon
.
verticesList
.
front
();
...
...
@@ -607,9 +605,8 @@ int OpenGL3DRenderer::RenderLine3D(Polygon3DInfo &polygon)
int
OpenGL3DRenderer
::
RenderPolygon3D
(
Polygon3DInfo
&
polygon
)
{
int
verticesNum
,
normalsNum
;
verticesNum
=
polygon
.
verticesList
.
size
();
normalsNum
=
polygon
.
normalsList
.
size
();
size_t
verticesNum
=
polygon
.
verticesList
.
size
();
size_t
normalsNum
=
polygon
.
normalsList
.
size
();
//check whether the number of vertices and normals are equal
if
(
verticesNum
!=
normalsNum
)
{
...
...
@@ -624,7 +621,7 @@ int OpenGL3DRenderer::RenderPolygon3D(Polygon3DInfo &polygon)
glUseProgram
(
m_3DProID
);
glUniformMatrix4fv
(
m_3DViewID
,
1
,
GL_FALSE
,
&
m_3DView
[
0
][
0
]);
glUniformMatrix4fv
(
m_3DProjectionID
,
1
,
GL_FALSE
,
&
m_3DProjection
[
0
][
0
]);
for
(
in
t
i
=
0
;
i
<
verticesNum
;
i
++
)
for
(
size_
t
i
=
0
;
i
<
verticesNum
;
i
++
)
{
//move the circle to the pos, and scale using the xScale and Y scale
Vertices3D
*
pointList
=
polygon
.
verticesList
.
front
();
...
...
@@ -689,8 +686,8 @@ int OpenGL3DRenderer::RenderPolygon3DObject()
return
0
;
}
glDepthMask
(
GL_FALSE
);
in
t
polygonNum
=
m_Polygon3DInfoList
.
size
();
for
(
in
t
i
=
0
;
i
<
polygonNum
;
i
++
)
size_
t
polygonNum
=
m_Polygon3DInfoList
.
size
();
for
(
size_
t
i
=
0
;
i
<
polygonNum
;
i
++
)
{
Polygon3DInfo
&
polygon
=
m_Polygon3DInfoList
.
front
();
if
(
polygon
.
lineOnly
||
(
!
polygon
.
fillStyle
))
...
...
@@ -737,7 +734,6 @@ void OpenGL3DRenderer::SetLightInfo(bool lightOn, sal_Int32 color, const glm::ve
m_LightsInfo
.
light
[
m_LightsInfo
.
lightNum
].
lightPower
=
1.0
;
m_LightsInfo
.
lightNum
++
;
}
}
void
OpenGL3DRenderer
::
AddShapePolygon3DObject
(
sal_Int32
color
,
bool
lineOnly
,
sal_Int32
lineColor
,
long
fillStyle
,
sal_Int32
specular
)
...
...
@@ -822,7 +818,7 @@ void OpenGL3DRenderer::EndAddPolygon3DObjectPoint()
{
m_Polygon3DInfo
.
verticesList
.
push_back
(
m_Polygon3DInfo
.
vertices
);
//get the buttom surface to calc the camera org, just for the demo
if
(
(
m_Polygon3DInfo
.
vertices
->
size
())
&&
(
!
m_bCameraUpdated
)
)
if
(
m_Polygon3DInfo
.
vertices
->
size
()
&&
!
m_bCameraUpdated
)
{
float
minX
=
m_Polygon3DInfo
.
vertices
->
at
(
0
).
x
;
float
maxX
=
m_Polygon3DInfo
.
vertices
->
at
(
0
).
x
;
...
...
@@ -830,7 +826,7 @@ void OpenGL3DRenderer::EndAddPolygon3DObjectPoint()
float
maxZ
=
m_Polygon3DInfo
.
vertices
->
at
(
0
).
z
;
float
maxY
=
m_Polygon3DInfo
.
vertices
->
at
(
0
).
y
;
float
minY
=
m_Polygon3DInfo
.
vertices
->
at
(
0
).
y
;
for
(
unsigned
in
t
i
=
1
;
i
<
m_Polygon3DInfo
.
vertices
->
size
();
i
++
)
for
(
size_
t
i
=
1
;
i
<
m_Polygon3DInfo
.
vertices
->
size
();
i
++
)
{
minX
=
std
::
min
(
minX
,
m_Polygon3DInfo
.
vertices
->
at
(
i
).
x
);
maxX
=
std
::
max
(
maxX
,
m_Polygon3DInfo
.
vertices
->
at
(
i
).
x
);
...
...
@@ -1150,8 +1146,8 @@ int OpenGL3DRenderer::RenderExtrude3DObject()
(
void
*
)
0
// array buffer offset
);
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
m_CubeElementBuf
);
in
t
extrude3DNum
=
m_Extrude3DList
.
size
();
for
(
in
t
i
=
0
;
i
<
extrude3DNum
;
i
++
)
size_
t
extrude3DNum
=
m_Extrude3DList
.
size
();
for
(
size_
t
i
=
0
;
i
<
extrude3DNum
;
i
++
)
{
Extrude3DInfo
extrude3DInfo
=
m_Extrude3DList
[
i
];
glBindBuffer
(
GL_UNIFORM_BUFFER
,
m_3DUBOBuffer
);
...
...
@@ -1244,9 +1240,9 @@ int OpenGL3DRenderer::ProcessUnrenderedShape()
glm
::
vec4
OpenGL3DRenderer
::
GetColorByIndex
(
int
index
)
{
int
r
=
index
&
0xFF
;
int
g
=
(
index
>>
8
)
&
0xFF
;
int
b
=
(
index
>>
16
)
&
0xFF
;
sal_uInt8
r
=
index
&
0xFF
;
sal_uInt8
g
=
(
index
>>
8
)
&
0xFF
;
sal_uInt8
b
=
(
index
>>
16
)
&
0xFF
;
return
glm
::
vec4
(((
float
)
r
)
/
255.0
,
((
float
)
g
)
/
255.0
,
((
float
)
b
)
/
255.0
,
1.0
);
}
...
...
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