KDChartLeveyJenningsDiagram.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 ** Copyright (C) 2001-2010 Klaralvdalens Datakonsult AB.  All rights reserved.
00003 **
00004 ** This file is part of the KD Chart library.
00005 **
00006 ** Licensees holding valid commercial KD Chart licenses may use this file in
00007 ** accordance with the KD Chart Commercial License Agreement provided with
00008 ** the Software.
00009 **
00010 **
00011 ** This file may be distributed and/or modified under the terms of the
00012 ** GNU General Public License version 2 and version 3 as published by the
00013 ** Free Software Foundation and appearing in the file LICENSE.GPL included.
00014 **
00015 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00016 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00017 **
00018 ** Contact info@kdab.com if any conditions of this licensing are not
00019 ** clear to you.
00020 **
00021 **********************************************************************/
00022 
00023 #ifndef KDCHARTLEVEYJENNINGSDIAGRAM_H
00024 #define KDCHARTLEVEYJENNINGSDIAGRAM_H
00025 
00026 #include "../KDChartLineDiagram.h"
00027 #include "KDChartLeveyJenningsCoordinatePlane.h"
00028 
00029 class QPainter;
00030 class QPolygonF;
00031 class QSvgRenderer;
00032 
00033 namespace KDChart {
00034 
00035     class ThreeDLineAttributes;
00036 
00042 class KDCHART_EXPORT LeveyJenningsDiagram : public LineDiagram
00043 {
00044     Q_OBJECT
00045 
00046     Q_DISABLE_COPY( LeveyJenningsDiagram )
00047 //    KDCHART_DECLARE_PRIVATE_DERIVED_PARENT( LineDiagram, CartesianCoordinatePlane * )
00048 
00049     KDCHART_DECLARE_DERIVED_DIAGRAM( LeveyJenningsDiagram, LeveyJenningsCoordinatePlane )
00050 
00051 
00052 public:
00053     explicit LeveyJenningsDiagram( QWidget* parent = 0, LeveyJenningsCoordinatePlane* plane = 0 );
00054     virtual ~LeveyJenningsDiagram();
00055 
00056     virtual LineDiagram * clone() const;
00057 
00058     enum Symbol
00059     {
00060         OkDataPoint,
00061         NotOkDataPoint,
00062         LotChanged,
00063         SensorChanged,
00064         FluidicsPackChanged
00065     };
00066 
00070     bool compare( const LeveyJenningsDiagram* other ) const;
00071 
00072     void setLotChangedSymbolPosition( Qt::Alignment pos );
00073     Qt::Alignment lotChangedSymbolPosition() const;
00074 
00075     void setFluidicsPackChangedSymbolPosition( Qt::Alignment pos );
00076     Qt::Alignment fluidicsPackChangedSymbolPosition() const;
00077 
00078     void setSensorChangedSymbolPosition( Qt::Alignment pos );
00079     Qt::Alignment sensorChangedSymbolPosition() const;
00080 
00081     void setExpectedMeanValue( float meanValue );
00082     float expectedMeanValue() const;
00083 
00084     void setExpectedStandardDeviation( float sd );
00085     float expectedStandardDeviation() const; 
00086 
00087     float calculatedMeanValue() const;
00088     float calculatedStandardDeviation() const;
00089 
00090     void setFluidicsPackChanges( const QVector< QDateTime >& changes );
00091     QVector< QDateTime > fluidicsPackChanges() const;
00092 
00093     void setSensorChanges( const QVector< QDateTime >& changes );
00094     QVector< QDateTime > sensorChanges() const;
00095 
00096     void setScanLinePen( const QPen& pen );
00097     QPen scanLinePen() const;
00098 
00099     void setSymbol( Symbol symbol, const QString& filename );
00100     QString symbol( Symbol symbol ) const;
00101 
00102     /* \reimpl */
00103     void setModel( QAbstractItemModel* model );
00104 
00105     QPair< QDateTime, QDateTime > timeRange() const;
00106     void setTimeRange( const QPair< QDateTime, QDateTime >& timeRange );
00107 
00108 protected:
00109     void paint( PaintContext* paintContext );
00110     void drawChanges( PaintContext* paintContext );
00111 
00112     virtual void drawDataPointSymbol( PaintContext* paintContext, const QPointF& pos, bool ok );
00113     virtual void drawLotChangeSymbol( PaintContext* paintContext, const QPointF& pos );
00114     virtual void drawSensorChangedSymbol( PaintContext* paintContext, const QPointF& pos );
00115     virtual void drawFluidicsPackChangedSymbol( PaintContext* paintContext, const QPointF& pos );
00116 
00117     virtual QRectF iconRect() const;
00118 
00119     QSvgRenderer* iconRenderer( Symbol symbol );
00120 
00122     const QPair<QPointF, QPointF> calculateDataBoundaries() const;
00123 
00124 protected Q_SLOTS:
00125     void calculateMeanAndStandardDeviation() const;
00126 }; // End of class KDChartLineDiagram
00127 
00128 }
00129 
00130 #endif // KDCHARTLINEDIAGRAM_H