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 553 : BarPositionHelper::BarPositionHelper( bool /* bSwapXAndY */ )
33 553 : : CategoryPositionHelper( 1 )
34 : {
35 553 : AllowShiftXAxisPos(true);
36 553 : AllowShiftZAxisPos(true);
37 553 : }
38 :
39 1 : BarPositionHelper::BarPositionHelper( const BarPositionHelper& rSource )
40 : : CategoryPositionHelper( rSource )
41 1 : , PlottingPositionHelper( rSource )
42 : {
43 1 : }
44 :
45 1108 : BarPositionHelper::~BarPositionHelper()
46 : {
47 1108 : }
48 :
49 1 : PlottingPositionHelper* BarPositionHelper::clone() const
50 : {
51 1 : BarPositionHelper* pRet = new BarPositionHelper(*this);
52 1 : return pRet;
53 : }
54 :
55 6887 : void BarPositionHelper::updateSeriesCount( double fSeriesCount )
56 : {
57 6887 : m_fSeriesCount = fSeriesCount;
58 6887 : }
59 :
60 6943 : double BarPositionHelper::getScaledSlotPos( double fUnscaledLogicX, double fSeriesNumber ) const
61 : {
62 6943 : if( m_bDateAxis )
63 0 : fUnscaledLogicX = DateHelper::RasterizeDateValue( fUnscaledLogicX, m_aNullDate, m_nTimeResolution );
64 6943 : double fScaledLogicX(fUnscaledLogicX);
65 6943 : doLogicScaling(&fScaledLogicX,NULL,NULL);
66 6943 : fScaledLogicX = CategoryPositionHelper::getScaledSlotPos( fScaledLogicX, fSeriesNumber );
67 6943 : return fScaledLogicX;
68 :
69 : }
70 :
71 6895 : void BarPositionHelper::setScaledCategoryWidth( double fScaledCategoryWidth )
72 : {
73 6895 : m_fScaledCategoryWidth = fScaledCategoryWidth;
74 6895 : CategoryPositionHelper::setCategoryWidth( m_fScaledCategoryWidth );
75 6895 : }
76 : } //namespace chart
77 :
78 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|