remove the GL based 3D charts
Change-Id: Ia578c71ae70aa0a85b49fa50138edf90f961b1e9 Reviewed-on: https://gerrit.libreoffice.org/57533 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
@ -345,9 +345,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
|
||||
canvastools \
|
||||
chartcore \
|
||||
chartcontroller \
|
||||
$(if $(ENABLE_HEADLESS),, \
|
||||
chartopengl \
|
||||
) \
|
||||
$(call gb_Helper_optional,OPENCL,clew) \
|
||||
$(if $(filter $(OS),WNT),,cmdmail) \
|
||||
cppcanvas \
|
||||
|
@ -152,7 +152,7 @@ local file="$1"
|
||||
*/libdesktop_detectorlo.so|*/ui-previewer|*/oosplash|*/gengal.bin)
|
||||
whitelist="${whitelist} ${x11whitelist}"
|
||||
;;
|
||||
*/libvclplug_genlo.so|*/libchartcorelo.so|*/libavmediaogl.so|*/libOGLTranslo.so|*/liboglcanvaslo.so|*/libchartopengllo.so)
|
||||
*/libvclplug_genlo.so|*/libchartcorelo.so|*/libavmediaogl.so|*/libOGLTranslo.so|*/liboglcanvaslo.so)
|
||||
whitelist="${whitelist} ${x11whitelist} ${openglwhitelist}"
|
||||
;;
|
||||
*/libvcllo.so)
|
||||
|
@ -47,7 +47,6 @@ DEFAULTS = \
|
||||
'basic.sb' : ( 2, EXCLUDE, EXCLUDE, INCLUDE), # 10.7
|
||||
'chart2.chartcontroller' : ( 6, EXCLUDE, INCLUDE, INCLUDE), # 18.4
|
||||
'chart2.chartcore' : ( 3, EXCLUDE, EXCLUDE, INCLUDE), # 22.5
|
||||
'chart2.chartopengl' : (12, EXCLUDE, EXCLUDE, EXCLUDE), # 5.3
|
||||
'comphelper.comphelper' : ( 4, EXCLUDE, INCLUDE, INCLUDE), # 7.6
|
||||
'configmgr.configmgr' : ( 6, EXCLUDE, INCLUDE, INCLUDE), # 6.0
|
||||
'connectivity.ado' : ( 2, EXCLUDE, EXCLUDE, EXCLUDE), # 6.4
|
||||
|
@ -348,18 +348,6 @@ blacklist:
|
||||
chart2/source/view/inc/Linear3DTransformation.hxx:
|
||||
# base class has to be a complete type
|
||||
- com/sun/star/chart2/XTransformation.hpp
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:
|
||||
# base class has to be a complete type
|
||||
- boost/shared_array.hpp
|
||||
- map
|
||||
- vector
|
||||
chart2/source/view/inc/GL3DBarChart.hxx:
|
||||
# base class has to be a complete type
|
||||
- deque
|
||||
- memory
|
||||
- vector
|
||||
- GL3DPlotterBase.hxx
|
||||
- vcl/idle.hxx
|
||||
chart2/source/view/inc/VLineProperties.hxx:
|
||||
# base class has to be a complete type
|
||||
- com/sun/star/uno/Reference.h
|
||||
|
@ -75,7 +75,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
|
||||
chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty \
|
||||
chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties \
|
||||
chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty \
|
||||
chart2/source/controller/chartapiwrapper/WrappedGL3DProperties \
|
||||
chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty \
|
||||
chart2/source/controller/chartapiwrapper/WrappedScaleProperty \
|
||||
chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties \
|
||||
@ -88,7 +87,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
|
||||
chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty \
|
||||
chart2/source/controller/dialogs/ChangingResource \
|
||||
chart2/source/controller/dialogs/ChartTypeDialogController \
|
||||
chart2/source/controller/dialogs/GL3DBarChartDialogController \
|
||||
chart2/source/controller/dialogs/DataBrowser \
|
||||
chart2/source/controller/dialogs/DataBrowserModel \
|
||||
chart2/source/controller/dialogs/DialogModel \
|
||||
|
@ -23,17 +23,10 @@ $(eval $(call gb_Library_add_defs,chartcore,\
|
||||
-DOOO_DLLIMPLEMENTATION_CHARTVIEW \
|
||||
))
|
||||
|
||||
ifeq ($(SYSTEM_GLM),TRUE)
|
||||
$(eval $(call gb_Library_add_defs,chartcore,\
|
||||
-DGLM_ENABLE_EXPERIMENTAL \
|
||||
))
|
||||
endif
|
||||
|
||||
$(eval $(call gb_Library_set_precompiled_header,chartcore,$(SRCDIR)/chart2/inc/pch/precompiled_chartcore))
|
||||
|
||||
$(eval $(call gb_Library_use_externals,chartcore,\
|
||||
boost_headers \
|
||||
glm_headers \
|
||||
))
|
||||
|
||||
ifeq ($(ENABLE_HEADLESS),)
|
||||
@ -125,14 +118,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\
|
||||
chart2/source/view/main/VTitle \
|
||||
chart2/source/view/main/VButton \
|
||||
))
|
||||
ifeq ($(ENABLE_HEADLESS),)
|
||||
$(eval $(call gb_Library_add_exception_objects,chartcore,\
|
||||
chart2/source/view/main/3DChartObjects \
|
||||
chart2/source/view/main/GL3DPlotterBase \
|
||||
chart2/source/view/main/GL3DRenderer \
|
||||
chart2/source/view/charttypes/GL3DBarChart \
|
||||
))
|
||||
endif
|
||||
|
||||
# model pieces ...
|
||||
$(eval $(call gb_Library_add_exception_objects,chartcore,\
|
||||
@ -172,8 +157,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\
|
||||
chart2/source/model/template/ColumnLineDataInterpreter \
|
||||
chart2/source/model/template/DataInterpreter \
|
||||
chart2/source/model/template/FilledNetChartType \
|
||||
chart2/source/model/template/GL3DBarChartType \
|
||||
chart2/source/model/template/GL3DBarChartTypeTemplate \
|
||||
chart2/source/model/template/LineChartType \
|
||||
chart2/source/model/template/LineChartTypeTemplate \
|
||||
chart2/source/model/template/NetChartType \
|
||||
|
@ -1,64 +0,0 @@
|
||||
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
||||
#
|
||||
# This file is part of the LibreOffice project.
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
|
||||
$(eval $(call gb_Library_Library,chartopengl))
|
||||
|
||||
$(eval $(call gb_Library_set_include,chartopengl,\
|
||||
-I$(SRCDIR)/chart2/inc \
|
||||
-I$(SRCDIR)/chart2/source/model/inc \
|
||||
-I$(SRCDIR)/chart2/source/view/inc \
|
||||
-I$(SRCDIR)/chart2/source/inc \
|
||||
$$(INCLUDE) \
|
||||
))
|
||||
|
||||
$(eval $(call gb_Library_set_precompiled_header,chartopengl,$(SRCDIR)/chart2/inc/pch/precompiled_chartopengl))
|
||||
|
||||
$(eval $(call gb_Library_use_externals,chartopengl,\
|
||||
boost_headers \
|
||||
glm_headers \
|
||||
epoxy \
|
||||
))
|
||||
|
||||
$(eval $(call gb_Library_use_sdk_api,chartopengl))
|
||||
|
||||
$(eval $(call gb_Library_use_libraries,chartopengl,\
|
||||
basegfx \
|
||||
chartcore \
|
||||
comphelper \
|
||||
cppu \
|
||||
cppuhelper \
|
||||
drawinglayer \
|
||||
editeng \
|
||||
fwe \
|
||||
i18nlangtag \
|
||||
sal \
|
||||
sfx \
|
||||
svl \
|
||||
svt \
|
||||
svxcore \
|
||||
tl \
|
||||
tk \
|
||||
ucbhelper \
|
||||
utl \
|
||||
vcl \
|
||||
))
|
||||
|
||||
$(eval $(call gb_Library_add_exception_objects,chartopengl,\
|
||||
chart2/source/view/main/OpenglShapeFactory \
|
||||
chart2/source/view/main/DummyXShape \
|
||||
chart2/source/view/main/OpenGLRender \
|
||||
))
|
||||
|
||||
ifeq ($(SYSTEM_GLM),TRUE)
|
||||
$(eval $(call gb_Library_add_defs,chartopengl,\
|
||||
-DGLM_ENABLE_EXPERIMENTAL \
|
||||
))
|
||||
endif
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
@ -14,12 +14,6 @@ $(eval $(call gb_Module_add_targets,chart2,\
|
||||
Library_chartcore \
|
||||
UIConfig_chart2 \
|
||||
))
|
||||
ifeq ($(ENABLE_HEADLESS),)
|
||||
$(eval $(call gb_Module_add_targets,chart2,\
|
||||
Library_chartopengl \
|
||||
Package_opengl \
|
||||
))
|
||||
endif
|
||||
|
||||
$(eval $(call gb_Module_add_l10n_targets,chart2,\
|
||||
AllLangMoTarget_chart \
|
||||
|
@ -1,41 +0,0 @@
|
||||
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
||||
#
|
||||
# This file is part of the LibreOffice project.
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
|
||||
$(eval $(call gb_Package_Package,chart2_opengl_shader,$(SRCDIR)/chart2/opengl))
|
||||
|
||||
$(eval $(call gb_Package_add_files,chart2_opengl_shader,$(LIBO_ETC_FOLDER)/opengl,\
|
||||
backgroundFragmentShader.glsl \
|
||||
backgroundVertexShader.glsl \
|
||||
commonFragmentShader.glsl \
|
||||
commonVertexShader.glsl \
|
||||
debugFragmentShader.glsl \
|
||||
debugVertexShader.glsl \
|
||||
pickingVertexShader.glsl \
|
||||
pickingFragmentShader.glsl \
|
||||
symbolFragmentShader.glsl \
|
||||
symbolVertexShader.glsl \
|
||||
textFragmentShader.glsl \
|
||||
textVertexShader.glsl \
|
||||
screenTextFragmentShader.glsl \
|
||||
screenTextVertexShader.glsl \
|
||||
shape3DFragmentShader.glsl \
|
||||
shape3DVertexShader.glsl \
|
||||
renderTextureVertexShader.glsl \
|
||||
renderTextureFragmentShader.glsl \
|
||||
shape3DFragmentShaderBatch.glsl \
|
||||
shape3DVertexShaderBatch.glsl \
|
||||
shape3DFragmentShaderV300.glsl \
|
||||
shape3DVertexShaderV300.glsl \
|
||||
textFragmentShaderBatch.glsl \
|
||||
textVertexShaderBatch.glsl \
|
||||
shape3DFragmentShaderBatchScroll.glsl \
|
||||
shape3DVertexShaderBatchScroll.glsl \
|
||||
))
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
@ -46,7 +46,6 @@
|
||||
|
||||
#include <com/sun/star/chart2/XChartDocument.hpp>
|
||||
#include <com/sun/star/chart2/XTitled.hpp>
|
||||
#include <com/sun/star/chart2/X3DChartWindowProvider.hpp>
|
||||
|
||||
#include <com/sun/star/frame/XLoadable.hpp>
|
||||
#include <com/sun/star/datatransfer/XTransferable.hpp>
|
||||
@ -68,7 +67,6 @@ namespace com { namespace sun { namespace star { namespace frame { class XModel;
|
||||
namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; } } } }
|
||||
|
||||
class SvNumberFormatter;
|
||||
class OpenGLWindow;
|
||||
|
||||
namespace chart
|
||||
{
|
||||
@ -100,7 +98,6 @@ typedef cppu::WeakImplHelper<
|
||||
,css::document::XDocumentPropertiesSupplier
|
||||
,css::chart2::data::XDataSource
|
||||
,css::document::XUndoManagerSupplier
|
||||
,css::chart2::X3DChartWindowProvider
|
||||
,css::util::XUpdatable
|
||||
,css::qa::XDumper
|
||||
>
|
||||
@ -371,8 +368,6 @@ public:
|
||||
|
||||
virtual void SAL_CALL createDefaultChart() override;
|
||||
|
||||
virtual sal_Bool SAL_CALL isOpenGLChart() override;
|
||||
|
||||
// ____ XDataReceiver (public API) ____
|
||||
virtual void SAL_CALL
|
||||
attachDataProvider( const css::uno::Reference< css::chart2::data::XDataProvider >& xProvider ) override;
|
||||
@ -450,9 +445,6 @@ public:
|
||||
// ____ XDataSource ____ allows access to the currently used data and data ranges
|
||||
virtual css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > SAL_CALL getDataSequences() override;
|
||||
|
||||
// X3DChartWindowProvider
|
||||
virtual void SAL_CALL setWindow( sal_uInt64 nWindowPtr ) override;
|
||||
|
||||
// XUpdatable
|
||||
virtual void SAL_CALL update() override;
|
||||
|
||||
@ -475,16 +467,9 @@ public:
|
||||
|
||||
void removeDataProviders();
|
||||
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
OpenGLWindow* getOpenGLWindow() { return mpOpenGLWindow;}
|
||||
#endif
|
||||
|
||||
private:
|
||||
sal_Int32 mnStart;
|
||||
sal_Int32 mnEnd;
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
VclPtr<OpenGLWindow> mpOpenGLWindow;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace chart
|
||||
|
@ -54,8 +54,6 @@ namespace chart {
|
||||
class VCoordinateSystem;
|
||||
class DrawModelWrapper;
|
||||
class VDataSeries;
|
||||
class GL3DPlotterBase;
|
||||
class GL2DRenderer;
|
||||
struct CreateShapeParam2D;
|
||||
|
||||
struct TimeBasedInfo
|
||||
@ -96,7 +94,6 @@ class ChartView : public ::cppu::WeakImplHelper<
|
||||
, public ExplicitValueProvider
|
||||
, private SfxListener
|
||||
{
|
||||
friend class GL2DRenderer;
|
||||
private:
|
||||
void init();
|
||||
|
||||
@ -182,14 +179,11 @@ public:
|
||||
virtual OUString SAL_CALL dump() override;
|
||||
|
||||
void setViewDirty();
|
||||
void updateOpenGLWindow();
|
||||
|
||||
private: //methods
|
||||
void createShapes();
|
||||
void createShapes2D( const css::awt::Size& rPageSize );
|
||||
bool createAxisTitleShapes2D( CreateShapeParam2D& rParam, const css::awt::Size& rPageSize );
|
||||
void createShapes3D();
|
||||
bool isReal3DChart();
|
||||
void getMetaFile( const css::uno::Reference< css::io::XOutputStream >& xOutStream
|
||||
, bool bUseHighContrast );
|
||||
SdrPage* getSdrPage();
|
||||
@ -201,8 +195,6 @@ private: //methods
|
||||
|
||||
void impl_updateView( bool bCheckLockedCtrler = true );
|
||||
|
||||
void render();
|
||||
|
||||
css::awt::Rectangle impl_createDiagramAndContent( const CreateShapeParam2D& rParam, const css::awt::Size& rPageSize );
|
||||
|
||||
DECL_LINK( UpdateTimeBased, Timer*, void );
|
||||
@ -255,10 +247,8 @@ private: //member
|
||||
|
||||
css::awt::Rectangle m_aResultingDiagramRectangleExcludingAxes;
|
||||
|
||||
std::shared_ptr<GL3DPlotterBase> m_pGL3DPlotter;
|
||||
TimeBasedInfo maTimeBased;
|
||||
osl::Mutex maTimeMutex;
|
||||
std::unique_ptr<GL2DRenderer> mp2DRenderer;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -20,9 +20,7 @@
|
||||
#define BMP_TYPE_STOCK "chart2/res/typestock_16.png"
|
||||
#define BMP_TYPE_COLUMN_LINE "chart2/res/typecolumnline_16.png"
|
||||
#define BMP_TYPE_BUBBLE "chart2/res/typebubble_16.png"
|
||||
#define BMP_TYPE_GL3D_BAR "chart2/res/typegl3dbar_16.png"
|
||||
#define BMP_BUBBLE_1 "chart2/res/bubble_52x60.png"
|
||||
#define BMP_GL3D_BAR_ROUNDRECT "chart2/res/gl3dbar_roundrect.png"
|
||||
#define BMP_AREAS_2D "chart2/res/areas_52x60.png"
|
||||
#define BMP_AREAS_2D_1 "chart2/res/areaspiled_52x60.png"
|
||||
#define BMP_AREAS_2D_3 "chart2/res/areasfull_52x60.png"
|
||||
|
@ -1,12 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "precompiled_chartopengl.hxx"
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,36 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
/*
|
||||
This file has been autogenerated by update_pch.sh. It is possible to edit it
|
||||
manually (such as when an include file has been moved/renamed/removed). All such
|
||||
manual changes will be rewritten by the next run of update_pch.sh (which presumably
|
||||
also fixes all possible problems, so it's usually better to use it).
|
||||
|
||||
Generated on 2017-09-20 22:51:46 using:
|
||||
./bin/update_pch chart2 chartopengl --cutoff=12 --exclude:system --exclude:module --exclude:local
|
||||
|
||||
If after updating build fails, use the following command to locate conflicting headers:
|
||||
./bin/update_pch_bisect ./chart2/inc/pch/precompiled_chartopengl.hxx "make chart2.build" --find-conflicts
|
||||
*/
|
||||
|
||||
#include <ostream>
|
||||
#include <osl/interlck.h>
|
||||
#include <osl/mutex.hxx>
|
||||
#include <osl/thread.hxx>
|
||||
#include <rtl/instance.hxx>
|
||||
#include <rtl/math.hxx>
|
||||
#include <rtl/ref.hxx>
|
||||
#include <rtl/stringutils.hxx>
|
||||
#include <rtl/textenc.h>
|
||||
#include <rtl/ustring.h>
|
||||
#include <sal/config.h>
|
||||
#include <sal/log.hxx>
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -184,8 +184,6 @@
|
||||
#define STR_FILLED NC_("STR_FILLED", "Filled")
|
||||
#define STR_TYPE_BUBBLE NC_("STR_TYPE_BUBBLE", "Bubble")
|
||||
#define STR_BUBBLE_1 NC_("STR_BUBBLE_1", "Bubble Chart")
|
||||
#define STR_TYPE_GL3D_BAR NC_("STR_TYPE_GL3D_BAR", "GL3D Bar")
|
||||
#define STR_GL3D_BAR NC_("STR_GL3D_BAR", "GL3D Bar Chart")
|
||||
|
||||
#define STR_INVALID_NUMBER NC_("STR_INVALID_NUMBER", "Numbers are required. Check your input.")
|
||||
#define STR_STEP_GT_ZERO NC_("STR_STEP_GT_ZERO", "The major interval requires a positive number. Check your input.")
|
||||
|
@ -11,7 +11,6 @@
|
||||
#define INCLUDED_CHART2_INC_UNONAMES_HXX
|
||||
|
||||
#define CHART_UNONAME_SORT_BY_XVALUES "SortByXValues"
|
||||
#define CHART_UNONAME_ROUNDED_EDGE "RoundedEdge"
|
||||
#define CHART_UNONAME_SPLINE_TYPE "SplineType"
|
||||
#define CHART_UNONAME_SPLINE_ORDER "SplineOrder"
|
||||
#define CHART_UNONAME_SPLINE_RESOLUTION "SplineResolution"
|
||||
|
@ -1,19 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
in vec4 fragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = fragmentColor;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,23 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
in vec3 vPosition;
|
||||
uniform mat4 MVP;
|
||||
in vec4 vColor;
|
||||
out vec4 fragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = MVP * vec4(vPosition, 1);
|
||||
fragmentColor = vColor;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,20 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
in vec4 fragmentColor;
|
||||
out vec4 actualColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
actualColor = fragmentColor;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,23 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
in vec3 vPosition;
|
||||
uniform mat4 MVP;
|
||||
uniform vec4 vColor;
|
||||
out vec4 fragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = MVP * vec4(vPosition, 1);
|
||||
fragmentColor = vColor;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,19 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
in vec4 fragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = vec4(1.0, 1.0, 0.0, 0.5);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,21 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
in vec3 vPosition;
|
||||
uniform vec4 vColor;
|
||||
out vec4 fragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = vec4(vPosition, 1);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,24 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
uniform float minCoordX;
|
||||
in vec3 positionWorldspace;
|
||||
in vec4 fragmentColor;
|
||||
out vec4 actualColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (positionWorldspace.x <= minCoordX)
|
||||
discard;
|
||||
actualColor = fragmentColor;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,28 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
in vec3 vPosition;
|
||||
uniform mat4 MVP;
|
||||
uniform mat4 M;
|
||||
uniform vec4 vColor;
|
||||
uniform float minCoordX;
|
||||
uniform float maxCoordX;
|
||||
out vec4 fragmentColor;
|
||||
out vec3 positionWorldspace;
|
||||
void main()
|
||||
{
|
||||
positionWorldspace = (M * vec4(vPosition,1)).xyz;
|
||||
positionWorldspace.x = clamp(positionWorldspace.x, minCoordX, maxCoordX);
|
||||
gl_Position = MVP * vec4(vPosition, 1);
|
||||
fragmentColor = vColor;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,21 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
uniform sampler2D RenderTex;
|
||||
in vec2 vTexCoord;
|
||||
out vec4 actualColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
actualColor = vec4(texture(RenderTex, vTexCoord).rgb, 1.0);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,21 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
in vec4 vPosition;
|
||||
in vec2 texCoord;
|
||||
out vec2 vTexCoord;
|
||||
void main()
|
||||
{
|
||||
gl_Position = vPosition;
|
||||
vTexCoord = texCoord;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,23 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
in vec2 vTexCoord;
|
||||
uniform sampler2D TextTex;
|
||||
uniform vec4 textColor;
|
||||
out vec4 actualColor;
|
||||
void main()
|
||||
{
|
||||
vec3 color = texture2D(TextTex, vTexCoord).rgb;
|
||||
actualColor = ((1.0 - color.r) == 0.0) ? vec4(0.0, 0.0, 0.0, textColor.a) :
|
||||
vec4(textColor.rgb, 1.0);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,21 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
in vec3 vPosition;
|
||||
in vec2 texCoord;
|
||||
out vec2 vTexCoord;
|
||||
void main()
|
||||
{
|
||||
gl_Position = vec4(vPosition, 1);
|
||||
vTexCoord = texCoord;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,112 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 330 core
|
||||
#define MAX_LIGHT_NUM 8
|
||||
|
||||
in vec3 positionWorldspace;
|
||||
in vec3 normalCameraspace;
|
||||
uniform mat4 V;
|
||||
out vec4 actualColor;
|
||||
struct MaterialParameters
|
||||
{
|
||||
vec4 ambient;
|
||||
vec4 diffuse;
|
||||
vec4 specular;
|
||||
vec4 materialColor;
|
||||
|
||||
int twoSidesLighting;
|
||||
float shininess;
|
||||
float pad;
|
||||
float pad1;
|
||||
};
|
||||
|
||||
layout(std140) uniform GlobalMaterialParameters
|
||||
{
|
||||
MaterialParameters matralParameter;
|
||||
}Material;
|
||||
|
||||
struct LightSource
|
||||
{
|
||||
vec4 lightColor;
|
||||
vec4 positionWorldspace;
|
||||
float lightPower;
|
||||
float pad1;
|
||||
float pad2;
|
||||
float pad3;
|
||||
};
|
||||
|
||||
layout(std140) uniform GlobalLights
|
||||
{
|
||||
int lightNum;
|
||||
vec4 ambient;
|
||||
LightSource light[MAX_LIGHT_NUM];
|
||||
} Lights;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 colorTotal = vec3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
vec3 vertexPositionCameraspace = (V * vec4(positionWorldspace,1)).xyz;
|
||||
|
||||
vec3 MaterialDiffuseColor = Material.matralParameter.materialColor.rgb;
|
||||
|
||||
vec3 normalDirectionCameraspace = normalCameraspace;
|
||||
vec3 eyeDirectionCameraspace = normalize(vec3(0, 0, 0) - vertexPositionCameraspace);
|
||||
float attenuation = 1.0;
|
||||
int i = 0;
|
||||
vec3 lightDirectionCameraspace;
|
||||
vec3 vertexToLightSource;
|
||||
|
||||
vec3 lightAmbient = Lights.ambient.rgb *
|
||||
MaterialDiffuseColor *
|
||||
Material.matralParameter.ambient.rgb
|
||||
* 5.0;
|
||||
|
||||
if ((Material.matralParameter.twoSidesLighting == 1) && (!gl_FrontFacing))
|
||||
{
|
||||
normalDirectionCameraspace = -normalDirectionCameraspace;
|
||||
}
|
||||
for (i = 0; i < Lights.lightNum; i++)
|
||||
{
|
||||
float LightPower = Lights.light[i].lightPower;
|
||||
lightDirectionCameraspace = normalize((V * Lights.light[i].positionWorldspace).xyz);
|
||||
|
||||
float cosTheta = clamp(dot(normalDirectionCameraspace,lightDirectionCameraspace), 0,1);
|
||||
vec3 lightDiffuse = LightPower *
|
||||
attenuation *
|
||||
Lights.light[i].lightColor.rgb *
|
||||
MaterialDiffuseColor *
|
||||
Material.matralParameter.diffuse.rgb *
|
||||
cosTheta;
|
||||
|
||||
vec3 specularReflection;
|
||||
if (dot(normalDirectionCameraspace, lightDirectionCameraspace) < 0)
|
||||
{
|
||||
specularReflection = vec3(0.0, 0.0, 0.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
vec3 R = reflect(-lightDirectionCameraspace,normalDirectionCameraspace);
|
||||
float cosAlpha = clamp(dot(eyeDirectionCameraspace, R), 0,1);
|
||||
specularReflection = attenuation *
|
||||
LightPower *
|
||||
Lights.light[i].lightColor.rgb *
|
||||
Material.matralParameter.specular.rgb *
|
||||
MaterialDiffuseColor *
|
||||
pow(max(0.0, cosAlpha), Material.matralParameter.shininess);
|
||||
}
|
||||
colorTotal += lightDiffuse + specularReflection;
|
||||
|
||||
}
|
||||
colorTotal += lightAmbient;
|
||||
actualColor = vec4(colorTotal, 1.0);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,108 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 330 core
|
||||
#define MAX_LIGHT_NUM 8
|
||||
|
||||
in vec3 positionWorldspace;
|
||||
in vec3 normalCameraspace;
|
||||
in vec4 fragBarColor;
|
||||
uniform mat4 V;
|
||||
out vec4 actualColor;
|
||||
struct MaterialParameters
|
||||
{
|
||||
vec4 ambient;
|
||||
vec4 diffuse;
|
||||
vec4 specular;
|
||||
vec4 materialColor;
|
||||
|
||||
int twoSidesLighting;
|
||||
float shininess;
|
||||
float pad;
|
||||
float pad1;
|
||||
};
|
||||
|
||||
layout(std140) uniform GlobalMaterialParameters
|
||||
{
|
||||
MaterialParameters matralParameter;
|
||||
}Material;
|
||||
|
||||
struct LightSource
|
||||
{
|
||||
vec4 lightColor;
|
||||
vec4 positionWorldspace;
|
||||
float lightPower;
|
||||
float pad1;
|
||||
float pad2;
|
||||
float pad3;
|
||||
};
|
||||
|
||||
layout(std140) uniform GlobalLights
|
||||
{
|
||||
int lightNum;
|
||||
vec4 ambient;
|
||||
LightSource light[MAX_LIGHT_NUM];
|
||||
} Lights;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 colorTotal = vec3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
vec3 vertexPositionCameraspace = (V * vec4(positionWorldspace,1)).xyz;
|
||||
|
||||
vec3 MaterialDiffuseColor = fragBarColor.rgb;
|
||||
|
||||
vec3 normalDirectionCameraspace = normalCameraspace;
|
||||
vec3 eyeDirectionCameraspace = normalize(vec3(0, 0, 0) - vertexPositionCameraspace);
|
||||
float attenuation = 1.0;
|
||||
int i = 0;
|
||||
vec3 lightDirectionCameraspace;
|
||||
vec3 vertexToLightSource;
|
||||
|
||||
vec3 lightAmbient = Lights.ambient.rgb *
|
||||
MaterialDiffuseColor *
|
||||
Material.matralParameter.ambient.rgb;
|
||||
|
||||
for (i = 0; i < Lights.lightNum; i++)
|
||||
{
|
||||
float LightPower = Lights.light[i].lightPower;
|
||||
lightDirectionCameraspace = normalize((V * Lights.light[i].positionWorldspace).xyz);
|
||||
|
||||
float cosTheta = clamp(dot(normalDirectionCameraspace,lightDirectionCameraspace), 0,1);
|
||||
vec3 lightDiffuse = LightPower *
|
||||
attenuation *
|
||||
Lights.light[i].lightColor.rgb *
|
||||
MaterialDiffuseColor *
|
||||
Material.matralParameter.diffuse.rgb *
|
||||
cosTheta;
|
||||
|
||||
vec3 specularReflection;
|
||||
if (dot(normalDirectionCameraspace, lightDirectionCameraspace) < 0)
|
||||
{
|
||||
specularReflection = vec3(0.0, 0.0, 0.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
vec3 R = reflect(-lightDirectionCameraspace,normalDirectionCameraspace);
|
||||
float cosAlpha = clamp(dot(eyeDirectionCameraspace, R), 0,1);
|
||||
specularReflection = attenuation *
|
||||
LightPower *
|
||||
Lights.light[i].lightColor.rgb *
|
||||
Material.matralParameter.specular.rgb *
|
||||
MaterialDiffuseColor *
|
||||
pow(max(0.0, cosAlpha), Material.matralParameter.shininess);
|
||||
}
|
||||
colorTotal += lightDiffuse + specularReflection;
|
||||
|
||||
}
|
||||
colorTotal += lightAmbient;
|
||||
actualColor = vec4(colorTotal, 1.0);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,112 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 330 core
|
||||
#define MAX_LIGHT_NUM 8
|
||||
|
||||
in vec3 positionWorldspace;
|
||||
in vec3 normalCameraspace;
|
||||
in vec4 fragBarColor;
|
||||
uniform mat4 V;
|
||||
uniform int undraw;
|
||||
uniform float minCoordX;
|
||||
out vec4 actualColor;
|
||||
struct MaterialParameters
|
||||
{
|
||||
vec4 ambient;
|
||||
vec4 diffuse;
|
||||
vec4 specular;
|
||||
vec4 materialColor;
|
||||
|
||||
int twoSidesLighting;
|
||||
float shininess;
|
||||
float pad;
|
||||
float pad1;
|
||||
};
|
||||
|
||||
layout(std140) uniform GlobalMaterialParameters
|
||||
{
|
||||
MaterialParameters matralParameter;
|
||||
}Material;
|
||||
|
||||
struct LightSource
|
||||
{
|
||||
vec4 lightColor;
|
||||
vec4 positionWorldspace;
|
||||
float lightPower;
|
||||
float pad1;
|
||||
float pad2;
|
||||
float pad3;
|
||||
};
|
||||
|
||||
layout(std140) uniform GlobalLights
|
||||
{
|
||||
int lightNum;
|
||||
vec4 ambient;
|
||||
LightSource light[MAX_LIGHT_NUM];
|
||||
} Lights;
|
||||
|
||||
void main()
|
||||
{
|
||||
if ((positionWorldspace.x <= minCoordX) && (undraw == 1))
|
||||
discard;
|
||||
vec3 colorTotal = vec3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
vec3 vertexPositionCameraspace = (V * vec4(positionWorldspace,1)).xyz;
|
||||
|
||||
vec3 MaterialDiffuseColor = fragBarColor.rgb;
|
||||
|
||||
vec3 normalDirectionCameraspace = normalCameraspace;
|
||||
vec3 eyeDirectionCameraspace = normalize(vec3(0, 0, 0) - vertexPositionCameraspace);
|
||||
float attenuation = 1.0;
|
||||
int i = 0;
|
||||
vec3 lightDirectionCameraspace;
|
||||
vec3 vertexToLightSource;
|
||||
|
||||
vec3 lightAmbient = Lights.ambient.rgb *
|
||||
MaterialDiffuseColor *
|
||||
Material.matralParameter.ambient.rgb;
|
||||
|
||||
for (i = 0; i < Lights.lightNum; i++)
|
||||
{
|
||||
float LightPower = Lights.light[i].lightPower;
|
||||
lightDirectionCameraspace = normalize((V * Lights.light[i].positionWorldspace).xyz);
|
||||
|
||||
float cosTheta = clamp(dot(normalDirectionCameraspace,lightDirectionCameraspace), 0,1);
|
||||
vec3 lightDiffuse = LightPower *
|
||||
attenuation *
|
||||
Lights.light[i].lightColor.rgb *
|
||||
MaterialDiffuseColor *
|
||||
Material.matralParameter.diffuse.rgb *
|
||||
cosTheta;
|
||||
|
||||
vec3 specularReflection;
|
||||
if (dot(normalDirectionCameraspace, lightDirectionCameraspace) < 0)
|
||||
{
|
||||
specularReflection = vec3(0.0, 0.0, 0.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
vec3 R = reflect(-lightDirectionCameraspace,normalDirectionCameraspace);
|
||||
float cosAlpha = clamp(dot(eyeDirectionCameraspace, R), 0,1);
|
||||
specularReflection = attenuation *
|
||||
LightPower *
|
||||
Lights.light[i].lightColor.rgb *
|
||||
Material.matralParameter.specular.rgb *
|
||||
MaterialDiffuseColor *
|
||||
pow(max(0.0, cosAlpha), Material.matralParameter.shininess);
|
||||
}
|
||||
colorTotal += lightDiffuse + specularReflection;
|
||||
|
||||
}
|
||||
colorTotal += lightAmbient;
|
||||
actualColor = vec4(colorTotal, 1.0);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,93 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
#define MAX_LIGHT_NUM 8
|
||||
|
||||
in vec3 positionWorldspace;
|
||||
in vec3 normalCameraspace;
|
||||
|
||||
uniform mat4 V;
|
||||
uniform vec4 materialAmbient;
|
||||
uniform vec4 materialDiffuse;
|
||||
uniform vec4 materialSpecular;
|
||||
uniform vec4 materialColor;
|
||||
uniform int twoSidesLighting;
|
||||
uniform float materialShininess;
|
||||
uniform vec4 lightColor[MAX_LIGHT_NUM];
|
||||
uniform vec4 lightPosWorldspace[MAX_LIGHT_NUM];
|
||||
uniform float lightPower[MAX_LIGHT_NUM];
|
||||
uniform int lightNum;
|
||||
uniform vec4 lightAmbient;
|
||||
uniform int undraw;
|
||||
uniform float minCoordX;
|
||||
|
||||
void main()
|
||||
{
|
||||
if ((positionWorldspace.x <= minCoordX) && (undraw == 1))
|
||||
discard;
|
||||
vec3 colorTotal = vec3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
vec3 vertexPositionCameraspace = (V * vec4(positionWorldspace,1)).xyz;
|
||||
|
||||
vec3 MaterialDiffuseColor = materialColor.rgb;
|
||||
|
||||
vec3 normalDirectionCameraspace = normalCameraspace;
|
||||
vec3 eyeDirectionCameraspace = normalize(vec3(0, 0, 0) - vertexPositionCameraspace);
|
||||
float attenuation = 1.0;
|
||||
int i = 0;
|
||||
vec3 lightDirectionCameraspace;
|
||||
vec3 vertexToLightSource;
|
||||
|
||||
vec3 totalAmbient = lightAmbient.rgb *
|
||||
MaterialDiffuseColor *
|
||||
materialAmbient.rgb;
|
||||
|
||||
if ((twoSidesLighting == 1) && (!gl_FrontFacing))
|
||||
{
|
||||
normalDirectionCameraspace = -normalDirectionCameraspace;
|
||||
}
|
||||
for (i = 0; i < lightNum; i++)
|
||||
{
|
||||
float LightPower = lightPower[i];
|
||||
lightDirectionCameraspace = normalize((V * lightPosWorldspace[i]).xyz);
|
||||
|
||||
float cosTheta = clamp(dot(normalDirectionCameraspace,lightDirectionCameraspace), 0,1);
|
||||
vec3 lightDiffuse = LightPower *
|
||||
attenuation *
|
||||
lightColor[i].rgb *
|
||||
MaterialDiffuseColor *
|
||||
materialDiffuse.rgb *
|
||||
cosTheta;
|
||||
|
||||
vec3 specularReflection;
|
||||
if (dot(normalDirectionCameraspace, lightDirectionCameraspace) < 0)
|
||||
{
|
||||
specularReflection = vec3(0.0, 0.0, 0.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
vec3 R = reflect(-lightDirectionCameraspace,normalDirectionCameraspace);
|
||||
float cosAlpha = clamp(dot(eyeDirectionCameraspace, R), 0,1);
|
||||
specularReflection = attenuation *
|
||||
LightPower *
|
||||
lightColor[i].rgb *
|
||||
materialSpecular.rgb *
|
||||
MaterialDiffuseColor *
|
||||
pow(max(0.0, cosAlpha), materialShininess);
|
||||
}
|
||||
colorTotal += lightDiffuse + specularReflection;
|
||||
|
||||
}
|
||||
colorTotal += totalAmbient;
|
||||
gl_FragColor = vec4(colorTotal, 1.0);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,32 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 330 core
|
||||
|
||||
in vec3 vertexPositionModelspace;
|
||||
in vec3 vertexNormalModelspace;
|
||||
|
||||
out vec3 positionWorldspace;
|
||||
out vec3 normalCameraspace;
|
||||
|
||||
uniform mat4 P;
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat3 normalMatrix;
|
||||
|
||||
void main()
|
||||
{
|
||||
positionWorldspace = (M * vec4(vertexPositionModelspace,1)).xyz;
|
||||
|
||||
gl_Position = P * V * vec4(positionWorldspace,1);
|
||||
|
||||
normalCameraspace = normalize(mat3(V) * normalMatrix * vertexNormalModelspace);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,36 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 330 core
|
||||
|
||||
in vec3 vertexPositionModelspace;
|
||||
in vec3 vertexNormalModelspace;
|
||||
in mat4 M;
|
||||
in mat3 normalMatrix;
|
||||
in vec4 barColor;
|
||||
|
||||
out vec3 positionWorldspace;
|
||||
out vec3 normalCameraspace;
|
||||
out vec4 fragBarColor;
|
||||
|
||||
uniform mat4 P;
|
||||
uniform mat4 V;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = P * V * M * vec4(vertexPositionModelspace,1);
|
||||
|
||||
positionWorldspace = (M * vec4(vertexPositionModelspace,1)).xyz;
|
||||
|
||||
normalCameraspace = normalize(mat3(V) * normalMatrix * vertexNormalModelspace);
|
||||
|
||||
fragBarColor = barColor;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,41 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 330 core
|
||||
|
||||
in vec3 vertexPositionModelspace;
|
||||
in vec3 vertexNormalModelspace;
|
||||
in mat4 M;
|
||||
in mat3 normalMatrix;
|
||||
in vec4 barColor;
|
||||
|
||||
out vec3 positionWorldspace;
|
||||
out vec3 normalCameraspace;
|
||||
out vec4 fragBarColor;
|
||||
|
||||
uniform mat4 P;
|
||||
uniform mat4 V;
|
||||
uniform mat4 transMatrix;
|
||||
uniform float minCoordX;
|
||||
uniform float maxCoordX;
|
||||
|
||||
void main()
|
||||
{
|
||||
positionWorldspace = (transMatrix * M * vec4(vertexPositionModelspace,1)).xyz;
|
||||
|
||||
positionWorldspace.x = clamp(positionWorldspace.x, minCoordX, maxCoordX);
|
||||
|
||||
gl_Position = P * V * vec4(positionWorldspace,1);
|
||||
|
||||
normalCameraspace = normalize(mat3(V) * normalMatrix * vertexNormalModelspace);
|
||||
|
||||
fragBarColor = barColor;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,36 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
in vec3 vertexPositionModelspace;
|
||||
in vec3 vertexNormalModelspace;
|
||||
|
||||
out vec3 positionWorldspace;
|
||||
out vec3 normalCameraspace;
|
||||
|
||||
uniform mat4 P;
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat3 normalMatrix;
|
||||
uniform float minCoordX;
|
||||
uniform float maxCoordX;
|
||||
|
||||
void main()
|
||||
{
|
||||
positionWorldspace = (M * vec4(vertexPositionModelspace,1)).xyz;
|
||||
|
||||
positionWorldspace.x = clamp(positionWorldspace.x, minCoordX, maxCoordX);
|
||||
|
||||
gl_Position = P * V * vec4(positionWorldspace,1);
|
||||
|
||||
normalCameraspace = normalize(mat3(V) * normalMatrix * vertexNormalModelspace);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,101 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
in vec4 fragmentColor;
|
||||
uniform int shape;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 p = gl_PointCoord * 2.0 - vec2(1.0); // (0,0) in the center
|
||||
if(shape == 0)
|
||||
{
|
||||
}
|
||||
else if(shape == 1) //diamond
|
||||
{
|
||||
if (abs(p.x) + abs(p.y) > 1)
|
||||
discard;
|
||||
}
|
||||
else if(shape == 2) // arrow
|
||||
{
|
||||
if(p.y < 0 && (abs(p.x) + abs(p.y)) > 1)
|
||||
discard;
|
||||
else if(p.y > 0 && abs(p.x) > 0.5)
|
||||
discard;
|
||||
}
|
||||
else if(shape == 3) //arrow up
|
||||
{
|
||||
if(p.y > 0 && (abs(p.x) + abs(p.y)) > 1)
|
||||
discard;
|
||||
else if(p.y < 0 && abs(p.x) > 0.5)
|
||||
discard;
|
||||
}
|
||||
else if(shape == 4) // arrow right
|
||||
{
|
||||
if(p.x > 0 && (abs(p.x) + abs(p.y)) > 1)
|
||||
discard;
|
||||
else if(p.x < 0 && abs(p.y) > 0.5)
|
||||
discard;
|
||||
}
|
||||
else if(shape == 5) // arrow left
|
||||
{
|
||||
if(p.x < 0 && (abs(p.x) + abs(p.y)) > 1)
|
||||
discard;
|
||||
else if(p.x > 0 && abs(p.y) > 0.5)
|
||||
discard;
|
||||
}
|
||||
else if(shape == 6) // hour glass
|
||||
{
|
||||
if(abs(p.x) < abs(p.y))
|
||||
discard;
|
||||
}
|
||||
else if(shape == 7) // bow tie
|
||||
{
|
||||
if(abs(p.y) < abs(p.x))
|
||||
discard;
|
||||
}
|
||||
else if(shape == 8) // circle
|
||||
{
|
||||
if(dot(p.x, p.y) > 1)
|
||||
discard;
|
||||
}
|
||||
else if(shape == 9) // star
|
||||
{
|
||||
if(sqrt(abs(p.x))+sqrt(abs(p.y)) > 1)
|
||||
discard;
|
||||
}
|
||||
else if(shape == 10) // X
|
||||
{
|
||||
if(abs(abs(p.x) - abs(p.y)) > 0.2)
|
||||
discard;
|
||||
}
|
||||
else if(shape == 11) // Plus
|
||||
{
|
||||
if(abs(p.x) > 0.2 && abs(p.y) > 0.2)
|
||||
discard;
|
||||
}
|
||||
else if(shape == 12) // asterisk
|
||||
{
|
||||
}
|
||||
else if(shape == 13) // horizontal bar
|
||||
{
|
||||
if(abs(p.y) > 0.2)
|
||||
discard;
|
||||
}
|
||||
else if(shape == 14) // vertical bar
|
||||
{
|
||||
if(abs(p.x) > 0.2)
|
||||
discard;
|
||||
}
|
||||
|
||||
gl_FragColor = fragmentColor;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,23 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
in vec3 vPosition;
|
||||
uniform mat4 MVP;
|
||||
uniform vec4 vColor;
|
||||
out vec4 fragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = MVP * vec4(vPosition, 1);
|
||||
fragmentColor = vColor;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,23 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
uniform sampler2D TextTex;
|
||||
in vec2 vTexCoord;
|
||||
out vec4 actualColor;
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 color = texture(TextTex, vTexCoord).rgb;
|
||||
actualColor = vec4(color, 1.0 - color.r);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,24 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 330 core
|
||||
|
||||
#extension GL_EXT_texture_array : enable
|
||||
|
||||
uniform sampler2DArray texArray;
|
||||
in vec3 vTexCoord;
|
||||
|
||||
out vec4 actualColor;
|
||||
void main()
|
||||
{
|
||||
vec3 color = texture(texArray, vTexCoord.xyz).rgb;
|
||||
actualColor = vec4(color, 1.0 - color.r);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,22 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 150 core
|
||||
|
||||
in vec3 vPosition;
|
||||
uniform mat4 MVP;
|
||||
in vec2 texCoord;
|
||||
out vec2 vTexCoord;
|
||||
void main()
|
||||
{
|
||||
gl_Position = MVP * vec4(vPosition, 1);
|
||||
vTexCoord = texCoord;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,24 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#version 330 core
|
||||
|
||||
in vec3 vPosition;
|
||||
in vec3 texCoord;
|
||||
|
||||
out vec3 vTexCoord;
|
||||
uniform mat4 MVP;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = MVP * vec4(vPosition, 1);
|
||||
vTexCoord = texCoord;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -122,11 +122,6 @@
|
||||
<service name="com.sun.star.chart2.BubbleChartType"/>
|
||||
<service name="com.sun.star.chart2.ChartType"/>
|
||||
</implementation>
|
||||
<implementation name="com.sun.star.comp.chart.GL3DBarChartType"
|
||||
constructor="com_sun_star_comp_chart_GL3DBarChartType_get_implementation">
|
||||
<service name="com.sun.star.chart2.GL3DBarChartType"/>
|
||||
<service name="com.sun.star.chart2.ChartType"/>
|
||||
</implementation>
|
||||
<implementation name="com.sun.star.comp.chart.CandleStickChartType"
|
||||
constructor="com_sun_star_comp_chart_CandleStickChartType_get_implementation">
|
||||
<service name="com.sun.star.beans.PropertySet"/>
|
||||
|
@ -91,7 +91,6 @@ enum eServiceType
|
||||
SERVICE_NAME_STOCK_DIAGRAM,
|
||||
SERVICE_NAME_XY_DIAGRAM,
|
||||
SERVICE_NAME_BUBBLE_DIAGRAM,
|
||||
SERVICE_NAME_GL3DBAR_DIAGRAM,
|
||||
|
||||
SERVICE_NAME_DASH_TABLE,
|
||||
SERVICE_NAME_GARDIENT_TABLE,
|
||||
@ -120,7 +119,6 @@ tServiceNameMap & lcl_getStaticServiceNameMap()
|
||||
{"com.sun.star.chart.StockDiagram", SERVICE_NAME_STOCK_DIAGRAM},
|
||||
{"com.sun.star.chart.XYDiagram", SERVICE_NAME_XY_DIAGRAM},
|
||||
{"com.sun.star.chart.BubbleDiagram", SERVICE_NAME_BUBBLE_DIAGRAM},
|
||||
{"com.sun.star.chart.GL3DBarDiagram", SERVICE_NAME_GL3DBAR_DIAGRAM},
|
||||
|
||||
{"com.sun.star.drawing.DashTable", SERVICE_NAME_DASH_TABLE},
|
||||
{"com.sun.star.drawing.GradientTable", SERVICE_NAME_GARDIENT_TABLE},
|
||||
@ -1167,15 +1165,6 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
|
||||
bCreateDiagram = true;
|
||||
}
|
||||
break;
|
||||
case SERVICE_NAME_GL3DBAR_DIAGRAM:
|
||||
if( xManagerFact.is())
|
||||
{
|
||||
xTemplate.set(
|
||||
xManagerFact->createInstance("com.sun.star.chart2.template.GL3DBar"),
|
||||
uno::UNO_QUERY );
|
||||
bCreateDiagram = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case SERVICE_NAME_DASH_TABLE:
|
||||
case SERVICE_NAME_GARDIENT_TABLE:
|
||||
|
@ -38,7 +38,6 @@
|
||||
#include "WrappedSplineProperties.hxx"
|
||||
#include "WrappedStockProperties.hxx"
|
||||
#include "WrappedSceneProperty.hxx"
|
||||
#include "WrappedGL3DProperties.hxx"
|
||||
#include <RelativePositionHelper.hxx>
|
||||
#include <ControllerLockGuard.hxx>
|
||||
#include <ModifyListenerHelper.hxx>
|
||||
@ -426,7 +425,6 @@ private:
|
||||
WrappedSplineProperties::addProperties( aProperties );
|
||||
WrappedStockProperties::addProperties( aProperties );
|
||||
WrappedAutomaticPositionProperties::addProperties( aProperties );
|
||||
WrappedGL3DProperties::addProperties(aProperties);
|
||||
|
||||
std::sort( aProperties.begin(), aProperties.end(),
|
||||
::chart::PropertyNameLess() );
|
||||
@ -480,9 +478,6 @@ OUString lcl_getDiagramType( const OUString & rTemplateServiceName )
|
||||
{
|
||||
const OUString aName( rTemplateServiceName.copy( aPrefix.getLength()));
|
||||
|
||||
if (aName.indexOf("GL3DBar") != -1)
|
||||
return OUString("com.sun.star.chart.GL3DBarDiagram");
|
||||
|
||||
// "Area" "StackedArea" "PercentStackedArea" "ThreeDArea"
|
||||
// "StackedThreeDArea" "PercentStackedThreeDArea"
|
||||
if( aName.indexOf( "Area" ) != -1 )
|
||||
@ -556,8 +551,8 @@ const tMakeStringStringMap& lcl_getChartTypeNameMap()
|
||||
{"com.sun.star.chart2.FilledNetChartType", "com.sun.star.chart.FilledNetDiagram"},
|
||||
{"com.sun.star.chart2.NetChartType", "com.sun.star.chart.NetDiagram"},
|
||||
{"com.sun.star.chart2.CandleStickChartType", "com.sun.star.chart.StockDiagram"},
|
||||
{"com.sun.star.chart2.BubbleChartType", "com.sun.star.chart.BubbleDiagram"},
|
||||
{"com.sun.star.chart2.GL3DBarChartType", "com.sun.star.chart.GL3DBarDiagram"}};
|
||||
{"com.sun.star.chart2.BubbleChartType", "com.sun.star.chart.BubbleDiagram"}
|
||||
};
|
||||
return g_aChartTypeNameMap;
|
||||
}
|
||||
|
||||
@ -1859,7 +1854,6 @@ const std::vector< WrappedProperty* > DiagramWrapper::createWrappedProperties()
|
||||
WrappedSplineProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
|
||||
WrappedStockProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
|
||||
WrappedAutomaticPositionProperties::addWrappedProperties( aWrappedProperties );
|
||||
WrappedGL3DProperties::addWrappedProperties(aWrappedProperties, m_spChart2ModelContact);
|
||||
|
||||
aWrappedProperties.push_back( new WrappedDataRowSourceProperty( m_spChart2ModelContact ) );
|
||||
aWrappedProperties.push_back( new WrappedStackingProperty( StackMode::YStacked,m_spChart2ModelContact ) );
|
||||
|
@ -1,136 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "WrappedGL3DProperties.hxx"
|
||||
#include "Chart2ModelContact.hxx"
|
||||
#include <FastPropertyIdRanges.hxx>
|
||||
#include <unonames.hxx>
|
||||
#include <WrappedProperty.hxx>
|
||||
#include <DiagramHelper.hxx>
|
||||
|
||||
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
||||
#include <com/sun/star/chart2/XDiagram.hpp>
|
||||
|
||||
using namespace com::sun::star;
|
||||
|
||||
namespace chart { namespace wrapper {
|
||||
|
||||
namespace {
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_GL3DCHARTTYPE_ROUNDED_EDGE = FAST_PROPERTY_ID_START_GL_3D
|
||||
};
|
||||
|
||||
class WrappedGL3DProperty : public WrappedProperty
|
||||
{
|
||||
uno::Any maDefault;
|
||||
std::shared_ptr<Chart2ModelContact> mpModelContact;
|
||||
|
||||
private:
|
||||
uno::Reference<chart2::XChartType> getChartType() const
|
||||
{
|
||||
uno::Reference<chart2::XDiagram> xDiagram = mpModelContact->getChart2Diagram();
|
||||
uno::Sequence<uno::Reference<chart2::XChartType> > aCTs =
|
||||
DiagramHelper::getChartTypesFromDiagram(xDiagram);
|
||||
|
||||
for (sal_Int32 i = 0; i < aCTs.getLength(); ++i)
|
||||
{
|
||||
uno::Reference<chart2::XChartType> xThisCT = aCTs[i];
|
||||
if (xThisCT->getChartType() == "com.sun.star.chart2.GL3DBarChartType")
|
||||
// Found the right chart type.
|
||||
return xThisCT;
|
||||
}
|
||||
|
||||
return uno::Reference<chart2::XChartType>();
|
||||
}
|
||||
|
||||
public:
|
||||
WrappedGL3DProperty( const OUString& rInName, const OUString& rOutName, const uno::Any& rDefault, const std::shared_ptr<Chart2ModelContact>& pContact ) :
|
||||
WrappedProperty(rInName, rOutName), maDefault(rDefault), mpModelContact(pContact) {}
|
||||
|
||||
virtual uno::Any getPropertyValue( const uno::Reference<beans::XPropertySet>& /*xInnerPS*/ ) const override
|
||||
{
|
||||
uno::Reference<chart2::XChartType> xCT = getChartType();
|
||||
if (!xCT.is())
|
||||
return uno::Any();
|
||||
|
||||
try
|
||||
{
|
||||
uno::Reference<beans::XPropertySet> xPS(xCT, uno::UNO_QUERY_THROW);
|
||||
return xPS->getPropertyValue(CHART_UNONAME_ROUNDED_EDGE);
|
||||
}
|
||||
catch ( const uno::Exception& ) {}
|
||||
|
||||
return uno::Any();
|
||||
};
|
||||
|
||||
virtual void setPropertyValue(
|
||||
const uno::Any& rOutValue, const uno::Reference<beans::XPropertySet>& /*xInnerPS*/ ) const override
|
||||
{
|
||||
uno::Reference<chart2::XChartType> xCT = getChartType();
|
||||
if (!xCT.is())
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
uno::Reference<beans::XPropertySet> xPS(xCT, uno::UNO_QUERY_THROW);
|
||||
return xPS->setPropertyValue(CHART_UNONAME_ROUNDED_EDGE, rOutValue);
|
||||
}
|
||||
catch ( const uno::Exception& ) {}
|
||||
}
|
||||
|
||||
virtual void setPropertyToDefault( const uno::Reference<beans::XPropertyState>& /*xInnerPropState*/ ) const override
|
||||
{
|
||||
uno::Reference<chart2::XChartType> xCT = getChartType();
|
||||
if (!xCT.is())
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
uno::Reference<beans::XPropertySet> xPS(xCT, uno::UNO_QUERY_THROW);
|
||||
return xPS->setPropertyValue(CHART_UNONAME_ROUNDED_EDGE, maDefault);
|
||||
}
|
||||
catch ( const uno::Exception& ) {}
|
||||
}
|
||||
|
||||
virtual uno::Any getPropertyDefault( const uno::Reference<beans::XPropertyState>& /*xInnerPS*/ ) const override
|
||||
{
|
||||
return maDefault;
|
||||
}
|
||||
|
||||
virtual beans::PropertyState getPropertyState( const uno::Reference<beans::XPropertyState>& /*xInnerPS*/ ) const override
|
||||
{
|
||||
return beans::PropertyState_DIRECT_VALUE;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
void WrappedGL3DProperties::addProperties( std::vector<css::beans::Property> & rOutProps )
|
||||
{
|
||||
rOutProps.emplace_back(
|
||||
CHART_UNONAME_ROUNDED_EDGE,
|
||||
PROP_GL3DCHARTTYPE_ROUNDED_EDGE,
|
||||
cppu::UnoType<bool>::get(),
|
||||
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT
|
||||
);
|
||||
}
|
||||
|
||||
void WrappedGL3DProperties::addWrappedProperties(
|
||||
std::vector<WrappedProperty*>& rList, const std::shared_ptr<Chart2ModelContact>& pChart2ModelContact )
|
||||
{
|
||||
rList.push_back(
|
||||
new WrappedGL3DProperty(
|
||||
CHART_UNONAME_ROUNDED_EDGE, CHART_UNONAME_ROUNDED_EDGE, uno::Any(false), pChart2ModelContact));
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,38 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_WRAPPEDGL3DPROPERTIES_HXX
|
||||
#define INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_WRAPPEDGL3DPROPERTIES_HXX
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <com/sun/star/beans/Property.hpp>
|
||||
|
||||
namespace chart {
|
||||
|
||||
class WrappedProperty;
|
||||
|
||||
namespace wrapper {
|
||||
|
||||
class Chart2ModelContact;
|
||||
|
||||
class WrappedGL3DProperties
|
||||
{
|
||||
public:
|
||||
static void addProperties( std::vector<css::beans::Property> & rOutProps );
|
||||
static void addWrappedProperties(
|
||||
std::vector<WrappedProperty*>& rList, const std::shared_ptr<Chart2ModelContact>& pChart2ModelContact );
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -159,12 +159,6 @@ ChartTypeParameter ChartTypeDialogController::getChartTypeParameterForService(
|
||||
//not all templates need to support Geometry3D
|
||||
ex.Context.is();//to have debug information without compilation warnings
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
xTemplateProps->getPropertyValue(CHART_UNONAME_ROUNDED_EDGE) >>= aRet.mbRoundedEdge;
|
||||
}
|
||||
catch ( const uno::Exception& ) {}
|
||||
}
|
||||
return aRet;
|
||||
}
|
||||
@ -300,14 +294,6 @@ uno::Reference< XChartTypeTemplate > ChartTypeDialogController::getCurrentTempla
|
||||
ex.Context.is();//to have debug information without compilation warnings
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
xTemplateProps->setPropertyValue(CHART_UNONAME_ROUNDED_EDGE, uno::Any(rParameter.mbRoundedEdge));
|
||||
}
|
||||
catch ( const uno::Exception& )
|
||||
{
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
setTemplateProperties( xTemplateProps );
|
||||
@ -380,11 +366,6 @@ bool ChartTypeDialogController::shouldShow_SortByXValuesResourceGroup() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ChartTypeDialogController::shouldShow_GL3DResourceGroup() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void ChartTypeDialogController::showExtraControls( VclBuilderContainer* /*pParent*/ )
|
||||
{
|
||||
}
|
||||
|
@ -101,7 +101,6 @@ public:
|
||||
virtual bool shouldShow_SplineControl() const;
|
||||
virtual bool shouldShow_GeometryControl() const;
|
||||
virtual bool shouldShow_SortByXValuesResourceGroup() const;
|
||||
virtual bool shouldShow_GL3DResourceGroup() const;
|
||||
|
||||
virtual void showExtraControls(VclBuilderContainer* pParent);
|
||||
virtual void hideExtraControls() const;
|
||||
|
@ -1,57 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "GL3DBarChartDialogController.hxx"
|
||||
#include <strings.hrc>
|
||||
#include <bitmaps.hlst>
|
||||
#include <ResId.hxx>
|
||||
#include <svtools/valueset.hxx>
|
||||
|
||||
namespace chart {
|
||||
|
||||
GL3DBarChartDialogController::GL3DBarChartDialogController() {}
|
||||
|
||||
GL3DBarChartDialogController::~GL3DBarChartDialogController() {}
|
||||
|
||||
bool GL3DBarChartDialogController::shouldShow_GL3DResourceGroup() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
OUString GL3DBarChartDialogController::getName()
|
||||
{
|
||||
return SchResId(STR_TYPE_GL3D_BAR);
|
||||
}
|
||||
|
||||
Image GL3DBarChartDialogController::getImage()
|
||||
{
|
||||
return Image(BitmapEx(BMP_TYPE_GL3D_BAR));
|
||||
}
|
||||
|
||||
const tTemplateServiceChartTypeParameterMap&
|
||||
GL3DBarChartDialogController::getTemplateMap() const
|
||||
{
|
||||
static tTemplateServiceChartTypeParameterMap aMap{
|
||||
{"com.sun.star.chart2.template.GL3DBar", ChartTypeParameter(1)},
|
||||
{"com.sun.star.chart2.template.GL3DBarRoundedRectangle", ChartTypeParameter(2)}};
|
||||
return aMap;
|
||||
}
|
||||
|
||||
void GL3DBarChartDialogController::fillSubTypeList(
|
||||
ValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/ )
|
||||
{
|
||||
rSubTypeList.Clear();
|
||||
rSubTypeList.InsertItem(1, Image(BitmapEx(BMP_GL3D_BAR_ROUNDRECT)));
|
||||
|
||||
rSubTypeList.SetItemText(1, SchResId(STR_GL3D_BAR));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,36 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_GL3DBARCHARTDIALOGCONTROLLER_HXX
|
||||
#define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_GL3DBARCHARTDIALOGCONTROLLER_HXX
|
||||
|
||||
#include "ChartTypeDialogController.hxx"
|
||||
|
||||
namespace chart {
|
||||
|
||||
class GL3DBarChartDialogController : public ChartTypeDialogController
|
||||
{
|
||||
public:
|
||||
GL3DBarChartDialogController();
|
||||
virtual ~GL3DBarChartDialogController() override;
|
||||
|
||||
virtual bool shouldShow_GL3DResourceGroup() const override;
|
||||
|
||||
virtual OUString getName() override;
|
||||
virtual Image getImage() override;
|
||||
virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const override;
|
||||
|
||||
virtual void fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& rParameter ) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -24,7 +24,6 @@
|
||||
#include <DiagramHelper.hxx>
|
||||
#include "res_BarGeometry.hxx"
|
||||
#include <ControllerLockGuard.hxx>
|
||||
#include "GL3DBarChartDialogController.hxx"
|
||||
#include <unonames.hxx>
|
||||
|
||||
#include <svtools/controldims.hxx>
|
||||
@ -261,48 +260,6 @@ IMPL_LINK_NOARG(StackingResourceGroup, StackingEnableHdl, CheckBox&, void)
|
||||
m_pChangeListener->stateChanged(this);
|
||||
}
|
||||
|
||||
class GL3DResourceGroup : public ChangingResource
|
||||
{
|
||||
public:
|
||||
explicit GL3DResourceGroup( VclBuilderContainer* pWindow );
|
||||
|
||||
void showControls( bool bShow );
|
||||
void fillControls( const ChartTypeParameter& rParam );
|
||||
void fillParameter( ChartTypeParameter& rParam );
|
||||
|
||||
private:
|
||||
DECL_LINK( SettingChangedHdl, CheckBox&, void );
|
||||
private:
|
||||
VclPtr<CheckBox> m_pCB_RoundedEdge;
|
||||
};
|
||||
|
||||
GL3DResourceGroup::GL3DResourceGroup( VclBuilderContainer* pWindow )
|
||||
{
|
||||
pWindow->get(m_pCB_RoundedEdge, "rounded-edge");
|
||||
m_pCB_RoundedEdge->SetToggleHdl( LINK(this, GL3DResourceGroup, SettingChangedHdl) );
|
||||
}
|
||||
|
||||
void GL3DResourceGroup::showControls( bool bShow )
|
||||
{
|
||||
m_pCB_RoundedEdge->Show(bShow);
|
||||
}
|
||||
|
||||
void GL3DResourceGroup::fillControls( const ChartTypeParameter& rParam )
|
||||
{
|
||||
m_pCB_RoundedEdge->Check(rParam.mbRoundedEdge);
|
||||
}
|
||||
|
||||
void GL3DResourceGroup::fillParameter( ChartTypeParameter& rParam )
|
||||
{
|
||||
rParam.mbRoundedEdge = m_pCB_RoundedEdge->IsChecked();
|
||||
}
|
||||
|
||||
IMPL_LINK_NOARG( GL3DResourceGroup, SettingChangedHdl, CheckBox&, void )
|
||||
{
|
||||
if (m_pChangeListener)
|
||||
m_pChangeListener->stateChanged(this);
|
||||
}
|
||||
|
||||
class SplinePropertiesDialog : public weld::GenericDialogController
|
||||
{
|
||||
public:
|
||||
@ -662,7 +619,6 @@ ChartTypeTabPage::ChartTypeTabPage(vcl::Window* pParent
|
||||
, m_pSplineResourceGroup( new SplineResourceGroup(this) )
|
||||
, m_pGeometryResourceGroup( new GeometryResourceGroup( this ) )
|
||||
, m_pSortByXValuesResourceGroup( new SortByXValuesResourceGroup( this ) )
|
||||
, m_pGL3DResourceGroup(new GL3DResourceGroup(this))
|
||||
, m_xChartModel( xChartModel )
|
||||
, m_aChartTypeDialogControllerList(0)
|
||||
, m_pCurrentMainType(nullptr)
|
||||
@ -728,8 +684,6 @@ ChartTypeTabPage::ChartTypeTabPage(vcl::Window* pParent
|
||||
m_aChartTypeDialogControllerList.emplace_back(new CombiColumnLineChartDialogController() );
|
||||
|
||||
SvtMiscOptions aOpts;
|
||||
if ( aOpts.IsExperimentalMode() )
|
||||
m_aChartTypeDialogControllerList.emplace_back(new GL3DBarChartDialogController());
|
||||
|
||||
for (auto const& elem : m_aChartTypeDialogControllerList)
|
||||
{
|
||||
@ -742,7 +696,6 @@ ChartTypeTabPage::ChartTypeTabPage(vcl::Window* pParent
|
||||
m_pSplineResourceGroup->setChangeListener( this );
|
||||
m_pGeometryResourceGroup->setChangeListener( this );
|
||||
m_pSortByXValuesResourceGroup->setChangeListener( this );
|
||||
m_pGL3DResourceGroup->setChangeListener(this);
|
||||
}
|
||||
|
||||
ChartTypeTabPage::~ChartTypeTabPage()
|
||||
@ -761,7 +714,6 @@ void ChartTypeTabPage::dispose()
|
||||
m_pSplineResourceGroup.reset();
|
||||
m_pGeometryResourceGroup.reset();
|
||||
m_pSortByXValuesResourceGroup.reset();
|
||||
m_pGL3DResourceGroup.reset();
|
||||
m_pFT_ChooseType.clear();
|
||||
m_pMainTypeList.clear();
|
||||
m_pSubTypeList.clear();
|
||||
@ -777,7 +729,6 @@ ChartTypeParameter ChartTypeTabPage::getCurrentParamter() const
|
||||
m_pSplineResourceGroup->fillParameter( aParameter );
|
||||
m_pGeometryResourceGroup->fillParameter( aParameter );
|
||||
m_pSortByXValuesResourceGroup->fillParameter( aParameter );
|
||||
m_pGL3DResourceGroup->fillParameter(aParameter);
|
||||
return aParameter;
|
||||
}
|
||||
|
||||
@ -902,8 +853,6 @@ void ChartTypeTabPage::showAllControls( ChartTypeDialogController& rTypeControll
|
||||
m_pGeometryResourceGroup->showControls( bShow );
|
||||
bShow = rTypeController.shouldShow_SortByXValuesResourceGroup();
|
||||
m_pSortByXValuesResourceGroup->showControls( bShow );
|
||||
bShow = rTypeController.shouldShow_GL3DResourceGroup();
|
||||
m_pGL3DResourceGroup->showControls(bShow);
|
||||
rTypeController.showExtraControls(this);
|
||||
}
|
||||
|
||||
@ -920,7 +869,6 @@ void ChartTypeTabPage::fillAllControls( const ChartTypeParameter& rParameter, bo
|
||||
m_pSplineResourceGroup->fillControls( rParameter );
|
||||
m_pGeometryResourceGroup->fillControls( rParameter );
|
||||
m_pSortByXValuesResourceGroup->fillControls( rParameter );
|
||||
m_pGL3DResourceGroup->fillControls(rParameter);
|
||||
m_nChangingCalls--;
|
||||
}
|
||||
|
||||
@ -981,7 +929,6 @@ void ChartTypeTabPage::initializePage()
|
||||
m_pSplineResourceGroup->showControls( false );
|
||||
m_pGeometryResourceGroup->showControls( false );
|
||||
m_pSortByXValuesResourceGroup->showControls( false );
|
||||
m_pGL3DResourceGroup->showControls(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,6 @@ class SplineResourceGroup;
|
||||
class GeometryResourceGroup;
|
||||
class ChartTypeParameter;
|
||||
class SortByXValuesResourceGroup;
|
||||
class GL3DResourceGroup;
|
||||
|
||||
class ChartTypeTabPage final : public ResourceChangeListener, public svt::OWizardPage, public ChartTypeTemplateProvider
|
||||
{
|
||||
@ -82,7 +81,6 @@ private:
|
||||
std::unique_ptr<SplineResourceGroup> m_pSplineResourceGroup;
|
||||
std::unique_ptr<GeometryResourceGroup> m_pGeometryResourceGroup;
|
||||
std::unique_ptr<SortByXValuesResourceGroup> m_pSortByXValuesResourceGroup;
|
||||
std::unique_ptr<GL3DResourceGroup> m_pGL3DResourceGroup;
|
||||
|
||||
css::uno::Reference< css::chart2::XChartDocument > m_xChartModel;
|
||||
|
||||
|
@ -82,7 +82,6 @@ private:
|
||||
ChartController* m_pWindowController;
|
||||
bool m_bInPaint;
|
||||
VclPtr<vcl::Window> m_pViewShellWindow;
|
||||
VclPtr<vcl::Window> m_pOpenGLWindow;
|
||||
|
||||
void adjustHighContrastMode();
|
||||
};
|
||||
|
@ -796,10 +796,6 @@ void SAL_CALL ChartController::dispose()
|
||||
|
||||
//--release all resources and references
|
||||
{
|
||||
uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider(getModel(), uno::UNO_QUERY);
|
||||
if(x3DWindowProvider.is())
|
||||
x3DWindowProvider->setWindow(0);
|
||||
|
||||
uno::Reference< util::XModeChangeBroadcaster > xViewBroadcaster( m_xChartView, uno::UNO_QUERY );
|
||||
if( xViewBroadcaster.is() )
|
||||
xViewBroadcaster->removeModeChangeListener(this);
|
||||
|
@ -23,10 +23,8 @@
|
||||
#include <uiobject.hxx>
|
||||
|
||||
#include <vcl/help.hxx>
|
||||
#include <vcl/openglwin.hxx>
|
||||
#include <vcl/settings.hxx>
|
||||
#include <config_features.h>
|
||||
#include <com/sun/star/chart2/X3DChartWindowProvider.hpp>
|
||||
|
||||
#include <sfx2/ipclient.hxx>
|
||||
#include <sfx2/viewsh.hxx>
|
||||
@ -58,11 +56,6 @@ ChartWindow::ChartWindow( ChartController* pController, vcl::Window* pParent, Wi
|
||||
, m_pWindowController( pController )
|
||||
, m_bInPaint(false)
|
||||
, m_pViewShellWindow( nullptr )
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
, m_pOpenGLWindow(VclPtr<OpenGLWindow>::Create(this, false))
|
||||
#else
|
||||
, m_pOpenGLWindow(nullptr)
|
||||
#endif
|
||||
{
|
||||
set_id("chart_window");
|
||||
SetHelpId( HID_SCH_WIN_DOCUMENT );
|
||||
@ -73,17 +66,6 @@ ChartWindow::ChartWindow( ChartController* pController, vcl::Window* pParent, Wi
|
||||
EnableRTL( false );
|
||||
if( pParent )
|
||||
pParent->EnableRTL( false );// #i96215# necessary for a correct position of the context menu in rtl mode
|
||||
|
||||
if( m_pOpenGLWindow )
|
||||
{
|
||||
m_pOpenGLWindow->Show();
|
||||
uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider(pController->getModel(), uno::UNO_QUERY_THROW);
|
||||
sal_uInt64 nWindowPtr = reinterpret_cast<sal_uInt64>(m_pOpenGLWindow.get());
|
||||
x3DWindowProvider->setWindow(nWindowPtr);
|
||||
uno::Reference<util::XUpdatable> const xUpdatable(x3DWindowProvider,
|
||||
uno::UNO_QUERY_THROW);
|
||||
xUpdatable->update();
|
||||
}
|
||||
}
|
||||
|
||||
ChartWindow::~ChartWindow()
|
||||
@ -93,15 +75,6 @@ ChartWindow::~ChartWindow()
|
||||
|
||||
void ChartWindow::dispose()
|
||||
{
|
||||
if (m_pWindowController && m_pWindowController->getModel().is())
|
||||
{
|
||||
uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider(m_pWindowController->getModel(), uno::UNO_QUERY_THROW);
|
||||
x3DWindowProvider->setWindow(0);
|
||||
uno::Reference<util::XUpdatable> const xUpdatable(x3DWindowProvider,
|
||||
uno::UNO_QUERY_THROW);
|
||||
xUpdatable->update();
|
||||
}
|
||||
m_pOpenGLWindow.disposeAndClear();
|
||||
m_pViewShellWindow.clear();
|
||||
vcl::Window::dispose();
|
||||
}
|
||||
@ -122,11 +95,7 @@ void ChartWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang
|
||||
return;
|
||||
|
||||
m_bInPaint = true;
|
||||
if (m_pOpenGLWindow && m_pOpenGLWindow->IsVisible())
|
||||
{
|
||||
m_pOpenGLWindow->Paint(rRenderContext, rRect);
|
||||
}
|
||||
else if (m_pWindowController)
|
||||
if (m_pWindowController)
|
||||
{
|
||||
m_pWindowController->execute_Paint(rRenderContext, rRect);
|
||||
}
|
||||
@ -173,9 +142,6 @@ void ChartWindow::Resize()
|
||||
m_pWindowController->execute_Resize();
|
||||
else
|
||||
Window::Resize();
|
||||
|
||||
if( m_pOpenGLWindow )
|
||||
m_pOpenGLWindow->SetSizePixel(GetSizePixel());
|
||||
}
|
||||
|
||||
void ChartWindow::Activate()
|
||||
@ -293,40 +259,24 @@ void ChartWindow::adjustHighContrastMode()
|
||||
void ChartWindow::ForceInvalidate()
|
||||
{
|
||||
vcl::Window::Invalidate();
|
||||
if(m_pOpenGLWindow)
|
||||
{
|
||||
m_pOpenGLWindow->Invalidate();
|
||||
}
|
||||
}
|
||||
void ChartWindow::Invalidate( InvalidateFlags nFlags )
|
||||
{
|
||||
if( m_bInPaint ) // #i101928# superfluous paint calls while entering and editing charts"
|
||||
return;
|
||||
vcl::Window::Invalidate( nFlags );
|
||||
if(m_pOpenGLWindow)
|
||||
{
|
||||
m_pOpenGLWindow->Invalidate( nFlags );
|
||||
}
|
||||
}
|
||||
void ChartWindow::Invalidate( const tools::Rectangle& rRect, InvalidateFlags nFlags )
|
||||
{
|
||||
if( m_bInPaint ) // #i101928# superfluous paint calls while entering and editing charts"
|
||||
return;
|
||||
vcl::Window::Invalidate( rRect, nFlags );
|
||||
if(m_pOpenGLWindow)
|
||||
{
|
||||
m_pOpenGLWindow->Invalidate( rRect, nFlags );
|
||||
}
|
||||
}
|
||||
void ChartWindow::Invalidate( const vcl::Region& rRegion, InvalidateFlags nFlags )
|
||||
{
|
||||
if( m_bInPaint ) // #i101928# superfluous paint calls while entering and editing charts"
|
||||
return;
|
||||
vcl::Window::Invalidate( rRegion, nFlags );
|
||||
if(m_pOpenGLWindow)
|
||||
{
|
||||
m_pOpenGLWindow->Invalidate( rRegion, nFlags );
|
||||
}
|
||||
}
|
||||
|
||||
void ChartWindow::LogicInvalidate(const tools::Rectangle* pRectangle)
|
||||
|
@ -41,7 +41,6 @@ enum FastPropertyIdRanges
|
||||
FAST_PROPERTY_ID_START_CHART_STOCK_PROP = FAST_PROPERTY_ID_START + 16000,
|
||||
FAST_PROPERTY_ID_START_CHART_AUTOPOSITION_PROP = FAST_PROPERTY_ID_START + 17000,
|
||||
FAST_PROPERTY_ID_START_SCALE_TEXT_PROP = FAST_PROPERTY_ID_START + 18000,
|
||||
FAST_PROPERTY_ID_START_GL_3D = FAST_PROPERTY_ID_START + 19000
|
||||
};
|
||||
|
||||
} // namespace chart
|
||||
|
@ -31,7 +31,6 @@ namespace chart {
|
||||
#define CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET "com.sun.star.chart2.FilledNetChartType"
|
||||
#define CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK "com.sun.star.chart2.CandleStickChartType"
|
||||
#define CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE "com.sun.star.chart2.BubbleChartType"
|
||||
#define CHART2_SERVICE_NAME_CHARTTYPE_GL3DBAR "com.sun.star.chart2.GL3DBarChartType"
|
||||
|
||||
} //namespace chart
|
||||
|
||||
|
@ -35,8 +35,6 @@
|
||||
#include <ModifyListenerHelper.hxx>
|
||||
#include <svx/charthelper.hxx>
|
||||
|
||||
#include <vcl/openglwin.hxx>
|
||||
|
||||
#include <com/sun/star/chart/ChartDataRowSource.hpp>
|
||||
#include <com/sun/star/chart2/data/XPivotTableDataProvider.hpp>
|
||||
|
||||
@ -114,9 +112,6 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext)
|
||||
"com.sun.star.xml.NamespaceMap", "com.sun.star.comp.chart.XMLNameSpaceMap" ), uno::UNO_QUERY)
|
||||
, mnStart(0)
|
||||
, mnEnd(0)
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
, mpOpenGLWindow(nullptr)
|
||||
#endif
|
||||
{
|
||||
osl_atomic_increment(&m_refCount);
|
||||
{
|
||||
@ -158,9 +153,6 @@ ChartModel::ChartModel( const ChartModel & rOther )
|
||||
, m_xInternalDataProvider( rOther.m_xInternalDataProvider )
|
||||
, mnStart(rOther.mnStart)
|
||||
, mnEnd(rOther.mnEnd)
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
, mpOpenGLWindow(nullptr)
|
||||
#endif
|
||||
{
|
||||
osl_atomic_increment(&m_refCount);
|
||||
{
|
||||
@ -946,11 +938,6 @@ void SAL_CALL ChartModel::createDefaultChart()
|
||||
insertDefaultChart();
|
||||
}
|
||||
|
||||
sal_Bool SAL_CALL ChartModel::isOpenGLChart()
|
||||
{
|
||||
return ChartHelper::isGL3DDiagram(m_xDiagram);
|
||||
}
|
||||
|
||||
// ____ XTitled ____
|
||||
uno::Reference< chart2::XTitle > SAL_CALL ChartModel::getTitleObject()
|
||||
{
|
||||
@ -1309,16 +1296,6 @@ void ChartModel::setTimeBasedRange(sal_Int32 nStart, sal_Int32 nEnd)
|
||||
mbTimeBased = true;
|
||||
}
|
||||
|
||||
void ChartModel::setWindow( const sal_uInt64 nWindowPtr )
|
||||
{
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
OpenGLWindow* pWindow = reinterpret_cast<OpenGLWindow*>(nWindowPtr);
|
||||
mpOpenGLWindow = pWindow;
|
||||
#else
|
||||
(void)nWindowPtr;
|
||||
#endif
|
||||
}
|
||||
|
||||
void ChartModel::update()
|
||||
{
|
||||
if(!mxChartView.is())
|
||||
@ -1327,9 +1304,6 @@ void ChartModel::update()
|
||||
}
|
||||
mxChartView->setViewDirty();
|
||||
mxChartView->update();
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
mxChartView->updateOpenGLWindow();
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ChartModel::isDataFromSpreadsheet()
|
||||
|
@ -32,9 +32,6 @@
|
||||
#include "NetChartTypeTemplate.hxx"
|
||||
#include "BubbleChartTypeTemplate.hxx"
|
||||
#include <config_features.h>
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
#include "GL3DBarChartTypeTemplate.hxx"
|
||||
#endif
|
||||
#include <cppuhelper/component_context.hxx>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
|
||||
@ -123,8 +120,6 @@ enum TemplateId
|
||||
TEMPLATE_STOCKVOLUMELOWHIGHCLOSE,
|
||||
TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE,
|
||||
TEMPLATE_BUBBLE,
|
||||
TEMPLATE_GL3DBAR,
|
||||
TEMPLATE_GL3DBAR_ROUNDED_RECTANGLE,
|
||||
// TEMPLATE_SURFACE,
|
||||
// TEMPLATE_ADDIN,
|
||||
TEMPLATE_NOT_FOUND = 0xffff
|
||||
@ -199,8 +194,6 @@ const tTemplateMapType & lcl_DefaultChartTypeMap()
|
||||
{"com.sun.star.chart2.template.StockVolumeLowHighClose", TEMPLATE_STOCKVOLUMELOWHIGHCLOSE},
|
||||
{"com.sun.star.chart2.template.StockVolumeOpenLowHighClose", TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE},
|
||||
{"com.sun.star.chart2.template.Bubble", TEMPLATE_BUBBLE},
|
||||
{"com.sun.star.chart2.template.GL3DBar", TEMPLATE_GL3DBAR},
|
||||
{"com.sun.star.chart2.template.GL3DBarRoundedRectangle", TEMPLATE_GL3DBAR_ROUNDED_RECTANGLE},
|
||||
// {"com.sun.star.chart2.template.Surface", TEMPLATE_SURFACE},
|
||||
// {"com.sun.star.chart2.template.Addin", TEMPLATE_ADDIN},
|
||||
};
|
||||
@ -530,16 +523,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance(
|
||||
case TEMPLATE_BUBBLE:
|
||||
xTemplate.set( new BubbleChartTypeTemplate( m_xContext, aServiceSpecifier ));
|
||||
break;
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
case TEMPLATE_GL3DBAR:
|
||||
xTemplate.set(new GL3DBarChartTypeTemplate(m_xContext, aServiceSpecifier));
|
||||
break;
|
||||
case TEMPLATE_GL3DBAR_ROUNDED_RECTANGLE:
|
||||
xTemplate.set(new GL3DBarChartTypeTemplate(m_xContext, aServiceSpecifier));
|
||||
break;
|
||||
#else
|
||||
default: break;
|
||||
#endif
|
||||
// case TEMPLATE_SURFACE:
|
||||
// case TEMPLATE_ADDIN:
|
||||
// break;
|
||||
|
@ -1,166 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "GL3DBarChartType.hxx"
|
||||
#include <servicenames_charttypes.hxx>
|
||||
#include <PropertyHelper.hxx>
|
||||
#include <unonames.hxx>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
|
||||
#include <com/sun/star/beans/Property.hpp>
|
||||
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
||||
#include <com/sun/star/uno/XComponentContext.hpp>
|
||||
|
||||
using namespace com::sun::star;
|
||||
|
||||
namespace chart {
|
||||
|
||||
namespace {
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_GL3DCHARTTYPE_ROUNDED_EDGE
|
||||
};
|
||||
|
||||
struct DefaultsInitializer
|
||||
{
|
||||
tPropertyValueMap* operator()()
|
||||
{
|
||||
static tPropertyValueMap aStaticDefaults;
|
||||
|
||||
if (aStaticDefaults.empty())
|
||||
addDefaults(aStaticDefaults);
|
||||
|
||||
return &aStaticDefaults;
|
||||
}
|
||||
private:
|
||||
|
||||
static void addDefaults( tPropertyValueMap & rOutMap )
|
||||
{
|
||||
PropertyHelper::setPropertyValueDefault(rOutMap, PROP_GL3DCHARTTYPE_ROUNDED_EDGE, false);
|
||||
}
|
||||
};
|
||||
|
||||
struct Defaults : public rtl::StaticAggregate<tPropertyValueMap, DefaultsInitializer> {};
|
||||
|
||||
struct InfoHelperInitializer
|
||||
{
|
||||
cppu::OPropertyArrayHelper* operator()()
|
||||
{
|
||||
static cppu::OPropertyArrayHelper aHelper(getProperties());
|
||||
return &aHelper;
|
||||
}
|
||||
|
||||
static uno::Sequence<beans::Property> getProperties()
|
||||
{
|
||||
uno::Sequence<beans::Property> aRet(1);
|
||||
|
||||
aRet[0] = beans::Property(
|
||||
CHART_UNONAME_ROUNDED_EDGE,
|
||||
PROP_GL3DCHARTTYPE_ROUNDED_EDGE,
|
||||
cppu::UnoType<bool>::get(),
|
||||
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT);
|
||||
|
||||
return aRet;
|
||||
}
|
||||
};
|
||||
|
||||
struct InfoHelper : public rtl::StaticAggregate<cppu::OPropertyArrayHelper, InfoHelperInitializer> {};
|
||||
|
||||
struct ChartTypeInfoInitializer
|
||||
{
|
||||
uno::Reference<beans::XPropertySetInfo>* operator()()
|
||||
{
|
||||
static uno::Reference<beans::XPropertySetInfo> xPropertySetInfo;
|
||||
|
||||
if (!xPropertySetInfo.is())
|
||||
xPropertySetInfo = cppu::OPropertySetHelper::createPropertySetInfo(*InfoHelper::get());
|
||||
|
||||
return &xPropertySetInfo;
|
||||
}
|
||||
};
|
||||
|
||||
struct ChartTypeInfo : public rtl::StaticAggregate<uno::Reference<beans::XPropertySetInfo>, ChartTypeInfoInitializer> {};
|
||||
|
||||
}
|
||||
|
||||
GL3DBarChartType::GL3DBarChartType()
|
||||
{
|
||||
}
|
||||
|
||||
GL3DBarChartType::GL3DBarChartType( const GL3DBarChartType& rOther ) :
|
||||
ChartType(rOther)
|
||||
{
|
||||
}
|
||||
|
||||
GL3DBarChartType::~GL3DBarChartType() {}
|
||||
|
||||
OUString SAL_CALL GL3DBarChartType::getImplementationName()
|
||||
{
|
||||
return OUString("com.sun.star.comp.chart.GL3DBarChartType");
|
||||
}
|
||||
|
||||
sal_Bool SAL_CALL GL3DBarChartType::supportsService( const OUString& rServiceName )
|
||||
{
|
||||
return cppu::supportsService(this, rServiceName);
|
||||
}
|
||||
|
||||
css::uno::Sequence< OUString > SAL_CALL GL3DBarChartType::getSupportedServiceNames()
|
||||
{
|
||||
return {
|
||||
CHART2_SERVICE_NAME_CHARTTYPE_GL3DBAR,
|
||||
"com.sun.star.chart2.ChartType",
|
||||
"com.sun.star.beans.PropertySet" };
|
||||
}
|
||||
|
||||
OUString SAL_CALL GL3DBarChartType::getChartType()
|
||||
{
|
||||
return OUString(CHART2_SERVICE_NAME_CHARTTYPE_GL3DBAR);
|
||||
}
|
||||
|
||||
uno::Sequence<OUString> GL3DBarChartType::getSupportedPropertyRoles()
|
||||
{
|
||||
uno::Sequence< OUString > aPropRoles { "FillColor" };
|
||||
|
||||
return aPropRoles;
|
||||
}
|
||||
|
||||
css::uno::Reference<css::util::XCloneable>
|
||||
GL3DBarChartType::createClone()
|
||||
{
|
||||
return uno::Reference<util::XCloneable>(new GL3DBarChartType(*this));
|
||||
}
|
||||
|
||||
css::uno::Any GL3DBarChartType::GetDefaultValue( sal_Int32 nHandle ) const
|
||||
{
|
||||
const tPropertyValueMap& rDefaults = *Defaults::get();
|
||||
tPropertyValueMap::const_iterator it = rDefaults.find(nHandle);
|
||||
return it == rDefaults.end() ? uno::Any() : it->second;
|
||||
}
|
||||
|
||||
cppu::IPropertyArrayHelper& GL3DBarChartType::getInfoHelper()
|
||||
{
|
||||
return *InfoHelper::get();
|
||||
}
|
||||
|
||||
css::uno::Reference<css::beans::XPropertySetInfo> GL3DBarChartType::getPropertySetInfo()
|
||||
{
|
||||
return *ChartTypeInfo::get();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
|
||||
com_sun_star_comp_chart_GL3DBarChartType_get_implementation(css::uno::XComponentContext * /*context*/,
|
||||
css::uno::Sequence<css::uno::Any> const &)
|
||||
{
|
||||
return cppu::acquire(new ::chart::GL3DBarChartType);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,58 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_CHART2_SOURCE_MODEL_TEMPLATE_GL3DBARCHARTTYPE_HXX
|
||||
#define INCLUDED_CHART2_SOURCE_MODEL_TEMPLATE_GL3DBARCHARTTYPE_HXX
|
||||
|
||||
#include "ChartType.hxx"
|
||||
|
||||
namespace chart {
|
||||
|
||||
/**
|
||||
* Chart type that represents 3 dimensional data content in 3D space using
|
||||
* OpenGL.
|
||||
*/
|
||||
class GL3DBarChartType final : public ChartType
|
||||
{
|
||||
public:
|
||||
explicit GL3DBarChartType();
|
||||
virtual ~GL3DBarChartType() override;
|
||||
|
||||
virtual css::uno::Sequence< OUString > SAL_CALL
|
||||
getSupportedPropertyRoles() override;
|
||||
virtual OUString SAL_CALL
|
||||
getImplementationName() override;
|
||||
virtual sal_Bool SAL_CALL
|
||||
supportsService( const OUString& ServiceName ) override;
|
||||
virtual css::uno::Sequence< OUString > SAL_CALL
|
||||
getSupportedServiceNames() override;
|
||||
|
||||
private:
|
||||
GL3DBarChartType( const GL3DBarChartType& rOther );
|
||||
|
||||
virtual OUString SAL_CALL getChartType() override;
|
||||
|
||||
virtual css::uno::Reference<css::util::XCloneable> SAL_CALL
|
||||
createClone() override;
|
||||
|
||||
// OPropertySet
|
||||
virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const override;
|
||||
|
||||
virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
|
||||
|
||||
// XPropertySet
|
||||
virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL
|
||||
getPropertySetInfo() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,195 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "GL3DBarChartTypeTemplate.hxx"
|
||||
#include "GL3DBarChartType.hxx"
|
||||
|
||||
#include <servicenames_charttypes.hxx>
|
||||
#include <PropertyHelper.hxx>
|
||||
#include <DiagramHelper.hxx>
|
||||
#include <unonames.hxx>
|
||||
|
||||
#include <com/sun/star/beans/Property.hpp>
|
||||
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
||||
#include <tools/diagnose_ex.h>
|
||||
|
||||
using namespace com::sun::star;
|
||||
|
||||
namespace chart {
|
||||
|
||||
namespace {
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_GL3DCHARTTYPE_ROUNDED_EDGE
|
||||
};
|
||||
|
||||
struct DefaultsInitializer
|
||||
{
|
||||
tPropertyValueMap* operator()()
|
||||
{
|
||||
static tPropertyValueMap aStaticDefaults;
|
||||
|
||||
if (aStaticDefaults.empty())
|
||||
addDefaults(aStaticDefaults);
|
||||
|
||||
return &aStaticDefaults;
|
||||
}
|
||||
private:
|
||||
|
||||
static void addDefaults( tPropertyValueMap & rOutMap )
|
||||
{
|
||||
PropertyHelper::setPropertyValueDefault(rOutMap, PROP_GL3DCHARTTYPE_ROUNDED_EDGE, false);
|
||||
}
|
||||
};
|
||||
|
||||
struct Defaults : public rtl::StaticAggregate<tPropertyValueMap, DefaultsInitializer> {};
|
||||
|
||||
struct InfoHelperInitializer
|
||||
{
|
||||
cppu::OPropertyArrayHelper* operator()()
|
||||
{
|
||||
static cppu::OPropertyArrayHelper aHelper(getProperties());
|
||||
return &aHelper;
|
||||
}
|
||||
|
||||
static uno::Sequence<beans::Property> getProperties()
|
||||
{
|
||||
uno::Sequence<beans::Property> aRet(1);
|
||||
|
||||
aRet[0] = beans::Property(
|
||||
CHART_UNONAME_ROUNDED_EDGE,
|
||||
PROP_GL3DCHARTTYPE_ROUNDED_EDGE,
|
||||
cppu::UnoType<bool>::get(),
|
||||
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT);
|
||||
|
||||
return aRet;
|
||||
}
|
||||
};
|
||||
|
||||
struct InfoHelper : public rtl::StaticAggregate<cppu::OPropertyArrayHelper, InfoHelperInitializer> {};
|
||||
|
||||
struct ChartTypeInfoInitializer
|
||||
{
|
||||
uno::Reference<beans::XPropertySetInfo>* operator()()
|
||||
{
|
||||
static uno::Reference<beans::XPropertySetInfo> xPropertySetInfo;
|
||||
|
||||
if (!xPropertySetInfo.is())
|
||||
xPropertySetInfo = cppu::OPropertySetHelper::createPropertySetInfo(*InfoHelper::get());
|
||||
|
||||
return &xPropertySetInfo;
|
||||
}
|
||||
};
|
||||
|
||||
struct ChartTypeInfo : public rtl::StaticAggregate<uno::Reference<beans::XPropertySetInfo>, ChartTypeInfoInitializer> {};
|
||||
|
||||
}
|
||||
|
||||
GL3DBarChartTypeTemplate::GL3DBarChartTypeTemplate(
|
||||
const uno::Reference<uno::XComponentContext>& xContext, const OUString& rServiceName ) :
|
||||
property::OPropertySet(m_aMutex),
|
||||
ChartTypeTemplate(xContext, rServiceName) {}
|
||||
|
||||
GL3DBarChartTypeTemplate::~GL3DBarChartTypeTemplate() {}
|
||||
|
||||
uno::Reference<chart2::XChartType> GL3DBarChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
|
||||
{
|
||||
uno::Reference<chart2::XChartType> xResult;
|
||||
|
||||
try
|
||||
{
|
||||
uno::Reference<lang::XMultiServiceFactory> xFact(
|
||||
GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW);
|
||||
|
||||
xResult.set(xFact->createInstance(CHART2_SERVICE_NAME_CHARTTYPE_GL3DBAR), uno::UNO_QUERY_THROW);
|
||||
|
||||
uno::Reference<beans::XPropertySet> xCTProp(xResult, uno::UNO_QUERY);
|
||||
if (xCTProp.is())
|
||||
{
|
||||
xCTProp->setPropertyValue(
|
||||
CHART_UNONAME_ROUNDED_EDGE, getFastPropertyValue(PROP_GL3DCHARTTYPE_ROUNDED_EDGE));
|
||||
}
|
||||
}
|
||||
catch (const uno::Exception &)
|
||||
{
|
||||
DBG_UNHANDLED_EXCEPTION("chart2");
|
||||
}
|
||||
|
||||
return xResult;
|
||||
}
|
||||
|
||||
sal_Bool SAL_CALL GL3DBarChartTypeTemplate::matchesTemplate(
|
||||
const css::uno::Reference<css::chart2::XDiagram>& xDiagram,
|
||||
sal_Bool bAdaptProperties )
|
||||
{
|
||||
bool bResult = ChartTypeTemplate::matchesTemplate(xDiagram, bAdaptProperties);
|
||||
|
||||
if (bResult && bAdaptProperties)
|
||||
{
|
||||
uno::Reference<chart2::XChartType> xChartType = DiagramHelper::getChartTypeByIndex(xDiagram, 0);
|
||||
uno::Reference<beans::XPropertySet> xPS(xChartType, uno::UNO_QUERY);
|
||||
if (xPS.is())
|
||||
{
|
||||
setFastPropertyValue_NoBroadcast(
|
||||
PROP_GL3DCHARTTYPE_ROUNDED_EDGE, xPS->getPropertyValue(CHART_UNONAME_ROUNDED_EDGE));
|
||||
}
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
uno::Reference<chart2::XChartType>
|
||||
GL3DBarChartTypeTemplate::getChartTypeForNewSeries( const uno::Sequence<uno::Reference<chart2::XChartType> >& /*xOldChartTypes*/ )
|
||||
{
|
||||
uno::Reference<chart2::XChartType> xResult;
|
||||
|
||||
try
|
||||
{
|
||||
rtl::Reference<GL3DBarChartType> chart(new GL3DBarChartType());
|
||||
bool bVal = false;
|
||||
getFastPropertyValue(PROP_GL3DCHARTTYPE_ROUNDED_EDGE) >>= bVal;
|
||||
chart->setPropertyValue(CHART_UNONAME_ROUNDED_EDGE, uno::Any(bVal));
|
||||
xResult = chart.get();
|
||||
}
|
||||
catch (const uno::Exception &)
|
||||
{
|
||||
DBG_UNHANDLED_EXCEPTION("chart2");
|
||||
}
|
||||
|
||||
return xResult;
|
||||
}
|
||||
|
||||
sal_Bool GL3DBarChartTypeTemplate::supportsCategories()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
css::uno::Any GL3DBarChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle ) const
|
||||
{
|
||||
const tPropertyValueMap& rDefaults = *Defaults::get();
|
||||
tPropertyValueMap::const_iterator it = rDefaults.find(nHandle);
|
||||
return it == rDefaults.end() ? uno::Any() : it->second;
|
||||
}
|
||||
|
||||
cppu::IPropertyArrayHelper& GL3DBarChartTypeTemplate::getInfoHelper()
|
||||
{
|
||||
return *InfoHelper::get();
|
||||
}
|
||||
|
||||
css::uno::Reference<css::beans::XPropertySetInfo> GL3DBarChartTypeTemplate::getPropertySetInfo()
|
||||
{
|
||||
return *ChartTypeInfo::get();
|
||||
}
|
||||
|
||||
IMPLEMENT_FORWARD_XINTERFACE2(GL3DBarChartTypeTemplate, ChartTypeTemplate, OPropertySet)
|
||||
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,62 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_CHART2_SOURCE_MODEL_TEMPLATE_GL3DBARCHARTTYPETEMPLATE_HXX
|
||||
#define INCLUDED_CHART2_SOURCE_MODEL_TEMPLATE_GL3DBARCHARTTYPETEMPLATE_HXX
|
||||
|
||||
#include <MutexContainer.hxx>
|
||||
#include "ChartTypeTemplate.hxx"
|
||||
#include <OPropertySet.hxx>
|
||||
|
||||
#include <comphelper/uno3.hxx>
|
||||
|
||||
namespace chart {
|
||||
|
||||
class GL3DBarChartTypeTemplate :
|
||||
public MutexContainer, public property::OPropertySet, public ChartTypeTemplate
|
||||
{
|
||||
public:
|
||||
|
||||
DECLARE_XINTERFACE()
|
||||
|
||||
GL3DBarChartTypeTemplate(
|
||||
const css::uno::Reference<
|
||||
css::uno::XComponentContext>& xContext,
|
||||
const OUString& rServiceName );
|
||||
|
||||
virtual ~GL3DBarChartTypeTemplate() override;
|
||||
|
||||
virtual css::uno::Reference<css::chart2::XChartType> getChartTypeForIndex( sal_Int32 nChartTypeIndex ) override;
|
||||
|
||||
// XChartTypeTemplate
|
||||
|
||||
virtual sal_Bool SAL_CALL matchesTemplate(
|
||||
const css::uno::Reference<css::chart2::XDiagram>& xDiagram,
|
||||
sal_Bool bAdaptProperties ) override;
|
||||
|
||||
virtual css::uno::Reference<css::chart2::XChartType> SAL_CALL
|
||||
getChartTypeForNewSeries( const css::uno::Sequence<css::uno::Reference<css::chart2::XChartType> >& xOldChartTypes ) override;
|
||||
|
||||
virtual sal_Bool SAL_CALL supportsCategories() override;
|
||||
|
||||
// OPropertySet
|
||||
virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const override;
|
||||
|
||||
virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
|
||||
|
||||
// XPropertySet
|
||||
virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL
|
||||
getPropertySetInfo() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,159 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_CHART2_SOURCE_VIEW_INC_3DCHARTOBJECTS_HXX
|
||||
#define INCLUDED_CHART2_SOURCE_VIEW_INC_3DCHARTOBJECTS_HXX
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <tools/color.hxx>
|
||||
|
||||
#include "GL3DRenderer.hxx"
|
||||
|
||||
#include <boost/shared_array.hpp>
|
||||
|
||||
#include <map>
|
||||
|
||||
namespace chart {
|
||||
|
||||
namespace opengl3D {
|
||||
|
||||
struct TextCacheItem
|
||||
{
|
||||
TextCacheItem(sal_uInt8 *pPixels, ::Size aSize)
|
||||
: maSize(aSize), maPixels(pPixels)
|
||||
{
|
||||
}
|
||||
::Size maSize;
|
||||
boost::shared_array<sal_uInt8> maPixels;
|
||||
};
|
||||
|
||||
class TextCache
|
||||
{
|
||||
public:
|
||||
const TextCacheItem &getText(OUString const & rText, bool bIs3dText = false);
|
||||
private:
|
||||
typedef std::map<OUString const, TextCacheItem> TextCacheType;
|
||||
|
||||
TextCacheType m_TextCache;
|
||||
};
|
||||
|
||||
class Renderable3DObject
|
||||
{
|
||||
public:
|
||||
Renderable3DObject(OpenGL3DRenderer* pRenderer, sal_uInt32 nId);
|
||||
|
||||
virtual ~Renderable3DObject() {};
|
||||
|
||||
virtual void render();
|
||||
|
||||
protected:
|
||||
OpenGL3DRenderer* mpRenderer;
|
||||
sal_uInt32 mnUniqueId;
|
||||
};
|
||||
|
||||
class Bar : public Renderable3DObject
|
||||
{
|
||||
public:
|
||||
Bar(OpenGL3DRenderer* pRenderer, const glm::mat4& rPosition, Color nColor, sal_uInt32 nId);
|
||||
|
||||
virtual void render() override;
|
||||
private:
|
||||
glm::mat4 maPos;
|
||||
Color maColor; // RGBA fill color
|
||||
};
|
||||
|
||||
class Line : public Renderable3DObject
|
||||
{
|
||||
public:
|
||||
Line(OpenGL3DRenderer* pRenderer, sal_uInt32 nId);
|
||||
|
||||
virtual void render() override;
|
||||
|
||||
void setPosition(const glm::vec3& rBegin, const glm::vec3& rEnd);
|
||||
void setLineColor(const Color& rColor);
|
||||
|
||||
private:
|
||||
glm::vec3 maPosBegin;
|
||||
glm::vec3 maPosEnd;
|
||||
Color maLineColor; // RGBA line color
|
||||
};
|
||||
|
||||
class Text : public Renderable3DObject
|
||||
{
|
||||
public:
|
||||
Text(OpenGL3DRenderer* pRenderer, TextCache& rTextCache, const OUString& rStr, sal_uInt32 nId);
|
||||
virtual void render() override;
|
||||
|
||||
void setPosition(const glm::vec3& rTopLeft, const glm::vec3& rTopRight, const glm::vec3& rBottomRight);
|
||||
|
||||
private:
|
||||
TextCacheItem maText;
|
||||
glm::vec3 maTopLeft;
|
||||
glm::vec3 maTopRight;
|
||||
glm::vec3 maBottomRight;
|
||||
};
|
||||
|
||||
class ScreenText : public Renderable3DObject
|
||||
{
|
||||
public:
|
||||
ScreenText(OpenGL3DRenderer* pRenderer, TextCache& rTextCache,
|
||||
const OUString& rStr, const glm::vec4& rColor, sal_uInt32 nId, bool bIs3dText = false);
|
||||
|
||||
virtual void render() override;
|
||||
void setPosition(const glm::vec2& rTopLeft, const glm::vec2& rBottomRight,
|
||||
const glm::vec3& r3DPos);
|
||||
|
||||
private:
|
||||
TextCacheItem maText;
|
||||
glm::vec2 maTopLeft;
|
||||
glm::vec2 maBottomRight;
|
||||
glm::vec3 ma3DPos;
|
||||
glm::vec4 maColor;
|
||||
};
|
||||
|
||||
class Rectangle : public Renderable3DObject
|
||||
{
|
||||
public:
|
||||
Rectangle(OpenGL3DRenderer* pRenderer, sal_uInt32 nId);
|
||||
virtual void render() override;
|
||||
|
||||
void setPosition(const glm::vec3& rTopLeft, const glm::vec3& rTopRight, const glm::vec3& rBottomRight);
|
||||
void setFillColor(const Color& rColor);
|
||||
void setLineColor(const Color& rColor);
|
||||
|
||||
private:
|
||||
glm::vec3 maTopLeft;
|
||||
glm::vec3 maTopRight;
|
||||
glm::vec3 maBottomRight;
|
||||
Color maColor; // RGBA fill color
|
||||
Color maLineColor; // RGBA line color
|
||||
};
|
||||
|
||||
class Camera : public Renderable3DObject
|
||||
{
|
||||
public:
|
||||
Camera(OpenGL3DRenderer* pRenderer);
|
||||
virtual void render() override;
|
||||
|
||||
void setPosition(const glm::vec3& rPos);
|
||||
void setDirection(const glm::vec3& rPos);
|
||||
|
||||
private:
|
||||
glm::vec3 maPos;
|
||||
glm::vec3 maUp;
|
||||
glm::vec3 maDirection;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // INCLUDED_CHART2_SOURCE_VIEW_INC_3DCHARTOBJECTS_HXX
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -18,7 +18,6 @@
|
||||
|
||||
#include <rtl/ustring.hxx>
|
||||
|
||||
class OpenGLWindow;
|
||||
namespace chart { struct VLineProperties; }
|
||||
namespace com { namespace sun { namespace star { namespace beans { class XPropertySet; } } } }
|
||||
namespace com { namespace sun { namespace star { namespace chart2 { class XFormattedString; } } } }
|
||||
@ -238,14 +237,6 @@ public:
|
||||
|
||||
virtual void setPageSize( css::uno::Reference < css::drawing::XShapes > xChartShapes, const css::awt::Size& rSize ) = 0;
|
||||
|
||||
/**
|
||||
* Only necessary for stateless implementations
|
||||
*/
|
||||
virtual void render(css::uno::Reference< css::drawing::XShapes > xRootShape, bool bInitOpenGL) = 0;
|
||||
|
||||
virtual bool preRender(css::uno::Reference< css::drawing::XShapes > xRootShape, OpenGLWindow* pWindow) = 0;
|
||||
virtual void postRender(OpenGLWindow* pWindow) = 0;
|
||||
|
||||
virtual void clearPage(css::uno::Reference< css::drawing::XShapes > xRootShape) = 0;
|
||||
|
||||
static css::uno::Reference< css::drawing::XShapes >
|
||||
|
@ -1,210 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_CHART2_SOURCE_VIEW_INC_GL3DBARCHART_HXX
|
||||
#define INCLUDED_CHART2_SOURCE_VIEW_INC_GL3DBARCHART_HXX
|
||||
|
||||
#include "GL3DPlotterBase.hxx"
|
||||
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include <vcl/idle.hxx>
|
||||
#include <vcl/openglwin.hxx>
|
||||
|
||||
#include <rtl/ref.hxx>
|
||||
|
||||
#include <osl/conditn.hxx>
|
||||
|
||||
namespace com { namespace sun { namespace star { namespace chart2 { class XChartType; } } } }
|
||||
class Timer;
|
||||
|
||||
namespace chart {
|
||||
|
||||
class ExplicitCategoriesProvider;
|
||||
|
||||
namespace opengl3D {
|
||||
|
||||
class Renderable3DObject;
|
||||
class OpenGL3DRenderer;
|
||||
class TextCache;
|
||||
class Camera;
|
||||
|
||||
}
|
||||
|
||||
enum RenderEventType
|
||||
{
|
||||
EVENT_NONE,
|
||||
EVENT_CLICK,
|
||||
EVENT_MOVE_TO_DEFAULT,
|
||||
EVENT_DRAG_LEFT,
|
||||
EVENT_DRAG_RIGHT,
|
||||
EVENT_SCROLL,
|
||||
EVENT_SHOW_SCROLL,
|
||||
EVENT_SHOW_SELECT,
|
||||
EVENT_AUTO_FLY,
|
||||
EVENT_SELECTBAR_UPDEDATE
|
||||
};
|
||||
|
||||
class RenderThread;
|
||||
class RenderOneFrameThread;
|
||||
class RenderAnimationThread;
|
||||
|
||||
class GL3DBarChart : public GL3DPlotterBase, public IRenderer
|
||||
{
|
||||
friend class RenderThread;
|
||||
friend class RenderOneFrameThread;
|
||||
friend class RenderAnimationThread;
|
||||
friend class RenderBenchMarkThread;
|
||||
public:
|
||||
GL3DBarChart(
|
||||
const css::uno::Reference<css::chart2::XChartType>& xChartType,
|
||||
OpenGLWindow* pContext);
|
||||
|
||||
virtual ~GL3DBarChart() override;
|
||||
|
||||
virtual void create3DShapes(const std::vector<std::unique_ptr<VDataSeries>>& rDataSeries,
|
||||
ExplicitCategoriesProvider& rCatProvider) override;
|
||||
|
||||
virtual void render() override;
|
||||
|
||||
/// Render one frame of the 3D bar chart.
|
||||
void renderFrame();
|
||||
|
||||
virtual void update() override;
|
||||
|
||||
/// Draw to the framebuffer context, and provide the ID of the bar that the user has clicked.
|
||||
sal_uInt32 barIdAtPosition(const Point& rPos);
|
||||
virtual void clickedAt(const Point& rPos, sal_uInt16 nButtons) override;
|
||||
|
||||
virtual void mouseDragMove(const Point& rStartPos, const Point& rEndPos, sal_uInt16 nButtons) override;
|
||||
virtual void scroll(long nDelta) override;
|
||||
virtual void contextDestroyed() override;
|
||||
|
||||
void setOpenGLWindow(OpenGLWindow* pWindow);
|
||||
|
||||
private:
|
||||
|
||||
void spawnRenderThread(RenderThread *pThread);
|
||||
void joinRenderThread();
|
||||
void moveToCorner();
|
||||
void moveToDefault();
|
||||
glm::vec3 getCornerPosition(sal_Int8 nCornerId);
|
||||
void updateScreenText();
|
||||
void updateRenderFPS();
|
||||
void updateDataUpdateFPS();
|
||||
DECL_LINK(UpdateTimerHdl, Timer*, void);
|
||||
static int calcTimeInterval(TimeValue const &startTime, TimeValue const &endTime);
|
||||
float addScreenTextShape(OUString &nStr, const glm::vec2& rLeftOrRightTop, float nTextHeight, bool bLeftTopFlag,
|
||||
const glm::vec4& rColor,
|
||||
const glm::vec3& rPos = glm::vec3(0.0f, 0.0f, 0.0f),
|
||||
sal_uInt32 nEvent = 0);
|
||||
void recordBarHistory(sal_uInt32 nBarID, float nVal);
|
||||
void updateClickEvent();
|
||||
void calcDistance(std::vector<sal_uInt32> &vectorNearest);
|
||||
static float calcScrollDistance(const glm::mat4 &mvp, const glm::vec3& rPos);
|
||||
void initDistanceHeap(std::vector<sal_uInt32> &vectorNearest);
|
||||
void keepHeap(std::vector<sal_uInt32> &vectorNearest, int index);
|
||||
static void swapVector(int i, int j, std::vector<sal_uInt32> &vectorNearest);
|
||||
void getNearestBars(std::vector<sal_uInt32> &vectorNearest);
|
||||
void updateScroll();
|
||||
void processAutoFly(sal_uInt32 nId, Color nColor);
|
||||
void getNeighborBarID(sal_uInt32 nSelectBarId, sal_uInt32 *pNeighborBarId);
|
||||
void addMovementScreenText(sal_uInt32 nBarId);
|
||||
css::uno::Reference<css::chart2::XChartType> mxChartType;
|
||||
std::vector<std::unique_ptr<opengl3D::Renderable3DObject> > maShapes;
|
||||
|
||||
std::unique_ptr<opengl3D::OpenGL3DRenderer> mpRenderer;
|
||||
VclPtr<OpenGLWindow> mpWindow;
|
||||
|
||||
opengl3D::Camera* mpCamera;
|
||||
bool mbValidContext;
|
||||
|
||||
std::unique_ptr<opengl3D::TextCache> mpTextCache;
|
||||
|
||||
glm::vec3 maCameraPosition;
|
||||
glm::vec3 maCameraDirection;
|
||||
|
||||
glm::vec3 maDefaultCameraPosition;
|
||||
glm::vec3 maDefaultCameraDirection;
|
||||
|
||||
float mnMaxX;
|
||||
float mnMaxY;
|
||||
float mnDistance;
|
||||
/**
|
||||
* 0 = corner at (0,0,0);
|
||||
* numbering counter clockwise
|
||||
*/
|
||||
sal_Int8 mnCornerId;
|
||||
|
||||
std::vector<OUString> maCategories;
|
||||
std::vector<OUString> maSeriesNames;
|
||||
struct BarInformation
|
||||
{
|
||||
glm::vec3 maPos;
|
||||
float mnVal;
|
||||
|
||||
BarInformation(const glm::vec3& rPos, float nVal);
|
||||
};
|
||||
|
||||
std::map<sal_uInt32, const BarInformation> maBarMap;
|
||||
bool mbNeedsNewRender;
|
||||
bool mbCameraInit;
|
||||
|
||||
osl::Mutex maMutex;
|
||||
rtl::Reference<RenderThread> mpRenderThread;
|
||||
bool mbRenderDie;
|
||||
::osl::Condition maClickCond;
|
||||
RenderEventType maRenderEvent;
|
||||
RenderEventType maPreRenderEvent;
|
||||
sal_uInt32 mnSelectBarId;
|
||||
sal_uInt32 mnPreSelectBarId;
|
||||
Point maClickPos;
|
||||
sal_uInt32 miScrollRate;
|
||||
bool mbScrollFlg;
|
||||
Idle maIdle;
|
||||
bool mbScreenTextNewRender;
|
||||
std::vector<std::unique_ptr<opengl3D::Renderable3DObject>> maScreenTextShapes;
|
||||
OUString maFPS;
|
||||
OUString maDataUpdateFPS;
|
||||
sal_uInt32 miFrameCount;
|
||||
sal_uInt32 miDataUpdateCounter;
|
||||
TimeValue maFPSRenderStartTime;
|
||||
TimeValue maFPSRenderEndTime;
|
||||
TimeValue maDataUpdateStartTime;
|
||||
TimeValue maDataUpdateEndTime;
|
||||
std::map<sal_uInt32, std::deque<float> > maBarHistory;
|
||||
std::vector<sal_uInt32> maVectorNearest;
|
||||
std::map<sal_uInt32, float> maDistanceMap;
|
||||
std::map<sal_uInt32, Color> maBarColorMap;
|
||||
int mnColorRate;
|
||||
bool mbBenchMarkMode;
|
||||
sal_uInt32 mnHistoryCounter;
|
||||
sal_uInt32 mnBarsInRow;
|
||||
bool mbAutoFly;
|
||||
sal_Int32 mnUpdateBarId;
|
||||
|
||||
// these form a pair:
|
||||
// main thread sets condition 1 and waits until it can take the mutex
|
||||
// render thread checks condition 1 before taking the mutex and waits in case it
|
||||
// is set until condition 2 is set
|
||||
//
|
||||
// only necessary for the benchmark mode
|
||||
osl::Condition maCond1;
|
||||
osl::Condition maCond2;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,35 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_CHART2_SOURCE_VIEW_INC_GL3DPLOTTERBASE_HXX
|
||||
#define INCLUDED_CHART2_SOURCE_VIEW_INC_GL3DPLOTTERBASE_HXX
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
namespace chart {
|
||||
|
||||
class ExplicitCategoriesProvider;
|
||||
class VDataSeries;
|
||||
|
||||
class GL3DPlotterBase
|
||||
{
|
||||
public:
|
||||
virtual ~GL3DPlotterBase();
|
||||
|
||||
virtual void create3DShapes(const std::vector<std::unique_ptr<VDataSeries> >& rDataSeries,
|
||||
ExplicitCategoriesProvider& rCatProvider) = 0;
|
||||
virtual void render() = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,491 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_CHART2_SOURCE_VIEW_INC_GL3DRENDERER_HXX
|
||||
#define INCLUDED_CHART2_SOURCE_VIEW_INC_GL3DRENDERER_HXX
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtx/transform.hpp>
|
||||
#include <glm/gtx/euler_angles.hpp>
|
||||
#include <glm/gtx/quaternion.hpp>
|
||||
|
||||
#include <boost/shared_array.hpp>
|
||||
#include <tools/gen.hxx>
|
||||
#include <tools/color.hxx>
|
||||
#include <string.h>
|
||||
|
||||
#include <epoxy/gl.h>
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace chart {
|
||||
|
||||
namespace opengl3D {
|
||||
|
||||
const auto maxLights = 8;
|
||||
|
||||
struct PosVecf3
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
};
|
||||
|
||||
typedef std::vector <glm::vec3> Vertices3D;
|
||||
typedef std::vector <glm::vec3> Normals3D;
|
||||
|
||||
// fields must match definition in GLSL shader file
|
||||
struct MaterialParameters
|
||||
{
|
||||
glm::vec4 ambient;
|
||||
glm::vec4 diffuse;
|
||||
glm::vec4 specular;
|
||||
glm::vec4 materialColor;
|
||||
|
||||
bool twoSidesLighting;
|
||||
float shininess;
|
||||
float pad;
|
||||
float pad1;
|
||||
};
|
||||
|
||||
// fields must match definition in GLSL shader file
|
||||
struct LightSource
|
||||
{
|
||||
glm::vec4 lightColor;
|
||||
glm::vec4 positionWorldspace;
|
||||
float lightPower;
|
||||
float pad1;
|
||||
float pad2;
|
||||
float pad3;
|
||||
};
|
||||
|
||||
struct GlobalLights
|
||||
{
|
||||
int lightNum;
|
||||
glm::vec4 ambient;
|
||||
LightSource light[maxLights];
|
||||
};
|
||||
|
||||
struct Polygon3DInfo
|
||||
{
|
||||
bool lineOnly;
|
||||
float lineWidth;
|
||||
bool twoSidesLighting;
|
||||
long fillStyle;
|
||||
glm::vec4 polygonColor;
|
||||
glm::vec4 id;
|
||||
Vertices3D *vertices;
|
||||
Normals3D *normals;
|
||||
std::vector <Vertices3D *> verticesList;
|
||||
std::vector <Normals3D *> normalsList;
|
||||
MaterialParameters material;
|
||||
};
|
||||
|
||||
struct Extrude3DInfo
|
||||
{
|
||||
bool rounded;
|
||||
bool twoSidesLighting;
|
||||
glm::vec4 extrudeColor;
|
||||
glm::vec4 id;
|
||||
sal_uInt32 orgID;
|
||||
float xScale;
|
||||
float yScale;
|
||||
float zScale;
|
||||
float xTransform;
|
||||
float yTransform;
|
||||
float zTransform;
|
||||
glm::mat4 rotation;
|
||||
MaterialParameters material;
|
||||
int startIndex[5];
|
||||
int size[5];
|
||||
int reverse;
|
||||
};
|
||||
|
||||
struct CameraInfo
|
||||
{
|
||||
glm::vec3 cameraPos;
|
||||
glm::vec3 cameraOrg;
|
||||
glm::vec3 cameraUp;
|
||||
|
||||
CameraInfo():
|
||||
cameraUp(glm::vec3(0, 0, 1)) {}
|
||||
};
|
||||
|
||||
struct RoundBarMesh
|
||||
{
|
||||
float topThreshold;
|
||||
float bottomThreshold;
|
||||
int iMeshStartIndices;
|
||||
int iMeshSizes;
|
||||
int iElementStartIndices[5];
|
||||
int iElementSizes[5];
|
||||
};
|
||||
|
||||
struct PackedVertex{
|
||||
glm::vec3 position;
|
||||
glm::vec3 normal;
|
||||
bool operator<(const PackedVertex& that) const{
|
||||
return memcmp(this, &that, sizeof(PackedVertex))>0;
|
||||
};
|
||||
};
|
||||
|
||||
struct TextInfo
|
||||
{
|
||||
glm::vec4 id;
|
||||
sal_uInt32 uniqueId;
|
||||
GLuint texture;
|
||||
float vertex[12];
|
||||
glm::vec3 pos;
|
||||
glm::vec4 textColor;
|
||||
};
|
||||
|
||||
struct TextureArrayInfo
|
||||
{
|
||||
size_t subTextureNum;
|
||||
int textureArrayWidth;
|
||||
int textureArrayHeight;
|
||||
GLuint textureID;
|
||||
|
||||
TextureArrayInfo();
|
||||
};
|
||||
|
||||
struct TextInfoBatch
|
||||
{
|
||||
size_t batchNum;
|
||||
std::vector<glm::vec4> idList;
|
||||
std::vector<TextureArrayInfo> texture;
|
||||
std::vector<glm::vec3> vertexList;
|
||||
std::vector<glm::vec3> textureCoordList;
|
||||
};
|
||||
|
||||
struct BatchBarInfo
|
||||
{
|
||||
std::vector <glm::mat4> modelMatrixList;
|
||||
std::vector <glm::mat3> normalMatrixList;
|
||||
std::vector <glm::vec4> colorList;
|
||||
std::map<sal_uInt32, unsigned int> mapId2Color;
|
||||
glm::vec4 selectBarColor;
|
||||
};
|
||||
|
||||
class OpenGL3DRenderer
|
||||
{
|
||||
public:
|
||||
OpenGL3DRenderer();
|
||||
~OpenGL3DRenderer();
|
||||
|
||||
void init();
|
||||
void Set3DSenceInfo(Color color, bool twoSidesLighting = true);
|
||||
void SetLightInfo(bool lightOn, Color color, const glm::vec4& direction);
|
||||
void AddShapePolygon3DObject(Color color, bool lineOnly, Color lineColor,
|
||||
long fillStyle, sal_uInt32 specular, sal_uInt32 nUniqueId);
|
||||
void EndAddShapePolygon3DObject();
|
||||
void AddPolygon3DObjectNormalPoint(float x, float y, float z);
|
||||
void EndAddPolygon3DObjectNormalPoint();
|
||||
void AddPolygon3DObjectPoint(float x, float y, float z);
|
||||
void EndAddPolygon3DObjectPoint();
|
||||
void AddShape3DExtrudeObject(bool roundedCorner, Color color, sal_uInt32 specular, const glm::mat4& modelMatrix, sal_uInt32 nUniqueId);
|
||||
void EndAddShape3DExtrudeObject();
|
||||
void SetSize(const Size& rSize);
|
||||
void SetCameraInfo(const glm::vec3& pos, const glm::vec3& direction, const glm::vec3& up);
|
||||
void CreateTextTexture(const boost::shared_array<sal_uInt8> &bitmapBuf,
|
||||
const ::Size& rSizePixels,
|
||||
const glm::vec3& vTopLeft, const glm::vec3& vTopRight,
|
||||
const glm::vec3& vBottomRight, const glm::vec3& vBottomLeft,
|
||||
sal_uInt32 nUniqueId);
|
||||
void CreateScreenTextTexture(const boost::shared_array<sal_uInt8> &bitmapBuf,
|
||||
const ::Size& rSizePixels, const glm::vec2& vTopLeft,
|
||||
const glm::vec2& vBottomRight, const glm::vec3& vPos, const glm::vec4& vScreenTextColor,
|
||||
sal_uInt32 nUniqueId);
|
||||
void ProcessUnrenderedShape(bool bNewScene);
|
||||
|
||||
void SetPickingMode(bool bPickingMode);
|
||||
|
||||
Color GetPixelColorFromPoint(long nX, long nY);
|
||||
|
||||
void ReleaseShapes();
|
||||
void ReleaseScreenTextShapes();
|
||||
void ReleaseTextTexture();
|
||||
void ReleaseScreenTextTexture();
|
||||
void StartClick(sal_uInt32 selectID);
|
||||
void EndClick();
|
||||
void SetScroll();
|
||||
void SetScrollSpeed(float scrollSpeed);
|
||||
void SetScrollDistance(float scrollDistance);
|
||||
void SetSceneEdge(float minCoordX, float maxCoordX);
|
||||
const glm::mat4& GetProjectionMatrix();
|
||||
const glm::mat4& GetViewMatrix();
|
||||
const glm::mat4& GetGlobalScaleMatrix();
|
||||
glm::mat4 GetDiffOfTwoCameras(const glm::vec3& rBeginPos, const glm::vec3& rEndPos, const glm::vec3& rBeginDirection, const glm::vec3& rEndDirection);
|
||||
glm::mat4 GetDiffOfTwoCameras(const glm::vec3& rEndPos, const glm::vec3& rEndDirection);
|
||||
void AddMatrixDiff(const glm::mat4& aMat);
|
||||
void ResetMatrixDiff();
|
||||
private:
|
||||
void MoveModelf( const PosVecf3& trans, const PosVecf3& angle, const PosVecf3& scale);
|
||||
|
||||
static void ClearBuffer();
|
||||
void RenderPolygon3DObject();
|
||||
void RenderLine3D(const Polygon3DInfo &polygon);
|
||||
void RenderPolygon3D(const Polygon3DInfo &polygon);
|
||||
void Init3DUniformBlock();
|
||||
void Update3DUniformBlock();
|
||||
void RenderExtrude3DObject();
|
||||
//add for text
|
||||
void RenderTextShape();
|
||||
void RenderScreenTextShape();
|
||||
void RenderExtrudeSurface(const Extrude3DInfo& extrude3D);
|
||||
void RenderExtrudeTopSurface(const Extrude3DInfo& extrude3D);
|
||||
void RenderExtrudeMiddleSurface(const Extrude3DInfo& extrude3D);
|
||||
void RenderExtrudeBottomSurface(const Extrude3DInfo& extrude3D);
|
||||
void RenderExtrudeFlatSurface(const Extrude3DInfo& extrude3D, int surIndex);
|
||||
void AddVertexData(GLuint vertexBuf);
|
||||
void AddNormalData(GLuint normalBuf);
|
||||
void AddIndexData(GLuint indexBuf);
|
||||
void RenderNonRoundedBar(const Extrude3DInfo& extrude3D);
|
||||
static bool GetSimilarVertexIndex(PackedVertex const & packed,
|
||||
std::map<PackedVertex,unsigned short> & VertexToOutIndex,
|
||||
unsigned short & result
|
||||
);
|
||||
static void SetVertex(PackedVertex const &packed,
|
||||
std::map<PackedVertex,unsigned short> &VertexToOutIndex,
|
||||
std::vector<glm::vec3> &vertex,
|
||||
std::vector<glm::vec3> &normal,
|
||||
std::vector<unsigned short> &indeices);
|
||||
void CreateActualRoundedCube(float fRadius, int iSubDivY, int iSubDivZ, float width, float height, float depth);
|
||||
static int GenerateRoundCornerBar(std::vector<glm::vec3> &vertices, std::vector<glm::vec3> &normals, float fRadius, int iSubDivY,
|
||||
int iSubDivZ, float width, float height, float depth);
|
||||
void CreateSceneBoxView();
|
||||
|
||||
void ReleasePolygonShapes();
|
||||
void ReleaseExtrude3DShapes();
|
||||
void ReleaseTextShapes();
|
||||
void ReleaseBatchBarInfo();
|
||||
void GetBatchBarsInfo();
|
||||
void GetBatchTopAndFlatInfo(const Extrude3DInfo &extrude3D);
|
||||
void GetBatchMiddleInfo(const Extrude3DInfo &extrude3D);
|
||||
void InitBatch3DUniformBlock();
|
||||
void UpdateBatch3DUniformBlock();
|
||||
void RenderBatchBars(bool bNewScene);
|
||||
void RenderTextShapeBatch();
|
||||
void ReleaseTextShapesBatch();
|
||||
void CreateTextTextureSingle(const boost::shared_array<sal_uInt8> &bitmapBuf,
|
||||
const ::Size& rSizePixels,
|
||||
const glm::vec3& vTopLeft, const glm::vec3& vTopRight,
|
||||
const glm::vec3& vBottomRight, const glm::vec3& vBottomLeft,
|
||||
sal_uInt32 nUniqueId);
|
||||
void CreateTextTextureBatch(const boost::shared_array<sal_uInt8> &bitmapBuf,
|
||||
const ::Size& rSizePixels,
|
||||
const glm::vec3& vTopLeft, const glm::vec3& vTopRight,
|
||||
const glm::vec3& vBottomRight, const glm::vec3& vBottomLeft,
|
||||
sal_uInt32 nUniqueId);
|
||||
void SetHighLightBar(BatchBarInfo &barInfo);
|
||||
void DisableHighLightBar(BatchBarInfo &barInfo);
|
||||
void CalcScrollMoveMatrix(bool bNewScene);
|
||||
private:
|
||||
|
||||
struct ShaderResources
|
||||
{
|
||||
bool m_b330Support;
|
||||
bool m_bScrollFlag;
|
||||
// 3DProID
|
||||
GLint m_3DProID;
|
||||
GLint m_3DProjectionID;
|
||||
GLint m_3DViewID;
|
||||
GLint m_3DModelID;
|
||||
GLint m_3DNormalMatrixID;
|
||||
GLint m_3DVertexID;
|
||||
GLint m_3DNormalID;
|
||||
GLint m_3DMinCoordXID;
|
||||
GLint m_3DMaxCoordXID;
|
||||
GLint m_3DUndrawID;
|
||||
//300 version;
|
||||
GLint m_3DMaterialAmbientID;
|
||||
GLint m_3DMaterialDiffuseID;
|
||||
GLint m_3DMaterialSpecularID;
|
||||
GLint m_3DMaterialColorID;
|
||||
GLint m_3DMaterialTwoSidesID;
|
||||
GLint m_3DMaterialShininessID;
|
||||
GLint m_3DLightColorID;
|
||||
GLint m_3DLightPosID;
|
||||
GLint m_3DLightPowerID;
|
||||
GLint m_3DLightNumID;
|
||||
GLint m_3DLightAmbientID;
|
||||
|
||||
// TextProID
|
||||
GLint m_TextProID;
|
||||
GLint m_TextMatrixID;
|
||||
GLint m_TextVertexID;
|
||||
GLint m_TextTexCoordID;
|
||||
GLint m_TextTexID;
|
||||
|
||||
// ScreenTextProID
|
||||
GLint m_ScreenTextProID;
|
||||
GLint m_ScreenTextVertexID;
|
||||
GLint m_ScreenTextTexCoordID;
|
||||
GLint m_ScreenTextTexID;
|
||||
GLint m_ScreenTextColorID;
|
||||
|
||||
// CommonProID
|
||||
GLint m_CommonProID;
|
||||
GLint m_2DVertexID;
|
||||
GLint m_2DColorID;
|
||||
GLint m_MatrixID;
|
||||
|
||||
// Batch render
|
||||
GLint m_3DBatchProID;
|
||||
GLint m_3DBatchProjectionID;
|
||||
GLint m_3DBatchViewID;
|
||||
GLint m_3DBatchModelID;
|
||||
GLint m_3DBatchNormalMatrixID;
|
||||
GLint m_3DBatchVertexID;
|
||||
GLint m_3DBatchNormalID;
|
||||
GLint m_3DBatchColorID;
|
||||
GLint m_3DBatchTransMatrixID;
|
||||
GLint m_3DBatchMinCoordXID;
|
||||
GLint m_3DBatchMaxCoordXID;
|
||||
GLint m_3DBatchUndrawID;
|
||||
|
||||
//Batch render text
|
||||
bool mbTexBatchSupport;
|
||||
GLint m_BatchTextProID;
|
||||
GLint m_BatchTextMatrixID;
|
||||
GLint m_BatchTextVertexID;
|
||||
GLint m_BatchTextTexCoordID;
|
||||
GLint m_BatchTextTexID;
|
||||
|
||||
ShaderResources();
|
||||
~ShaderResources();
|
||||
|
||||
void LoadShaders();
|
||||
};
|
||||
|
||||
struct PickingShaderResources
|
||||
{
|
||||
// CommonProID
|
||||
GLint m_CommonProID;
|
||||
GLint m_2DVertexID;
|
||||
GLint m_2DColorID;
|
||||
GLint m_MatrixID;
|
||||
GLint m_ModelID;
|
||||
GLint m_MinCoordXID;
|
||||
GLint m_MaxCoordXID;
|
||||
PickingShaderResources();
|
||||
~PickingShaderResources();
|
||||
|
||||
void LoadShaders();
|
||||
};
|
||||
|
||||
ShaderResources maResources;
|
||||
PickingShaderResources maPickingResources;
|
||||
|
||||
// Model matrix : an identity matrix (model will be at the origin
|
||||
glm::mat4 m_Model;
|
||||
|
||||
sal_Int32 m_iWidth;
|
||||
|
||||
sal_Int32 m_iHeight;
|
||||
|
||||
GlobalLights m_LightsInfo;
|
||||
|
||||
CameraInfo m_CameraInfo;
|
||||
|
||||
Polygon3DInfo m_Polygon3DInfo;
|
||||
|
||||
std::vector <Polygon3DInfo> m_Polygon3DInfoList;
|
||||
|
||||
glm::mat4 m_3DProjection;
|
||||
|
||||
glm::mat4 m_3DView;
|
||||
|
||||
glm::mat4 m_3DMVP;
|
||||
|
||||
GLuint m_3DUBOBuffer;
|
||||
|
||||
GLint m_3DActualSizeLight;
|
||||
|
||||
GLuint m_NormalBuffer;
|
||||
|
||||
GLuint m_VertexBuffer;
|
||||
|
||||
Extrude3DInfo m_Extrude3DInfo;
|
||||
|
||||
std::vector <Extrude3DInfo> m_Extrude3DList;
|
||||
|
||||
GLuint m_CubeVertexBuf;
|
||||
|
||||
GLuint m_CubeElementBuf;
|
||||
|
||||
GLuint m_CubeNormalBuf;
|
||||
|
||||
GLuint m_BoundBox;
|
||||
GLuint m_BoundBoxNormal;
|
||||
// add for text
|
||||
std::vector <TextInfo> m_TextInfoList;
|
||||
std::vector <TextInfo> m_ScreenTextInfoList;
|
||||
GLuint m_TextTexCoordBuf;
|
||||
GLuint m_TextTexCoordBufBatch;
|
||||
|
||||
std::vector<glm::vec3> m_Vertices;
|
||||
|
||||
std::vector<glm::vec3> m_Normals;
|
||||
|
||||
std::vector<unsigned short> m_Indices;
|
||||
|
||||
RoundBarMesh m_RoundBarMesh;
|
||||
|
||||
GLuint m_RenderVertexBuf;
|
||||
|
||||
GLuint m_RenderTexCoordBuf;
|
||||
|
||||
float m_fViewAngle;
|
||||
|
||||
bool mbPickingMode;
|
||||
|
||||
GLuint mnPickingFbo;
|
||||
GLuint mnPickingRboDepth;
|
||||
GLuint mnPickingRboColor;
|
||||
|
||||
BatchBarInfo m_BarSurface[3];
|
||||
GLuint m_BatchModelMatrixBuf;
|
||||
GLuint m_BatchNormalMatrixBuf;
|
||||
GLuint m_BatchColorBuf;
|
||||
MaterialParameters m_Batchmaterial;
|
||||
GLuint m_Batch3DUBOBuffer;
|
||||
GLint m_Batch3DActualSizeLight;
|
||||
|
||||
glm::mat4 m_GlobalScaleMatrix;
|
||||
TextInfoBatch m_TextInfoBatch;
|
||||
//for 3.0 version
|
||||
int m_iLightNum;
|
||||
glm::vec4 m_Ambient;
|
||||
glm::vec4 m_LightColor[maxLights];
|
||||
glm::vec4 m_PositionWorldspace[maxLights];
|
||||
float m_fLightPower[maxLights];
|
||||
//for 3.0 end
|
||||
std::vector<GLuint> m_Texturelist;
|
||||
std::vector<GLuint> m_ScreenTexturelist;
|
||||
bool m_bHighLighting;
|
||||
sal_uInt32 m_uiSelectID;
|
||||
float m_fScrollSpeed;
|
||||
float m_fScrollDistance;
|
||||
float m_fMinCoordX;
|
||||
float m_fMaxCoordX;
|
||||
float m_fCurDistance;
|
||||
glm::mat4 m_ScrollMoveMatrix;
|
||||
bool m_bUndrawFlag;
|
||||
glm::mat4 m_matDiff;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,206 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_CHART2_SOURCE_VIEW_INC_OPENGLSHAPEFACTORY_HXX
|
||||
#define INCLUDED_CHART2_SOURCE_VIEW_INC_OPENGLSHAPEFACTORY_HXX
|
||||
|
||||
#include "AbstractShapeFactory.hxx"
|
||||
|
||||
namespace chart {
|
||||
|
||||
namespace opengl {
|
||||
|
||||
// This class is stateless!!!!!
|
||||
// Don't add member variables
|
||||
class OpenglShapeFactory : public chart::AbstractShapeFactory
|
||||
{
|
||||
public:
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShapes >
|
||||
createGroup2D(
|
||||
const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const OUString& aName = OUString() ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShapes >
|
||||
createGroup3D(
|
||||
const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const OUString& aName = OUString() ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createCube( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const css::drawing::Position3D& rPosition
|
||||
, const css::drawing::Direction3D& rSize
|
||||
, sal_Int32 nRotateZAngleHundredthDegree
|
||||
, const css::uno::Reference< css::beans::XPropertySet >& xSourceProp
|
||||
, const tPropertyNameMap& rPropertyNameMap
|
||||
, bool bRounded = false) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createCylinder( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const css::drawing::Position3D& rPosition
|
||||
, const css::drawing::Direction3D& rSize
|
||||
, sal_Int32 nRotateZAngleHundredthDegree ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createPyramid( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const css::drawing::Position3D& rPosition
|
||||
, const css::drawing::Direction3D& rSize
|
||||
, double fTopHeight
|
||||
, bool bRotateZ
|
||||
, const css::uno::Reference< css::beans::XPropertySet >& xSourceProp
|
||||
, const tPropertyNameMap& rPropertyNameMap) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createCone( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const css::drawing::Position3D& rPosition
|
||||
, const css::drawing::Direction3D& rSize
|
||||
, double fTopHeight, sal_Int32 nRotateZAngleHundredthDegree ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createPieSegment2D( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, double fUnitCircleStartAngleDegree, double fUnitCircleWidthAngleDegree
|
||||
, double fUnitCircleInnerRadius, double fUnitCircleOuterRadius
|
||||
, const css::drawing::Direction3D& rOffset
|
||||
, const css::drawing::HomogenMatrix& rUnitCircleToScene ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createPieSegment( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, double fUnitCircleStartAngleDegree, double fUnitCircleWidthAngleDegree
|
||||
, double fUnitCircleInnerRadius, double fUnitCircleOuterRadius
|
||||
, const css::drawing::Direction3D& rOffset
|
||||
, const css::drawing::HomogenMatrix& rUnitCircleToScene
|
||||
, double fDepth ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createStripe( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const Stripe& rStripe
|
||||
, const css::uno::Reference< css::beans::XPropertySet >& xSourceProp
|
||||
, const tPropertyNameMap& rPropertyNameMap
|
||||
, bool bDoubleSided
|
||||
, short nRotatedTexture = 0 //0 to 7 are the different possibilities
|
||||
, bool bFlatNormals=true ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createArea3D( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const css::drawing::PolyPolygonShape3D& rPolyPolygon
|
||||
, double fDepth) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createArea2D( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const css::drawing::PolyPolygonShape3D& rPolyPolygon) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createSymbol2D( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const css::drawing::Position3D& rPos
|
||||
, const css::drawing::Direction3D& rSize
|
||||
, sal_Int32 nStandardSymbol
|
||||
, sal_Int32 nBorderColor
|
||||
, sal_Int32 nFillColor ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createGraphic2D( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const css::drawing::Position3D& rPos
|
||||
, const css::drawing::Direction3D& rSize
|
||||
, const css::uno::Reference< css::graphic::XGraphic >& xGraphic ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createLine2D( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const css::drawing::PointSequenceSequence& rPoints
|
||||
, const VLineProperties* pLineProperties = nullptr ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createLine ( const css::uno::Reference< css::drawing::XShapes >& xTarget,
|
||||
const css::awt::Size& rSize, const css::awt::Point& rPosition ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createLine3D( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const css::drawing::PolyPolygonShape3D& rPoints
|
||||
, const VLineProperties& rLineProperties ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createCircle2D( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const css::drawing::Position3D& rPos
|
||||
, const css::drawing::Direction3D& rSize ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createCircle( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const css::awt::Size& rSize
|
||||
, const css::awt::Point& rPosition ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createText( const css::uno::Reference< css::drawing::XShapes >& xTarget2D
|
||||
, const OUString& rText
|
||||
, const tNameSequence& rPropNames
|
||||
, const tAnySequence& rPropValues
|
||||
, const css::uno::Any& rATransformation
|
||||
) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createText( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, const css::uno::Sequence< OUString >& rTextParagraphs
|
||||
, const css::uno::Sequence< tNameSequence >& rParaPropNames
|
||||
, const css::uno::Sequence< tAnySequence >& rParaPropValues
|
||||
, const tNameSequence& rPropNames
|
||||
, const tAnySequence& rPropValues
|
||||
, const css::uno::Any& rATransformation ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createText( const css::uno::Reference< css::drawing::XShapes >& xTarget
|
||||
, css::uno::Sequence< css::uno::Reference< css::chart2::XFormattedString > >& xFormattedString
|
||||
, const tNameSequence& rPropNames
|
||||
, const tAnySequence& rPropValues
|
||||
, const css::uno::Any& rATransformation ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createText( const css::uno::Reference< css::drawing::XShapes >& xTarget2D,
|
||||
const css::awt::Size& rSize,
|
||||
const css::awt::Point& rPosition,
|
||||
css::uno::Sequence< css::uno::Reference< css::chart2::XFormattedString > >& xFormattedString,
|
||||
const css::uno::Reference< css::beans::XPropertySet > & xTextProperties,
|
||||
double nRotation, const OUString& aName ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createInvisibleRectangle(
|
||||
const css::uno::Reference<
|
||||
css::drawing::XShapes >& xTarget
|
||||
, const css::awt::Size& rSize ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createRectangle(
|
||||
const css::uno::Reference< css::drawing::XShapes >& xTarget,
|
||||
const css::awt::Size& rSize,
|
||||
const css::awt::Point& rPosition,
|
||||
const tNameSequence& rPropNames,
|
||||
const tAnySequence& rPropValues,
|
||||
StackPosition ePos = Top ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShape >
|
||||
createRectangle(
|
||||
const css::uno::Reference< css::drawing::XShapes >& xTarget ) override;
|
||||
|
||||
virtual css::uno::Reference< css::drawing::XShapes >
|
||||
getOrCreateChartRootShape( const css::uno::Reference< css::drawing::XDrawPage>& xPage ) override;
|
||||
|
||||
virtual void setPageSize( css::uno::Reference < css::drawing::XShapes > xChartShapes, const css::awt::Size& rSize ) override;
|
||||
|
||||
virtual void render(css::uno::Reference< css::drawing::XShapes > xDrawPage, bool bInitOpenGL) override;
|
||||
|
||||
virtual bool preRender(css::uno::Reference< css::drawing::XShapes > xRootShape, OpenGLWindow* pWindow) override;
|
||||
virtual void postRender(OpenGLWindow* pWindow) override;
|
||||
|
||||
virtual void clearPage(css::uno::Reference< css::drawing::XShapes > xDrawPage) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -227,14 +227,6 @@ public:
|
||||
|
||||
virtual void setPageSize( css::uno::Reference < css::drawing::XShapes > xChartShapes, const css::awt::Size& rSize ) override;
|
||||
|
||||
/**
|
||||
* not necessary right now
|
||||
*/
|
||||
virtual void render(css::uno::Reference< css::drawing::XShapes >, bool ) override {}
|
||||
|
||||
virtual bool preRender(css::uno::Reference< css::drawing::XShapes >, OpenGLWindow*) override { return true; }
|
||||
virtual void postRender(OpenGLWindow*) override {}
|
||||
|
||||
virtual void clearPage(css::uno::Reference< css::drawing::XShapes > ) override {}
|
||||
|
||||
private:
|
||||
|
@ -1,135 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_CHART2_SOURCE_VIEW_INC_STATICGEOMETRY_H
|
||||
#define INCLUDED_CHART2_SOURCE_VIEW_INC_STATICGEOMETRY_H
|
||||
|
||||
#define TOP_SURFACE 0
|
||||
#define MIDDLE_SURFACE 1
|
||||
#define FLAT_BOTTOM_SURFACE 2
|
||||
#define BOTTOM_SURFACE 3
|
||||
#define FLAT_TOP_SURFACE 4
|
||||
|
||||
static GLfloat boundBox[] = {
|
||||
0.0f, 0.0f, 0.0f,
|
||||
0.0f, 0.0f, 1.0f,
|
||||
0.0f, 1.0f, 1.0f,//1
|
||||
|
||||
0.0f, 0.0f, 0.0f,
|
||||
0.0f, 1.0f, 1.0f,
|
||||
0.0f, 1.0f, 0.0f,//2
|
||||
|
||||
1.0f, 1.0f, 0.0f,
|
||||
0.0f, 0.0f, 0.0f,
|
||||
0.0f, 1.0f, 0.0f,//3
|
||||
|
||||
1.0f, 1.0f, 0.0f,
|
||||
1.0f, 0.0f, 0.0f,
|
||||
0.0f, 0.0f, 0.0f,//4
|
||||
|
||||
1.0f, 0.0f, 1.0f,
|
||||
0.0f, 0.0f, 0.0f,
|
||||
1.0f, 0.0f, 0.0f,//5
|
||||
|
||||
1.0f, 0.0f, 1.0f,
|
||||
0.0f, 0.0f, 1.0f,
|
||||
0.0f, 0.0f, 0.0f,//6
|
||||
|
||||
1.0f, 1.0f, 1.0f,
|
||||
1.0f, 1.0f, 0.0f,
|
||||
0.0f, 1.0f, 0.0f,//7
|
||||
|
||||
1.0f, 1.0f, 1.0f,
|
||||
0.0f, 1.0f, 0.0f,
|
||||
0.0f, 1.0f, 1.0f,//8
|
||||
|
||||
0.0f, 1.0f, 1.0f,
|
||||
0.0f, 0.0f, 1.0f,
|
||||
1.0f, 0.0f, 1.0f,//9
|
||||
|
||||
1.0f, 1.0f, 1.0f,
|
||||
0.0f, 1.0f, 1.0f,
|
||||
1.0f, 0.0f, 1.0f,//10
|
||||
|
||||
1.0f, 1.0f, 1.0f,
|
||||
1.0f, 0.0f, 0.0f,
|
||||
1.0f, 1.0f, 0.0f,//11
|
||||
|
||||
1.0f, 0.0f, 0.0f,
|
||||
1.0f, 1.0f, 1.0f,
|
||||
1.0f, 0.0f, 1.0f//12
|
||||
};
|
||||
|
||||
static const GLfloat boundBoxNormal[] = {
|
||||
-1.0f, 0.0f, 0.0f,
|
||||
-1.0f, 0.0f, 0.0f,
|
||||
-1.0f, 0.0f, 0.0f,//1
|
||||
|
||||
-1.0f, 0.0f, 0.0f,
|
||||
-1.0f, 0.0f, 0.0f,
|
||||
-1.0f, 0.0f, 0.0f,//2
|
||||
|
||||
0.0f, 0.0f, -1.0f,
|
||||
0.0f, 0.0f, -1.0f,
|
||||
0.0f, 0.0f, -1.0f,//3
|
||||
|
||||
0.0f, 0.0f, -1.0f,
|
||||
0.0f, 0.0f, -1.0f,
|
||||
0.0f, 0.0f, -1.0f,//4
|
||||
|
||||
0.0f, -1.0f, 0.0f,
|
||||
0.0f, -1.0f, 0.0f,
|
||||
0.0f,- 1.0f, 0.0f,//5
|
||||
|
||||
0.0f, -1.0f, 0.0f,
|
||||
0.0f, -1.0f, 0.0f,
|
||||
0.0f, -1.0f, 0.0f,//6
|
||||
|
||||
0.0f, 1.0f, 0.0f,
|
||||
0.0f, 1.0f, 0.0f,
|
||||
0.0f, 1.0f, 0.0f,//7
|
||||
|
||||
0.0f, 1.0f, 0.0f,
|
||||
0.0f, 1.0f, 0.0f,
|
||||
0.0f, 1.0f, 0.0f,//8
|
||||
|
||||
0.0f, 0.0f, 1.0f,
|
||||
0.0f, 0.0f, 1.0f,
|
||||
0.0f, 0.0f, 1.0f,//9
|
||||
|
||||
0.0f, 0.0f, 1.0f,
|
||||
0.0f, 0.0f, 1.0f,
|
||||
0.0f, 0.0f, 1.0f,//10
|
||||
|
||||
1.0f, 0.0f, 0.0f,
|
||||
1.0f, 0.0f, 0.0f,
|
||||
1.0f, 0.0f, 0.0f,//11
|
||||
|
||||
1.0f, 0.0f, 0.0f,
|
||||
1.0f, 0.0f, 0.0f,
|
||||
1.0f, 0.0f, 0.0f//12
|
||||
};
|
||||
|
||||
static GLfloat coordReverseVertices[] = {
|
||||
0.0f, 1.0f,
|
||||
1.0f, 1.0f,
|
||||
1.0f, 0.0f,
|
||||
0.0f, 0.0f,
|
||||
};
|
||||
|
||||
static GLfloat squareVertices[] = {
|
||||
-1.0f, -1.0f, -1.0,
|
||||
1.0f, -1.0f, -1.0,
|
||||
1.0f, 1.0f, -1.0,
|
||||
-1.0f, 1.0f, -1.0
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,234 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include <3DChartObjects.hxx>
|
||||
#include <vcl/virdev.hxx>
|
||||
#include <vcl/svapp.hxx>
|
||||
#include <sal/log.hxx>
|
||||
|
||||
#include <vcl/opengl/GLMHelper.hxx>
|
||||
#include <vcl/opengl/OpenGLHelper.hxx>
|
||||
#include <vcl/bitmapaccess.hxx>
|
||||
|
||||
namespace chart {
|
||||
|
||||
namespace opengl3D {
|
||||
|
||||
Renderable3DObject::Renderable3DObject(OpenGL3DRenderer* pRenderer, sal_uInt32 nId):
|
||||
mpRenderer(pRenderer),
|
||||
mnUniqueId(nId)
|
||||
{
|
||||
}
|
||||
|
||||
void Renderable3DObject::render()
|
||||
{
|
||||
(void) mnUniqueId;
|
||||
}
|
||||
|
||||
Bar::Bar(OpenGL3DRenderer* pRenderer, const glm::mat4& rPosition, Color aColor, sal_uInt32 nId)
|
||||
: Renderable3DObject(pRenderer, nId)
|
||||
, maPos(rPosition)
|
||||
, maColor(aColor)
|
||||
{
|
||||
SAL_INFO("chart2.3dopengl", rPosition);
|
||||
}
|
||||
|
||||
void Bar::render()
|
||||
{
|
||||
mpRenderer->AddShape3DExtrudeObject(true/*RoundedCorners*/, maColor, 0xFFFFFF, maPos, mnUniqueId);
|
||||
mpRenderer->EndAddShape3DExtrudeObject();
|
||||
}
|
||||
|
||||
Line::Line(OpenGL3DRenderer* pRenderer, sal_uInt32 nId):
|
||||
Renderable3DObject(pRenderer, nId)
|
||||
{
|
||||
}
|
||||
|
||||
void Line::render()
|
||||
{
|
||||
mpRenderer->AddShapePolygon3DObject(Color(0), true, maLineColor, 0, 0, mnUniqueId);
|
||||
mpRenderer->AddPolygon3DObjectPoint(maPosBegin.x, maPosBegin.y, maPosBegin.z);
|
||||
mpRenderer->AddPolygon3DObjectPoint(maPosEnd.x, maPosEnd.y, maPosEnd.z);
|
||||
mpRenderer->EndAddPolygon3DObjectPoint();
|
||||
mpRenderer->EndAddShapePolygon3DObject();
|
||||
}
|
||||
|
||||
void Line::setPosition(const glm::vec3& rBegin, const glm::vec3& rEnd)
|
||||
{
|
||||
maPosBegin = rBegin;
|
||||
maPosEnd = rEnd;
|
||||
}
|
||||
|
||||
void Line::setLineColor(const Color& rColor)
|
||||
{
|
||||
maLineColor = rColor;
|
||||
}
|
||||
|
||||
const TextCacheItem& TextCache::getText(OUString const & rText, bool bIs3dText)
|
||||
{
|
||||
TextCacheType::const_iterator const itr = m_TextCache.find(rText);
|
||||
if (itr != m_TextCache.end())
|
||||
return itr->second;
|
||||
|
||||
ScopedVclPtrInstance< VirtualDevice > pDevice(*Application::GetDefaultDevice(),
|
||||
DeviceFormat::DEFAULT, DeviceFormat::DEFAULT);
|
||||
vcl::Font aFont;
|
||||
if(bIs3dText)
|
||||
aFont = vcl::Font("Brillante St",Size(0,0));
|
||||
else
|
||||
aFont = pDevice->GetFont();
|
||||
aFont.SetFontSize(Size(0, 96));
|
||||
aFont.SetColor(COL_GREEN);
|
||||
pDevice->SetFont(aFont);
|
||||
pDevice->Erase();
|
||||
|
||||
pDevice->SetOutputSize(Size(pDevice->GetTextWidth(rText), pDevice->GetTextHeight()));
|
||||
pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
|
||||
pDevice->DrawText(Point(0,0), rText);
|
||||
|
||||
BitmapEx aText(pDevice->GetBitmapEx(Point(0,0), pDevice->GetOutputSize()));
|
||||
Bitmap aBitmap (aText.GetBitmap());
|
||||
BitmapReadAccess *pAcc = aBitmap.AcquireReadAccess();
|
||||
sal_uInt8 *buf = reinterpret_cast<sal_uInt8 *>(pAcc->GetBuffer());
|
||||
long nBmpWidth = aText.GetSizePixel().Width();
|
||||
long nBmpHeight = aText.GetSizePixel().Height();
|
||||
sal_uInt8* pBitmapBuf(new sal_uInt8[3* nBmpWidth * nBmpHeight]);
|
||||
memcpy(pBitmapBuf, buf, 3* nBmpWidth * nBmpHeight);
|
||||
m_TextCache.insert(std::make_pair(rText, TextCacheItem(pBitmapBuf, aText.GetSizePixel())));
|
||||
Bitmap::ReleaseAccess(pAcc);
|
||||
return m_TextCache.find(rText)->second;
|
||||
}
|
||||
|
||||
Text::Text(OpenGL3DRenderer* pRenderer, TextCache& rTextCache, const OUString& rStr, sal_uInt32 nId):
|
||||
Renderable3DObject(pRenderer, nId),
|
||||
maText(rTextCache.getText(rStr))
|
||||
{
|
||||
}
|
||||
|
||||
void Text::render()
|
||||
{
|
||||
glm::vec3 dir2 = maTopRight - maTopLeft;
|
||||
glm::vec3 bottomLeft = maBottomRight - dir2;
|
||||
mpRenderer->CreateTextTexture(maText.maPixels, maText.maSize,
|
||||
maTopLeft, maTopRight, maBottomRight, bottomLeft,
|
||||
mnUniqueId);
|
||||
}
|
||||
|
||||
void Text::setPosition(const glm::vec3& rTopLeft, const glm::vec3& rTopRight, const glm::vec3& rBottomRight)
|
||||
{
|
||||
maTopLeft = rTopLeft;
|
||||
maTopRight = rTopRight;
|
||||
maBottomRight = rBottomRight;
|
||||
}
|
||||
|
||||
ScreenText::ScreenText(OpenGL3DRenderer* pRenderer, TextCache& rTextCache,
|
||||
const OUString& rStr, const glm::vec4& rColor, sal_uInt32 nId, bool bIs3dText):
|
||||
Renderable3DObject(pRenderer, nId),
|
||||
maText(rTextCache.getText(rStr,bIs3dText)),
|
||||
maColor(rColor)
|
||||
{
|
||||
}
|
||||
|
||||
void ScreenText::setPosition(const glm::vec2& rTopLeft, const glm::vec2& rBottomRight,
|
||||
const glm::vec3& r3DPos)
|
||||
{
|
||||
maTopLeft = rTopLeft;
|
||||
maBottomRight = rBottomRight;
|
||||
ma3DPos = r3DPos;
|
||||
}
|
||||
|
||||
void ScreenText::render()
|
||||
{
|
||||
mpRenderer->CreateScreenTextTexture(maText.maPixels, maText.maSize,
|
||||
maTopLeft, maBottomRight, ma3DPos, maColor,
|
||||
mnUniqueId);
|
||||
}
|
||||
|
||||
Rectangle::Rectangle(OpenGL3DRenderer* pRenderer, sal_uInt32 nId):
|
||||
Renderable3DObject(pRenderer, nId)
|
||||
{
|
||||
}
|
||||
|
||||
void Rectangle::render()
|
||||
{
|
||||
glm::vec3 dir1 = maBottomRight - maTopLeft;
|
||||
glm::vec3 dir2 = maTopRight - maTopLeft;
|
||||
glm::vec3 normal = glm::normalize(glm::cross(dir1, dir2));
|
||||
mpRenderer->AddShapePolygon3DObject(maColor, false, Color(0), 1, 0xFFFFFF, mnUniqueId);
|
||||
glm::vec3 bottomLeft = maBottomRight - dir2;
|
||||
//set polygon points and normals
|
||||
mpRenderer->AddPolygon3DObjectPoint(maBottomRight.x, maBottomRight.y, maBottomRight.z);
|
||||
mpRenderer->AddPolygon3DObjectNormalPoint(normal.x, normal.y, normal.z);
|
||||
mpRenderer->AddPolygon3DObjectPoint(maTopRight.x, maTopRight.y, maTopRight.z);
|
||||
mpRenderer->AddPolygon3DObjectNormalPoint(normal.x, normal.y, normal.z);
|
||||
mpRenderer->AddPolygon3DObjectPoint(maTopLeft.x, maTopLeft.y, maTopLeft.z);
|
||||
mpRenderer->AddPolygon3DObjectNormalPoint(normal.x, normal.y, normal.z);
|
||||
mpRenderer->AddPolygon3DObjectPoint(bottomLeft.x, bottomLeft.y, bottomLeft.z);
|
||||
mpRenderer->AddPolygon3DObjectNormalPoint(normal.x, normal.y, normal.z);
|
||||
mpRenderer->EndAddPolygon3DObjectPoint();
|
||||
mpRenderer->EndAddPolygon3DObjectNormalPoint();
|
||||
mpRenderer->EndAddShapePolygon3DObject();
|
||||
//we should render the edge if the edge color is different from the fill color
|
||||
if (maColor != maLineColor)
|
||||
{
|
||||
mpRenderer->AddShapePolygon3DObject(Color(0), true, maLineColor, 0, 0xFFFFFF, mnUniqueId);
|
||||
mpRenderer->AddPolygon3DObjectPoint(maBottomRight.x, maBottomRight.y, maBottomRight.z);
|
||||
mpRenderer->AddPolygon3DObjectPoint(maTopRight.x, maTopRight.y, maTopRight.z);
|
||||
mpRenderer->AddPolygon3DObjectPoint(maTopLeft.x, maTopLeft.y, maTopLeft.z);
|
||||
mpRenderer->AddPolygon3DObjectPoint(bottomLeft.x, bottomLeft.y, bottomLeft.z);
|
||||
mpRenderer->EndAddPolygon3DObjectPoint();
|
||||
mpRenderer->EndAddShapePolygon3DObject();
|
||||
}
|
||||
}
|
||||
|
||||
void Rectangle::setPosition(const glm::vec3& rTopLeft, const glm::vec3& rTopRight, const glm::vec3& rBottomRight)
|
||||
{
|
||||
maTopLeft = rTopLeft;
|
||||
maTopRight = rTopRight;
|
||||
maBottomRight = rBottomRight;
|
||||
}
|
||||
|
||||
void Rectangle::setFillColor(const Color& rColor)
|
||||
{
|
||||
maColor = rColor;
|
||||
}
|
||||
|
||||
void Rectangle::setLineColor(const Color& rColor)
|
||||
{
|
||||
maLineColor = rColor;
|
||||
}
|
||||
|
||||
Camera::Camera(OpenGL3DRenderer* pRenderer):
|
||||
Renderable3DObject(pRenderer, 0),
|
||||
maPos(10,-50,20),
|
||||
maUp(0, 0, 1),
|
||||
maDirection(glm::vec3(0,0,0))
|
||||
{
|
||||
}
|
||||
|
||||
void Camera::render()
|
||||
{
|
||||
mpRenderer->SetCameraInfo(maPos, maDirection, maUp);
|
||||
}
|
||||
|
||||
void Camera::setPosition(const glm::vec3& rPos)
|
||||
{
|
||||
maPos = rPos;
|
||||
}
|
||||
|
||||
void Camera::setDirection(const glm::vec3& rDir)
|
||||
{
|
||||
maDirection = rDir;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -45,7 +45,6 @@
|
||||
|
||||
#include <osl/module.hxx>
|
||||
|
||||
#include <OpenglShapeFactory.hxx>
|
||||
#include <ShapeFactory.hxx>
|
||||
|
||||
#include <config_features.h>
|
||||
@ -54,41 +53,6 @@ using namespace com::sun::star;
|
||||
|
||||
namespace chart {
|
||||
|
||||
namespace {
|
||||
|
||||
typedef opengl::OpenglShapeFactory* (*getOpenglShapeFactory_)(void);
|
||||
|
||||
#if HAVE_FEATURE_UI
|
||||
|
||||
#ifndef DISABLE_DYNLOADING
|
||||
|
||||
void thisModule() {}
|
||||
|
||||
osl::Module* getOpenGLModule()
|
||||
{
|
||||
static osl::Module aModule;
|
||||
if (aModule.is())
|
||||
// Already loaded.
|
||||
return &aModule;
|
||||
|
||||
OUString aLibName(SVLIBRARY("chartopengl"));
|
||||
bool bLoaded = aModule.loadRelative(&thisModule, aLibName);
|
||||
if (!bLoaded)
|
||||
bLoaded = aModule.load(aLibName);
|
||||
|
||||
return bLoaded ? &aModule : nullptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#ifdef DISABLE_DYNLOADING
|
||||
extern "C" opengl::OpenglShapeFactory* getOpenglShapeFactory();
|
||||
#endif
|
||||
|
||||
AbstractShapeFactory* AbstractShapeFactory::getOrCreateShapeFactory(const uno::Reference< lang::XMultiServiceFactory>& xFactory)
|
||||
{
|
||||
static AbstractShapeFactory* pShapeFactory = nullptr;
|
||||
@ -96,30 +60,6 @@ AbstractShapeFactory* AbstractShapeFactory::getOrCreateShapeFactory(const uno::R
|
||||
if (pShapeFactory)
|
||||
return pShapeFactory;
|
||||
|
||||
#if HAVE_FEATURE_UI
|
||||
if(getenv("CHART_DUMMY_FACTORY") && !Application::IsHeadlessModeEnabled())
|
||||
{
|
||||
#ifndef DISABLE_DYNLOADING
|
||||
osl::Module* pModule = getOpenGLModule();
|
||||
if(pModule)
|
||||
{
|
||||
oslGenericFunction fn = pModule->getFunctionSymbol("getOpenglShapeFactory");
|
||||
if(fn)
|
||||
{
|
||||
|
||||
pShapeFactory = reinterpret_cast<getOpenglShapeFactory_>(fn)();
|
||||
pShapeFactory->m_xShapeFactory = xFactory;
|
||||
}
|
||||
}
|
||||
#elif defined(IOS) || defined(ANDROID) // Library_chartopengl is not portable enough yet
|
||||
pShapeFactory = NULL;
|
||||
#else
|
||||
pShapeFactory = getOpenglShapeFactory();
|
||||
pShapeFactory->m_xShapeFactory = xFactory;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!pShapeFactory)
|
||||
pShapeFactory = new ShapeFactory(xFactory);
|
||||
|
||||
|
@ -51,9 +51,6 @@
|
||||
#include <ExplicitCategoriesProvider.hxx>
|
||||
#include <defines.hxx>
|
||||
#include <unonames.hxx>
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
#include <GL3DBarChart.hxx>
|
||||
#endif
|
||||
#include <editeng/frmdiritem.hxx>
|
||||
#include <rtl/uuid.h>
|
||||
#include <tools/globname.hxx>
|
||||
@ -70,10 +67,6 @@
|
||||
#include <vcl/svapp.hxx>
|
||||
#include <osl/mutex.hxx>
|
||||
#include <svx/unofill.hxx>
|
||||
#include <vcl/openglwin.hxx>
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
#include <vcl/opengl/OpenGLContext.hxx>
|
||||
#endif
|
||||
#include <drawinglayer/XShapeDumper.hxx>
|
||||
|
||||
#include <time.h>
|
||||
@ -1056,102 +1049,6 @@ struct CreateShapeParam2D
|
||||
mbUseFixedInnerSize(false) {}
|
||||
};
|
||||
|
||||
class GL2DRenderer : public IRenderer
|
||||
{
|
||||
public:
|
||||
explicit GL2DRenderer(ChartView* pView);
|
||||
virtual ~GL2DRenderer() override;
|
||||
|
||||
virtual void update() override;
|
||||
virtual void clickedAt(const Point& rPos, sal_uInt16 nButton) override;
|
||||
virtual void mouseDragMove(const Point& rBegin, const Point& rEnd, sal_uInt16 nButton) override;
|
||||
virtual void scroll(long nDelta) override;
|
||||
virtual void contextDestroyed() override;
|
||||
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
const OpenGLWindow* getOpenGLWindow() const;
|
||||
void updateOpenGLWindow();
|
||||
#endif
|
||||
private:
|
||||
ChartView* mpView;
|
||||
bool mbContextDestroyed;
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
VclPtr<OpenGLWindow> mpWindow;
|
||||
#endif
|
||||
};
|
||||
|
||||
GL2DRenderer::GL2DRenderer(ChartView* pView)
|
||||
: mpView(pView)
|
||||
, mbContextDestroyed(false)
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
, mpWindow(mpView->mrChartModel.getOpenGLWindow())
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
GL2DRenderer::~GL2DRenderer()
|
||||
{
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
SolarMutexGuard g;
|
||||
if(!mbContextDestroyed && mpWindow)
|
||||
mpWindow->setRenderer(nullptr);
|
||||
mpWindow.reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
void GL2DRenderer::update()
|
||||
{
|
||||
mpView->update();
|
||||
mpView->render();
|
||||
}
|
||||
|
||||
void GL2DRenderer::clickedAt(const Point&, sal_uInt16 )
|
||||
{
|
||||
}
|
||||
|
||||
void GL2DRenderer::mouseDragMove(const Point& , const Point& , sal_uInt16 )
|
||||
{
|
||||
}
|
||||
|
||||
void GL2DRenderer::scroll(long )
|
||||
{
|
||||
}
|
||||
|
||||
void GL2DRenderer::contextDestroyed()
|
||||
{
|
||||
mbContextDestroyed = true;
|
||||
}
|
||||
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
|
||||
const OpenGLWindow* GL2DRenderer::getOpenGLWindow() const
|
||||
{
|
||||
return mpWindow;
|
||||
}
|
||||
|
||||
void GL2DRenderer::updateOpenGLWindow()
|
||||
{
|
||||
if(mbContextDestroyed)
|
||||
return;
|
||||
|
||||
OpenGLWindow* pWindow = mpView->mrChartModel.getOpenGLWindow();
|
||||
if(pWindow != mpWindow)
|
||||
{
|
||||
if(mpWindow)
|
||||
{
|
||||
mpWindow->setRenderer(nullptr);
|
||||
}
|
||||
|
||||
if(pWindow)
|
||||
{
|
||||
pWindow->setRenderer(this);
|
||||
}
|
||||
}
|
||||
mpWindow = pWindow;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
const uno::Sequence<sal_Int8>& ExplicitValueProvider::getUnoTunnelId()
|
||||
{
|
||||
return theExplicitValueProviderUnoTunnelId::get().getSeq();
|
||||
@ -1193,7 +1090,6 @@ ChartView::ChartView(
|
||||
, m_nScaleYDenominator(1)
|
||||
, m_bSdrViewIsInEditMode(false)
|
||||
, m_aResultingDiagramRectangleExcludingAxes(0,0,0,0)
|
||||
, mp2DRenderer(new GL2DRenderer(this))
|
||||
{
|
||||
init();
|
||||
}
|
||||
@ -2577,19 +2473,6 @@ void ChartView::impl_refreshAddIn()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Is it a real 3D chart with a true 3D scene or a 3D chart in a 2D scene.
|
||||
*/
|
||||
bool ChartView::isReal3DChart()
|
||||
{
|
||||
uno::Reference< XDiagram > xDiagram( mrChartModel.getFirstDiagram() );
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
return ChartHelper::isGL3DDiagram(xDiagram);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static const char* envChartDummyFactory = getenv("CHART_DUMMY_FACTORY");
|
||||
|
||||
void ChartView::createShapes()
|
||||
@ -2630,24 +2513,6 @@ void ChartView::createShapes()
|
||||
}
|
||||
pShapeFactory->setPageSize(mxRootShape, aPageSize);
|
||||
pShapeFactory->clearPage(mxRootShape);
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
#if HAVE_FEATURE_DESKTOP
|
||||
if(isReal3DChart())
|
||||
{
|
||||
createShapes3D();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pGL3DPlotter.reset();
|
||||
|
||||
// hide OpenGL window for now in normal charts
|
||||
OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow();
|
||||
if(pWindow && !envChartDummyFactory)
|
||||
pWindow->Show(false);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
createShapes2D(aPageSize);
|
||||
|
||||
@ -2664,27 +2529,6 @@ void ChartView::createShapes()
|
||||
}
|
||||
}
|
||||
|
||||
void ChartView::render()
|
||||
{
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
if(!isReal3DChart())
|
||||
{
|
||||
AbstractShapeFactory* pShapeFactory = AbstractShapeFactory::getOrCreateShapeFactory(m_xShapeFactory);
|
||||
OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow();
|
||||
if(pWindow)
|
||||
pWindow->setRenderer(mp2DRenderer.get());
|
||||
bool bRender = pShapeFactory->preRender(mxRootShape, pWindow);
|
||||
if(bRender)
|
||||
{
|
||||
pShapeFactory->render(mxRootShape, pWindow != mp2DRenderer->getOpenGLWindow());
|
||||
pShapeFactory->postRender(pWindow);
|
||||
}
|
||||
}
|
||||
#else
|
||||
(void) this;
|
||||
#endif
|
||||
}
|
||||
|
||||
// util::XEventListener (base of XCloseListener)
|
||||
void SAL_CALL ChartView::disposing( const lang::EventObject& /* rSource */ )
|
||||
{
|
||||
@ -2721,11 +2565,6 @@ void ChartView::impl_updateView( bool bCheckLockedCtrler )
|
||||
|
||||
//create chart view
|
||||
{
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow();
|
||||
if (pWindow && ChartHelper::isGL3DDiagram(mrChartModel.getFirstDiagram()))
|
||||
pWindow->Initialize();
|
||||
#endif
|
||||
m_bViewDirty = false;
|
||||
m_bViewUpdatePending = false;
|
||||
createShapes();
|
||||
@ -3234,8 +3073,6 @@ void ChartView::createShapes2D( const awt::Size& rPageSize )
|
||||
//cleanup: remove all empty group shapes to avoid grey border lines:
|
||||
lcl_removeEmptyGroupShapes( mxRootShape );
|
||||
|
||||
render();
|
||||
|
||||
if(maTimeBased.bTimeBased && maTimeBased.nFrame % 60 == 0)
|
||||
{
|
||||
// create copy of the data for next frame
|
||||
@ -3309,93 +3146,6 @@ bool ChartView::createAxisTitleShapes2D( CreateShapeParam2D& rParam, const css::
|
||||
return true;
|
||||
}
|
||||
|
||||
void ChartView::createShapes3D()
|
||||
{
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow();
|
||||
if(!pWindow)
|
||||
return;
|
||||
|
||||
if( pWindow->GetSizePixel().Width() == 0 || pWindow->GetSizePixel().Height() == 0 )
|
||||
{
|
||||
awt::Size aPageSize = mrChartModel.getVisualAreaSize( embed::Aspects::MSOLE_CONTENT );
|
||||
Size aSize = pWindow->LogicToPixel(Size(aPageSize.Width, aPageSize.Height), MapMode(MapUnit::Map100thMM));
|
||||
pWindow->SetSizePixel(aSize);
|
||||
}
|
||||
pWindow->Show();
|
||||
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() );
|
||||
|
||||
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<XCoordinateSystem> xCooSys( aCooSysList[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::Sequence< uno::Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() );
|
||||
if (aChartTypeList.getLength() != 1)
|
||||
// Likewise, we can't really support multiple chart types here.
|
||||
return;
|
||||
|
||||
uno::Reference< XChartType > xChartType( aChartTypeList[0] );
|
||||
|
||||
if (!m_pGL3DPlotter)
|
||||
{
|
||||
m_pGL3DPlotter.reset(new GL3DBarChart(xChartType, pWindow));
|
||||
}
|
||||
else
|
||||
{
|
||||
GL3DBarChart* pChart = dynamic_cast<GL3DBarChart*>(m_pGL3DPlotter.get());
|
||||
if (pChart)
|
||||
pChart->setOpenGLWindow(pWindow);
|
||||
}
|
||||
|
||||
uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
|
||||
OSL_ASSERT( xDataSeriesContainer.is());
|
||||
if( !xDataSeriesContainer.is() )
|
||||
return;
|
||||
|
||||
std::vector<std::unique_ptr<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;
|
||||
|
||||
aDataSeries.push_back(o3tl::make_unique<VDataSeries>(xDataSeries));
|
||||
}
|
||||
|
||||
std::unique_ptr<ExplicitCategoriesProvider> pCatProvider(new ExplicitCategoriesProvider(xCooSys, mrChartModel));
|
||||
|
||||
m_pGL3DPlotter->create3DShapes(aDataSeries, *pCatProvider);
|
||||
|
||||
m_pGL3DPlotter->render();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if HAVE_FEATURE_OPENGL
|
||||
|
||||
void ChartView::updateOpenGLWindow()
|
||||
{
|
||||
if(!isReal3DChart())
|
||||
mp2DRenderer->updateOpenGLWindow();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} //namespace chart
|
||||
|
||||
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
|
||||
|
@ -1,402 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_CHART2_SOURCE_VIEW_MAIN_DUMMYXSHAPE_HXX
|
||||
#define INCLUDED_CHART2_SOURCE_VIEW_MAIN_DUMMYXSHAPE_HXX
|
||||
|
||||
#include <cppuhelper/implbase6.hxx>
|
||||
|
||||
#include <vcl/opengl/OpenGLContext.hxx>
|
||||
#include "OpenGLRender.hxx"
|
||||
|
||||
#include <com/sun/star/drawing/XShape.hpp>
|
||||
#include <com/sun/star/drawing/XShapes.hpp>
|
||||
#include <com/sun/star/beans/XMultiPropertySet.hpp>
|
||||
#include <com/sun/star/container/XNamed.hpp>
|
||||
#include <com/sun/star/container/XChild.hpp>
|
||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||
#include <com/sun/star/awt/Point.hpp>
|
||||
#include <com/sun/star/awt/Size.hpp>
|
||||
#include <com/sun/star/uno/Type.h>
|
||||
#include <com/sun/star/uno/Any.h>
|
||||
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
|
||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||
#include <com/sun/star/drawing/CircleKind.hpp>
|
||||
#include <com/sun/star/drawing/DoubleSequence.hpp>
|
||||
#include <com/sun/star/drawing/FlagSequence.hpp>
|
||||
#include <com/sun/star/drawing/FillStyle.hpp>
|
||||
#include <com/sun/star/drawing/LineStyle.hpp>
|
||||
#include <com/sun/star/drawing/NormalsKind.hpp>
|
||||
#include <com/sun/star/drawing/PointSequence.hpp>
|
||||
#include <com/sun/star/drawing/PolygonKind.hpp>
|
||||
#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
|
||||
#include <com/sun/star/drawing/ProjectionMode.hpp>
|
||||
#include <com/sun/star/drawing/ShadeMode.hpp>
|
||||
#include <com/sun/star/drawing/TextFitToSizeType.hpp>
|
||||
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
|
||||
#include <com/sun/star/drawing/TextureProjectionMode.hpp>
|
||||
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
|
||||
#include <com/sun/star/text/XText.hpp>
|
||||
#include <com/sun/star/uno/Any.hxx>
|
||||
#include <com/sun/star/drawing/Direction3D.hpp>
|
||||
#include <com/sun/star/drawing/Position3D.hpp>
|
||||
#include <com/sun/star/graphic/XGraphic.hpp>
|
||||
#include <com/sun/star/drawing/HomogenMatrix.hpp>
|
||||
#include <com/sun/star/drawing/PointSequenceSequence.hpp>
|
||||
#include <com/sun/star/chart2/XFormattedString.hpp>
|
||||
|
||||
#include <PropertyMapper.hxx>
|
||||
#include <VLineProperties.hxx>
|
||||
#include <Stripe.hxx>
|
||||
|
||||
#include <rtl/ustring.hxx>
|
||||
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
namespace chart {
|
||||
|
||||
namespace dummy {
|
||||
|
||||
class DummyChart;
|
||||
|
||||
class TextCache
|
||||
{
|
||||
public:
|
||||
struct TextCacheKey
|
||||
{
|
||||
OUString maText;
|
||||
std::map<OUString, css::uno::Any> maProperties;
|
||||
|
||||
bool operator==(const TextCacheKey& rKey) const
|
||||
{
|
||||
return maText == rKey.maText && maProperties == rKey.maProperties;
|
||||
}
|
||||
};
|
||||
|
||||
struct TextCacheKeyHash
|
||||
{
|
||||
size_t operator()(const TextCacheKey& rKey) const
|
||||
{
|
||||
return rKey.maText.hashCode();
|
||||
}
|
||||
};
|
||||
|
||||
bool hasEntry(const TextCacheKey& rKey);
|
||||
BitmapEx& getBitmap(const TextCacheKey& rKey);
|
||||
void insertBitmap(const TextCacheKey& rKey, const BitmapEx& rBitmap);
|
||||
|
||||
private:
|
||||
|
||||
std::unordered_map<TextCacheKey, BitmapEx, TextCacheKeyHash> maCache;
|
||||
};
|
||||
|
||||
class DummyXShape : public cppu::WeakAggImplHelper6<
|
||||
css::drawing::XShape,
|
||||
css::beans::XPropertySet,
|
||||
css::beans::XMultiPropertySet,
|
||||
css::container::XNamed,
|
||||
css::container::XChild,
|
||||
css::lang::XServiceInfo >
|
||||
{
|
||||
public:
|
||||
DummyXShape();
|
||||
|
||||
// XNamed
|
||||
virtual OUString SAL_CALL getName() override;
|
||||
virtual void SAL_CALL setName( const OUString& aName ) override;
|
||||
|
||||
// XShape
|
||||
virtual css::awt::Point SAL_CALL getPosition() override;
|
||||
virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
|
||||
virtual css::awt::Size SAL_CALL getSize() override;
|
||||
virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
|
||||
|
||||
// XShapeDescriptor
|
||||
virtual OUString SAL_CALL getShapeType() override;
|
||||
|
||||
// XPropertySet
|
||||
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
|
||||
virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
|
||||
virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
|
||||
virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
|
||||
virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
|
||||
virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
|
||||
virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
|
||||
|
||||
// XMultiPropertySet
|
||||
virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames,
|
||||
const css::uno::Sequence< css::uno::Any >& aValues ) override;
|
||||
|
||||
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues(
|
||||
const css::uno::Sequence< OUString >& aPropertyNames ) override;
|
||||
|
||||
virtual void SAL_CALL addPropertiesChangeListener( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
|
||||
|
||||
virtual void SAL_CALL removePropertiesChangeListener( const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
|
||||
|
||||
virtual void SAL_CALL firePropertiesChangeEvent( const css::uno::Sequence< OUString >& aPropertyNames,
|
||||
const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
|
||||
|
||||
// XChild
|
||||
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
|
||||
virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
|
||||
|
||||
// XServiceInfo
|
||||
virtual OUString SAL_CALL getImplementationName() override;
|
||||
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
|
||||
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
|
||||
|
||||
// normal non UNO methods
|
||||
|
||||
virtual DummyChart* getRootShape();
|
||||
/**
|
||||
* Implement this method for all subclasses that should be rendered
|
||||
*/
|
||||
virtual void render();
|
||||
|
||||
const css::awt::Point& getPos() { return maPosition;} // internal API
|
||||
|
||||
protected:
|
||||
|
||||
std::map<OUString, css::uno::Any> maProperties;
|
||||
css::awt::Point maPosition;
|
||||
css::awt::Size maSize;
|
||||
|
||||
private:
|
||||
OUString maName;
|
||||
|
||||
css::uno::Reference< css::uno::XInterface > mxParent;
|
||||
|
||||
};
|
||||
|
||||
class DummyCube : public DummyXShape
|
||||
{
|
||||
public:
|
||||
DummyCube(const css::drawing::Position3D &rPos, const css::drawing::Direction3D& rSize,
|
||||
const css::uno::Reference< css::beans::XPropertySet > & xPropSet,
|
||||
const tPropertyNameMap& rPropertyNameMap );
|
||||
};
|
||||
|
||||
class DummyCylinder : public DummyXShape
|
||||
{
|
||||
public:
|
||||
DummyCylinder(const css::drawing::Position3D&, const css::drawing::Direction3D& rSize );
|
||||
};
|
||||
|
||||
class DummyPyramid : public DummyXShape
|
||||
{
|
||||
public:
|
||||
DummyPyramid(const css::drawing::Position3D& rPosition, const css::drawing::Direction3D& rSize,
|
||||
const css::uno::Reference< css::beans::XPropertySet > & xPropSet,
|
||||
const tPropertyNameMap& rPropertyNameMap );
|
||||
};
|
||||
|
||||
class DummyCone : public DummyXShape
|
||||
{
|
||||
public:
|
||||
DummyCone(const css::drawing::Position3D& rPosition, const css::drawing::Direction3D& rSize);
|
||||
};
|
||||
|
||||
class DummyPieSegment2D : public DummyXShape
|
||||
{
|
||||
public:
|
||||
DummyPieSegment2D(double fUnitCircleStartAngleDegree, double fUnitCircleWidthAngleDegree,
|
||||
double fUnitCircleInnerRadius, double fUnitCircleOuterRadius,
|
||||
const css::drawing::Direction3D& rOffset, const css::drawing::HomogenMatrix& rUnitCircleToScene);
|
||||
void render() override;
|
||||
private:
|
||||
double mfUnitCircleStartAngleDegree;
|
||||
double mfUnitCircleWidthAngleDegree;
|
||||
double mfUnitCircleInnerRadius;
|
||||
double mfUnitCircleOuterRadius;
|
||||
|
||||
css::drawing::Direction3D maOffset;
|
||||
css::drawing::HomogenMatrix maUnitCircleToScene;
|
||||
};
|
||||
|
||||
class DummyPieSegment : public DummyXShape {};
|
||||
|
||||
class DummyStripe : public DummyXShape
|
||||
{
|
||||
public:
|
||||
DummyStripe(const css::uno::Reference< css::beans::XPropertySet > & xPropSet,
|
||||
const tPropertyNameMap& rPropertyNameMap );
|
||||
};
|
||||
|
||||
class DummyArea3D : public DummyXShape {};
|
||||
|
||||
class DummyArea2D : public DummyXShape
|
||||
{
|
||||
public:
|
||||
explicit DummyArea2D(const css::drawing::PointSequenceSequence& rShape);
|
||||
|
||||
virtual void render() override;
|
||||
|
||||
private:
|
||||
css::drawing::PointSequenceSequence maShapes;
|
||||
};
|
||||
|
||||
class DummySymbol2D : public DummyXShape
|
||||
{
|
||||
public:
|
||||
DummySymbol2D(const css::drawing::Position3D& rPosition, const css::drawing::Direction3D& rSize,
|
||||
sal_Int32 nStandardSymbol, sal_Int32 nFillColor);
|
||||
void render() override;
|
||||
private:
|
||||
sal_Int32 mnStandardSymbol;
|
||||
sal_Int32 mnFillColor;
|
||||
};
|
||||
|
||||
class DummyGraphic2D : public DummyXShape
|
||||
{
|
||||
public:
|
||||
DummyGraphic2D(const css::drawing::Position3D& rPosition, const css::drawing::Direction3D& rSize );
|
||||
};
|
||||
|
||||
class DummyCircle : public DummyXShape
|
||||
{
|
||||
public:
|
||||
DummyCircle(const css::awt::Point& rPosition, const css::awt::Size& rSize);
|
||||
|
||||
virtual void render() override;
|
||||
};
|
||||
|
||||
class DummyLine3D : public DummyXShape
|
||||
{
|
||||
public:
|
||||
explicit DummyLine3D(const VLineProperties& rProperties);
|
||||
};
|
||||
|
||||
class DummyLine2D : public DummyXShape
|
||||
{
|
||||
public:
|
||||
DummyLine2D(const css::drawing::PointSequenceSequence& rPoints, const VLineProperties* pProperties);
|
||||
DummyLine2D(const css::awt::Size& rSize, const css::awt::Point& rPosition);
|
||||
|
||||
virtual void render() override;
|
||||
|
||||
private:
|
||||
css::drawing::PointSequenceSequence maPoints;
|
||||
};
|
||||
|
||||
class DummyRectangle : public DummyXShape
|
||||
{
|
||||
public:
|
||||
DummyRectangle();
|
||||
explicit DummyRectangle(const css::awt::Size& rSize);
|
||||
DummyRectangle(const css::awt::Size& rSize, const css::awt::Point& rPoint, const tNameSequence& rNames,
|
||||
const tAnySequence& rValues );
|
||||
|
||||
virtual void render() override;
|
||||
};
|
||||
|
||||
class DummyText : public DummyXShape
|
||||
{
|
||||
public:
|
||||
DummyText(const OUString& rText, const tNameSequence& rNames,
|
||||
const tAnySequence& rValues, const css::uno::Any& rTrans, css::uno::Reference<
|
||||
css::drawing::XShapes > const & xTarget, double nRotation);
|
||||
|
||||
virtual void render() override;
|
||||
|
||||
virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
|
||||
|
||||
virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
|
||||
|
||||
private:
|
||||
void setTransformatAsProperty(const css::drawing::HomogenMatrix3& rMatrix);
|
||||
|
||||
css::uno::Any maTrans;
|
||||
BitmapEx maBitmap;
|
||||
double mnRotation;
|
||||
};
|
||||
|
||||
class DummyXShapes : public DummyXShape, public css::drawing::XShapes
|
||||
{
|
||||
public:
|
||||
|
||||
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
|
||||
virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& rType ) override;
|
||||
virtual void SAL_CALL acquire() throw() override;
|
||||
virtual void SAL_CALL release() throw() override;
|
||||
|
||||
// XShapes
|
||||
virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
|
||||
virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override;
|
||||
|
||||
// XElementAccess
|
||||
virtual css::uno::Type SAL_CALL getElementType() override;
|
||||
virtual sal_Bool SAL_CALL hasElements() override;
|
||||
|
||||
// XIndexAccess
|
||||
virtual sal_Int32 SAL_CALL getCount() override ;
|
||||
virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
|
||||
|
||||
// normal methods
|
||||
virtual void render() override;
|
||||
|
||||
protected:
|
||||
std::vector<css::uno::Reference< css::drawing::XShape > > maUNOShapes;
|
||||
std::vector<DummyXShape*> maShapes;
|
||||
};
|
||||
|
||||
class DummyChart : public DummyXShapes
|
||||
{
|
||||
public:
|
||||
DummyChart();
|
||||
virtual ~DummyChart() override;
|
||||
virtual DummyChart* getRootShape() override;
|
||||
|
||||
virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
|
||||
virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
|
||||
|
||||
virtual void render() override;
|
||||
|
||||
void clear();
|
||||
void invalidateInit() { mbNotInit = true; }
|
||||
TextCache& getTextCache() { return maTextCache;}
|
||||
|
||||
OpenGLRender& getRenderer() { return m_GLRender; }
|
||||
|
||||
private:
|
||||
|
||||
TextCache maTextCache;
|
||||
bool mbNotInit;
|
||||
|
||||
public:
|
||||
OpenGLRender m_GLRender;
|
||||
|
||||
};
|
||||
|
||||
class DummyGroup2D : public DummyXShapes
|
||||
{
|
||||
public:
|
||||
explicit DummyGroup2D(const OUString& rName);
|
||||
|
||||
virtual css::awt::Point SAL_CALL getPosition() override;
|
||||
virtual css::awt::Size SAL_CALL getSize() override;
|
||||
virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override;
|
||||
virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
|
||||
};
|
||||
|
||||
class DummyGroup3D : public DummyXShapes
|
||||
{
|
||||
public:
|
||||
explicit DummyGroup3D(const OUString& rName);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,18 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include <GL3DPlotterBase.hxx>
|
||||
|
||||
namespace chart {
|
||||
|
||||
GL3DPlotterBase::~GL3DPlotterBase() {}
|
||||
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,192 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_CHART2_SOURCE_VIEW_MAIN_OPENGLRENDER_HXX
|
||||
#define INCLUDED_CHART2_SOURCE_VIEW_MAIN_OPENGLRENDER_HXX
|
||||
|
||||
#include <vcl/bitmapex.hxx>
|
||||
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
|
||||
#include <com/sun/star/drawing/FillStyle.hpp>
|
||||
#include <com/sun/star/drawing/XDrawPage.hpp>
|
||||
#include <vcl/font.hxx>
|
||||
#include <vcl/opengl/OpenGLContext.hxx>
|
||||
#include <boost/shared_array.hpp>
|
||||
|
||||
// Include GLM
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtx/transform.hpp>
|
||||
#include <glm/gtx/euler_angles.hpp>
|
||||
#include <glm/gtx/quaternion.hpp>
|
||||
|
||||
#define DEBUG_POSITIONING 0
|
||||
|
||||
struct PosVecf3
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
};
|
||||
|
||||
struct Bubble2DPointList
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float xScale;
|
||||
float yScale;
|
||||
};
|
||||
|
||||
struct RectanglePointList
|
||||
{
|
||||
float points[12];
|
||||
};
|
||||
|
||||
struct TextInfo
|
||||
{
|
||||
GLuint texture;
|
||||
double rotation;
|
||||
float vertex[12];
|
||||
float nDx;
|
||||
float nDy;
|
||||
};
|
||||
|
||||
typedef std::vector<GLfloat> PointList;
|
||||
|
||||
// for 3D, use vector to save the points
|
||||
|
||||
class OpenGLRender
|
||||
{
|
||||
public:
|
||||
OpenGLRender();
|
||||
~OpenGLRender();
|
||||
int InitOpenGL();
|
||||
void MoveModelf(const PosVecf3& trans, const PosVecf3& angle, const PosVecf3& scale);
|
||||
void SetSize(int width, int height);
|
||||
void SetSizePixel(int width, int height);
|
||||
void Release();
|
||||
int RenderLine2FBO();
|
||||
void SetLine2DShapePoint(float x, float y, int listLength);
|
||||
void SetLine2DColor(sal_uInt8 r, sal_uInt8 g, sal_uInt8 b, sal_uInt8 nAlpha);
|
||||
void SetLine2DWidth(int width);
|
||||
void SetColor(sal_uInt32 color, sal_uInt8 nAlpha);
|
||||
void Bubble2DShapePoint(float x, float y, float directionX, float directionY);
|
||||
int RenderBubble2FBO();
|
||||
|
||||
void prepareToRender();
|
||||
|
||||
void RenderRectangleShape(bool bBorder, bool bFill);
|
||||
void RectangleShapePoint(float x, float y, float directionX, float directionY);
|
||||
|
||||
void CreateTextTexture(const boost::shared_array<sal_uInt8> &rPixels,
|
||||
const ::Size &aPixelSize,
|
||||
const css::awt::Size& aSize,
|
||||
long rotation,
|
||||
const css::drawing::HomogenMatrix3& rTrans);
|
||||
int CreateTextTexture(const BitmapEx& rBitmapEx,
|
||||
const css::awt::Size& aSize,
|
||||
long rotation, const css::drawing::HomogenMatrix3& rTrans);
|
||||
void RenderTextShape();
|
||||
|
||||
void SetArea2DShapePoint(float x, float y, int listLength);
|
||||
void RenderArea2DShape();
|
||||
void SetChartTransparencyGradient(long transparencyGradient);
|
||||
|
||||
void GeneratePieSegment2D(double, double, double, double);
|
||||
void RenderPieSegment2DShape(float, float, float);
|
||||
|
||||
void RenderSymbol2DShape(float, float, sal_Int32);
|
||||
#if DEBUG_POSITIONING
|
||||
void renderDebug();
|
||||
#endif
|
||||
|
||||
void SetBackGroundColor(::Color color1, ::Color color2, css::drawing::FillStyle fillstyle);
|
||||
|
||||
private:
|
||||
int m_iWidth;
|
||||
|
||||
int m_iHeight;
|
||||
|
||||
private:
|
||||
int Create2DCircle(int detail);
|
||||
private:
|
||||
// Projection matrix : default 45 degree Field of View, 4:3 ratio, display range : 0.1 unit <-> 100 units
|
||||
glm::mat4 m_Projection;
|
||||
// Camera matrix
|
||||
glm::mat4 m_View;
|
||||
// Model matrix : an identity matrix (model will be at the origin
|
||||
glm::mat4 m_Model;
|
||||
// Our ModelViewProjection : multiplication of our 3 matrices
|
||||
glm::mat4 m_MVP;
|
||||
|
||||
GLuint m_VertexBuffer;
|
||||
|
||||
GLuint m_ColorBuffer;
|
||||
|
||||
GLint m_MatrixID;
|
||||
|
||||
GLuint m_RenderVertexBuf;
|
||||
|
||||
GLuint m_RenderTexCoordBuf;
|
||||
|
||||
PointList m_Line2DPointList;
|
||||
|
||||
float m_fLineWidth;
|
||||
|
||||
std::vector<PointList> m_Line2DShapePointList;
|
||||
|
||||
glm::vec4 m_2DColor;
|
||||
|
||||
std::vector<GLfloat> m_Bubble2DCircle;
|
||||
|
||||
std::vector<Bubble2DPointList> m_Bubble2DShapePointList;
|
||||
GLint m_CommonProID;
|
||||
GLint m_2DVertexID;
|
||||
GLint m_2DColorID;
|
||||
|
||||
float m_fZStep;
|
||||
|
||||
std::vector<RectanglePointList> m_RectangleShapePointList;
|
||||
// add for text
|
||||
std::vector<TextInfo> m_TextInfoVector;
|
||||
GLint m_TextProID;
|
||||
GLint m_TextMatrixID;
|
||||
GLint m_TextVertexID;
|
||||
GLint m_TextTexCoordID;
|
||||
GLuint m_TextTexCoordBuf;
|
||||
GLint m_TextTexID;
|
||||
|
||||
PointList m_Area2DPointList;
|
||||
std::vector<PointList> m_Area2DShapePointList;
|
||||
|
||||
GLint m_BackgroundProID;
|
||||
GLint m_BackgroundMatrixID;
|
||||
GLint m_BackgroundVertexID;
|
||||
GLint m_BackgroundColorID;
|
||||
|
||||
float m_BackgroundColor[16];
|
||||
|
||||
std::vector<PointList> m_PieSegment2DShapePointList;
|
||||
|
||||
GLuint m_SymbolProID;
|
||||
GLuint m_SymbolVertexID;
|
||||
GLuint m_SymbolMatrixID;
|
||||
GLuint m_SymbolColorID;
|
||||
GLuint m_SymbolShapeID;
|
||||
|
||||
#if DEBUG_POSITIONING
|
||||
GLuint m_DebugProID;
|
||||
GLuint m_DebugVertexID;
|
||||
GLuint m_DebugColorID;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // INCLUDED_CHART2_SOURCE_VIEW_MAIN_OPENGLRENDER_HXX
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,504 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
#include <svx/unoshape.hxx>
|
||||
#include <OpenglShapeFactory.hxx>
|
||||
#include "DummyXShape.hxx"
|
||||
#include <ViewDefines.hxx>
|
||||
#include <Stripe.hxx>
|
||||
#include <CommonConverters.hxx>
|
||||
#include <PropertyMapper.hxx>
|
||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||
#include <com/sun/star/drawing/CircleKind.hpp>
|
||||
#include <com/sun/star/drawing/DoubleSequence.hpp>
|
||||
#include <com/sun/star/drawing/FlagSequence.hpp>
|
||||
#include <com/sun/star/drawing/FillStyle.hpp>
|
||||
#include <com/sun/star/drawing/LineStyle.hpp>
|
||||
#include <com/sun/star/drawing/NormalsKind.hpp>
|
||||
#include <com/sun/star/drawing/PointSequence.hpp>
|
||||
#include <com/sun/star/drawing/PolygonKind.hpp>
|
||||
#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
|
||||
#include <com/sun/star/drawing/ProjectionMode.hpp>
|
||||
#include <com/sun/star/drawing/ShadeMode.hpp>
|
||||
#include <com/sun/star/drawing/TextFitToSizeType.hpp>
|
||||
#include <com/sun/star/drawing/TextureProjectionMode.hpp>
|
||||
#include <com/sun/star/text/XText.hpp>
|
||||
#include <com/sun/star/uno/Sequence.hxx>
|
||||
#include <com/sun/star/uno/Any.hxx>
|
||||
|
||||
#include <editeng/unoprnms.hxx>
|
||||
#include <rtl/math.hxx>
|
||||
#include <svx/svdocirc.hxx>
|
||||
#include <svx/svdopath.hxx>
|
||||
#include <vcl/openglwin.hxx>
|
||||
#include <sal/log.hxx>
|
||||
|
||||
#include <basegfx/point/b2dpoint.hxx>
|
||||
#include <basegfx/matrix/b3dhommatrix.hxx>
|
||||
|
||||
#include <RelativeSizeHelper.hxx>
|
||||
|
||||
using namespace ::com::sun::star;
|
||||
|
||||
namespace chart
|
||||
{
|
||||
|
||||
extern "C" {
|
||||
SAL_DLLPUBLIC_EXPORT opengl::OpenglShapeFactory* getOpenglShapeFactory()
|
||||
{ return new opengl::OpenglShapeFactory;}
|
||||
}
|
||||
|
||||
using dummy::DummyCylinder;
|
||||
using dummy::DummyRectangle;
|
||||
using dummy::DummyPyramid;
|
||||
using dummy::DummyCone;
|
||||
|
||||
namespace opengl {
|
||||
|
||||
namespace {
|
||||
|
||||
uno::Reference< drawing::XShapes > getChartShape(
|
||||
const uno::Reference< drawing::XDrawPage>& xDrawPage )
|
||||
{
|
||||
uno::Reference< drawing::XShapes > xRet;
|
||||
uno::Reference< drawing::XShapes > xShapes( xDrawPage, uno::UNO_QUERY );
|
||||
if( xShapes.is() )
|
||||
{
|
||||
sal_Int32 nCount = xShapes->getCount();
|
||||
uno::Reference< drawing::XShape > xShape;
|
||||
for( sal_Int32 nN = nCount; nN--; )
|
||||
{
|
||||
if( xShapes->getByIndex( nN ) >>= xShape )
|
||||
{
|
||||
|
||||
OUString aRet;
|
||||
|
||||
uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY );
|
||||
xProp->getPropertyValue( UNO_NAME_MISC_OBJ_NAME ) >>= aRet;
|
||||
if( aRet == "com.sun.star.chart2.shapes" )
|
||||
{
|
||||
xRet = dynamic_cast<SvxDummyShapeContainer&>(*xShape.get()).getWrappedShape();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return xRet;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShapes > OpenglShapeFactory::getOrCreateChartRootShape(
|
||||
const uno::Reference< drawing::XDrawPage>& xDrawPage )
|
||||
{
|
||||
uno::Reference< drawing::XShapes > xRet( getChartShape( xDrawPage ) );
|
||||
if( !xRet.is() )
|
||||
{
|
||||
//create the root shape
|
||||
SAL_WARN("chart2.opengl", "getOrCreateChartRootShape");
|
||||
|
||||
dummy::DummyChart *pChart = new dummy::DummyChart();
|
||||
SvxDummyShapeContainer* pContainer = new SvxDummyShapeContainer(pChart);
|
||||
pContainer->setSize(awt::Size(0,0));
|
||||
xRet = pChart;
|
||||
xDrawPage->add(pContainer);
|
||||
}
|
||||
return xRet;
|
||||
}
|
||||
|
||||
void OpenglShapeFactory::setPageSize( uno::Reference < drawing::XShapes > xChartShapes, const awt::Size& rSize )
|
||||
{
|
||||
uno::Reference< drawing::XShape > xShape(xChartShapes, uno::UNO_QUERY_THROW);
|
||||
xShape->setSize(rSize);
|
||||
}
|
||||
|
||||
// methods for 3D shape creation
|
||||
|
||||
uno::Reference<drawing::XShape>
|
||||
OpenglShapeFactory::createCube(
|
||||
const uno::Reference<drawing::XShapes>& xTarget
|
||||
, const drawing::Position3D& rPosition, const drawing::Direction3D& rSize
|
||||
, sal_Int32
|
||||
, const uno::Reference< beans::XPropertySet >& xSourceProp
|
||||
, const tPropertyNameMap& rPropertyNameMap
|
||||
, bool )
|
||||
{
|
||||
dummy::DummyCube* pCube = new dummy::DummyCube(rPosition, rSize,
|
||||
xSourceProp,
|
||||
rPropertyNameMap);
|
||||
xTarget->add(pCube);
|
||||
return pCube;
|
||||
}
|
||||
|
||||
uno::Reference<drawing::XShape>
|
||||
OpenglShapeFactory::createCylinder(
|
||||
const uno::Reference<drawing::XShapes>& xTarget
|
||||
, const drawing::Position3D& rPosition, const drawing::Direction3D& rSize
|
||||
, sal_Int32 )
|
||||
{
|
||||
dummy::DummyCylinder* pCylinder = new dummy::DummyCylinder( rPosition, rSize );
|
||||
xTarget->add(pCylinder);
|
||||
return pCylinder;
|
||||
}
|
||||
|
||||
uno::Reference<drawing::XShape>
|
||||
OpenglShapeFactory::createPyramid(
|
||||
const uno::Reference<drawing::XShapes>& xTarget
|
||||
, const drawing::Position3D& rPosition, const drawing::Direction3D& rSize
|
||||
, double, bool
|
||||
, const uno::Reference< beans::XPropertySet >& xSourceProp
|
||||
, const tPropertyNameMap& rPropertyNameMap )
|
||||
{
|
||||
dummy::DummyPyramid* pPyramid = new dummy::DummyPyramid(rPosition, rSize,
|
||||
xSourceProp, rPropertyNameMap );
|
||||
xTarget->add(pPyramid);
|
||||
return pPyramid;
|
||||
}
|
||||
|
||||
uno::Reference<drawing::XShape>
|
||||
OpenglShapeFactory::createCone(
|
||||
const uno::Reference<drawing::XShapes>& xTarget
|
||||
, const drawing::Position3D& rPosition, const drawing::Direction3D& rSize
|
||||
, double, sal_Int32 )
|
||||
{
|
||||
dummy::DummyCone* pCone = new dummy::DummyCone(rPosition, rSize);
|
||||
xTarget->add(pCone);
|
||||
return pCone;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createPieSegment2D(
|
||||
const uno::Reference< drawing::XShapes >& xTarget
|
||||
, double fUnitCircleStartAngleDegree, double fUnitCircleWidthAngleDegree
|
||||
, double fUnitCircleInnerRadius, double fUnitCircleOuterRadius
|
||||
, const drawing::Direction3D& rOffset
|
||||
, const drawing::HomogenMatrix& rUnitCircleToScene )
|
||||
{
|
||||
dummy::DummyPieSegment2D* pSegment = new dummy::DummyPieSegment2D(fUnitCircleStartAngleDegree,
|
||||
fUnitCircleWidthAngleDegree, fUnitCircleInnerRadius, fUnitCircleOuterRadius,
|
||||
rOffset, rUnitCircleToScene);
|
||||
xTarget->add(pSegment);
|
||||
return pSegment;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createPieSegment(
|
||||
const uno::Reference< drawing::XShapes >& xTarget
|
||||
, double, double
|
||||
, double, double
|
||||
, const drawing::Direction3D&
|
||||
, const drawing::HomogenMatrix&
|
||||
, double )
|
||||
{
|
||||
dummy::DummyPieSegment* pSegment = new dummy::DummyPieSegment;
|
||||
|
||||
xTarget->add(pSegment);
|
||||
return pSegment;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createStripe( const uno::Reference< drawing::XShapes >& xTarget
|
||||
, const Stripe&
|
||||
, const uno::Reference< beans::XPropertySet >& xSourceProp
|
||||
, const tPropertyNameMap& rPropertyNameMap
|
||||
, bool
|
||||
, short
|
||||
, bool )
|
||||
{
|
||||
dummy::DummyStripe* pStripe = new dummy::DummyStripe(
|
||||
xSourceProp, rPropertyNameMap);
|
||||
xTarget->add(pStripe);
|
||||
return pStripe;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createArea3D( const uno::Reference< drawing::XShapes >& xTarget
|
||||
, const drawing::PolyPolygonShape3D&
|
||||
, double )
|
||||
{
|
||||
dummy::DummyArea3D* pArea = new dummy::DummyArea3D;
|
||||
xTarget->add(pArea);
|
||||
return pArea;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createArea2D( const uno::Reference< drawing::XShapes >& xTarget
|
||||
, const drawing::PolyPolygonShape3D& rPolyPolygon )
|
||||
{
|
||||
dummy::DummyArea2D* pArea = new dummy::DummyArea2D(PolyToPointSequence(rPolyPolygon));
|
||||
xTarget->add(pArea);
|
||||
return pArea;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createSymbol2D(
|
||||
const uno::Reference< drawing::XShapes >& xTarget
|
||||
, const drawing::Position3D& rPosition
|
||||
, const drawing::Direction3D& rSize
|
||||
, sal_Int32 nStandardSymbol
|
||||
, sal_Int32
|
||||
, sal_Int32 nFillColor )
|
||||
{
|
||||
dummy::DummySymbol2D* pSymbol = new dummy::DummySymbol2D(rPosition, rSize,
|
||||
nStandardSymbol, nFillColor);
|
||||
xTarget->add(pSymbol);
|
||||
return pSymbol;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createGraphic2D(
|
||||
const uno::Reference< drawing::XShapes >& xTarget
|
||||
, const drawing::Position3D& rPosition
|
||||
, const drawing::Direction3D& rSize
|
||||
, const uno::Reference< graphic::XGraphic >& )
|
||||
{
|
||||
dummy::DummyGraphic2D* pGraphic = new dummy::DummyGraphic2D(rPosition, rSize);
|
||||
xTarget->add(pGraphic);
|
||||
return pGraphic;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShapes >
|
||||
OpenglShapeFactory::createGroup2D( const uno::Reference< drawing::XShapes >& xTarget
|
||||
, const OUString& aName)
|
||||
{
|
||||
dummy::DummyGroup2D* pNewShape = new dummy::DummyGroup2D(aName);
|
||||
xTarget->add(pNewShape);
|
||||
return pNewShape;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShapes >
|
||||
OpenglShapeFactory::createGroup3D( const uno::Reference< drawing::XShapes >& xTarget
|
||||
, const OUString& aName )
|
||||
{
|
||||
dummy::DummyGroup3D* pNewShape = new dummy::DummyGroup3D(aName);
|
||||
xTarget->add(pNewShape);
|
||||
return pNewShape;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createCircle2D( const uno::Reference< drawing::XShapes >& xTarget
|
||||
, const drawing::Position3D& rPosition
|
||||
, const drawing::Direction3D& rSize )
|
||||
{
|
||||
drawing::Position3D aCenterPosition(
|
||||
rPosition.PositionX - (rSize.DirectionX / 2.0),
|
||||
rPosition.PositionY - (rSize.DirectionY / 2.0),
|
||||
rPosition.PositionZ );
|
||||
dummy::DummyCircle* pCircle = new dummy::DummyCircle(Position3DToAWTPoint( aCenterPosition ),
|
||||
Direction3DToAWTSize( rSize ));
|
||||
xTarget->add(pCircle);
|
||||
return pCircle;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createCircle( const uno::Reference< drawing::XShapes >& xTarget
|
||||
, const awt::Size& rSize
|
||||
, const awt::Point& rPosition )
|
||||
{
|
||||
dummy::DummyCircle* pCircle = new dummy::DummyCircle(rPosition, rSize);
|
||||
xTarget->add(pCircle);
|
||||
return pCircle;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createLine3D( const uno::Reference< drawing::XShapes >& xTarget
|
||||
, const drawing::PolyPolygonShape3D&
|
||||
, const VLineProperties& rLineProperties )
|
||||
{
|
||||
dummy::DummyLine3D* pLine = new dummy::DummyLine3D(rLineProperties);
|
||||
xTarget->add(pLine);
|
||||
return pLine;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createLine2D( const uno::Reference< drawing::XShapes >& xTarget
|
||||
, const drawing::PointSequenceSequence& rPoints
|
||||
, const VLineProperties* pLineProperties )
|
||||
{
|
||||
dummy::DummyLine2D* pLine = new dummy::DummyLine2D(rPoints, pLineProperties);
|
||||
xTarget->add(pLine);
|
||||
|
||||
return pLine;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createLine ( const uno::Reference< drawing::XShapes >& xTarget,
|
||||
const awt::Size& rSize, const awt::Point& rPosition )
|
||||
{
|
||||
dummy::DummyLine2D* pLine = new dummy::DummyLine2D(rSize, rPosition);
|
||||
xTarget->add(pLine);
|
||||
return pLine;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape > OpenglShapeFactory::createInvisibleRectangle(
|
||||
const uno::Reference< drawing::XShapes >& xTarget
|
||||
, const awt::Size& rSize )
|
||||
{
|
||||
dummy::DummyRectangle* pRectangle = new dummy::DummyRectangle(rSize);
|
||||
pRectangle->setPropertyValue("Invisible", uno::Any(true));
|
||||
xTarget->add(pRectangle);
|
||||
return pRectangle;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape > OpenglShapeFactory::createRectangle(
|
||||
const uno::Reference< drawing::XShapes >& xTarget,
|
||||
const awt::Size& rSize,
|
||||
const awt::Point& rPosition,
|
||||
const tNameSequence& rPropNames,
|
||||
const tAnySequence& rPropValues,
|
||||
StackPosition /*ePos*/ )
|
||||
{
|
||||
dummy::DummyRectangle* pRectangle = new dummy::DummyRectangle(rSize, rPosition,
|
||||
rPropNames, rPropValues);
|
||||
|
||||
// TODO : Honor stack position.
|
||||
xTarget->add(pRectangle);
|
||||
return pRectangle;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createRectangle(
|
||||
const uno::Reference<
|
||||
drawing::XShapes >& xTarget)
|
||||
{
|
||||
dummy::DummyRectangle* pRectangle = new dummy::DummyRectangle();
|
||||
xTarget->add(pRectangle);
|
||||
return pRectangle;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createText( const uno::Reference< drawing::XShapes >& xTarget
|
||||
, const OUString& rText
|
||||
, const tNameSequence& rPropNames
|
||||
, const tAnySequence& rPropValues
|
||||
, const uno::Any& rATransformation )
|
||||
{
|
||||
dummy::DummyText* pText = new dummy::DummyText( rText, rPropNames, rPropValues,
|
||||
rATransformation, xTarget, 0 );
|
||||
return pText;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createText( const uno::Reference< drawing::XShapes >& xTarget
|
||||
, const uno::Sequence< OUString >& rTextParagraphs
|
||||
, const uno::Sequence< tNameSequence >& /*rParaPropNames*/
|
||||
, const uno::Sequence< tAnySequence >& /*rParaPropValues*/
|
||||
, const tNameSequence& rPropNames
|
||||
, const tAnySequence& rPropValues
|
||||
, const uno::Any& rATransformation )
|
||||
{
|
||||
dummy::DummyText* pText = new dummy::DummyText( rTextParagraphs[0], rPropNames, rPropValues,
|
||||
rATransformation, xTarget, 0 );
|
||||
return pText;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createText( const uno::Reference< drawing::XShapes >& xTarget
|
||||
, uno::Sequence< uno::Reference< chart2::XFormattedString > >& rFormattedString
|
||||
, const tNameSequence& rPropNames
|
||||
, const tAnySequence& rPropValues
|
||||
, const uno::Any& rATransformation )
|
||||
{
|
||||
dummy::DummyText* pText = new dummy::DummyText( rFormattedString[0]->getString(), rPropNames, rPropValues,
|
||||
rATransformation, xTarget, 0 );
|
||||
return pText;
|
||||
}
|
||||
|
||||
uno::Reference< drawing::XShape >
|
||||
OpenglShapeFactory::createText( const uno::Reference< drawing::XShapes >& xTarget,
|
||||
const awt::Size& , const awt::Point& rPos,
|
||||
uno::Sequence< uno::Reference< chart2::XFormattedString > >& rFormattedString,
|
||||
const uno::Reference< beans::XPropertySet > & xTextProperties,
|
||||
double nRotation, const OUString& rName)
|
||||
{
|
||||
tPropertyNameValueMap aValueMap;
|
||||
//fill line-, fill- and paragraph-properties into the ValueMap
|
||||
{
|
||||
tPropertyNameMap aNameMap = PropertyMapper::getPropertyNameMapForParagraphProperties();
|
||||
auto const & add = PropertyMapper::getPropertyNameMapForFillAndLineProperties();
|
||||
aNameMap.insert(add.begin(), add.end());
|
||||
|
||||
PropertyMapper::getValueMap( aValueMap, aNameMap, xTextProperties );
|
||||
}
|
||||
|
||||
//fill some more shape properties into the ValueMap
|
||||
aValueMap.insert( { "TextHorizontalAdjust", uno::Any(drawing::TextHorizontalAdjust_CENTER) } );
|
||||
aValueMap.insert( { "TextVerticalAdjust", uno::Any(drawing::TextVerticalAdjust_CENTER) } );
|
||||
aValueMap.insert( { "TextAutoGrowHeight", uno::Any(true) } );
|
||||
aValueMap.insert( { "TextAutoGrowWidth", uno::Any(true) } );
|
||||
|
||||
//set global title properties
|
||||
tNameSequence aPropNames;
|
||||
tAnySequence aPropValues;
|
||||
PropertyMapper::getMultiPropertyListsFromValueMap( aPropNames, aPropValues, aValueMap );
|
||||
|
||||
OUString aString = rFormattedString[0]->getString();
|
||||
|
||||
sal_Int32 nXPos = rPos.X;
|
||||
sal_Int32 nYPos = rPos.Y;
|
||||
::basegfx::B2DHomMatrix aM;
|
||||
aM.rotate( -nRotation*F_PI/180.0 );//#i78696#->#i80521#
|
||||
aM.translate( nXPos, nYPos );
|
||||
|
||||
dummy::DummyText* pText = new dummy::DummyText(aString, aPropNames, aPropValues,
|
||||
uno::Any(B2DHomMatrixToHomogenMatrix3(aM)), xTarget, nRotation);
|
||||
pText->setName(rName);
|
||||
return pText;
|
||||
}
|
||||
|
||||
void OpenglShapeFactory::render(uno::Reference< drawing::XShapes > xRootShape, bool bInitOpenGL)
|
||||
{
|
||||
dummy::DummyChart& rChart = dynamic_cast<dummy::DummyChart&>(*xRootShape.get());
|
||||
if(bInitOpenGL)
|
||||
{
|
||||
rChart.invalidateInit();
|
||||
}
|
||||
rChart.render();
|
||||
}
|
||||
|
||||
bool OpenglShapeFactory::preRender(uno::Reference< drawing::XShapes > xRootShape, OpenGLWindow* pWindow)
|
||||
{
|
||||
if(!pWindow)
|
||||
return false;
|
||||
|
||||
pWindow->Show();
|
||||
pWindow->getContext().makeCurrent();
|
||||
Size aSize = pWindow->GetSizePixel();
|
||||
pWindow->getContext().setWinSize(aSize);
|
||||
dummy::DummyChart& rChart = dynamic_cast<dummy::DummyChart&>(*xRootShape.get());
|
||||
rChart.getRenderer().SetSizePixel(aSize.Width(), aSize.Height());
|
||||
return true;
|
||||
}
|
||||
|
||||
void OpenglShapeFactory::postRender(OpenGLWindow* pWindow)
|
||||
{
|
||||
pWindow->getContext().swapBuffers();
|
||||
}
|
||||
|
||||
void OpenglShapeFactory::clearPage(uno::Reference< drawing::XShapes > xRootShape)
|
||||
{
|
||||
dummy::DummyChart& rChart = dynamic_cast<dummy::DummyChart&>(*xRootShape.get());
|
||||
rChart.clear();
|
||||
}
|
||||
|
||||
} //namespace dummy
|
||||
|
||||
} //namespace chart
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -412,33 +412,6 @@
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="gl3dblock">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="rounded-edge">
|
||||
<property name="label" translatable="yes" context="tp_ChartType|rounded-edge">Rounded edge</property>
|
||||
<property name="visible">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="width">1</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="width">1</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
|
@ -142,22 +142,6 @@ chart2/source/view/charttypes/CategoryPositionHelper.hxx:29
|
||||
void chart::CategoryPositionHelper::CategoryPositionHelper(double,double)
|
||||
double fSeriesCount
|
||||
1
|
||||
chart2/source/view/inc/GL3DBarChart.hxx:107
|
||||
float chart::GL3DBarChart::addScreenTextShape(class rtl::OUString &,const struct glm::detail::tvec2<float> &,float,_Bool,const struct glm::detail::tvec4<float> &,const struct glm::detail::tvec3<float> &,unsigned int)
|
||||
unsigned int nEvent
|
||||
0
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:184
|
||||
void chart::opengl3D::OpenGL3DRenderer::Set3DSenceInfo(class Color,_Bool)
|
||||
_Bool twoSidesLighting
|
||||
1
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:185
|
||||
void chart::opengl3D::OpenGL3DRenderer::SetLightInfo(_Bool,class Color,const struct glm::detail::tvec4<float> &)
|
||||
_Bool lightOn
|
||||
1
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:193
|
||||
void chart::opengl3D::OpenGL3DRenderer::AddShape3DExtrudeObject(_Bool,class Color,unsigned int,const struct glm::detail::tmat4x4<float> &,unsigned int)
|
||||
_Bool roundedCorner
|
||||
1
|
||||
chart2/source/view/inc/PlottingPositionHelper.hxx:112
|
||||
void chart::PlottingPositionHelper::AllowShiftXAxisPos(_Bool)
|
||||
_Bool bAllowShift
|
||||
|
@ -78,26 +78,6 @@ chart2/source/tools/RangeHighlighter.cxx:43
|
||||
void lcl_fillRanges(class com::sun::star::uno::Sequence<struct com::sun::star::chart2::data::HighlightedRange> &,const class com::sun::star::uno::Sequence<class rtl::OUString> &,class Color,int)
|
||||
int nIndex
|
||||
-1
|
||||
chart2/source/view/charttypes/GL3DBarChart.cxx:157
|
||||
void chart::RenderAnimationThread::RenderAnimationThread(class chart::GL3DBarChart *,const struct glm::detail::tvec3<float> &,const struct glm::detail::tvec3<float> &,const int)
|
||||
const int nSteps
|
||||
200
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:193
|
||||
void chart::opengl3D::OpenGL3DRenderer::AddShape3DExtrudeObject(_Bool,class Color,unsigned int,const struct glm::detail::tmat4x4<float> &,unsigned int)
|
||||
unsigned int specular
|
||||
16777215
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:260
|
||||
void chart::opengl3D::OpenGL3DRenderer::CreateActualRoundedCube(float,int,int,float,float,float)
|
||||
int iSubDivZ
|
||||
20
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:260
|
||||
void chart::opengl3D::OpenGL3DRenderer::CreateActualRoundedCube(float,int,int,float,float,float)
|
||||
int iSubDivY
|
||||
20
|
||||
chart2/source/view/main/OpenGLRender.hxx:117
|
||||
int OpenGLRender::Create2DCircle(int)
|
||||
int detail
|
||||
100
|
||||
codemaker/source/javamaker/classfile.cxx:86
|
||||
void writeU4(class FileStream &,unsigned int)
|
||||
unsigned int data
|
||||
|
@ -1,9 +1,6 @@
|
||||
chart2/source/model/main/DataPoint.hxx:107
|
||||
chart::DataPoint m_bNoParentPropAllowed
|
||||
0
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:161
|
||||
chart::opengl3D::TextInfoBatch batchNum
|
||||
512
|
||||
connectivity/source/inc/dbase/DIndexIter.hxx:37
|
||||
connectivity::dbase::OIndexIterator m_pOperand
|
||||
0
|
||||
|
@ -304,8 +304,6 @@ chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx:
|
||||
enum chart::wrapper::(anonymous namespace)::(anonymous at chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx:96:1) PROP_CHART_AUTOMATIC_POSITION
|
||||
chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx:54
|
||||
enum chart::wrapper::(anonymous namespace)::(anonymous at chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx:51:1) PROP_CHART_DATAPOINT_DATA_CAPTION
|
||||
chart2/source/controller/chartapiwrapper/WrappedGL3DProperties.cxx:28
|
||||
enum chart::wrapper::(anonymous namespace)::(anonymous at chart2/source/controller/chartapiwrapper/WrappedGL3DProperties.cxx:26:1) PROP_GL3DCHARTTYPE_ROUNDED_EDGE
|
||||
chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx:110
|
||||
enum chart::wrapper::(anonymous namespace)::(anonymous at chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx:108:1) PROP_CHART_SCALE_TEXT
|
||||
chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx:171
|
||||
@ -830,10 +828,6 @@ chart2/source/model/template/ColumnChartType.cxx:37
|
||||
enum (anonymous namespace)::(anonymous at chart2/source/model/template/ColumnChartType.cxx:34:1) PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE
|
||||
chart2/source/model/template/ColumnLineChartTypeTemplate.cxx:47
|
||||
enum (anonymous namespace)::(anonymous at chart2/source/model/template/ColumnLineChartTypeTemplate.cxx:45:1) PROP_COL_LINE_NUMBER_OF_LINES
|
||||
chart2/source/model/template/GL3DBarChartType.cxx:27
|
||||
enum chart::(anonymous namespace)::(anonymous at chart2/source/model/template/GL3DBarChartType.cxx:25:1) PROP_GL3DCHARTTYPE_ROUNDED_EDGE
|
||||
chart2/source/model/template/GL3DBarChartTypeTemplate.cxx:30
|
||||
enum chart::(anonymous namespace)::(anonymous at chart2/source/model/template/GL3DBarChartTypeTemplate.cxx:28:1) PROP_GL3DCHARTTYPE_ROUNDED_EDGE
|
||||
chart2/source/model/template/LineChartType.cxx:40
|
||||
enum (anonymous namespace)::(anonymous at chart2/source/model/template/LineChartType.cxx:38:1) PROP_LINECHARTTYPE_CURVE_STYLE
|
||||
chart2/source/model/template/LineChartType.cxx:41
|
||||
@ -6290,8 +6284,6 @@ include/xmloff/xmltoken.hxx:911
|
||||
enum xmloff::token::XMLTokenEnum XML_GENERATOR
|
||||
include/xmloff/xmltoken.hxx:912
|
||||
enum xmloff::token::XMLTokenEnum XML_GEQ
|
||||
include/xmloff/xmltoken.hxx:913
|
||||
enum xmloff::token::XMLTokenEnum XML_GL3DBAR
|
||||
include/xmloff/xmltoken.hxx:914
|
||||
enum xmloff::token::XMLTokenEnum XML_GOURAUD
|
||||
include/xmloff/xmltoken.hxx:915
|
||||
@ -7534,8 +7526,6 @@ include/xmloff/xmltoken.hxx:1555
|
||||
enum xmloff::token::XMLTokenEnum XML_ROTATION_ANGLE
|
||||
include/xmloff/xmltoken.hxx:1556
|
||||
enum xmloff::token::XMLTokenEnum XML_ROUND
|
||||
include/xmloff/xmltoken.hxx:1557
|
||||
enum xmloff::token::XMLTokenEnum XML_ROUNDED_EDGE
|
||||
include/xmloff/xmltoken.hxx:1559
|
||||
enum xmloff::token::XMLTokenEnum XML_ROW_HEIGHT
|
||||
include/xmloff/xmltoken.hxx:1560
|
||||
@ -16968,8 +16958,6 @@ xmloff/source/chart/SchXMLTools.hxx:63
|
||||
enum SchXMLTools::SchXMLChartTypeEnum XML_CHART_CLASS_BAR
|
||||
xmloff/source/chart/SchXMLTools.hxx:65
|
||||
enum SchXMLTools::SchXMLChartTypeEnum XML_CHART_CLASS_BUBBLE
|
||||
xmloff/source/chart/SchXMLTools.hxx:66
|
||||
enum SchXMLTools::SchXMLChartTypeEnum XML_CHART_CLASS_GL3DBAR
|
||||
xmloff/source/chart/SchXMLTools.hxx:67
|
||||
enum SchXMLTools::SchXMLChartTypeEnum XML_CHART_CLASS_ADDIN
|
||||
xmloff/source/chart/transporttypes.hxx:30
|
||||
|
@ -30,16 +30,6 @@ chart2/source/controller/inc/dlg_View3D.hxx:53
|
||||
chart::View3DDialog m_aControllerLocker class chart::ControllerLockHelper
|
||||
chart2/source/controller/inc/RangeSelectionListener.hxx:63
|
||||
chart::RangeSelectionListener m_aControllerLockGuard class chart::ControllerLockGuardUNO
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:54
|
||||
chart::opengl3D::MaterialParameters pad float
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:55
|
||||
chart::opengl3D::MaterialParameters pad1 float
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:64
|
||||
chart::opengl3D::LightSource pad1 float
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:65
|
||||
chart::opengl3D::LightSource pad2 float
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:66
|
||||
chart::opengl3D::LightSource pad3 float
|
||||
connectivity/source/commontools/RowFunctionParser.cxx:374
|
||||
connectivity::(anonymous namespace)::ExpressionGrammar::definition unaryFunction ::boost::spirit::rule<ScannerT>
|
||||
connectivity/source/commontools/RowFunctionParser.cxx:375
|
||||
|
@ -22,16 +22,6 @@ canvas/source/vcl/impltools.hxx:117
|
||||
vclcanvas::tools::LocalGuard aSolarGuard class SolarMutexGuard
|
||||
chart2/source/controller/inc/RangeSelectionListener.hxx:63
|
||||
chart::RangeSelectionListener m_aControllerLockGuard class chart::ControllerLockGuardUNO
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:54
|
||||
chart::opengl3D::MaterialParameters pad float
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:55
|
||||
chart::opengl3D::MaterialParameters pad1 float
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:64
|
||||
chart::opengl3D::LightSource pad1 float
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:65
|
||||
chart::opengl3D::LightSource pad2 float
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:66
|
||||
chart::opengl3D::LightSource pad3 float
|
||||
comphelper/source/container/enumerablemap.cxx:298
|
||||
comphelper::MapEnumeration m_xKeepMapAlive Reference<class com::sun::star::uno::XInterface>
|
||||
connectivity/source/drivers/evoab2/EApi.h:122
|
||||
|
@ -66,14 +66,6 @@ chart2/source/inc/MediaDescriptorHelper.hxx:75
|
||||
apphelper::MediaDescriptorHelper ReadOnly _Bool
|
||||
chart2/source/view/charttypes/PieChart.hxx:128
|
||||
chart::PieChart::PieLabelInfo fValue double
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:63
|
||||
chart::opengl3D::LightSource lightPower float
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:80
|
||||
chart::opengl3D::Polygon3DInfo twoSidesLighting _Bool
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:94
|
||||
chart::opengl3D::Extrude3DInfo twoSidesLighting _Bool
|
||||
chart2/source/view/inc/GL3DRenderer.hxx:123
|
||||
chart::opengl3D::RoundBarMesh topThreshold float
|
||||
codemaker/source/cppumaker/dependencies.hxx:105
|
||||
codemaker::cppumaker::Dependencies m_voidDependency _Bool
|
||||
codemaker/source/cppumaker/dependencies.hxx:111
|
||||
|
@ -1257,8 +1257,7 @@ awt::Rectangle SAL_CALL DocumentHolder::calcAdjustedRectangle( const awt::Rectan
|
||||
|
||||
void SAL_CALL DocumentHolder::activated( )
|
||||
{
|
||||
if ( (m_pEmbedObj->getStatus(embed::Aspects::MSOLE_CONTENT)&embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE) ||
|
||||
svt::EmbeddedObjectRef::IsGLChart(m_pEmbedObj) )
|
||||
if ( m_pEmbedObj->getStatus(embed::Aspects::MSOLE_CONTENT)&embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE )
|
||||
{
|
||||
if ( m_pEmbedObj->getCurrentState() != embed::EmbedStates::UI_ACTIVE &&
|
||||
!(m_pEmbedObj->getStatus(embed::Aspects::MSOLE_CONTENT)&embed::EmbedMisc::MS_EMBED_NOUIACTIVATE) )
|
||||
|
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 372 B |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 377 B |
@ -1 +0,0 @@
|
||||
<svg height="52" viewBox="0 0 60 52" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="11" x2="57" y1="1026.3622" y2="1026.3622"><stop offset="0" stop-color="#f62459"/><stop offset="1" stop-color="#f73768"/></linearGradient><linearGradient id="b" gradientUnits="userSpaceOnUse" x1="11" x2="3" y1="1028.3622" y2="1028.3622"><stop offset="0" stop-color="#22a7f0"/><stop offset="1" stop-color="#19b5fe"/></linearGradient><g transform="translate(0 -1000.3622)"><path d="m0 1000.3622h60v52h-60z" fill="#fff"/><path d="m11 1049.3622 46.000001-3.8334v-38.3333l-46.000001-3.8333z" fill="url(#a)" fill-rule="evenodd"/><path d="m3 1011.0288 8-7.6666v46l-8-7.6667z" fill="url(#b)" fill-rule="evenodd"/><g fill="#fff"><path d="m41 1015.3622h2v21.999983h-2z"/><path d="m43 1035.3622h4v2h-4z"/><path d="m35 1027.3622h2v10h-2z"/><path d="m31 1027.3622h4v2h-4z"/><path d="m34 1015.3622a11 11 0 0 0 -11 11 11 11 0 0 0 11 11 11 11 0 0 0 3-.4277v-2.0977a9 9 0 0 1 -3 .5254 9 9 0 0 1 -9-9 9 9 0 0 1 9-9 9 9 0 0 1 3 .5273v-2.1074a11 11 0 0 0 -3-.4199z"/><path d="m33 1035.3622h3v2h-3z"/><path d="m35 1009.3622a20 17 0 0 0 -20 17 20 17 0 0 0 20 17 20 17 0 0 0 20-17 18 15 0 0 1 -18 15 18 15 0 0 1 -18-15 18 15 0 0 1 18-15 18 15 0 0 1 17.955078 13.9395 20 17 0 0 0 -19.955078-15.9395z"/></g></g></svg>
|
Before Width: | Height: | Size: 1.3 KiB |
@ -1,10 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<path
|
||||
style="fill:#b3b3b3"
|
||||
d="M 3 2 L 3 14 L 15 13 L 15 3 L 3 2 z "
|
||||
/>
|
||||
<path
|
||||
style="fill:#4d4d4d"
|
||||
d="M 3 2 L 1 4 L 1 12 L 3 14 L 3 2 z M 9.5 3 A 5.5 5 0 0 0 4 8 A 5.5 5 0 0 0 9.5 13 A 5.5 5 0 0 0 15 8 A 5.0416667 4 0 0 1 9.9589844 12 A 5.0416667 4 0 0 1 4.9160156 8 A 5.0416667 4 0 0 1 9.9589844 4 A 5.0416667 4 0 0 1 14.982422 7.6796875 A 5.5 5 0 0 0 9.5 3 z M 14.982422 7.6796875 A 5.5 5 0 0 1 15 8 A 5.0416667 4 0 0 0 14.982422 7.6796875 z M 9 5 A 3 3 0 0 0 6 8 A 3 3 0 0 0 9 11 A 3 3 0 0 0 10 10.824219 L 10 10 L 10 9.7285156 L 10 8 L 9 8 L 8 8 L 8 9 L 9 9 L 9 10 A 2 2 0 0 1 7 8 A 2 2 0 0 1 9 6 A 2 2 0 0 1 10 6.2695312 L 10 5.1738281 A 3 3 0 0 0 9 5 z M 11 5 L 11 11 L 12 11 L 13 11 L 13 10 L 12 10 L 12 5 L 11 5 z "
|
||||
/>
|
||||
</svg>
|
Before Width: | Height: | Size: 831 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 561 B |