~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to kchart/kdchart/src/Ternary/KDChartTernaryGrid.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: C++ -*-
2
 
   KDChart - a multi-platform charting engine
3
 
   */
4
 
 
5
 
/****************************************************************************
6
 
 ** Copyright (C) 2005-2007 Klarälvdalens Datakonsult AB.  All rights reserved.
7
 
 **
8
 
 ** This file is part of the KD Chart library.
9
 
 **
10
 
 ** This file may be used under the terms of the GNU General Public
11
 
 ** License versions 2.0 or 3.0 as published by the Free Software
12
 
 ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
13
 
 ** included in the packaging of this file.  Alternatively you may (at
14
 
 ** your option) use any later version of the GNU General Public
15
 
 ** License if such license has been publicly approved by
16
 
 ** Klarälvdalens Datakonsult AB (or its successors, if any).
17
 
 ** 
18
 
 ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
19
 
 ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
20
 
 ** A PARTICULAR PURPOSE. Klarälvdalens Datakonsult AB reserves all rights
21
 
 ** not expressly granted herein.
22
 
 ** 
23
 
 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24
 
 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25
 
 **
26
 
 **********************************************************************/
27
 
 
28
 
#ifndef KDCHARTTERNARYGRID_H
29
 
#define KDCHARTTERNARYGRID_H
30
 
 
31
 
#include <QList>
32
 
 
33
 
#include "KDChartAbstractGrid.h"
34
 
#include "PrerenderedElements/KDChartTextLabelCache.h"
35
 
 
36
 
namespace KDChart {
37
 
 
38
 
    struct TickInfo {
39
 
        TickInfo( double percentage = 0, int depth = 0 );
40
 
        double percentage;
41
 
        int depth;
42
 
    };
43
 
 
44
 
    bool operator==(const TickInfo&, const TickInfo& );
45
 
 
46
 
    class PaintContext;
47
 
 
48
 
    // VERIFY: Grids are not public API, are they?
49
 
    class TernaryGrid : public AbstractGrid
50
 
    {
51
 
    public:
52
 
        TernaryGrid();
53
 
 
54
 
        virtual ~TernaryGrid();
55
 
 
56
 
        void drawGrid( PaintContext* context );
57
 
        DataDimensionsList calculateGrid( const DataDimensionsList& rawDataDimensions ) const;
58
 
 
59
 
        /** Returns two QSizeF objects specifying the dimension of the
60
 
            margins needed between each corner of the diagram and the
61
 
            border of the drawing area. Margins are required because
62
 
            the tick marks are placed outside of the trianges
63
 
            containing rectangle.
64
 
            The margins are returned in <em>diagram coordinates</em>,
65
 
            since the grid does not know about widget coordinates.
66
 
        */
67
 
        QPair<QSizeF, QSizeF> requiredMargins() const;
68
 
        /** Return the locations of the grid lines, so that axes can
69
 
            draw axis rulers at the correct positions.
70
 
            This information is valid after the grid has been
71
 
            painted (that is, the axes need to be painted after the
72
 
            grid. */
73
 
        const QVector<TickInfo>& tickInfo() const;
74
 
    private:
75
 
        QVector<TickInfo> m_tickInfo;
76
 
        // QList<PrerenderedLabel> m_labels;
77
 
    };
78
 
 
79
 
}
80
 
 
81
 
#endif