qwt_plot_seriesitem.cpp
Go to the documentation of this file.
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * Qwt Widget Library
00003  * Copyright (C) 1997   Josef Wilgen
00004  * Copyright (C) 2002   Uwe Rathmann
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the Qwt License, Version 1.0
00008  *****************************************************************************/
00009 
00010 #include "qwt_plot_seriesitem.h"
00011 
00012 class QwtPlotSeriesItem::PrivateData
00013 {
00014 public:
00015     PrivateData():
00016         orientation( Qt::Vertical )
00017     {
00018     }
00019 
00020     Qt::Orientation orientation;
00021 };
00022 
00027 QwtPlotSeriesItem::QwtPlotSeriesItem( const QwtText &title ):
00028     QwtPlotItem( title )
00029 {
00030     d_data = new PrivateData();
00031     setItemInterest( QwtPlotItem::ScaleInterest, true );
00032 }
00033 
00038 QwtPlotSeriesItem::QwtPlotSeriesItem( const QString &title ):
00039     QwtPlotItem( QwtText( title ) )
00040 {
00041     d_data = new PrivateData();
00042 }
00043 
00045 QwtPlotSeriesItem::~QwtPlotSeriesItem()
00046 {
00047     delete d_data;
00048 }
00049 
00059 void QwtPlotSeriesItem::setOrientation( Qt::Orientation orientation )
00060 {
00061     if ( d_data->orientation != orientation )
00062     {
00063         d_data->orientation = orientation;
00064 
00065         legendChanged();
00066         itemChanged();
00067     }
00068 }
00069 
00074 Qt::Orientation QwtPlotSeriesItem::orientation() const
00075 {
00076     return d_data->orientation;
00077 }
00078 
00087 void QwtPlotSeriesItem::draw( QPainter *painter,
00088         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00089         const QRectF &canvasRect ) const
00090 {
00091     drawSeries( painter, xMap, yMap, canvasRect, 0, -1 );
00092 }
00093 
00094 QRectF QwtPlotSeriesItem::boundingRect() const
00095 {
00096     return dataRect();
00097 }
00098 
00099 void QwtPlotSeriesItem::updateScaleDiv(
00100     const QwtScaleDiv &xScaleDiv, const QwtScaleDiv &yScaleDiv )
00101 {   
00102     const QRectF rect = QRectF(
00103         xScaleDiv.lowerBound(), yScaleDiv.lowerBound(),
00104         xScaleDiv.range(), yScaleDiv.range() );
00105         
00106     setRectOfInterest( rect );
00107 }   
00108 
00109 void QwtPlotSeriesItem::dataChanged()
00110 {
00111     itemChanged();
00112 }


plotjuggler
Author(s): Davide Faconti
autogenerated on Fri Sep 1 2017 02:41:56