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
d06ce014
Kaydet (Commit)
d06ce014
authored
May 26, 2014
tarafından
Markus Mohrhard
Kaydeden (comit)
Markus Mohrhard
May 26, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add initial work on zoom into the bar movement
Change-Id: Idc8c1f27dbeafdf34706f09c890f202849c2ce33
üst
22e1895a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
22 deletions
+85
-22
GL3DBarChart.cxx
chart2/source/view/charttypes/GL3DBarChart.cxx
+71
-11
3DChartObjects.hxx
chart2/source/view/inc/3DChartObjects.hxx
+0
-3
GL3DBarChart.hxx
chart2/source/view/inc/GL3DBarChart.hxx
+14
-3
3DChartObjects.cxx
chart2/source/view/main/3DChartObjects.cxx
+0
-5
No files found.
chart2/source/view/charttypes/GL3DBarChart.cxx
Dosyayı görüntüle @
d06ce014
...
@@ -40,7 +40,15 @@ GL3DBarChart::GL3DBarChart(
...
@@ -40,7 +40,15 @@ GL3DBarChart::GL3DBarChart(
mpRenderer
->
SetSize
(
aSize
);
mpRenderer
->
SetSize
(
aSize
);
mrWindow
.
setRenderer
(
this
);
mrWindow
.
setRenderer
(
this
);
mpRenderer
->
init
();
mpRenderer
->
init
();
maTimer
.
SetTimeoutHdl
(
LINK
(
this
,
GL3DBarChart
,
MoveCamera
));
}
GL3DBarChart
::
BarInformation
::
BarInformation
(
const
glm
::
vec3
&
rPos
,
float
nVal
,
sal_Int32
nIndex
,
sal_Int32
nSeriesIndex
)
:
maPos
(
rPos
),
mnVal
(
nVal
),
mnIndex
(
nIndex
),
mnSeriesIndex
(
nSeriesIndex
)
{
}
}
GL3DBarChart
::~
GL3DBarChart
()
GL3DBarChart
::~
GL3DBarChart
()
...
@@ -102,6 +110,10 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
...
@@ -102,6 +110,10 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
COL_RED
,
COL_GREEN
,
COL_YELLOW
,
COL_BROWN
,
COL_GRAY
COL_RED
,
COL_GREEN
,
COL_YELLOW
,
COL_BROWN
,
COL_GRAY
};
};
maCategories
.
clear
();
maSeriesNames
.
clear
();
maSeriesNames
.
reserve
(
rDataSeriesContainer
.
size
());
maBarMap
.
clear
();
maShapes
.
clear
();
maShapes
.
clear
();
maShapes
.
push_back
(
new
opengl3D
::
Camera
(
mpRenderer
.
get
()));
maShapes
.
push_back
(
new
opengl3D
::
Camera
(
mpRenderer
.
get
()));
mpCamera
=
static_cast
<
opengl3D
::
Camera
*>
(
&
maShapes
.
back
());
mpCamera
=
static_cast
<
opengl3D
::
Camera
*>
(
&
maShapes
.
back
());
...
@@ -125,6 +137,8 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
...
@@ -125,6 +137,8 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
DataSeriesHelper
::
getDataSeriesLabel
(
DataSeriesHelper
::
getDataSeriesLabel
(
rDataSeries
.
getModel
(),
mxChartType
->
getRoleOfSequenceForSeriesLabel
());
rDataSeries
.
getModel
(),
mxChartType
->
getRoleOfSequenceForSeriesLabel
());
maSeriesNames
.
push_back
(
aSeriesName
);
if
(
!
aSeriesName
.
isEmpty
())
if
(
!
aSeriesName
.
isEmpty
())
{
{
maShapes
.
push_back
(
new
opengl3D
::
Text
(
mpRenderer
.
get
(),
maShapes
.
push_back
(
new
opengl3D
::
Text
(
mpRenderer
.
get
(),
...
@@ -155,6 +169,10 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
...
@@ -155,6 +169,10 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
glm
::
mat4
aTranslationMatrix
=
glm
::
translate
(
nXPos
,
nYPos
,
0.0
f
);
glm
::
mat4
aTranslationMatrix
=
glm
::
translate
(
nXPos
,
nYPos
,
0.0
f
);
glm
::
mat4
aBarPosition
=
aTranslationMatrix
*
aScaleMatrix
;
glm
::
mat4
aBarPosition
=
aTranslationMatrix
*
aScaleMatrix
;
maBarMap
.
insert
(
std
::
pair
<
sal_uInt32
,
BarInformation
>
(
nId
,
BarInformation
(
glm
::
vec3
(
nXPos
,
nYPos
,
float
(
nVal
/
nMaxVal
)),
nVal
,
nIndex
,
nSeriesIndex
)));
maShapes
.
push_back
(
new
opengl3D
::
Bar
(
mpRenderer
.
get
(),
aBarPosition
,
nColor
,
nId
++
));
maShapes
.
push_back
(
new
opengl3D
::
Bar
(
mpRenderer
.
get
(),
aBarPosition
,
nColor
,
nId
++
));
}
}
...
@@ -186,12 +204,6 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
...
@@ -186,12 +204,6 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
pAxis
->
setPosition
(
aBegin
,
aEnd
);
pAxis
->
setPosition
(
aBegin
,
aEnd
);
pAxis
->
setLineColor
(
COL_BLUE
);
pAxis
->
setLineColor
(
COL_BLUE
);
// test for information
maShapes
.
push_back
(
new
opengl3D
::
ScreenText
(
mpRenderer
.
get
(),
*
mpTextCache
,
"I'm really nice text"
,
0
));
opengl3D
::
ScreenText
*
pScreenText
=
static_cast
<
opengl3D
::
ScreenText
*>
(
&
maShapes
.
back
());
pScreenText
->
setPosition
(
glm
::
vec2
(
-
1.0
f
,
0.9
f
),
glm
::
vec2
(
-
0.6
f
,
0.75
f
));
// Chart background.
// Chart background.
maShapes
.
push_back
(
new
opengl3D
::
Rectangle
(
mpRenderer
.
get
(),
nId
++
));
maShapes
.
push_back
(
new
opengl3D
::
Rectangle
(
mpRenderer
.
get
(),
nId
++
));
opengl3D
::
Rectangle
*
pRect
=
static_cast
<
opengl3D
::
Rectangle
*>
(
&
maShapes
.
back
());
opengl3D
::
Rectangle
*
pRect
=
static_cast
<
opengl3D
::
Rectangle
*>
(
&
maShapes
.
back
());
...
@@ -208,6 +220,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
...
@@ -208,6 +220,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
uno
::
Sequence
<
OUString
>
aCats
=
rCatProvider
.
getSimpleCategories
();
uno
::
Sequence
<
OUString
>
aCats
=
rCatProvider
.
getSimpleCategories
();
for
(
sal_Int32
i
=
0
;
i
<
aCats
.
getLength
();
++
i
)
for
(
sal_Int32
i
=
0
;
i
<
aCats
.
getLength
();
++
i
)
{
{
maCategories
.
push_back
(
aCats
[
i
]);
if
(
aCats
[
i
].
isEmpty
())
if
(
aCats
[
i
].
isEmpty
())
continue
;
continue
;
...
@@ -292,16 +305,41 @@ public:
...
@@ -292,16 +305,41 @@ public:
}
}
void
GL3DBarChart
::
clickedAt
(
const
Point
&
rPos
)
void
GL3DBarChart
::
clickedAt
(
const
Point
&
/*rPos*/
)
{
{
sal_uInt32
nId
=
1
;
sal_uInt32
nId
=
5
;
/*
{
{
PickingModeSetter aPickingModeSetter(mpRenderer.get());
PickingModeSetter aPickingModeSetter(mpRenderer.get());
render();
render();
nId = mpRenderer->GetPixelColorFromPoint(rPos.X(), rPos.Y());
nId = mpRenderer->GetPixelColorFromPoint(rPos.X(), rPos.Y());
}
}
if
(
mpCamera
&&
nId
!=
COL_WHITE
)
*/
mpCamera
->
zoom
(
nId
);
std
::
map
<
sal_uInt32
,
const
BarInformation
>::
const_iterator
itr
=
maBarMap
.
find
(
nId
);
if
(
itr
==
maBarMap
.
end
())
return
;
const
BarInformation
&
rBarInfo
=
itr
->
second
;
mnStepsTotal
=
100
;
mnStep
=
0
;
maOldCameraDirection
=
maCameraDirection
;
maCameraDirection
=
rBarInfo
.
maPos
;
render
();
maStep
=
(
rBarInfo
.
maPos
-
maCameraPosition
)
/
102.0
f
;
maTimer
.
SetTimeout
(
TIMEOUT
);
maTimer
.
SetTimeoutHdl
(
LINK
(
this
,
GL3DBarChart
,
MoveToBar
));
maTimer
.
Start
();
maShapes
.
push_back
(
new
opengl3D
::
ScreenText
(
mpRenderer
.
get
(),
*
mpTextCache
,
OUString
(
"Value: "
)
+
OUString
::
number
(
rBarInfo
.
mnVal
),
0
));
opengl3D
::
ScreenText
*
pScreenText
=
static_cast
<
opengl3D
::
ScreenText
*>
(
&
maShapes
.
back
());
pScreenText
->
setPosition
(
glm
::
vec2
(
-
1.0
f
,
0.9
f
),
glm
::
vec2
(
-
0.6
f
,
0.75
f
));
}
}
void
GL3DBarChart
::
mouseDragMove
(
const
Point
&
rStartPos
,
const
Point
&
rEndPos
,
sal_uInt16
nButtons
)
void
GL3DBarChart
::
mouseDragMove
(
const
Point
&
rStartPos
,
const
Point
&
rEndPos
,
sal_uInt16
nButtons
)
...
@@ -357,6 +395,7 @@ void GL3DBarChart::moveToCorner()
...
@@ -357,6 +395,7 @@ void GL3DBarChart::moveToCorner()
mnStepsTotal
=
100
;
mnStepsTotal
=
100
;
maStep
=
(
getCornerPosition
(
mnCornerId
)
-
maCameraPosition
)
/
float
(
mnStepsTotal
);
maStep
=
(
getCornerPosition
(
mnCornerId
)
-
maCameraPosition
)
/
float
(
mnStepsTotal
);
maTimer
.
SetTimeout
(
TIMEOUT
);
maTimer
.
SetTimeout
(
TIMEOUT
);
maTimer
.
SetTimeoutHdl
(
LINK
(
this
,
GL3DBarChart
,
MoveCamera
));
maTimer
.
Start
();
maTimer
.
Start
();
}
}
...
@@ -380,6 +419,27 @@ IMPL_LINK_NOARG(GL3DBarChart, MoveCamera)
...
@@ -380,6 +419,27 @@ IMPL_LINK_NOARG(GL3DBarChart, MoveCamera)
return
0
;
return
0
;
}
}
IMPL_LINK_NOARG
(
GL3DBarChart
,
MoveToBar
)
{
maTimer
.
Stop
();
if
(
mnStep
<
mnStepsTotal
)
{
++
mnStep
;
maCameraPosition
+=
maStep
;
mpCamera
->
setPosition
(
maCameraPosition
);
render
();
maTimer
.
SetTimeout
(
TIMEOUT
);
maTimer
.
Start
();
}
else
{
maShapes
.
pop_back
();
mnStep
=
0
;
}
return
0
;
}
void
GL3DBarChart
::
scroll
(
long
nDelta
)
void
GL3DBarChart
::
scroll
(
long
nDelta
)
{
{
glm
::
vec3
maDir
=
glm
::
normalize
(
maCameraPosition
-
maCameraDirection
);
glm
::
vec3
maDir
=
glm
::
normalize
(
maCameraPosition
-
maCameraDirection
);
...
...
chart2/source/view/inc/3DChartObjects.hxx
Dosyayı görüntüle @
d06ce014
...
@@ -132,9 +132,6 @@ public:
...
@@ -132,9 +132,6 @@ public:
void
setPosition
(
const
glm
::
vec3
&
rPos
);
void
setPosition
(
const
glm
::
vec3
&
rPos
);
void
setDirection
(
const
glm
::
vec3
&
rPos
);
void
setDirection
(
const
glm
::
vec3
&
rPos
);
/// Zooms the camera towards the bar with Unique Id nId.
void
zoom
(
sal_uInt32
nId
);
private
:
private
:
glm
::
vec3
maPos
;
glm
::
vec3
maPos
;
glm
::
vec3
maUp
;
glm
::
vec3
maUp
;
...
...
chart2/source/view/inc/GL3DBarChart.hxx
Dosyayı görüntüle @
d06ce014
...
@@ -61,6 +61,7 @@ private:
...
@@ -61,6 +61,7 @@ private:
glm
::
vec3
getCornerPosition
(
sal_Int8
nCornerId
);
glm
::
vec3
getCornerPosition
(
sal_Int8
nCornerId
);
DECL_LINK
(
MoveCamera
,
void
*
);
DECL_LINK
(
MoveCamera
,
void
*
);
DECL_LINK
(
MoveToBar
,
void
*
);
css
::
uno
::
Reference
<
css
::
chart2
::
XChartType
>
mxChartType
;
css
::
uno
::
Reference
<
css
::
chart2
::
XChartType
>
mxChartType
;
boost
::
ptr_vector
<
opengl3D
::
Renderable3DObject
>
maShapes
;
boost
::
ptr_vector
<
opengl3D
::
Renderable3DObject
>
maShapes
;
...
@@ -76,6 +77,9 @@ private:
...
@@ -76,6 +77,9 @@ private:
glm
::
vec3
maCameraPosition
;
glm
::
vec3
maCameraPosition
;
glm
::
vec3
maCameraDirection
;
glm
::
vec3
maCameraDirection
;
glm
::
vec3
maOldCameraPosition
;
glm
::
vec3
maOldCameraDirection
;
Timer
maTimer
;
Timer
maTimer
;
glm
::
vec3
maStep
;
glm
::
vec3
maStep
;
size_t
mnStep
;
size_t
mnStep
;
...
@@ -88,14 +92,21 @@ private:
...
@@ -88,14 +92,21 @@ private:
*/
*/
sal_Int8
mnCornerId
;
sal_Int8
mnCornerId
;
std
::
vector
<
OUString
>
maCategories
;
std
::
vector
<
OUString
>
maSeriesNames
;
struct
BarInformation
struct
BarInformation
{
{
double
nVal
;
glm
::
vec3
maPos
;
OUString
aSeriesName
;
float
mnVal
;
sal_Int32
mnIndex
;
sal_Int32
mnSeriesIndex
;
BarInformation
(
const
glm
::
vec3
&
rPos
,
float
nVal
,
sal_Int32
nIndex
,
sal_Int32
nSeriesIndex
);
};
};
std
::
map
<
sal_uInt32
,
BarInformation
>
maBarMap
;
std
::
map
<
sal_uInt32
,
const
BarInformation
>
maBarMap
;
};
};
}
}
...
...
chart2/source/view/main/3DChartObjects.cxx
Dosyayı görüntüle @
d06ce014
...
@@ -209,11 +209,6 @@ void Camera::setDirection(const glm::vec3& rDir)
...
@@ -209,11 +209,6 @@ void Camera::setDirection(const glm::vec3& rDir)
maDirection
=
rDir
;
maDirection
=
rDir
;
}
}
void
Camera
::
zoom
(
sal_uInt32
/*nId*/
)
{
// TODO here
}
}
}
}
}
...
...
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