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
22b45c0a
Kaydet (Commit)
22b45c0a
authored
Agu 02, 2014
tarafından
weigao
Kaydeden (comit)
Markus Mohrhard
Agu 06, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add high light bar code for click
Change-Id: I412173d01fe6611027b45169fe4cd9be5b4cc4df
üst
7dcc31ed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
0 deletions
+70
-0
GL3DBarChart.cxx
chart2/source/view/charttypes/GL3DBarChart.cxx
+3
-0
GL3DRenderer.hxx
chart2/source/view/inc/GL3DRenderer.hxx
+10
-0
GL3DRenderer.cxx
chart2/source/view/main/GL3DRenderer.cxx
+57
-0
No files found.
chart2/source/view/charttypes/GL3DBarChart.cxx
Dosyayı görüntüle @
22b45c0a
...
...
@@ -230,6 +230,8 @@ void RenderBenchMarkThread::MoveCamera()
{
mnStep
=
0
;
mbExecuting
=
false
;
if
(
mpChart
->
maRenderEvent
==
EVENT_CLICK
)
mpChart
->
mpRenderer
->
EndClick
();
mpChart
->
maRenderEvent
=
EVENT_NONE
;
}
}
...
...
@@ -282,6 +284,7 @@ void RenderBenchMarkThread::MoveToBar()
maStepDirection
=
(
maTargetDirection
-
mpChart
->
maCameraDirection
)
/
((
float
)
mnStepsTotal
);
mpChart
->
maClickCond
.
set
();
mbExecuting
=
true
;
mpChart
->
mpRenderer
->
StartClick
(
mpChart
->
mSelectBarId
);
}
MoveCamera
();
}
...
...
chart2/source/view/inc/GL3DRenderer.hxx
Dosyayı görüntüle @
22b45c0a
...
...
@@ -93,6 +93,7 @@ struct Extrude3DInfo
bool
twoSidesLighting
;
glm
::
vec4
extrudeColor
;
glm
::
vec4
id
;
sal_uInt32
orgID
;
float
xScale
;
float
yScale
;
float
zScale
;
...
...
@@ -165,6 +166,8 @@ struct BatchBarInfo
std
::
vector
<
glm
::
mat4
>
modelMatrixList
;
std
::
vector
<
glm
::
mat3
>
normalMatrixList
;
std
::
vector
<
glm
::
vec4
>
colorList
;
std
::
map
<
sal_uInt32
,
unsigned
int
>
mapId2Color
;
glm
::
vec4
selectBarColor
;
};
class
OpenGL3DRenderer
...
...
@@ -204,6 +207,8 @@ public:
void
ReleaseShapes
();
void
ReleaseScreenTextShapes
();
void
ReleaseTextTexture
();
void
StartClick
(
sal_uInt32
&
selectID
);
void
EndClick
();
private
:
void
MoveModelf
(
const
PosVecf3
&
trans
,
const
PosVecf3
&
angle
,
const
PosVecf3
&
scale
);
...
...
@@ -263,6 +268,8 @@ private:
glm
::
vec3
vTopLeft
,
glm
::
vec3
vTopRight
,
glm
::
vec3
vBottomRight
,
glm
::
vec3
vBottomLeft
,
sal_uInt32
nUniqueId
);
void
SetHighLightBar
(
BatchBarInfo
&
barInfo
);
void
DisableHighLightBar
(
BatchBarInfo
&
barInfo
);
private
:
struct
ShaderResources
...
...
@@ -436,7 +443,10 @@ private:
glm
::
vec4
m_LightColor
[
MAX_LIGHT_NUM
];
glm
::
vec4
m_PositionWorldspace
[
MAX_LIGHT_NUM
];
float
m_fLightPower
[
MAX_LIGHT_NUM
];
//for 3.0 end
std
::
vector
<
GLuint
>
m_Texturelist
;
bool
m_bHighLighting
;
sal_uInt32
m_uiSelectID
;
};
}
...
...
chart2/source/view/main/GL3DRenderer.cxx
Dosyayı görüntüle @
22b45c0a
...
...
@@ -107,6 +107,8 @@ OpenGL3DRenderer::OpenGL3DRenderer():
,
m_Batch3DUBOBuffer
(
0
)
,
m_Batch3DActualSizeLight
(
0
)
,
m_iLightNum
(
0
)
,
m_bHighLighting
(
false
)
,
m_uiSelectID
(
0
)
{
m_Polygon3DInfo
.
lineOnly
=
false
;
m_Polygon3DInfo
.
twoSidesLighting
=
false
;
...
...
@@ -1140,6 +1142,7 @@ void OpenGL3DRenderer::EndAddPolygon3DObjectPoint()
void
OpenGL3DRenderer
::
AddShape3DExtrudeObject
(
bool
roundedCorner
,
sal_uInt32
nColor
,
sal_uInt32
specular
,
const
glm
::
mat4
&
modelMatrix
,
sal_uInt32
nUniqueId
)
{
m_Extrude3DInfo
.
id
=
getColorAsVector
(
nUniqueId
);
m_Extrude3DInfo
.
orgID
=
nUniqueId
;
glm
::
vec4
tranform
=
modelMatrix
*
glm
::
vec4
(
0.0
,
0.0
,
0.0
,
1.0
);
glm
::
vec4
DirX
=
modelMatrix
*
glm
::
vec4
(
1.0
,
0.0
,
0.0
,
0.0
);
glm
::
vec4
DirY
=
modelMatrix
*
glm
::
vec4
(
0.0
,
1.0
,
0.0
,
0.0
);
...
...
@@ -2107,6 +2110,7 @@ void OpenGL3DRenderer::ReleaseBatchBarInfo()
m_BarSurface
[
i
].
modelMatrixList
.
clear
();
m_BarSurface
[
i
].
normalMatrixList
.
clear
();
m_BarSurface
[
i
].
colorList
.
clear
();
m_BarSurface
[
i
].
mapId2Color
.
clear
();
}
}
...
...
@@ -2145,6 +2149,7 @@ void OpenGL3DRenderer::GetBatchMiddleInfo(const Extrude3DInfo &extrude3D)
m_BarSurface
[
MIDDLE_SURFACE
].
modelMatrixList
.
push_back
(
m_Model
);
m_BarSurface
[
MIDDLE_SURFACE
].
normalMatrixList
.
push_back
(
normalInverseTranspos
);
m_BarSurface
[
MIDDLE_SURFACE
].
colorList
.
push_back
(
extrude3D
.
material
.
materialColor
);
m_BarSurface
[
MIDDLE_SURFACE
].
mapId2Color
[
extrude3D
.
orgID
]
=
m_BarSurface
[
MIDDLE_SURFACE
].
colorList
.
size
()
-
1
;
}
void
OpenGL3DRenderer
::
GetBatchTopAndFlatInfo
(
const
Extrude3DInfo
&
extrude3D
)
...
...
@@ -2181,6 +2186,7 @@ void OpenGL3DRenderer::GetBatchTopAndFlatInfo(const Extrude3DInfo &extrude3D)
m_BarSurface
[
TOP_SURFACE
].
modelMatrixList
.
push_back
(
m_Model
);
m_BarSurface
[
TOP_SURFACE
].
normalMatrixList
.
push_back
(
normalInverseTranspos
);
m_BarSurface
[
TOP_SURFACE
].
colorList
.
push_back
(
extrude3D
.
material
.
materialColor
);
m_BarSurface
[
TOP_SURFACE
].
mapId2Color
[
extrude3D
.
orgID
]
=
m_BarSurface
[
TOP_SURFACE
].
colorList
.
size
()
-
1
;
glm
::
mat4
aTranslationMatrix
=
glm
::
translate
(
glm
::
vec3
(
trans
.
x
,
trans
.
y
,
trans
.
z
));
glm
::
mat4
flatScale
=
glm
::
scale
(
glm
::
vec3
(
xyScale
,
xyScale
,
xyScale
));
...
...
@@ -2192,6 +2198,7 @@ void OpenGL3DRenderer::GetBatchTopAndFlatInfo(const Extrude3DInfo &extrude3D)
m_BarSurface
[
FLAT_BOTTOM_SURFACE
].
modelMatrixList
.
push_back
(
m_Model
);
m_BarSurface
[
FLAT_BOTTOM_SURFACE
].
normalMatrixList
.
push_back
(
normalInverseTranspos
);
m_BarSurface
[
FLAT_BOTTOM_SURFACE
].
colorList
.
push_back
(
extrude3D
.
material
.
materialColor
);
m_BarSurface
[
FLAT_BOTTOM_SURFACE
].
mapId2Color
[
extrude3D
.
orgID
]
=
m_BarSurface
[
FLAT_BOTTOM_SURFACE
].
colorList
.
size
()
-
1
;
}
void
OpenGL3DRenderer
::
GetBatchBarsInfo
()
...
...
@@ -2215,14 +2222,64 @@ void OpenGL3DRenderer::GetBatchBarsInfo()
m_BarSurface
[
0
].
modelMatrixList
.
push_back
(
m_Model
);
m_BarSurface
[
0
].
normalMatrixList
.
push_back
(
normalInverseTranspos
);
m_BarSurface
[
0
].
colorList
.
push_back
(
extrude3DInfo
.
material
.
materialColor
);
m_BarSurface
[
0
].
mapId2Color
[
extrude3DInfo
.
orgID
]
=
m_BarSurface
[
0
].
colorList
.
size
()
-
1
;
}
}
}
void
OpenGL3DRenderer
::
SetHighLightBar
(
BatchBarInfo
&
barInfo
)
{
std
::
map
<
sal_uInt32
,
unsigned
int
>
::
iterator
it
=
barInfo
.
mapId2Color
.
find
(
m_uiSelectID
);
if
(
it
!=
barInfo
.
mapId2Color
.
end
())
{
unsigned
int
idx
=
it
->
second
;
barInfo
.
selectBarColor
=
barInfo
.
colorList
[
idx
];
barInfo
.
colorList
[
idx
]
=
glm
::
vec4
(
1.0
,
1.0
,
1.0
,
1.0
);
}
}
void
OpenGL3DRenderer
::
DisableHighLightBar
(
BatchBarInfo
&
barInfo
)
{
std
::
map
<
sal_uInt32
,
unsigned
int
>
::
iterator
it
=
barInfo
.
mapId2Color
.
find
(
m_uiSelectID
);
if
(
it
!=
barInfo
.
mapId2Color
.
end
())
{
unsigned
int
idx
=
it
->
second
;
barInfo
.
colorList
[
idx
]
=
barInfo
.
selectBarColor
;
}
}
void
OpenGL3DRenderer
::
StartClick
(
sal_uInt32
&
selectID
)
{
m_bHighLighting
=
true
;
m_uiSelectID
=
selectID
;
for
(
unsigned
int
i
=
0
;
i
<
3
;
i
++
)
{
SetHighLightBar
(
m_BarSurface
[
i
]);
}
}
void
OpenGL3DRenderer
::
EndClick
()
{
m_bHighLighting
=
false
;
for
(
unsigned
int
i
=
0
;
i
<
3
;
i
++
)
{
DisableHighLightBar
(
m_BarSurface
[
i
]);
}
}
void
OpenGL3DRenderer
::
RenderBatchBars
(
bool
bNewScene
)
{
if
(
bNewScene
)
{
GetBatchBarsInfo
();
if
(
m_bHighLighting
)
{
for
(
unsigned
int
i
=
0
;
i
<
3
;
i
++
)
{
SetHighLightBar
(
m_BarSurface
[
i
]);
}
}
}
glEnable
(
GL_DEPTH_TEST
);
glEnable
(
GL_CULL_FACE
);
glCullFace
(
GL_BACK
);
...
...
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