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 #ifndef QWT_PLOT_CLASSES_H 00011 #define QWT_PLOT_CLASSES_H 00012 00013 #include "qwt_global.h" 00014 #include "qwt_plot_item.h" 00015 #include "qwt_marker.h" 00016 #include "qwt_curve.h" 00017 #include "qwt_grid.h" 00018 00023 class QWT_EXPORT QwtPlotCurve: public QwtCurve, public QwtPlotMappedItem 00024 { 00025 public: 00027 QwtPlotCurve(QwtPlot* parent, const char *name = 0): 00028 QwtCurve(name), QwtPlotMappedItem(parent) {} 00029 00030 const QwtPlotCurve& operator=(const QwtPlotCurve &c) 00031 { 00032 QwtPlotMappedItem::operator=((const QwtPlotMappedItem &)c); 00033 QwtCurve::operator=(c); 00034 return *this; 00035 } 00036 protected: 00038 virtual void curveChanged() { itemChanged(); } 00039 }; 00040 00044 class QWT_EXPORT QwtPlotGrid: public QwtGrid, public QwtPlotMappedItem 00045 { 00046 public: 00048 QwtPlotGrid(QwtPlot *parent): 00049 QwtPlotMappedItem(parent) {} 00050 00051 protected: 00053 virtual void gridChanged() { itemChanged(); } 00054 }; 00055 00056 00060 class QWT_EXPORT QwtPlotMarker: public QwtMarker, public QwtPlotMappedItem 00061 { 00062 public: 00064 QwtPlotMarker(QwtPlot *parent): 00065 QwtPlotMappedItem(parent), 00066 d_xValue(0.0), 00067 d_yValue(0.0) 00068 {} 00069 00071 double xValue() const { return d_xValue; } 00072 00074 double yValue() const { return d_yValue; } 00075 00077 void setXValue(double val) { d_xValue = val; markerChanged(); } 00078 00080 void setYValue(double val) { d_yValue = val; markerChanged(); } 00081 00082 protected: 00084 virtual void markerChanged() { itemChanged(); } 00085 00086 private: 00087 double d_xValue; 00088 double d_yValue; 00089 }; 00090 00091 #endif
1.3.2