# KDChartPlotter.h

Go to the documentation of this file.

    00001 /* -*- Mode: C++ -*-
    00002    KDChart - a multi-platform charting engine
    00003    */
    00004
    00005 /****************************************************************************
    00006  ** Copyright (C) 2005-2007 Klaralvdalens Datakonsult AB.  All rights reserved.
    00007  **
    00008  ** This file is part of the KD Chart library.
    00009  **
    00010  ** This file may be distributed and/or modified under the terms of the
    00011  ** GNU General Public License version 2 as published by the Free Software
    00012  ** Foundation and appearing in the file LICENSE.GPL included in the
    00013  ** packaging of this file.
    00014  **
    00015  ** Licensees holding valid commercial KD Chart licenses may use this file in
    00016  ** accordance with the KD Chart Commercial License Agreement provided with
    00017  ** the Software.
    00018  **
    00019  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
    00020  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    00021  **
    00022  ** See http://www.kdab.net/kdchart for
    00023  **   information about KD Chart Commercial License Agreements.
    00024  **
    00025  ** Contact info@kdab.net if any conditions of this
    00026  ** licensing are not clear to you.
    00027  **
    00028  **********************************************************************/
    00029
    00030 #ifndef KDCHARTPLOTTER_H
    00031 #define KDCHARTPLOTTER_H
    00032
    00033 #include "KDChartAbstractCartesianDiagram.h"
    00034
    00035 #include "KDChartLineAttributes.h"
    00036 #include "KDChartValueTrackerAttributes.h"
    00037
    00038 namespace KDChart {
    00039
    00040     class ThreeDLineAttributes;
    00041
    00045 class KDCHART_EXPORT Plotter : public AbstractCartesianDiagram
    00046 {
    00047     Q_OBJECT
    00048
    00049     Q_DISABLE_COPY( Plotter )
    00050
    00051     KDCHART_DECLARE_DERIVED_DIAGRAM( Plotter, CartesianCoordinatePlane )
    00052
    00053
    00054 public:
    00055     class PlotterType;
    00056     friend class PlotterType;
    00057
    00058     Plotter( QWidget* parent = 0, CartesianCoordinatePlane* plane = 0 );
    00059     virtual ~Plotter();
    00060
    00061     virtual Plotter* clone() const;
    00062
    00066     bool compare( const Plotter* other ) const;
    00067
    00068     enum PlotType {
    00069         Normal =  0
    00070     };
    00071
    00072
    00073     void setType( const PlotType type );
    00074     PlotType type() const;
    00075
    00076     void setLineAttributes( const LineAttributes & a );
    00077     void setLineAttributes( int column, const LineAttributes & a );
    00078     void setLineAttributes( const QModelIndex & index, const LineAttributes & a );
    00079     void resetLineAttributes( int column );
    00080     void resetLineAttributes( const QModelIndex & index );
    00081     LineAttributes lineAttributes() const;
    00082     LineAttributes lineAttributes( int column ) const;
    00083     LineAttributes lineAttributes( const QModelIndex & index ) const;
    00084
    00085     void setThreeDLineAttributes( const ThreeDLineAttributes & a );
    00086     void setThreeDLineAttributes( int column, const ThreeDLineAttributes & a );
    00087     void setThreeDLineAttributes( const QModelIndex & index,
    00088                                   const ThreeDLineAttributes & a );
    00089
    00090     //FIXME(khz): big TODO(khz): add a lot of reset...Attributes() methods to all
    00091     // appropriate places, for 2.1 (that is: after we have release 2.0.2)  :-)
    00092
    00093     ThreeDLineAttributes threeDLineAttributes() const;
    00094     ThreeDLineAttributes threeDLineAttributes( int column ) const;
    00095     ThreeDLineAttributes threeDLineAttributes( const QModelIndex & index ) const;
    00096
    00097     void setValueTrackerAttributes( const QModelIndex & index,
    00098                                     const ValueTrackerAttributes & a );
    00099     ValueTrackerAttributes valueTrackerAttributes( const QModelIndex & index ) const;
    00100
    00101     // implement AbstractCartesianDiagram
    00102     /* reimpl */
    00103     const int numberOfAbscissaSegments () const;
    00104     /* reimpl */
    00105     const int numberOfOrdinateSegments () const;
    00106
    00107 protected:
    00108     void paint ( PaintContext* paintContext );
    00109
    00110 public:
    00111     void resize ( const QSizeF& area );
    00112
    00113 protected:
    00114     virtual double threeDItemDepth( const QModelIndex & index ) const;
    00115     virtual double threeDItemDepth( int column ) const;
    00117     virtual const QPair<QPointF, QPointF> calculateDataBoundaries() const;
    00118     void paintEvent ( QPaintEvent* );
    00119     void resizeEvent ( QResizeEvent* );
    00120 }; // End of class KDChart::Plotter
    00121
    00122 }
    00123
    00124 #endif // KDCHARTLINEDIAGRAM_H