Kaydet (Commit) 05efb605 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Add a new skeleton plotter for the GL3D bar chart.

It plots absolutely nothing. It's just a place holder for now.

Change-Id: I6eb9cc23481391b83f6946a8b49a6176c5b29cd7
üst b7c3e851
......@@ -87,6 +87,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\
chart2/source/view/charttypes/BubbleChart \
chart2/source/view/charttypes/CandleStickChart \
chart2/source/view/charttypes/CategoryPositionHelper \
chart2/source/view/charttypes/GL3DBarChart \
chart2/source/view/charttypes/NetChart \
chart2/source/view/charttypes/PieChart \
chart2/source/view/charttypes/Splines \
......
......@@ -101,6 +101,10 @@
<service name="com.sun.star.chart2.BubbleChartType"/>
<service name="com.sun.star.chart2.ChartType"/>
</implementation>
<implementation name="com.sun.star.comp.chart.GL3DBarChartType">
<service name="com.sun.star.chart2.GL3DBarChartType"/>
<service name="com.sun.star.chart2.ChartType"/>
</implementation>
<implementation name="com.sun.star.comp.chart.CandleStickChartType">
<service name="com.sun.star.beans.PropertySet"/>
<service name="com.sun.star.chart2.CandleStickChartType"/>
......
......@@ -15,7 +15,14 @@ using namespace com::sun::star;
namespace chart {
GL3DBarChartType::GL3DBarChartType( const uno::Reference<uno::XComponentContext>& xContext ) :
ChartType(xContext) {}
ChartType(xContext)
{
}
GL3DBarChartType::GL3DBarChartType( const GL3DBarChartType& rOther ) :
ChartType(rOther)
{
}
GL3DBarChartType::~GL3DBarChartType() {}
......@@ -30,9 +37,6 @@ uno::Sequence<OUString> GL3DBarChartType::getSupportedServiceNames_Static()
return aServices;
}
GL3DBarChartType::GL3DBarChartType( const GL3DBarChartType& rOther ) :
ChartType(rOther) {}
OUString SAL_CALL GL3DBarChartType::getChartType()
throw (::com::sun::star::uno::RuntimeException, std::exception)
{
......
......@@ -22,7 +22,7 @@ namespace chart {
class GL3DBarChartType : public ChartType
{
public:
GL3DBarChartType( const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>& xContext );
GL3DBarChartType( const css::uno::Reference<css::uno::XComponentContext>& xContext );
virtual ~GL3DBarChartType();
APPHELPER_XSERVICEINFO_DECL()
......
......@@ -8,6 +8,8 @@
*/
#include "GL3DBarChartTypeTemplate.hxx"
#include "GL3DBarChartType.hxx"
#include <servicenames_charttypes.hxx>
#include <macros.hxx>
......@@ -15,6 +17,12 @@ using namespace com::sun::star;
namespace chart {
namespace {
const OUString aServiceName("com.sun.star.chart2.BubbleChartTypeTemplate");
}
GL3DBarChartTypeTemplate::GL3DBarChartTypeTemplate(
const uno::Reference<uno::XComponentContext>& xContext, const OUString& rServiceName ) :
ChartTypeTemplate(xContext, rServiceName) {}
......@@ -51,8 +59,13 @@ GL3DBarChartTypeTemplate::getChartTypeForNewSeries(
uno::Reference<lang::XMultiServiceFactory> xFact(
GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW);
#if 1
// I gave up trying to use UNO just to instantiate this little thing...
xResult.set(new GL3DBarChartType(GetComponentContext()));
#else
// This never works for me.
xResult.set(xFact->createInstance(CHART2_SERVICE_NAME_CHARTTYPE_GL3DBAR), uno::UNO_QUERY_THROW);
#endif
ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem(xOldChartTypes, xResult);
}
catch (const uno::Exception & ex)
......@@ -68,6 +81,16 @@ sal_Bool GL3DBarChartTypeTemplate::supportsCategories()
return false;
}
uno::Sequence<OUString> GL3DBarChartTypeTemplate::getSupportedServiceNames_Static()
{
uno::Sequence<OUString> aServices(2);
aServices[0] = aServiceName;
aServices[1] = "com.sun.star.chart2.ChartTypeTemplate";
return aServices;
}
APPHELPER_XSERVICEINFO_IMPL(GL3DBarChartTypeTemplate, aServiceName);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -20,6 +20,8 @@ namespace chart {
class GL3DBarChartTypeTemplate : public ChartTypeTemplate
{
public:
APPHELPER_XSERVICEINFO_DECL()
GL3DBarChartTypeTemplate(
const css::uno::Reference<
css::uno::XComponentContext>& xContext,
......
......@@ -136,7 +136,7 @@ drawing::Direction3D AreaChart::getPreferredDiagramAspectRatio() const
drawing::Direction3D aRet(1,-1,1);
if( m_nDimension == 2 )
aRet = drawing::Direction3D(-1,-1,-1);
else
else if (m_pPosHelper)
{
drawing::Direction3D aScale( m_pPosHelper->getScaledLogicWidth() );
aRet.DirectionZ = aScale.DirectionZ*0.2;
......
/* -*- 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 "GL3DBarChart.hxx"
namespace chart {
GL3DBarChart::GL3DBarChart( const css::uno::Reference<css::chart2::XChartType>& xChartTypeModel ) :
VSeriesPlotter(xChartTypeModel, 3, false)
{
}
GL3DBarChart::~GL3DBarChart()
{
}
void GL3DBarChart::createShapes()
{
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 CHART2_GL3DBARCHART_HXX
#define CHART2_GL3DBARCHART_HXX
#include <VSeriesPlotter.hxx>
namespace chart {
class GL3DBarChart : public VSeriesPlotter
{
public:
GL3DBarChart( const css::uno::Reference<css::chart2::XChartType>& xChartTypeModel );
virtual ~GL3DBarChart();
virtual void createShapes();
};
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -51,7 +51,7 @@
#include "CandleStickChart.hxx"
#include "BubbleChart.hxx"
#include "NetChart.hxx"
#include "GL3DBarChart.hxx"
#include <com/sun/star/chart/ErrorBarStyle.hpp>
#include <com/sun/star/chart/TimeUnit.hpp>
......@@ -250,6 +250,9 @@ void VSeriesPlotter::addSeries( VDataSeries* pSeries, sal_Int32 zSlot, sal_Int32
drawing::Direction3D VSeriesPlotter::getPreferredDiagramAspectRatio() const
{
drawing::Direction3D aRet(1.0,1.0,1.0);
if (!m_pPosHelper)
return aRet;
drawing::Direction3D aScale( m_pPosHelper->getScaledLogicWidth() );
aRet.DirectionZ = aScale.DirectionZ*0.2;
if(aRet.DirectionZ>1.0)
......@@ -803,6 +806,9 @@ void VSeriesPlotter::createErrorBar(
if(nErrorBarStyle==::com::sun::star::chart::ErrorBarStyle::NONE)
return;
if (!m_pPosHelper)
return;
drawing::Position3D aUnscaledLogicPosition(rUnscaledLogicPosition);
if(nErrorBarStyle==::com::sun::star::chart::ErrorBarStyle::STANDARD_DEVIATION)
{
......@@ -967,6 +973,9 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries& rVDataSeries,
if(!xContainer.is())
return;
if (!m_pPosHelper)
return;
uno::Sequence< uno::Reference< XRegressionCurve > > aCurveList = xContainer->getRegressionCurves();
for(sal_Int32 nN=0; nN<aCurveList.getLength(); nN++)
......@@ -1882,7 +1891,7 @@ PlottingPositionHelper& VSeriesPlotter::getPlottingPositionHelper( sal_Int32 nAx
{
pRet = aPosIt->second;
}
else
else if (m_pPosHelper)
{
tSecondaryValueScales::const_iterator aScaleIt = m_aSecondaryValueScales.find( nAxisIndex );
if( aScaleIt != m_aSecondaryValueScales.end() )
......@@ -2434,6 +2443,8 @@ VSeriesPlotter* VSeriesPlotter::createSeriesPlotter(
pRet = new AreaChart(xChartTypeModel,nDimensionCount,false,true);
else if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) )
pRet = new BubbleChart(xChartTypeModel,nDimensionCount);
else if (aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_GL3DBAR))
pRet = new GL3DBarChart(xChartTypeModel);
else if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_PIE) )
pRet = new PieChart(xChartTypeModel,nDimensionCount, bExcludingPositioning );
else if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
......
......@@ -60,12 +60,18 @@ PlotterBase::~PlotterBase()
void PlotterBase::setScales( const std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis )
{
if (!m_pPosHelper)
return;
OSL_PRECOND(m_nDimension<=static_cast<sal_Int32>(rScales.size()),"Dimension of Plotter does not fit two dimension of given scale sequence");
m_pPosHelper->setScales( rScales, bSwapXAndYAxis );
}
void PlotterBase::setTransformationSceneToScreen( const drawing::HomogenMatrix& rMatrix)
{
if (!m_pPosHelper)
return;
OSL_PRECOND(m_nDimension==2,"Set this transformation only in case of 2D");
if(m_nDimension!=2)
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment