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
fa97a8b9
Kaydet (Commit)
fa97a8b9
authored
May 24, 2014
tarafından
Markus Mohrhard
Kaydeden (comit)
Markus Mohrhard
May 24, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
some work on mouse scrolling and improved mouse dragging
Change-Id: I3265e26530183b2fc4fd7f67319f3dc124353c2e
üst
2d8941ee
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
16 deletions
+49
-16
GL3DBarChart.cxx
chart2/source/view/charttypes/GL3DBarChart.cxx
+12
-3
GL3DBarChart.hxx
chart2/source/view/inc/GL3DBarChart.hxx
+3
-1
openglwin.hxx
include/vcl/openglwin.hxx
+5
-1
openglwin.cxx
vcl/source/window/openglwin.cxx
+29
-11
No files found.
chart2/source/view/charttypes/GL3DBarChart.cxx
Dosyayı görüntüle @
fa97a8b9
...
...
@@ -229,7 +229,8 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
maCameraPosition
=
glm
::
vec3
(
-
30
,
-
30
,
200
);
mpCamera
->
setPosition
(
maCameraPosition
);
mpCamera
->
setDirection
(
glm
::
vec3
(
nMaxPointCount
*
(
nBarSizeX
+
nBarDistanceX
),
nSeriesIndex
*
(
nBarSizeY
+
nBarDistanceY
),
0
));
maCameraDirection
=
glm
::
vec3
(
0
,
0
,
0
);
mpCamera
->
setDirection
(
maCameraDirection
);
}
void
GL3DBarChart
::
render
()
...
...
@@ -289,9 +290,17 @@ void GL3DBarChart::clickedAt(const Point& rPos)
mpCamera
->
zoom
(
nId
);
}
void
GL3DBarChart
::
mouseDragMove
(
const
Point
&
/*rPos*/
,
sal_uInt16
/*nButtons*/
)
void
GL3DBarChart
::
mouseDragMove
(
const
Point
&
rStartPos
,
const
Point
&
rEndPos
,
sal_uInt16
nButtons
)
{
// fprintf(stderr, "drag move %ld %ld (0x%x)\n", rPos.X(), rPos.Y(), nButtons);
SAL_WARN
(
"chart2.opengl"
,
"Dragging: "
<<
rStartPos
<<
" to : "
<<
rEndPos
<<
" Buttons: "
<<
nButtons
);
}
void
GL3DBarChart
::
scroll
(
long
nDelta
)
{
glm
::
vec3
maDir
=
glm
::
normalize
(
maCameraPosition
-
maCameraDirection
);
maCameraPosition
+=
(
float
((
nDelta
/
10
))
*
maDir
);
mpCamera
->
setPosition
(
maCameraPosition
);
render
();
}
void
GL3DBarChart
::
contextDestroyed
()
...
...
chart2/source/view/inc/GL3DBarChart.hxx
Dosyayı görüntüle @
fa97a8b9
...
...
@@ -50,7 +50,8 @@ public:
virtual
void
update
()
SAL_OVERRIDE
;
virtual
void
clickedAt
(
const
Point
&
rPos
)
SAL_OVERRIDE
;
virtual
void
mouseDragMove
(
const
Point
&
rPos
,
sal_uInt16
nButtons
)
SAL_OVERRIDE
;
virtual
void
mouseDragMove
(
const
Point
&
rStartPos
,
const
Point
&
rEndPos
,
sal_uInt16
nButtons
)
SAL_OVERRIDE
;
virtual
void
scroll
(
long
nDelta
)
SAL_OVERRIDE
;
virtual
void
contextDestroyed
()
SAL_OVERRIDE
;
private
:
...
...
@@ -66,6 +67,7 @@ private:
boost
::
scoped_ptr
<
opengl3D
::
TextCache
>
mpTextCache
;
glm
::
vec3
maCameraPosition
;
glm
::
vec3
maCameraDirection
;
};
}
...
...
include/vcl/openglwin.hxx
Dosyayı görüntüle @
fa97a8b9
...
...
@@ -25,7 +25,8 @@ public:
virtual
~
IRenderer
()
{}
virtual
void
update
()
=
0
;
virtual
void
clickedAt
(
const
Point
&
rPos
)
=
0
;
virtual
void
mouseDragMove
(
const
Point
&
rPos
,
sal_uInt16
nButtons
)
=
0
;
virtual
void
mouseDragMove
(
const
Point
&
rPosBegin
,
const
Point
&
rPosEnd
,
sal_uInt16
nButtons
)
=
0
;
virtual
void
scroll
(
long
nDelta
)
=
0
;
virtual
void
contextDestroyed
()
=
0
;
};
...
...
@@ -45,10 +46,13 @@ public:
virtual
void
MouseButtonDown
(
const
MouseEvent
&
rMEvt
)
SAL_OVERRIDE
;
virtual
void
MouseButtonUp
(
const
MouseEvent
&
rMEvt
)
SAL_OVERRIDE
;
virtual
void
MouseMove
(
const
MouseEvent
&
rMEvt
)
SAL_OVERRIDE
;
virtual
void
Command
(
const
CommandEvent
&
rCEvt
)
SAL_OVERRIDE
;
private
:
boost
::
scoped_ptr
<
OpenGLWindowImpl
>
mpImpl
;
IRenderer
*
mpRenderer
;
Point
maStartPoint
;
};
#endif
...
...
vcl/source/window/openglwin.cxx
Dosyayı görüntüle @
fa97a8b9
...
...
@@ -57,24 +57,42 @@ void OpenGLWindow::Paint(const Rectangle&)
void
OpenGLWindow
::
MouseButtonDown
(
const
MouseEvent
&
rMEvt
)
{
Point
aPoint
=
rMEvt
.
GetPosPixel
();
maStartPoint
=
rMEvt
.
GetPosPixel
();
}
Color
aColor
=
GetPixel
(
aPoint
);
SAL_WARN
(
"vcl.opengl"
,
aColor
.
GetColor
());
if
(
mpRenderer
)
mpRenderer
->
clickedAt
(
aPoint
);
void
OpenGLWindow
::
MouseButtonUp
(
const
MouseEvent
&
rMEvt
)
{
Point
aPoint
=
rMEvt
.
GetPosPixel
();
if
(
aPoint
==
maStartPoint
)
{
Color
aColor
=
GetPixel
(
aPoint
);
SAL_WARN
(
"vcl.opengl"
,
aColor
.
GetColor
());
if
(
mpRenderer
)
mpRenderer
->
clickedAt
(
aPoint
);
}
else
{
mpRenderer
->
mouseDragMove
(
maStartPoint
,
aPoint
,
rMEvt
.
GetButtons
());
}
}
void
OpenGLWindow
::
MouseButtonUp
(
const
MouseEvent
&
/* rMEvt */
)
void
OpenGLWindow
::
Command
(
const
CommandEvent
&
rCEvt
)
{
// in case we need to track button state ourselves.
if
(
rCEvt
.
GetCommand
()
==
COMMAND_WHEEL
)
{
const
CommandWheelData
*
pData
=
rCEvt
.
GetWheelData
();
if
(
pData
->
GetMode
()
==
COMMAND_WHEEL_SCROLL
)
{
long
nDelta
=
pData
->
GetDelta
();
if
(
mpRenderer
)
mpRenderer
->
scroll
(
nDelta
);
}
}
}
void
OpenGLWindow
::
MouseMove
(
const
MouseEvent
&
rMEvt
)
void
OpenGLWindow
::
MouseMove
(
const
MouseEvent
&
/*rMEvt*/
)
{
if
(
rMEvt
.
GetButtons
())
mpRenderer
->
mouseDragMove
(
rMEvt
.
GetPosPixel
(),
rMEvt
.
GetButtons
());
}
void
OpenGLWindow
::
setRenderer
(
IRenderer
*
pRenderer
)
...
...
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