Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include "BarPositionHelper.hxx"
21 : #include "Linear3DTransformation.hxx"
22 : #include "ViewDefines.hxx"
23 : #include "CommonConverters.hxx"
24 : #include "DateHelper.hxx"
25 : #include <com/sun/star/chart/TimeUnit.hpp>
26 :
27 : namespace chart
28 : {
29 : using namespace ::com::sun::star;
30 : using namespace ::com::sun::star::chart2;
31 :
32 890 : BarPositionHelper::BarPositionHelper( bool /* bSwapXAndY */ )
33 890 : : CategoryPositionHelper( 1 )
34 : {
35 890 : AllowShiftXAxisPos(true);
36 890 : AllowShiftZAxisPos(true);
37 890 : }
38 :
39 4 : BarPositionHelper::BarPositionHelper( const BarPositionHelper& rSource )
40 : : CategoryPositionHelper( rSource )
41 4 : , PlottingPositionHelper( rSource )
42 : {
43 4 : }
44 :
45 1788 : BarPositionHelper::~BarPositionHelper()
46 : {
47 1788 : }
48 :
49 4 : PlottingPositionHelper* BarPositionHelper::clone() const
50 : {
51 4 : BarPositionHelper* pRet = new BarPositionHelper(*this);
52 4 : return pRet;
53 : }
54 :
55 10451 : void BarPositionHelper::updateSeriesCount( double fSeriesCount )
56 : {
57 10451 : m_fSeriesCount = fSeriesCount;
58 10451 : }
59 :
60 10663 : double BarPositionHelper::getScaledSlotPos( double fUnscaledLogicX, double fSeriesNumber ) const
61 : {
62 10663 : if( m_bDateAxis )
63 0 : fUnscaledLogicX = DateHelper::RasterizeDateValue( fUnscaledLogicX, m_aNullDate, m_nTimeResolution );
64 10663 : double fScaledLogicX(fUnscaledLogicX);
65 10663 : doLogicScaling(&fScaledLogicX,NULL,NULL);
66 10663 : fScaledLogicX = CategoryPositionHelper::getScaledSlotPos( fScaledLogicX, fSeriesNumber );
67 10663 : return fScaledLogicX;
68 :
69 : }
70 :
71 10493 : void BarPositionHelper::setScaledCategoryWidth( double fScaledCategoryWidth )
72 : {
73 10493 : m_fScaledCategoryWidth = fScaledCategoryWidth;
74 10493 : CategoryPositionHelper::setCategoryWidth( m_fScaledCategoryWidth );
75 10493 : }
76 : } //namespace chart
77 :
78 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|