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
6c4ce5f3
Kaydet (Commit)
6c4ce5f3
authored
Haz 17, 2014
tarafından
weigao
Kaydeden (comit)
Markus Mohrhard
Haz 17, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
modify the default view angle
Change-Id: Ic7c901108a290a9d9c5a8564b6eefa7ed32a9e1f
üst
c52e4403
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
10 deletions
+57
-10
GL3DBarChart.cxx
chart2/source/view/charttypes/GL3DBarChart.cxx
+51
-10
GL3DBarChart.hxx
chart2/source/view/inc/GL3DBarChart.hxx
+6
-0
No files found.
chart2/source/view/charttypes/GL3DBarChart.cxx
Dosyayı görüntüle @
6c4ce5f3
...
@@ -38,7 +38,8 @@ GL3DBarChart::GL3DBarChart(
...
@@ -38,7 +38,8 @@ GL3DBarChart::GL3DBarChart(
mnMaxY
(
0
),
mnMaxY
(
0
),
mnCornerId
(
0
),
mnCornerId
(
0
),
mbBlockUserInput
(
false
),
mbBlockUserInput
(
false
),
mbNeedsNewRender
(
true
)
mbNeedsNewRender
(
true
),
mbCameraInit
(
false
)
{
{
Size
aSize
=
mrWindow
.
GetSizePixel
();
Size
aSize
=
mrWindow
.
GetSizePixel
();
mpRenderer
->
SetSize
(
aSize
);
mpRenderer
->
SetSize
(
aSize
);
...
@@ -63,9 +64,9 @@ GL3DBarChart::~GL3DBarChart()
...
@@ -63,9 +64,9 @@ GL3DBarChart::~GL3DBarChart()
namespace
{
namespace
{
const
float
TEXT_HEIGHT
=
1
5
.0
f
;
const
float
TEXT_HEIGHT
=
1
0
.0
f
;
const
float
DEFAULT_CAMERA_HEIGHT
=
500.0
f
;
float
DEFAULT_CAMERA_HEIGHT
=
500.0
f
;
const
size_t
STEPS
=
1
00
;
const
size_t
STEPS
=
2
00
;
const
sal_uLong
TIMEOUT
=
5
;
const
sal_uLong
TIMEOUT
=
5
;
const
sal_uInt32
ID_STEP
=
10
;
const
sal_uInt32
ID_STEP
=
10
;
...
@@ -268,12 +269,28 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
...
@@ -268,12 +269,28 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
mnMaxX
=
nMaxPointCount
*
(
BAR_SIZE_X
+
BAR_DISTANCE_X
)
+
40
;
mnMaxX
=
nMaxPointCount
*
(
BAR_SIZE_X
+
BAR_DISTANCE_X
)
+
40
;
mnMaxY
=
nSeriesIndex
*
(
BAR_SIZE_Y
+
BAR_DISTANCE_Y
)
+
40
;
mnMaxY
=
nSeriesIndex
*
(
BAR_SIZE_Y
+
BAR_DISTANCE_Y
)
+
40
;
if
(
!
mbCameraInit
)
maCameraPosition
=
glm
::
vec3
(
-
30
,
-
30
,
DEFAULT_CAMERA_HEIGHT
);
{
mpCamera
->
setPosition
(
maCameraPosition
);
mnDistance
=
sqrt
(
mnMaxX
*
mnMaxX
+
mnMaxY
*
mnMaxY
+
DEFAULT_CAMERA_HEIGHT
*
DEFAULT_CAMERA_HEIGHT
);
maCameraDirection
=
glm
::
vec3
(
mnMaxX
/
2
,
mnMaxY
/
2
,
0
);
maDefaultCameraDirection
=
glm
::
vec3
(
mnMaxX
*
0.4
,
mnMaxY
*
0.35
,
0
);
mpCamera
->
setDirection
(
maCameraDirection
);
maDefaultCameraPosition
=
glm
::
vec3
(
maDefaultCameraDirection
.
x
,
maDefaultCameraDirection
.
y
-
mnDistance
,
DEFAULT_CAMERA_HEIGHT
*
2
);
mnCornerId
=
0
;
mbCameraInit
=
true
;
float
pi
=
3.1415926
f
;
float
angleX
=
-
pi
/
6.5
f
;
float
angleZ
=
-
pi
/
8.0
f
;
glm
::
mat4
maDefaultRotateMatrix
=
glm
::
eulerAngleYXZ
(
0.0
f
,
angleX
,
angleZ
);
maDefaultCameraPosition
=
glm
::
vec3
(
maDefaultRotateMatrix
*
glm
::
vec4
(
maDefaultCameraPosition
,
1.0
f
));
maCameraPosition
=
maDefaultCameraPosition
;
maCameraDirection
=
maDefaultCameraDirection
;
mpCamera
->
setPosition
(
maCameraPosition
);
mpCamera
->
setDirection
(
maCameraDirection
);
}
else
{
mpCamera
->
setPosition
(
maCameraPosition
);
mpCamera
->
setDirection
(
maCameraDirection
);
}
mbNeedsNewRender
=
true
;
mbNeedsNewRender
=
true
;
}
}
...
@@ -330,6 +347,30 @@ public:
...
@@ -330,6 +347,30 @@ public:
}
}
void
GL3DBarChart
::
moveToDefault
()
{
mnStepsTotal
=
STEPS
;
mnStep
=
0
;
mbBlockUserInput
=
true
;
glm
::
vec3
maTargetPosition
=
maDefaultCameraPosition
;
maStep
=
(
maTargetPosition
-
maCameraPosition
)
/
((
float
)
mnStepsTotal
);
glm
::
vec3
maTargetDirection
=
maDefaultCameraDirection
;
maStepDirection
=
(
maTargetDirection
-
maCameraDirection
)
/
((
float
)
mnStepsTotal
);
while
((
mnStep
<
mnStepsTotal
)
&&
mbBlockUserInput
)
{
++
mnStep
;
maCameraPosition
+=
maStep
;
mpCamera
->
setPosition
(
maCameraPosition
);
maCameraDirection
+=
maStepDirection
;
mpCamera
->
setDirection
(
maCameraDirection
);
render
();
}
maShapes
.
pop_back
();
mbBlockUserInput
=
false
;
mnStep
=
0
;
}
void
GL3DBarChart
::
clickedAt
(
const
Point
&
rPos
,
sal_uInt16
nButtons
)
void
GL3DBarChart
::
clickedAt
(
const
Point
&
rPos
,
sal_uInt16
nButtons
)
{
{
if
(
mbBlockUserInput
)
if
(
mbBlockUserInput
)
...
...
chart2/source/view/inc/GL3DBarChart.hxx
Dosyayı görüntüle @
6c4ce5f3
...
@@ -58,6 +58,7 @@ public:
...
@@ -58,6 +58,7 @@ public:
private
:
private
:
void
moveToCorner
();
void
moveToCorner
();
void
moveToDefault
();
glm
::
vec3
getCornerPosition
(
sal_Int8
nCornerId
);
glm
::
vec3
getCornerPosition
(
sal_Int8
nCornerId
);
DECL_LINK
(
MoveCamera
,
void
*
);
DECL_LINK
(
MoveCamera
,
void
*
);
...
@@ -77,6 +78,9 @@ private:
...
@@ -77,6 +78,9 @@ private:
glm
::
vec3
maCameraPosition
;
glm
::
vec3
maCameraPosition
;
glm
::
vec3
maCameraDirection
;
glm
::
vec3
maCameraDirection
;
glm
::
vec3
maDefaultCameraPosition
;
glm
::
vec3
maDefaultCameraDirection
;
Timer
maTimer
;
Timer
maTimer
;
glm
::
vec3
maStep
;
glm
::
vec3
maStep
;
glm
::
vec3
maStepDirection
;
glm
::
vec3
maStepDirection
;
...
@@ -84,6 +88,7 @@ private:
...
@@ -84,6 +88,7 @@ private:
size_t
mnStepsTotal
;
size_t
mnStepsTotal
;
float
mnMaxX
;
float
mnMaxX
;
float
mnMaxY
;
float
mnMaxY
;
float
mnDistance
;
/**
/**
* 0 = corner at (0,0,0);
* 0 = corner at (0,0,0);
* numbering counter clockwise
* numbering counter clockwise
...
@@ -107,6 +112,7 @@ private:
...
@@ -107,6 +112,7 @@ private:
std
::
map
<
sal_uInt32
,
const
BarInformation
>
maBarMap
;
std
::
map
<
sal_uInt32
,
const
BarInformation
>
maBarMap
;
bool
mbBlockUserInput
;
bool
mbBlockUserInput
;
bool
mbNeedsNewRender
;
bool
mbNeedsNewRender
;
bool
mbCameraInit
;
};
};
}
}
...
...
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