qwt_plot_vectorfield.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Qwt Widget Library
3  * Copyright (C) 1997 Josef Wilgen
4  * Copyright (C) 2002 Uwe Rathmann
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the Qwt License, Version 1.0
8  *****************************************************************************/
9 
10 #ifndef QWT_PLOT_VECTOR_FIELD_H
11 #define QWT_PLOT_VECTOR_FIELD_H
12 
13 #include "qwt_global.h"
14 #include "qwt_plot_seriesitem.h"
15 
17 class QwtColorMap;
18 class QPen;
19 class QBrush;
20 
31  : public QwtPlotSeriesItem
32  , public QwtSeriesStore< QwtVectorFieldSample >
33 {
34  public:
40  {
43 
46 
48  OriginCenter
49  };
50 
56  {
57  /*
58  FilterVectors calculates an average sample from all samples
59  that lie in the same cell of a grid that is determined by
60  setting the rasterSize().
61 
62  \sa setRasterSize()
63  */
64  FilterVectors = 0x01
65  };
66 
67  Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
68 
69 
76  {
81  MagnitudeAsColor = 0x01,
82 
87  MagnitudeAsLength = 0x02
88  };
89 
90  Q_DECLARE_FLAGS( MagnitudeModes, MagnitudeMode )
91 
92  explicit QwtPlotVectorField( const QString& title = QString() );
93  explicit QwtPlotVectorField( const QwtText& title );
94 
95  virtual ~QwtPlotVectorField();
96 
97  void setPaintAttribute( PaintAttribute, bool on = true );
98  bool testPaintAttribute( PaintAttribute ) const;
99 
100  void setMagnitudeMode( MagnitudeMode, bool on = true );
101  bool testMagnitudeMode( MagnitudeMode ) const;
102 
103  void setSymbol( QwtVectorFieldSymbol* );
104  const QwtVectorFieldSymbol* symbol() const;
105 
106  void setPen( const QPen& );
107  QPen pen() const;
108 
109  void setBrush( const QBrush& );
110  QBrush brush() const;
111 
112  void setRasterSize( const QSizeF& );
113  QSizeF rasterSize() const;
114 
115  void setIndicatorOrigin( IndicatorOrigin );
116  IndicatorOrigin indicatorOrigin() const;
117 
118  void setSamples( const QVector< QwtVectorFieldSample >& );
119  void setSamples( QwtVectorFieldData* );
120 
121  void setColorMap( QwtColorMap* );
122  const QwtColorMap* colorMap() const;
123 
124  void setMagnitudeRange( const QwtInterval& );
125  QwtInterval magnitudeRange() const;
126 
127  void setMinArrowLength( double );
128  double minArrowLength() const;
129 
130  void setMaxArrowLength( double );
131  double maxArrowLength() const;
132 
133  virtual double arrowLength( double magnitude ) const;
134 
135  virtual QRectF boundingRect() const QWT_OVERRIDE;
136 
137  virtual void drawSeries( QPainter*,
138  const QwtScaleMap& xMap, const QwtScaleMap& yMap,
139  const QRectF& canvasRect, int from, int to ) const QWT_OVERRIDE;
140 
141  virtual int rtti() const QWT_OVERRIDE;
142 
143  virtual QwtGraphic legendIcon(
144  int index, const QSizeF& ) const QWT_OVERRIDE;
145 
146  void setMagnitudeScaleFactor( double factor );
147  double magnitudeScaleFactor() const;
148 
149  protected:
150  virtual void drawSymbols( QPainter*,
151  const QwtScaleMap& xMap, const QwtScaleMap& yMap,
152  const QRectF& canvasRect, int from, int to ) const;
153 
154  virtual void drawSymbol( QPainter*,
155  double x, double y, double vx, double vy ) const;
156 
157  virtual void dataChanged() QWT_OVERRIDE;
158 
159  private:
160  void init();
161 
162  class PrivateData;
163  PrivateData* m_data;
164 };
165 
166 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotVectorField::PaintAttributes )
167 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotVectorField::MagnitudeModes )
168 
169 #endif
QwtPlotVectorField::PrivateData
Definition: qwt_plot_vectorfield.cpp:240
QwtPlotSeriesItem
Base class for plot items representing a series of samples.
Definition: qwt_plot_seriesitem.h:24
QwtGraphic
A paint device for scalable graphics.
Definition: qwt_graphic.h:75
QVector
Definition: qwt_clipper.h:23
qwt_global.h
mqtt_test_proto.x
x
Definition: mqtt_test_proto.py:34
QwtPlotVectorField::IndicatorOrigin
IndicatorOrigin
Definition: qwt_plot_vectorfield.h:39
mqtt_test_proto.y
y
Definition: mqtt_test_proto.py:35
QwtPlotVectorField::OriginHead
@ OriginHead
symbol points to the sample position
Definition: qwt_plot_vectorfield.h:42
QwtPlotVectorField::OriginTail
@ OriginTail
The arrow starts at the sample position.
Definition: qwt_plot_vectorfield.h:45
QwtInterval
A class representing an interval.
Definition: qwt_interval.h:22
QwtText
A class representing a text.
Definition: qwt_text.h:51
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:26
QwtPlotVectorField::PaintAttribute
PaintAttribute
Definition: qwt_plot_vectorfield.h:55
QwtArraySeriesData
Template class for data, that is organized as QVector.
Definition: qwt_series_data.h:140
qwt_plot_seriesitem.h
QWT_OVERRIDE
#define QWT_OVERRIDE
Definition: qwt_global.h:53
QWT_EXPORT
#define QWT_EXPORT
Definition: qwt_global.h:38
QwtPlotSeriesItem::boundingRect
virtual QRectF boundingRect() const QWT_OVERRIDE
Definition: qwt_plot_seriesitem.cpp:97
QwtPlotVectorField::MagnitudeMode
MagnitudeMode
Definition: qwt_plot_vectorfield.h:75
QwtColorMap
QwtColorMap is used to map values into colors.
Definition: qwt_color_map.h:37
QwtSeriesStore
Class storing a QwtSeriesData object.
Definition: qwt_series_store.h:66
QwtVectorFieldSymbol
Definition: qwt_vectorfield_symbol.h:32
QwtPlotVectorField
A plot item, that represents a vector field.
Definition: qwt_plot_vectorfield.h:30


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46