Loading...
Searching...
No Matches
qwt_plot_vectorfield.h
/******************************************************************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_PLOT_VECTOR_FIELD_H
#define QWT_PLOT_VECTOR_FIELD_H
#include "qwt_global.h"
#include "qwt_plot_seriesitem.h"
class QwtVectorFieldSymbol;
class QwtColorMap;
class QPen;
class QBrush;
class QWT_EXPORT QwtPlotVectorField
: public QwtPlotSeriesItem
, public QwtSeriesStore< QwtVectorFieldSample >
{
public:
enum IndicatorOrigin
{
OriginHead,
OriginTail,
OriginCenter
};
enum PaintAttribute
{
/*
FilterVectors calculates an average sample from all samples
that lie in the same cell of a grid that is determined by
setting the rasterSize().
\sa setRasterSize()
*/
FilterVectors = 0x01
};
Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
enum MagnitudeMode
{
MagnitudeAsColor = 0x01,
MagnitudeAsLength = 0x02
};
Q_DECLARE_FLAGS( MagnitudeModes, MagnitudeMode )
explicit QwtPlotVectorField( const QString& title = QString() );
explicit QwtPlotVectorField( const QwtText& title );
virtual ~QwtPlotVectorField();
void setPaintAttribute( PaintAttribute, bool on = true );
bool testPaintAttribute( PaintAttribute ) const;
void setMagnitudeMode( MagnitudeMode, bool on = true );
bool testMagnitudeMode( MagnitudeMode ) const;
void setSymbol( QwtVectorFieldSymbol* );
const QwtVectorFieldSymbol* symbol() const;
void setPen( const QPen& );
QPen pen() const;
void setBrush( const QBrush& );
QBrush brush() const;
void setRasterSize( const QSizeF& );
QSizeF rasterSize() const;
void setIndicatorOrigin( IndicatorOrigin );
IndicatorOrigin indicatorOrigin() const;
void setSamples( const QVector< QwtVectorFieldSample >& );
void setSamples( QwtVectorFieldData* );
void setColorMap( QwtColorMap* );
const QwtColorMap* colorMap() const;
void setMagnitudeRange( const QwtInterval& );
QwtInterval magnitudeRange() const;
void setMinArrowLength( double );
double minArrowLength() const;
void setMaxArrowLength( double );
double maxArrowLength() const;
virtual double arrowLength( double magnitude ) const;
virtual QRectF boundingRect() const QWT_OVERRIDE;
virtual void drawSeries( QPainter*,
const QwtScaleMap& xMap, const QwtScaleMap& yMap,
const QRectF& canvasRect, int from, int to ) const QWT_OVERRIDE;
virtual int rtti() const QWT_OVERRIDE;
virtual QwtGraphic legendIcon(
int index, const QSizeF& ) const QWT_OVERRIDE;
void setMagnitudeScaleFactor( double factor );
double magnitudeScaleFactor() const;
protected:
virtual void drawSymbols( QPainter*,
const QwtScaleMap& xMap, const QwtScaleMap& yMap,
const QRectF& canvasRect, int from, int to ) const;
virtual void drawSymbol( QPainter*,
double x, double y, double vx, double vy ) const;
virtual void dataChanged() QWT_OVERRIDE;
private:
void init();
class PrivateData;
PrivateData* m_data;
};
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotVectorField::PaintAttributes )
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotVectorField::MagnitudeModes )
#endif
QVector
Definition qwt_clipper.h:23
QwtArraySeriesData
Template class for data, that is organized as QVector.
Definition qwt_series_data.h:153
QwtColorMap
QwtColorMap is used to map values into colors.
Definition qwt_color_map.h:38
QwtGraphic
A paint device for scalable graphics.
Definition qwt_graphic.h:76
QwtInterval
A class representing an interval.
Definition qwt_interval.h:23
QwtPlotSeriesItem
Base class for plot items representing a series of samples.
Definition qwt_plot_seriesitem.h:26
QwtPlotSeriesItem::boundingRect
virtual QRectF boundingRect() const override
Definition qwt_plot_seriesitem.cpp:97
QwtPlotVectorField
A plot item, that represents a vector field.
Definition qwt_plot_vectorfield.h:33
QwtPlotVectorField::IndicatorOrigin
IndicatorOrigin
Definition qwt_plot_vectorfield.h:40
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
QwtPlotVectorField::MagnitudeMode
MagnitudeMode
Definition qwt_plot_vectorfield.h:76
QwtPlotVectorField::PaintAttribute
PaintAttribute
Definition qwt_plot_vectorfield.h:56
QwtPlotVectorField::MagnitudeModes
QFlags< MagnitudeMode > MagnitudeModes
Definition qwt_plot_vectorfield.h:90
QwtPlotVectorField::PaintAttributes
QFlags< PaintAttribute > PaintAttributes
Definition qwt_plot_vectorfield.h:67
QwtScaleMap
A scale map.
Definition qwt_scale_map.h:27
QwtSeriesStore
Class storing a QwtSeriesData object.
Definition qwt_series_store.h:67
QwtText
A class representing a text.
Definition qwt_text.h:52
QwtVectorFieldSymbol
Definition qwt_vectorfield_symbol.h:33