KDChartLeveyJenningsDiagram.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 KDCHARTLEVEYJENNINGSDIAGRAM_H
00031 #define KDCHARTLEVEYJENNINGSDIAGRAM_H
00032 
00033 #include "../KDChartLineDiagram.h"
00034 #include "KDChartLeveyJenningsCoordinatePlane.h"
00035 
00036 class QPainter;
00037 class QPolygonF;
00038 class QSvgRenderer;
00039 
00040 namespace KDChart {
00041 
00042     class ThreeDLineAttributes;
00043 
00049 class KDCHART_EXPORT LeveyJenningsDiagram : public LineDiagram
00050 {
00051     Q_OBJECT
00052 
00053     Q_DISABLE_COPY( LeveyJenningsDiagram )
00054 //    KDCHART_DECLARE_PRIVATE_DERIVED_PARENT( LineDiagram, CartesianCoordinatePlane * )
00055 
00056     KDCHART_DECLARE_DERIVED_DIAGRAM( LeveyJenningsDiagram, LeveyJenningsCoordinatePlane )
00057 
00058 
00059 public:
00060     explicit LeveyJenningsDiagram( QWidget* parent = 0, LeveyJenningsCoordinatePlane* plane = 0 );
00061     virtual ~LeveyJenningsDiagram();
00062 
00063     virtual LineDiagram * clone() const;
00064 
00065     enum Symbol
00066     {
00067         OkDataPoint,
00068         NotOkDataPoint,
00069         LotChanged,
00070         SensorChanged,
00071         FluidicsPackChanged
00072     };
00073 
00077     bool compare( const LeveyJenningsDiagram* other ) const;
00078 
00079     void setLotChangedSymbolPosition( Qt::Alignment pos );
00080     Qt::Alignment lotChangedSymbolPosition() const;
00081 
00082     void setFluidicsPackChangedSymbolPosition( Qt::Alignment pos );
00083     Qt::Alignment fluidicsPackChangedSymbolPosition() const;
00084 
00085     void setSensorChangedSymbolPosition( Qt::Alignment pos );
00086     Qt::Alignment sensorChangedSymbolPosition() const;
00087 
00088     void setExpectedMeanValue( float meanValue );
00089     float expectedMeanValue() const;
00090 
00091     void setExpectedStandardDeviation( float sd );
00092     float expectedStandardDeviation() const; 
00093 
00094     float calculatedMeanValue() const;
00095     float calculatedStandardDeviation() const;
00096 
00097     void setFluidicsPackChanges( const QVector< QDateTime >& changes );
00098     QVector< QDateTime > fluidicsPackChanges() const;
00099 
00100     void setSensorChanges( const QVector< QDateTime >& changes );
00101     QVector< QDateTime > sensorChanges() const;
00102 
00103     void setScanLinePen( const QPen& pen );
00104     QPen scanLinePen() const;
00105 
00106     void setSymbol( Symbol symbol, const QString& filename );
00107     QString symbol( Symbol symbol ) const;
00108 
00109     /* \reimpl */
00110     void setModel( QAbstractItemModel* model );
00111 
00112     QPair< QDateTime, QDateTime > timeRange() const;
00113     void setTimeRange( const QPair< QDateTime, QDateTime >& timeRange );
00114 
00115 protected:
00116     void paint( PaintContext* paintContext );
00117     void drawChanges( PaintContext* paintContext );
00118 
00119     virtual void drawDataPointSymbol( PaintContext* paintContext, const QPointF& pos, bool ok );
00120     virtual void drawLotChangeSymbol( PaintContext* paintContext, const QPointF& pos );
00121     virtual void drawSensorChangedSymbol( PaintContext* paintContext, const QPointF& pos );
00122     virtual void drawFluidicsPackChangedSymbol( PaintContext* paintContext, const QPointF& pos );
00123 
00124     virtual QRectF iconRect() const;
00125 
00126     QSvgRenderer* iconRenderer( Symbol symbol );
00127 
00129     const QPair<QPointF, QPointF> calculateDataBoundaries() const;
00130 
00131 protected Q_SLOTS:
00132     void calculateMeanAndStandardDeviation() const;
00133 }; // End of class KDChartLineDiagram
00134 
00135 }
00136 
00137 #endif // KDCHARTLINEDIAGRAM_H

Generated on Thu Mar 4 23:19:11 2010 for KD Chart 2 by  doxygen 1.5.4