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 :
21 : #include "BarPositionHelper.hxx"
22 : #include "Linear3DTransformation.hxx"
23 : #include "ViewDefines.hxx"
24 : #include "CommonConverters.hxx"
25 : #include "DateHelper.hxx"
26 : #include <com/sun/star/chart/TimeUnit.hpp>
27 :
28 : //.............................................................................
29 : namespace chart
30 : {
31 : //.............................................................................
32 : using namespace ::com::sun::star;
33 : using namespace ::com::sun::star::chart2;
34 :
35 41 : BarPositionHelper::BarPositionHelper( bool /* bSwapXAndY */ )
36 41 : : CategoryPositionHelper( 1 )
37 : {
38 41 : AllowShiftXAxisPos(true);
39 41 : AllowShiftZAxisPos(true);
40 41 : }
41 :
42 0 : BarPositionHelper::BarPositionHelper( const BarPositionHelper& rSource )
43 : : CategoryPositionHelper( rSource )
44 0 : , PlottingPositionHelper( rSource )
45 : {
46 0 : }
47 :
48 82 : BarPositionHelper::~BarPositionHelper()
49 : {
50 82 : }
51 :
52 0 : PlottingPositionHelper* BarPositionHelper::clone() const
53 : {
54 0 : BarPositionHelper* pRet = new BarPositionHelper(*this);
55 0 : return pRet;
56 : }
57 :
58 492 : void BarPositionHelper::updateSeriesCount( double fSeriesCount )
59 : {
60 492 : m_fSeriesCount = fSeriesCount;
61 492 : }
62 :
63 492 : double BarPositionHelper::getScaledSlotPos( double fUnscaledLogicX, double fSeriesNumber ) const
64 : {
65 492 : if( m_bDateAxis )
66 0 : fUnscaledLogicX = DateHelper::RasterizeDateValue( fUnscaledLogicX, m_aNullDate, m_nTimeResolution );
67 492 : double fScaledLogicX(fUnscaledLogicX);
68 492 : doLogicScaling(&fScaledLogicX,NULL,NULL);
69 492 : fScaledLogicX = CategoryPositionHelper::getScaledSlotPos( fScaledLogicX, fSeriesNumber );
70 492 : return fScaledLogicX;
71 :
72 : }
73 :
74 492 : void BarPositionHelper::setScaledCategoryWidth( double fScaledCategoryWidth )
75 : {
76 492 : m_fScaledCategoryWidth = fScaledCategoryWidth;
77 492 : CategoryPositionHelper::setCategoryWidth( m_fScaledCategoryWidth );
78 492 : }
79 : //.............................................................................
80 : } //namespace chart
81 : //.............................................................................
82 :
83 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|