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

« back to all changes in this revision

Viewing changes to kchart/kdchart/src/KDChartLineDiagram_p.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
 
/****************************************************************************
2
 
 ** Copyright (C) 2007 Klaralvdalens Datakonsult AB.  All rights reserved.
3
 
 **
4
 
 ** This file is part of the KD Chart library.
5
 
 **
6
 
 ** This file may be used under the terms of the GNU General Public
7
 
 ** License versions 2.0 or 3.0 as published by the Free Software
8
 
 ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
9
 
 ** included in the packaging of this file.  Alternatively you may (at
10
 
 ** your option) use any later version of the GNU General Public
11
 
 ** License if such license has been publicly approved by
12
 
 ** Klarälvdalens Datakonsult AB (or its successors, if any).
13
 
 ** 
14
 
 ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
15
 
 ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
16
 
 ** A PARTICULAR PURPOSE. Klarälvdalens Datakonsult AB reserves all rights
17
 
 ** not expressly granted herein.
18
 
 ** 
19
 
 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20
 
 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
 
 **
22
 
 **********************************************************************/
23
 
 
24
 
#ifndef KDCHARTLINEDIAGRAM_P_H
25
 
#define KDCHARTLINEDIAGRAM_P_H
26
 
 
27
 
//
28
 
//  W A R N I N G
29
 
//  -------------
30
 
//
31
 
// This file is not part of the KD Chart API.  It exists purely as an
32
 
// implementation detail.  This header file may change from version to
33
 
// version without notice, or even be removed.
34
 
//
35
 
// We mean it.
36
 
//
37
 
 
38
 
#include "KDChartLineDiagram.h"
39
 
 
40
 
#include <QPainterPath>
41
 
 
42
 
#include "KDChartThreeDLineAttributes.h"
43
 
#include "KDChartAbstractCartesianDiagram_p.h"
44
 
#include "KDChartCartesianDiagramDataCompressor_p.h"
45
 
 
46
 
#include <KDABLibFakes>
47
 
 
48
 
 
49
 
namespace KDChart {
50
 
 
51
 
    class PaintContext;
52
 
 
53
 
/**
54
 
 * \internal
55
 
 */
56
 
    class LineDiagram::Private : public AbstractCartesianDiagram::Private
57
 
    {
58
 
        friend class LineDiagram;
59
 
        friend class LineDiagramType;
60
 
 
61
 
    public:
62
 
        Private();
63
 
        Private( const Private& rhs );
64
 
        ~Private();
65
 
 
66
 
        void paintPolyline(
67
 
            PaintContext* ctx,
68
 
            const QBrush& brush, const QPen& pen,
69
 
            const QPolygonF& points ) const;
70
 
 
71
 
        LineDiagram* diagram;
72
 
        LineDiagramType* implementor; // the current type
73
 
        LineDiagramType* normalDiagram;
74
 
        LineDiagramType* stackedDiagram;
75
 
        LineDiagramType* percentDiagram;
76
 
        bool centerDataPoints;
77
 
    };
78
 
 
79
 
    KDCHART_IMPL_DERIVED_DIAGRAM( LineDiagram, AbstractCartesianDiagram, CartesianCoordinatePlane )
80
 
 
81
 
    // we inherit privately, so that derived classes cannot call the
82
 
    // base class functions - those reference the wrong (unattached to
83
 
    // a diagram) d
84
 
    class LineDiagram::LineDiagramType : private LineDiagram::Private
85
 
    {
86
 
    public:
87
 
        explicit LineDiagramType( LineDiagram* d )
88
 
            : LineDiagram::Private()
89
 
            , m_private( d->d_func() )
90
 
        {
91
 
        }
92
 
        virtual ~LineDiagramType() {}
93
 
        virtual LineDiagram::LineType type() const = 0;
94
 
        virtual const QPair<QPointF,  QPointF> calculateDataBoundaries() const = 0;
95
 
        virtual void paint(  PaintContext* ctx ) = 0;
96
 
        LineDiagram* diagram() const;
97
 
 
98
 
    protected:
99
 
        // method that make elements of m_private available to derived
100
 
        // classes:
101
 
        AttributesModel* attributesModel() const;
102
 
        QModelIndex attributesModelRootIndex() const;
103
 
        ReverseMapper& reverseMapper();
104
 
        CartesianDiagramDataCompressor& compressor() const;
105
 
 
106
 
        double interpolateMissingValue( const CartesianDiagramDataCompressor::CachePosition& pos ) const;
107
 
 
108
 
        int datasetDimension() const;
109
 
        LineAttributes::MissingValuesPolicy getCellValues(
110
 
            int row, int column,
111
 
            bool shiftCountedXValuesByHalfSection,
112
 
            double& valueX, double& valueY ) const;
113
 
        double valueForCellTesting( int row, int column,
114
 
                                    bool& bOK,
115
 
                                    bool showHiddenCellsAsInvalid = false ) const;
116
 
        void paintAreas( PaintContext* ctx, const QModelIndex& index,
117
 
                         const QList<QPolygonF>& areas, const uint transparency );
118
 
        double valueForCell( int row, int column );
119
 
        void appendDataValueTextInfoToList(
120
 
            AbstractDiagram * diagram,
121
 
            DataValueTextInfoList & list,
122
 
            const QModelIndex & index,
123
 
            const CartesianDiagramDataCompressor::CachePosition * position,
124
 
            const PositionPoints& points,
125
 
            const Position& autoPositionPositive,
126
 
            const Position& autoPositionNegative,
127
 
            const qreal value );
128
 
 
129
 
 
130
 
        const QPointF project( QPointF point, QPointF maxLimits,
131
 
                               double z, const QModelIndex& index ) const;
132
 
 
133
 
        void paintThreeDLines(
134
 
            PaintContext* ctx, const QModelIndex& index,
135
 
            const QPointF& from, const QPointF& to, const double depth  );
136
 
 
137
 
        void paintElements( PaintContext* ctx,
138
 
                            DataValueTextInfoList&,
139
 
                            LineAttributesInfoList&,
140
 
                            LineAttributes::MissingValuesPolicy );
141
 
 
142
 
        void paintValueTracker( PaintContext* ctx, const ValueTrackerAttributes& vt,
143
 
                                const QPointF& at );
144
 
 
145
 
        LineDiagram::Private* m_private;
146
 
    };
147
 
 
148
 
/*
149
 
  inline LineDiagram::LineDiagram( Private * p, CartesianCoordinatePlane* plane )
150
 
  : AbstractCartesianDiagram( p, plane ) { init(); }
151
 
  inline LineDiagram::Private * LineDiagram::d_func()
152
 
  { return static_cast<Private*>( AbstractCartesianDiagram::d_func() ); }
153
 
  inline const LineDiagram::Private * LineDiagram::d_func() const
154
 
  { return static_cast<const Private*>( AbstractCartesianDiagram::d_func() ); }
155
 
*/
156
 
 
157
 
}
158
 
 
159
 
#endif /* KDCHARTLINEDIAGRAM_P_H */