/* -*- 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 #include #include #include "VDataSeries.hxx" #include #include #include namespace chart { class ExplicitCategoriesProvider; namespace opengl3D { class Renderable3DObject; class OpenGL3DRenderer; class TextCache; class Camera; } class GL3DBarChart : public GL3DPlotterBase, public IRenderer { public: GL3DBarChart( const css::uno::Reference& xChartType, OpenGLWindow& rContext); virtual ~GL3DBarChart(); virtual void create3DShapes(const boost::ptr_vector& rDataSeries, ExplicitCategoriesProvider& rCatProvider) SAL_OVERRIDE; virtual void render() SAL_OVERRIDE; virtual void update() SAL_OVERRIDE; virtual void clickedAt(const Point& rPos, sal_uInt16 nButtons) SAL_OVERRIDE; virtual void mouseDragMove(const Point& rStartPos, const Point& rEndPos, sal_uInt16 nButtons) SAL_OVERRIDE; virtual void scroll(long nDelta) SAL_OVERRIDE; virtual void contextDestroyed() SAL_OVERRIDE; private: void moveToCorner(); glm::vec3 getCornerPosition(sal_Int8 nCornerId); DECL_LINK(MoveCamera, void*); DECL_LINK(MoveToBar, void*); css::uno::Reference mxChartType; boost::ptr_vector maShapes; boost::scoped_ptr mpRenderer; OpenGLWindow& mrWindow; opengl3D::Camera* mpCamera; bool mbValidContext; boost::scoped_ptr mpTextCache; glm::vec3 maCameraPosition; glm::vec3 maCameraDirection; Timer maTimer; glm::vec3 maStep; glm::vec3 maStepDirection; size_t mnStep; size_t mnStepsTotal; float mnMaxX; float mnMaxY; /** * 0 = corner at (0,0,0); * numbering counter clockwise */ sal_Int8 mnCornerId; std::vector maCategories; std::vector maSeriesNames; struct BarInformation { glm::vec3 maPos; float mnVal; sal_Int32 mnIndex; sal_Int32 mnSeriesIndex; BarInformation(const glm::vec3& rPos, float nVal, sal_Int32 nIndex, sal_Int32 nSeriesIndex); }; std::map maBarMap; bool mbBlockUserInput; bool mbNeedsNewRender; }; } #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */