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
05ecb52d
Kaydet (Commit)
05ecb52d
authored
Agu 08, 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 position control to screen text
Change-Id: I6bf340acb3aa50f2ce534b10d5be32c4615b0688
üst
692878e3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
18 deletions
+49
-18
GL3DBarChart.cxx
chart2/source/view/charttypes/GL3DBarChart.cxx
+8
-4
3DChartObjects.hxx
chart2/source/view/inc/3DChartObjects.hxx
+2
-1
GL3DRenderer.hxx
chart2/source/view/inc/GL3DRenderer.hxx
+3
-1
3DChartObjects.cxx
chart2/source/view/main/3DChartObjects.cxx
+3
-2
GL3DRenderer.cxx
chart2/source/view/main/GL3DRenderer.cxx
+33
-10
No files found.
chart2/source/view/charttypes/GL3DBarChart.cxx
Dosyayı görüntüle @
05ecb52d
...
...
@@ -25,6 +25,8 @@
#endif
#define BENCH_MARK_MODE false
#define CLICK_EVENT_ID 1
#define SHAPE_START_ID 10
using
namespace
com
::
sun
::
star
;
...
...
@@ -489,7 +491,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
// Each series of data flows from left to right, and multiple series are
// stacked vertically along y axis.
sal_uInt32
nId
=
1
;
sal_uInt32
nId
=
SHAPE_START_ID
;
float
nXEnd
=
0.0
;
float
nYPos
=
0.0
;
...
...
@@ -805,11 +807,13 @@ void GL3DBarChart::clickedAt(const Point& rPos, sal_uInt16 nButtons)
return
;
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
);
maShapes
.
push_back
(
new
opengl3D
::
ScreenText
(
mpRenderer
.
get
(),
*
mpTextCache
,
OUString
(
"Value: "
)
+
OUString
::
number
(
rBarInfo
.
mnVal
),
0
));
OUString
(
"Value: "
)
+
OUString
::
number
(
rBarInfo
.
mnVal
),
CLICK_EVENT_ID
));
opengl3D
::
ScreenText
*
pScreenText
=
static_cast
<
opengl3D
::
ScreenText
*>
(
&
maShapes
.
back
());
pScreenText
->
setPosition
(
glm
::
vec2
(
-
0.9
f
,
0.9
f
),
glm
::
vec2
(
-
0.6
f
,
0.8
f
));
pScreenText
->
setPosition
(
glm
::
vec2
(
-
0.9
f
,
0.9
f
),
glm
::
vec2
(
-
0.6
f
,
0.8
f
)
,
textPos
);
pScreenText
->
render
();
glm
::
vec3
maTargetPosition
=
rBarInfo
.
maPos
;
...
...
chart2/source/view/inc/3DChartObjects.hxx
Dosyayı görüntüle @
05ecb52d
...
...
@@ -111,12 +111,13 @@ public:
ScreenText
(
OpenGL3DRenderer
*
pRenderer
,
TextCache
&
rTextCache
,
const
OUString
&
rStr
,
sal_uInt32
nId
);
virtual
void
render
()
SAL_OVERRIDE
;
void
setPosition
(
const
glm
::
vec2
&
rTopLeft
,
const
glm
::
vec2
&
rBottomRight
);
void
setPosition
(
const
glm
::
vec2
&
rTopLeft
,
const
glm
::
vec2
&
rBottomRight
,
glm
::
vec3
r3DPos
=
glm
::
vec3
(
0.0
,
0.0
,
0.0
)
);
private
:
TextCacheItem
maText
;
glm
::
vec2
maTopLeft
;
glm
::
vec2
maBottomRight
;
glm
::
vec3
ma3DPos
;
};
class
Rectangle
:
public
Renderable3DObject
...
...
chart2/source/view/inc/GL3DRenderer.hxx
Dosyayı görüntüle @
05ecb52d
...
...
@@ -138,8 +138,10 @@ struct PackedVertex{
struct
TextInfo
{
glm
::
vec4
id
;
sal_uInt32
uniqueId
;
GLuint
texture
;
float
vertex
[
12
];
glm
::
vec3
pos
;
};
struct
TextureArrayInfo
...
...
@@ -197,7 +199,7 @@ public:
sal_uInt32
nUniqueId
);
void
CreateScreenTextTexture
(
const
boost
::
shared_array
<
sal_uInt8
>
&
bitmapBuf
,
::
Size
maSizePixels
,
const
glm
::
vec2
&
vTopLeft
,
const
glm
::
vec2
&
vBottomRight
,
sal_uInt32
nUniqueId
);
const
glm
::
vec2
&
vBottomRight
,
glm
::
vec3
vPos
,
sal_uInt32
nUniqueId
);
void
ProcessUnrenderedShape
(
bool
bNewScene
);
void
SetPickingMode
(
bool
bPickingMode
);
...
...
chart2/source/view/main/3DChartObjects.cxx
Dosyayı görüntüle @
05ecb52d
...
...
@@ -134,16 +134,17 @@ ScreenText::ScreenText(OpenGL3DRenderer* pRenderer, TextCache& rTextCache, const
{
}
void
ScreenText
::
setPosition
(
const
glm
::
vec2
&
rTopLeft
,
const
glm
::
vec2
&
rBottomRight
)
void
ScreenText
::
setPosition
(
const
glm
::
vec2
&
rTopLeft
,
const
glm
::
vec2
&
rBottomRight
,
glm
::
vec3
r3DPos
)
{
maTopLeft
=
rTopLeft
;
maBottomRight
=
rBottomRight
;
ma3DPos
=
r3DPos
;
}
void
ScreenText
::
render
()
{
mpRenderer
->
CreateScreenTextTexture
(
maText
.
maPixels
,
maText
.
maSize
,
maTopLeft
,
maBottomRight
,
maTopLeft
,
maBottomRight
,
ma3DPos
,
mnUniqueId
);
}
...
...
chart2/source/view/main/GL3DRenderer.cxx
Dosyayı görüntüle @
05ecb52d
...
...
@@ -1666,13 +1666,14 @@ void OpenGL3DRenderer::RenderExtrude3DObject()
void
OpenGL3DRenderer
::
CreateScreenTextTexture
(
const
boost
::
shared_array
<
sal_uInt8
>
&
bitmapBuf
,
::
Size
maSizePixels
,
const
glm
::
vec2
&
vTopLeft
,
const
glm
::
vec2
&
vBottomRight
,
sal_uInt32
nUniqueId
)
const
glm
::
vec2
&
vBottomRight
,
glm
::
vec3
vPos
,
sal_uInt32
nUniqueId
)
{
long
bmpWidth
=
maSizePixels
.
Width
();
long
bmpHeight
=
maSizePixels
.
Height
();
TextInfo
aTextInfo
;
aTextInfo
.
id
=
getColorAsVector
(
nUniqueId
);
aTextInfo
.
uniqueId
=
nUniqueId
;
aTextInfo
.
vertex
[
0
]
=
vBottomRight
.
x
;
aTextInfo
.
vertex
[
1
]
=
vBottomRight
.
y
;
aTextInfo
.
vertex
[
2
]
=
0
;
...
...
@@ -1688,6 +1689,7 @@ void OpenGL3DRenderer::CreateScreenTextTexture(
aTextInfo
.
vertex
[
9
]
=
vTopLeft
.
x
;
aTextInfo
.
vertex
[
10
]
=
vBottomRight
.
y
;
aTextInfo
.
vertex
[
11
]
=
0
;
aTextInfo
.
pos
=
vPos
;
CHECK_GL_ERROR
();
glGenTextures
(
1
,
&
aTextInfo
.
texture
);
...
...
@@ -1868,16 +1870,37 @@ void OpenGL3DRenderer::ReleaseScreenTextShapes()
void
OpenGL3DRenderer
::
RenderScreenTextShape
()
{
glUseProgram
(
maResources
.
m_ScreenTextProID
);
CHECK_GL_ERROR
();
for
(
size_t
i
=
0
;
i
<
m_ScreenTextInfoList
.
size
();
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
;
if
(
textInfo
.
uniqueId
)
{
glm
::
vec3
worldPos
=
glm
::
vec3
(
m_ScrollMoveMatrix
*
m_GlobalScaleMatrix
*
glm
::
vec4
(
textInfo
.
pos
,
1
));
if
(
worldPos
.
x
<
m_fMinCoordX
)
continue
;
glm
::
vec4
pos
=
m_3DProjection
*
m_3DView
*
glm
::
vec4
(
worldPos
,
1
);
xTrans
=
pos
.
x
/
pos
.
w
;
yTrans
=
pos
.
y
/
pos
.
w
;
for
(
int
j
=
0
;
j
<
12
;
j
++
)
{
if
(
j
%
3
==
0
)
{
textInfo
.
vertex
[
j
]
+=
xTrans
;
}
if
(
j
%
3
==
1
)
{
textInfo
.
vertex
[
j
]
+=
yTrans
;
}
}
}
glBindBuffer
(
GL_ARRAY_BUFFER
,
m_VertexBuffer
);
CHECK_GL_ERROR
();
glBufferData
(
GL_ARRAY_BUFFER
,
sizeof
(
textInfo
.
vertex
),
textInfo
.
vertex
,
GL_STATIC_DRAW
);
CHECK_GL_ERROR
();
glUseProgram
(
maResources
.
m_ScreenTextProID
);
CHECK_GL_ERROR
();
// 1rst attribute buffer : vertices
...
...
@@ -1912,13 +1935,13 @@ void OpenGL3DRenderer::RenderScreenTextShape()
//TODO: moggi: get rid fo GL_QUADS
glDrawArrays
(
GL_QUADS
,
0
,
4
);
CHECK_GL_ERROR
();
glDisableVertexAttribArray
(
maResources
.
m_ScreenTextTexCoordID
);
CHECK_GL_ERROR
();
glDisableVertexAttribArray
(
maResources
.
m_ScreenTextVertexID
);
CHECK_GL_ERROR
();
glBindTexture
(
GL_TEXTURE_2D
,
0
);
glUseProgram
(
0
);
}
glDisableVertexAttribArray
(
maResources
.
m_ScreenTextTexCoordID
);
CHECK_GL_ERROR
();
glDisableVertexAttribArray
(
maResources
.
m_ScreenTextVertexID
);
CHECK_GL_ERROR
();
glBindTexture
(
GL_TEXTURE_2D
,
0
);
glUseProgram
(
0
);
CHECK_GL_ERROR
();
}
void
OpenGL3DRenderer
::
ReleaseTextShapesBatch
()
...
...
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