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
15e2c82a
Kaydet (Commit)
15e2c82a
authored
May 13, 2014
tarafından
Markus Mohrhard
Kaydeden (comit)
Markus Mohrhard
May 13, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
restore correct repaint after changed value in 3D chart
Change-Id: Ied1904a56b8d526288a89fd8df0bed639cd317d0
üst
9fbafe9f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
59 deletions
+63
-59
GL3DBarChart.cxx
chart2/source/view/charttypes/GL3DBarChart.cxx
+7
-9
GL3DBarChart.hxx
chart2/source/view/inc/GL3DBarChart.hxx
+3
-5
GL3DPlotterBase.hxx
chart2/source/view/inc/GL3DPlotterBase.hxx
+7
-1
ChartView.cxx
chart2/source/view/main/ChartView.cxx
+46
-44
No files found.
chart2/source/view/charttypes/GL3DBarChart.cxx
Dosyayı görüntüle @
15e2c82a
...
...
@@ -25,13 +25,10 @@ namespace chart {
GL3DBarChart
::
GL3DBarChart
(
const
css
::
uno
::
Reference
<
css
::
chart2
::
XChartType
>&
xChartType
,
const
boost
::
ptr_vector
<
VDataSeries
>&
rDataSeries
,
OpenGLWindow
&
rWindow
,
ExplicitCategoriesProvider
&
rCatProvider
)
:
OpenGLWindow
&
rWindow
)
:
mxChartType
(
xChartType
),
maDataSeries
(
rDataSeries
),
mpRenderer
(
new
opengl3D
::
OpenGL3DRenderer
()),
mrWindow
(
rWindow
),
mrCatProvider
(
rCatProvider
)
mrWindow
(
rWindow
)
{
mrWindow
.
setRenderer
(
this
);
mpRenderer
->
init
();
...
...
@@ -42,7 +39,8 @@ GL3DBarChart::~GL3DBarChart()
mrWindow
.
setRenderer
(
NULL
);
}
void
GL3DBarChart
::
create3DShapes
()
void
GL3DBarChart
::
create3DShapes
(
const
boost
::
ptr_vector
<
VDataSeries
>&
rDataSeriesContainer
,
ExplicitCategoriesProvider
&
rCatProvider
)
{
// Each series of data flows from left to right, and multiple series are
// stacked vertically along y axis.
...
...
@@ -68,8 +66,8 @@ void GL3DBarChart::create3DShapes()
maShapes
.
clear
();
maShapes
.
push_back
(
new
opengl3D
::
Camera
(
mpRenderer
.
get
()));
sal_Int32
nSeriesIndex
=
0
;
for
(
boost
::
ptr_vector
<
VDataSeries
>::
const_iterator
itr
=
maDataSeries
.
begin
(),
itrEnd
=
maDataSeries
.
end
();
itr
!=
itrEnd
;
++
itr
)
for
(
boost
::
ptr_vector
<
VDataSeries
>::
const_iterator
itr
=
rDataSeriesContainer
.
begin
(),
itrEnd
=
rDataSeriesContainer
.
end
();
itr
!=
itrEnd
;
++
itr
)
{
nYPos
=
nSeriesIndex
*
(
nBarSizeY
+
nBarDistanceY
)
+
nBarSizeY
;
...
...
@@ -147,7 +145,7 @@ void GL3DBarChart::create3DShapes()
pRect
->
setLineColor
(
COL_BLUE
);
// Create category texts along X-axis at the bottom.
uno
::
Sequence
<
OUString
>
aCats
=
m
rCatProvider
.
getSimpleCategories
();
uno
::
Sequence
<
OUString
>
aCats
=
rCatProvider
.
getSimpleCategories
();
for
(
sal_Int32
i
=
0
;
i
<
aCats
.
getLength
();
++
i
)
{
float
nXPos
=
i
*
(
nBarSizeX
+
nBarDistanceX
);
...
...
chart2/source/view/inc/GL3DBarChart.hxx
Dosyayı görüntüle @
15e2c82a
...
...
@@ -34,12 +34,12 @@ class GL3DBarChart : public GL3DPlotterBase, public IRenderer
public
:
GL3DBarChart
(
const
css
::
uno
::
Reference
<
css
::
chart2
::
XChartType
>&
xChartType
,
const
boost
::
ptr_vector
<
VDataSeries
>&
rDataSeries
,
OpenGLWindow
&
rContext
,
ExplicitCategoriesProvider
&
rCatProvider
);
OpenGLWindow
&
rContext
);
virtual
~
GL3DBarChart
();
virtual
void
create3DShapes
()
SAL_OVERRIDE
;
virtual
void
create3DShapes
(
const
boost
::
ptr_vector
<
VDataSeries
>&
rDataSeries
,
ExplicitCategoriesProvider
&
rCatProvider
)
SAL_OVERRIDE
;
virtual
void
render
()
SAL_OVERRIDE
;
...
...
@@ -49,12 +49,10 @@ public:
private
:
css
::
uno
::
Reference
<
css
::
chart2
::
XChartType
>
mxChartType
;
const
boost
::
ptr_vector
<
VDataSeries
>&
maDataSeries
;
boost
::
ptr_vector
<
opengl3D
::
Renderable3DObject
>
maShapes
;
boost
::
scoped_ptr
<
opengl3D
::
OpenGL3DRenderer
>
mpRenderer
;
OpenGLWindow
&
mrWindow
;
ExplicitCategoriesProvider
&
mrCatProvider
;
};
}
...
...
chart2/source/view/inc/GL3DPlotterBase.hxx
Dosyayı görüntüle @
15e2c82a
...
...
@@ -10,14 +10,20 @@
#ifndef CHART2_GL3DPLOTTERBASE_HXX
#define CHART2_GL3DPLOTTERBASE_HXX
#include <boost/ptr_container/ptr_vector.hpp>
#include "VDataSeries.hxx"
namespace
chart
{
class
ExplicitCategoriesProvider
;
class
GL3DPlotterBase
{
public
:
virtual
~
GL3DPlotterBase
();
virtual
void
create3DShapes
()
=
0
;
virtual
void
create3DShapes
(
const
boost
::
ptr_vector
<
VDataSeries
>&
rDataSeries
,
ExplicitCategoriesProvider
&
rCatProvider
)
=
0
;
virtual
void
render
()
=
0
;
};
...
...
chart2/source/view/main/ChartView.cxx
Dosyayı görüntüle @
15e2c82a
...
...
@@ -3115,65 +3115,67 @@ IMPL_LINK_NOARG(ChartView, UpdateTimeBased)
void
ChartView
::
createShapes3D
()
{
if
(
!
m_pGL3DPlotter
)
{
uno
::
Reference
<
XDiagram
>
xDiagram
(
mrChartModel
.
getFirstDiagram
()
);
uno
::
Reference
<
XCoordinateSystemContainer
>
xCooSysContainer
(
xDiagram
,
uno
::
UNO_QUERY
);
if
(
!
xCooSysContainer
.
is
())
return
;
uno
::
Sequence
<
uno
::
Reference
<
XCoordinateSystem
>
>
aCooSysList
(
xCooSysContainer
->
getCoordinateSystems
()
);
boost
::
ptr_vector
<
VDataSeries
>
aDataSeries
;
OpenGLWindow
*
pWindow
=
mrChartModel
.
getOpenGLWindow
();
if
(
!
pWindow
)
return
;
if
(
aCooSysList
.
getLength
()
!=
1
)
// Supporting multiple coordinates in a truly 3D chart (which implies
// it's a Cartesian coordinate system) is a bit of a challenge, if not
// impossible.
return
;
uno
::
Reference
<
XDiagram
>
xDiagram
(
mrChartModel
.
getFirstDiagram
()
);
uno
::
Reference
<
XCoordinateSystemContainer
>
xCooSysContainer
(
xDiagram
,
uno
::
UNO_QUERY
);
if
(
!
xCooSysContainer
.
is
())
return
;
uno
::
Reference
<
XCoordinateSystem
>
xCooSys
(
aCooSysList
[
0
]
);
uno
::
Sequence
<
uno
::
Reference
<
XCoordinateSystem
>
>
aCooSysList
(
xCooSysContainer
->
getCoordinateSystems
()
);
//iterate through all chart types in the current coordinate system
uno
::
Reference
<
XChartTypeContainer
>
xChartTypeContainer
(
xCooSys
,
uno
::
UNO_QUERY
);
OSL_ASSERT
(
xChartTypeContainer
.
is
());
if
(
!
xChartTypeContainer
.
is
()
)
return
;
if
(
aCooSysList
.
getLength
()
!=
1
)
// Supporting multiple coordinates in a truly 3D chart (which implies
// it's a Cartesian coordinate system) is a bit of a challenge, if not
// impossible.
return
;
uno
::
Sequence
<
uno
::
Reference
<
XChartType
>
>
aChartTypeList
(
xChartTypeContainer
->
getChartTypes
()
);
if
(
aChartTypeList
.
getLength
()
!=
1
)
// Likewise, we can't really support multiple chart types here.
return
;
uno
::
Reference
<
XCoordinateSystem
>
xCooSys
(
aCooSysList
[
0
]
);
uno
::
Reference
<
XChartType
>
xChartType
(
aChartTypeList
[
0
]
);
//iterate through all chart types in the current coordinate system
uno
::
Reference
<
XChartTypeContainer
>
xChartTypeContainer
(
xCooSys
,
uno
::
UNO_QUERY
);
OSL_ASSERT
(
xChartTypeContainer
.
is
());
if
(
!
xChartTypeContainer
.
is
()
)
return
;
uno
::
Reference
<
XDataSeriesContainer
>
xDataSeriesContainer
(
xChartType
,
uno
::
UNO_QUERY
);
OSL_ASSERT
(
xDataSeriesContainer
.
is
());
if
(
!
xDataSeriesContainer
.
is
()
)
return
;
uno
::
Sequence
<
uno
::
Reference
<
XChartType
>
>
aChartTypeList
(
xChartTypeContainer
->
getChartTypes
()
);
if
(
aChartTypeList
.
getLength
()
!=
1
)
// Likewise, we can't really support multiple chart types here.
return
;
uno
::
Sequence
<
uno
::
Reference
<
XDataSeries
>
>
aSeriesList
(
xDataSeriesContainer
->
getDataSeries
()
);
for
(
sal_Int32
nS
=
0
;
nS
<
aSeriesList
.
getLength
();
++
nS
)
{
uno
::
Reference
<
XDataSeries
>
xDataSeries
(
aSeriesList
[
nS
],
uno
::
UNO_QUERY
);
if
(
!
xDataSeries
.
is
())
continue
;
uno
::
Reference
<
XChartType
>
xChartType
(
aChartTypeList
[
0
]
);
aDataSeries
.
push_back
(
new
VDataSeries
(
xDataSeries
));
}
if
(
!
m_pGL3DPlotter
)
{
m_pGL3DPlotter
.
reset
(
new
GL3DBarChart
(
xChartType
,
*
pWindow
));
}
OpenGLWindow
*
pWindow
=
mrChartModel
.
getOpenGLWindow
();
if
(
!
pWindow
)
return
;
boost
::
scoped_ptr
<
ExplicitCategoriesProvider
>
pCatProvider
(
new
ExplicitCategoriesProvider
(
xCooSys
,
mrChartModel
));
uno
::
Reference
<
XDataSeriesContainer
>
xDataSeriesContainer
(
xChartType
,
uno
::
UNO_QUERY
);
OSL_ASSERT
(
xDataSeriesContainer
.
is
());
if
(
!
xDataSeriesContainer
.
is
()
)
return
;
pWindow
->
Show
();
boost
::
ptr_vector
<
VDataSeries
>
aDataSeries
;
uno
::
Sequence
<
uno
::
Reference
<
XDataSeries
>
>
aSeriesList
(
xDataSeriesContainer
->
getDataSeries
()
);
for
(
sal_Int32
nS
=
0
;
nS
<
aSeriesList
.
getLength
();
++
nS
)
{
uno
::
Reference
<
XDataSeries
>
xDataSeries
(
aSeriesList
[
nS
],
uno
::
UNO_QUERY
);
if
(
!
xDataSeries
.
is
())
continue
;
m_pGL3DPlotter
.
reset
(
new
GL3DBarChart
(
xChartType
,
aDataSeries
,
*
pWindow
,
*
pCatProvider
));
m_pGL3DPlotter
->
create3DShapes
();
aDataSeries
.
push_back
(
new
VDataSeries
(
xDataSeries
));
}
boost
::
scoped_ptr
<
ExplicitCategoriesProvider
>
pCatProvider
(
new
ExplicitCategoriesProvider
(
xCooSys
,
mrChartModel
));
m_pGL3DPlotter
->
create3DShapes
(
aDataSeries
,
*
pCatProvider
);
m_pGL3DPlotter
->
render
();
pWindow
->
Show
();
}
}
//namespace chart
...
...
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