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
916b1403
Kaydet (Commit)
916b1403
authored
Agu 09, 2014
tarafından
weigao
Kaydeden (comit)
Markus Mohrhard
Agu 13, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add click and history screen text
Change-Id: I7aba9fcc0a5ed96de722f9334476da6763221ab0
üst
7a91a493
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
8 deletions
+55
-8
GL3DBarChart.cxx
chart2/source/view/charttypes/GL3DBarChart.cxx
+50
-6
GL3DBarChart.hxx
chart2/source/view/inc/GL3DBarChart.hxx
+4
-1
GL3DRenderer.cxx
chart2/source/view/main/GL3DRenderer.cxx
+1
-1
No files found.
chart2/source/view/charttypes/GL3DBarChart.cxx
Dosyayı görüntüle @
916b1403
...
...
@@ -28,6 +28,9 @@
#define CLICK_EVENT_ID 1
#define SHAPE_START_ID 10
#define DATA_UPDATE_TIME 15
#define FPS_TIME 500
#define DATAUPDATE_FPS_TIME 500
#define HISTORY_NUM 5
using
namespace
com
::
sun
::
star
;
...
...
@@ -541,7 +544,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
maBarMap
.
insert
(
std
::
pair
<
sal_uInt32
,
BarInformation
>
(
nId
,
BarInformation
(
glm
::
vec3
(
nXPos
,
nYPos
,
float
(
nVal
/
nMaxVal
)),
nVal
,
nIndex
,
nSeriesIndex
)));
recordBarHistory
(
nId
,
nVal
);
maShapes
.
push_back
(
new
opengl3D
::
Bar
(
mpRenderer
.
get
(),
aBarPosition
,
nColor
,
nId
));
nId
+=
ID_STEP
;
}
...
...
@@ -929,7 +932,7 @@ void GL3DBarChart::addScreenTextShape(OUString &nStr, glm::vec2 rLeftTop, float
void
GL3DBarChart
::
updateRenderFPS
()
{
int
aDeltaMs
=
calcTimeInterval
(
maFPSRenderStartTime
,
maFPSRenderEndTime
);
if
(
aDeltaMs
>=
500
)
if
(
aDeltaMs
>=
FPS_TIME
)
{
osl_getSystemTime
(
&
maFPSRenderEndTime
);
aDeltaMs
=
calcTimeInterval
(
maFPSRenderStartTime
,
maFPSRenderEndTime
);
...
...
@@ -939,7 +942,7 @@ void GL3DBarChart::updateRenderFPS()
osl_getSystemTime
(
&
maFPSRenderStartTime
);
}
osl_getSystemTime
(
&
maFPSRenderEndTime
);
addScreenTextShape
(
maFPS
,
glm
::
vec2
(
-
0.99
f
,
0.99
f
),
0.1
f
,
glm
::
vec3
(
0.0
,
0.0
,
0.0
)
);
addScreenTextShape
(
maFPS
,
glm
::
vec2
(
-
0.99
f
,
0.99
f
),
0.1
f
);
}
int
GL3DBarChart
::
calcTimeInterval
(
TimeValue
&
startTime
,
TimeValue
&
endTime
)
...
...
@@ -959,13 +962,14 @@ void GL3DBarChart::updateScreenText()
mpRenderer
->
ReleaseScreenTextShapes
();
updateRenderFPS
();
updateDataUpdateFPS
();
updateClickEvent
();
mbScreenTextNewRender
=
true
;
}
void
GL3DBarChart
::
updateDataUpdateFPS
()
{
int
aDeltaMs
=
calcTimeInterval
(
maDataUpdateStartTime
,
maDataUpdateEndTime
);
if
(
aDeltaMs
>=
500
)
if
(
aDeltaMs
>=
DATAUPDATE_FPS_TIME
)
{
int
iFPS
=
miDataUpdateCounter
*
1000
/
aDeltaMs
;
if
(
iFPS
)
...
...
@@ -981,7 +985,48 @@ void GL3DBarChart::updateDataUpdateFPS()
osl_getSystemTime
(
&
maDataUpdateStartTime
);
}
osl_getSystemTime
(
&
maDataUpdateEndTime
);
addScreenTextShape
(
maDataUpdateFPS
,
glm
::
vec2
(
-
0.69
f
,
0.99
f
),
0.1
f
,
glm
::
vec3
(
0.0
,
0.0
,
0.0
));
addScreenTextShape
(
maDataUpdateFPS
,
glm
::
vec2
(
-
0.69
f
,
0.99
f
),
0.1
f
);
}
void
GL3DBarChart
::
recordBarHistory
(
sal_uInt32
&
nBarID
,
float
&
nVal
)
{
std
::
list
<
float
>
&
alist
=
maBarHistory
[
nBarID
];
if
(
alist
.
size
()
==
HISTORY_NUM
)
alist
.
pop_front
();
alist
.
push_back
(
nVal
);
}
void
GL3DBarChart
::
updateClickEvent
()
{
if
(
maRenderEvent
==
EVENT_CLICK
)
{
std
::
list
<
float
>
&
alist
=
maBarHistory
[
mSelectBarId
];
sal_uInt32
idex
=
0
;
for
(
std
::
list
<
float
>::
iterator
it
=
alist
.
begin
();
it
!=
alist
.
end
();
it
++
)
{
OUString
barValue
;
if
(
idex
+
1
==
alist
.
size
())
{
barValue
=
OUString
(
"Value: "
)
+
OUString
::
number
(
*
it
);
maScreenTextShapes
.
push_back
(
new
opengl3D
::
ScreenText
(
mpRenderer
.
get
(),
*
mpTextCache
,
barValue
,
CLICK_EVENT_ID
));
opengl3D
::
TextCacheItem
tmpTextCache
=
mpTextCache
->
getText
(
barValue
);
float
rectWidth
=
(
float
)
tmpTextCache
.
maSize
.
Width
()
/
(
float
)
tmpTextCache
.
maSize
.
Height
()
*
0.03
;
std
::
map
<
sal_uInt32
,
const
BarInformation
>::
const_iterator
itr
=
maBarMap
.
find
(
mSelectBarId
);
const
BarInformation
&
rBarInfo
=
itr
->
second
;
glm
::
vec3
textPos
=
glm
::
vec3
(
rBarInfo
.
maPos
.
x
+
BAR_SIZE_X
/
2.0
f
,
rBarInfo
.
maPos
.
y
+
BAR_SIZE_Y
/
2.0
f
,
rBarInfo
.
maPos
.
z
);
opengl3D
::
ScreenText
*
pScreenText
=
static_cast
<
opengl3D
::
ScreenText
*>
(
&
maScreenTextShapes
.
back
());
pScreenText
->
setPosition
(
glm
::
vec2
(
-
rectWidth
/
2
,
0.03
f
),
glm
::
vec2
(
rectWidth
/
2
,
-
0.03
f
),
textPos
);
}
else
{
barValue
=
OUString
(
"History_"
)
+
OUString
::
number
(
idex
)
+
OUString
(
": "
)
+
OUString
::
number
(
*
it
);
addScreenTextShape
(
barValue
,
glm
::
vec2
(
0.65
f
,
0.99
f
-
(
idex
*
0.1
f
)),
0.1
f
);
}
idex
++
;
}
}
}
IMPL_LINK_NOARG
(
GL3DBarChart
,
updateTimer
)
...
...
@@ -992,7 +1037,6 @@ IMPL_LINK_NOARG(GL3DBarChart, updateTimer)
maTimer
.
Start
();
return
0
;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
chart2/source/view/inc/GL3DBarChart.hxx
Dosyayı görüntüle @
916b1403
...
...
@@ -91,7 +91,9 @@ private:
void
updateDataUpdateFPS
();
DECL_LINK
(
updateTimer
,
void
*
);
int
calcTimeInterval
(
TimeValue
&
startTime
,
TimeValue
&
endTime
);
void
addScreenTextShape
(
OUString
&
nStr
,
glm
::
vec2
rLeftTop
,
float
nTextHeight
,
glm
::
vec3
rPos
,
sal_uInt32
nEvent
=
0
);
void
addScreenTextShape
(
OUString
&
nStr
,
glm
::
vec2
rLeftTop
,
float
nTextHeight
,
glm
::
vec3
rPos
=
glm
::
vec3
(
0.0
f
,
0.0
f
,
0.0
f
),
sal_uInt32
nEvent
=
0
);
void
recordBarHistory
(
sal_uInt32
&
nBarID
,
float
&
nVal
);
void
updateClickEvent
();
css
::
uno
::
Reference
<
css
::
chart2
::
XChartType
>
mxChartType
;
boost
::
ptr_vector
<
opengl3D
::
Renderable3DObject
>
maShapes
;
...
...
@@ -156,6 +158,7 @@ private:
TimeValue
maFPSRenderEndTime
;
TimeValue
maDataUpdateStartTime
;
TimeValue
maDataUpdateEndTime
;
std
::
map
<
sal_uInt32
,
std
::
list
<
float
>>
maBarHistory
;
};
}
...
...
chart2/source/view/main/GL3DRenderer.cxx
Dosyayı görüntüle @
916b1403
...
...
@@ -1880,7 +1880,7 @@ void OpenGL3DRenderer::RenderScreenTextShape()
CHECK_GL_ERROR
();
for
(
size_t
i
=
0
;
i
<
m_ScreenTextInfoList
.
size
();
i
++
)
{
TextInfo
&
textInfo
=
m_ScreenTextInfoList
[
i
];
TextInfo
textInfo
=
m_ScreenTextInfoList
[
i
];
//calc the postition and check whether it can be displayed
float
xTrans
=
0.0
f
;
float
yTrans
=
0.0
f
;
...
...
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