5 #include <QtCore/QString> 6 #include <QtCore/QList> 7 #include <QtDesigner/QDesignerExportWidget> 9 #include <QVTKWidget.h> 10 #include <vtkSmartPointer.h> 15 #include <vtkXYPlotActor.h> 16 #include <vtkDoubleArray.h> 17 #include <vtkFieldData.h> 18 #include <vtkTextActor.h> 19 #include <vtkRenderer.h> 21 typedef vtkSmartPointer<vtkDoubleArray>
array_t;
22 typedef vtkSmartPointer<vtkFieldData>
field_t;
24 class QDESIGNER_WIDGET_EXPORT
Plot2d :
public QVTKWidget
27 Q_CLASSINFO(
"Author",
"Alexander Duda")
30 Plot2d(QWidget *parent = NULL);
34 void setTitle(QString title);
35 void setXTitle(QString label);
36 void setYTitle(QString label);
38 void setStyle(
int id, QString style);
39 void setColor(
int id,
int r,
int g,
int b);
40 void setPlotLabel(
int id, QString label);
41 void setNumberOfXLabels(
int i);
42 void setNumberOfYLabels(
int i);
43 void showLegend(
bool on);
44 void autoScroll(
bool on);
46 void showPlotPoints(
bool on);
47 void showPlotLines(
bool on);
55 void setXValues(
int id);
56 void setXRange(
double min,
double max);
57 void setYRange(
double min,
double max);
59 void addPoint(
int id,
double x,
double y);
60 void addPoints(
int id,
const QList<double> &x,
const QList<double> &y);
66 bool isIdValid(
int id);
67 void scrollTo(
double x,
double y);
70 virtual void mouseMoveEvent(QMouseEvent *event);
77 vtkSmartPointer<vtkXYPlotActor> plot;
78 std::vector<field_t> field_data;
80 vtkSmartPointer<vtkTextActor> text;
81 vtkSmartPointer<vtkRenderer> renderer;
vtkSmartPointer< vtkFieldData > field_t
vtkSmartPointer< vtkDoubleArray > array_t