Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Attributes | List of all members
icl::qt::PlotWidget Class Reference

Easy to use widget component for 2D data visualization. More...

#include <PlotWidget.h>

Inheritance diagram for icl::qt::PlotWidget:
icl::qt::LowLevelPlotWidget icl::qt::AbstractPlotWidget icl::qt::ThreadedUpdatableWidget icl::utils::Configurable icl::qt::HistogrammWidget

Classes

struct  SeriesBuffer
 Utility structure for easier series plots. More...
 

Public Member Functions

 PlotWidget (QWidget *parent=0)
 Constructor with given parent. More...
 
 ~PlotWidget ()
 Destrutor. More...
 
void lock ()
 locks the draw queue More...
 
void unlock ()
 unlocks the draw queue More...
 
virtual void clear ()
 clears the draw queue More...
 
void reset ()
 synonym for clear() More...
 
void label (const std::string &primitiveLabel)
 sets the legend label for the next scatter-, series- or bar-plot More...
 
void nolabel ()
 calls label("") More...
 
void color (int r, int g, int b, int a=255)
 sets the line color More...
 
template<class VectorType >
void color (const VectorType &c)
 convenience macro for types that provide and index operator [] More...
 
void nocolor ()
 sets a fully transparent line color More...
 
void pen (const QPen &pen)
 sets the line pen More...
 
void fill (int r, int g, int b, int a=255)
 sets the fill color for series- and bar-plots More...
 
template<class VectorType >
void fill (const VectorType &c)
 convenience macro for types that provide and index operator [] More...
 
void nofill ()
 sets a fully transparent fill color More...
 
void brush (const QBrush &brush)
 sets the fill brush More...
 
void sym (char s)
 sets the current symbol More...
 
void sym (char s, int symsize)
 sets the current symbol and the symbol size More...
 
void nosym ()
 resets the symbol to ' ' which means no symbols are shown More...
 
void linewidth (float width)
 sets the linewidth More...
 
void symsize (float size)
 sets the symbols size More...
 
template<class T >
ICLQt_API void scatter (const T *xs, const T *ys, int num, int xStride=1, int yStride=1, bool connect=false)
 adds a scatter plot with given x- and y-data pointer More...
 
void scatter (const std::vector< utils::Point32f > &ps, bool connect=false)
 adds a scatter plot from given vector of points More...
 
void scatter (const std::vector< utils::Point > &ps, bool connect=false)
 adds a scatter plot from given vector of points More...
 
template<class T >
void scatter (const math::FixedMatrix< T, 1, 2 > *ps, int num, bool connect=false)
 adds a scatter plot from given set of of fixed vectors More...
 
template<class T >
void scatter (const math::FixedMatrix< T, 2, 1 > *ps, int num, bool connect=false)
 
void scatter (const std::vector< math::FixedColVector< float, 2 > > &ps, bool connect=false)
 adds a scatter plot from given vector of fixed vectors More...
 
template<class T >
ICLQt_API void series (const T *data, int num, int stride=1)
 adds series data More...
 
template<class T >
void series (const std::vector< T > &data)
 adds series data from given std::vector More...
 
template<class T >
ICLQt_API void bars (const T *data, int num, int stride=1)
 adds bar plot data More...
 
template<class T >
void bars (const std::vector< T > &data)
 adds bar plot data from given std::vector More...
 
void line (const utils::Point32f &a, const utils::Point32f &b)
 draws a line annotation using the current color More...
 
void line (float x1, float y1, float x2, float y2)
 draws a line annotation given 4 coordinates More...
 
void linestrip (const std::vector< utils::Point32f > &ps, bool closedLoop=true)
 draws a line strip annotation More...
 
void linestrip (const std::vector< utils::Point > &ps, bool closedLoop=true)
 draws a line strip annotation More...
 
void linestrip (const utils::Point32f *ps, int num, bool closedLoop=true)
 draws a line strip annotation More...
 
void linestrip (const utils::Point *ps, int num, bool closedLoop=true)
 draws a line strip annotation More...
 
void linestrip (const float *xs, const float *ys, int num, bool closedLoop=true, int stride=1)
 draws a line strip annotation More...
 
void rect (const utils::Point32f &ul, const utils::Point32f &lr)
 draws a rectangle annotation with given upper left and lower right coordinate More...
 
void rect (const utils::Rect &r)
 draws a rectangle annotation More...
 
void rect (const utils::Rect32f &r)
 draws a rectangle annotation More...
 
void rect (float x, float y, float w, float h)
 draws a rectangle annotation More...
 
void circle (const utils::Point32f &c, float r)
 draws a circle annotation More...
 
void circle (float cx, float cy, float r)
 draws a circle annotation More...
 
void text (float x, float y, const std::string &text)
 draws a text annotation More...
 
void text (const utils::Point32f &p, const std::string &text)
 draws a text annotation More...
 
void grid (int nX, int nY, const float *xs, const float *ys, int stride=1)
 draws a grid-annoation More...
 
void grid (const utils::Array2D< utils::Point > &data)
 draws a grid-annoation More...
 
void grid (const utils::Array2D< utils::Point32f > &data)
 draws a grid-annoation More...
 
void grid (int nX, int nY, const float *xys)
 draws a grid-annoation More...
 
void grid (int nX, int nY, const utils::Point *ps)
 draws a grid-annoation More...
 
void grid (int nX, int nY, const utils::Point32f *ps)
 draws a grid-annoation More...
 
void grid (int nX, int nY, const std::vector< utils::Point32f > &ps)
 draws a grid-annoation More...
 
void grid (int nX, int nY, const std::vector< utils::Point > &ps)
 draws a grid-annoation More...
 
void grid (int nX, int nY, const std::vector< float > &xys)
 draws a grid-annoation More...
 
void grid (int nX, int nY, const std::vector< float > &xs, const std::vector< float > &ys)
 draws a grid-annoation More...
 
void draw (const utils::VisualizationDescription &d)
 draws a VisualizationDescription instance More...
 
void title (const std::string &title)
 sets the diagram title More...
 
void xlabel (const std::string &xlabel)
 sets the x-axis label More...
 
void ylabel (const std::string &ylabel)
 sets the y-axis label More...
 
- Public Member Functions inherited from icl::qt::LowLevelPlotWidget
 LowLevelPlotWidget (QWidget *parent=0)
 constructor More...
 
 ~LowLevelPlotWidget ()
 destructor More...
 
virtual utils::Rect32f getDataViewPort () const
 returns the data viewport More...
 
void addSeriesData (const float *data, int len, const AbstractPlotWidget::PenPtr &style=new AbstractPlotWidget::Pen(QColor(255, 0, 0)), const std::string &name="", int stride=1, bool deepCopy=true, bool passOwnerShip=false)
 adds series data More...
 
void addBarPlotData (const float *data, int len, const AbstractPlotWidget::PenPtr &style=new AbstractPlotWidget::Pen(QColor(255, 0, 0)), const std::string &name="", int stride=1, bool deepCopy=true, bool passOwnerShip=false)
 adds data for a bar plots More...
 
void addScatterData (char symbol, const float *xs, const float *ys, int num, const std::string &name="", int r=255, int g=0, int b=0, int size=5, bool connectingLine=false, int xStride=1, int yStride=1, bool filled=false, bool deepCopyData=true, bool passDataOwnerShip=false)
 adds a list of symbols More...
 
void clearScatterData ()
 clears the scatter data draw list More...
 
void clearSeriesData ()
 clears series data draw list More...
 
void clearBarPlotData ()
 clears the bar plot draw list More...
 
- Public Member Functions inherited from icl::qt::AbstractPlotWidget
void install (MouseHandler *h)
 adds a new mouse handler More...
 
void uninstall (MouseHandler *h)
 removes a mouse handler More...
 
 AbstractPlotWidget (QWidget *parent=0)
 Base constructor. More...
 
 ~AbstractPlotWidget ()
 destructor More...
 
virtual void paintEvent (QPaintEvent *evt)
 custom drawing More...
 
virtual void keyPressEvent (QKeyEvent *event)
 listens for F11 which enables the fullscreen mode More...
 
void renderTo (QPainter &p)
 renders the whole content using the given qpainter More...
 
void setBackground (const QBrush &bgBrush)
 sets the background brush More...
 
void setPen (PenType p, const QPen &pen)
 sets the pen for one of the widget compoments More...
 
void render ()
 updates the screen More...
 
void setDataViewPort (const utils::Rect32f &viewPort)
 sets the default dataviewport More...
 
void setDataViewPort (const utils::Range32f &xrange, const utils::Range32f &yrange)
 sets the default viewport More...
 
void lock () const
 locks drawing / data updates in subclasses More...
 
void unlock () const
 unlocks drawing / data updates in subclasses More...
 
void addAnnotations (const char type, const float *data, int num=1, const QPen &linePen=QColor(255, 0, 0), const QBrush &brush=Qt::NoBrush, const std::string &text="", const std::string &textDelim=",")
 adds an annotation to the data viewport More...
 
void clearAnnotations ()
 removes all existing annotations More...
 
void setBackgroundFunction (bgFunction f)
 sets the background function More...
 
void updateBackgroundFunction ()
 forces a repaint on the background function in the next rendering cycle More...
 
void removeBackgroundFunction ()
 removes the background function More...
 
- Public Member Functions inherited from icl::qt::ThreadedUpdatableWidget
 ThreadedUpdatableWidget (QWidget *parent=0)
 Base constructor. More...
 
void updateFromOtherThread ()
 call this function to update a widget's UI from an external thread More...
 
virtual bool event (QEvent *event)
 automatically called by Qt's event processing mechanism More...
 
- Public Member Functions inherited from icl::utils::Configurable
virtual ~Configurable ()
 virtual destructor More...
 
 Configurable (const Configurable &other)
 Copy constructor. More...
 
Configurableoperator= (const Configurable &other)
 Assignment operator. More...
 
void setConfigurableID (const std::string &ID) throw (ICLException)
 sets the ID of this configurable More...
 
const std::string & getConfigurableID () const
 returns the configurables static ID More...
 
bool isOrderedFlagSet () const
 returns whether the ordered flag is set More...
 
void deactivateProperty (const std::string &pattern)
 adds an additional deativation pattern More...
 
void deleteDeactivationPattern (const std::string &pattern)
 removed a formerly added deactivation pattern More...
 
std::vector< std::string > getPropertyListWithoutDeactivated () const
 this returns a filtered list of properties (using all filters added by deactivateProperty) More...
 
virtual void adaptProperty (const std::string &name, const std::string &newType, const std::string &newInfo, const std::string &newToolTip) throw (ICLException)
 this function can be used to adapt a specific property afterwards More...
 
void registerCallback (const Callback &cb)
 add a callback for changed properties More...
 
void removedCallback (const Callback &cb)
 removes a callback that was registered before More...
 
void syncChangesTo (Configurable *others, int num=1)
 this can be used to let this instance also apply property changes to others More...
 
virtual void setPropertyValue (const std::string &propertyName, const Any &value) throw (ICLException)
 sets a property value More...
 
virtual std::vector< std::string > getPropertyList () const
 returns a list of All properties, that can be set using setProperty More...
 
virtual bool supportsProperty (const std::string &propertyName) const
 base implementation for property check (seaches in the property list) More...
 
virtual void saveProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=EMPTY_VEC) const
 writes all available properties into a file More...
 
virtual void loadProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=EMPTY_VEC)
 reads a camera config file from disc More...
 
virtual std::string getPropertyType (const std::string &propertyName) const
 get type of property More...
 
virtual std::string getPropertyInfo (const std::string &propertyName) const
 get information of a properties valid values More...
 
virtual Any getPropertyValue (const std::string &propertyName) const
 returns the current value of a property or a parameter More...
 
virtual std::string getPropertyToolTip (const std::string &propertyName) const
 returns the tooltip description for a given property More...
 
virtual int getPropertyVolatileness (const std::string &propertyName) const
 Returns whether this property may be changed internally. More...
 

Private Attributes

Data * m_data
 internal data structure More...
 

Additional Inherited Members

- Public Types inherited from icl::qt::AbstractPlotWidget
enum  PenType {
  X_AXIS_PEN, Y_AXIS_PEN, X_TIC_PEN, Y_TIC_PEN,
  X_LABEL_PEN, Y_LABEL_PEN, X_GRID_PEN, Y_GRID_PEN,
  AXIS_NAME_PEN, NUM_PEN_TYPES
}
 different pen types More...
 
typedef utils::SmartPtr< PenPenPtr
 typedef for managed row-style pointers More...
 
typedef utils::Function< float,
float, float > 
bgFunction
 function that is used to render a non-homo More...
 
- Public Types inherited from icl::utils::Configurable
typedef Function< void, const
Property & > 
Callback
 Function type for changed properties. More...
 
- Static Public Member Functions inherited from icl::utils::Configurable
static std::string create_default_ID (const std::string &prefix)
 this function can be used in subclasses to create a default ID More...
 
static Configurableget (const std::string &id)
 returns configurable by given ID More...
 
static void register_configurable_type (const std::string &classname, Function< Configurable * > creator) throw (ICLException)
 registers a configurable type More...
 
static std::vector< std::string > get_registered_configurables ()
 returns a list of all registered configurable classnames More...
 
static Configurablecreate_configurable (const std::string &classname) throw (ICLException)
 creates a configurable by given name More...
 
- Static Public Attributes inherited from icl::utils::Configurable
static const std::vector
< std::string > 
EMPTY_VEC
 used as shortcut – just an empty vector of std::strings More...
 
- Protected Member Functions inherited from icl::qt::LowLevelPlotWidget
virtual void drawLegend (QPainter &p, const utils::Rect &where, bool horizontal)
 internally used More...
 
virtual bool drawSeriesData (QPainter &p, const DrawState &state)
 draws the series data More...
 
virtual bool drawScatterData (QPainter &p, const DrawState &state)
 draws the sctter data More...
 
virtual bool drawBarPlotData (QPainter &p, const DrawState &state)
 draws the bar plot data More...
 
virtual bool drawData (QPainter &p)
 draws all the data More...
 
virtual utils::Range32f estimateDataXRange () const
 estimates the data xrange (for automatic viewport adaption) More...
 
virtual utils::Range32f estimateDataYRange () const
 estimates the data yrange (for automatic viewport adaption) More...
 
- Protected Member Functions inherited from icl::qt::AbstractPlotWidget
bool isZoomed () const
 returns whether the zoom is active More...
 
virtual void mouseDoubleClickEvent (QMouseEvent *event)
 internally used More...
 
virtual void mouseMoveEvent (QMouseEvent *event)
 internally used More...
 
virtual void mousePressEvent (QMouseEvent *event)
 internally used More...
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 internally used More...
 
virtual void enterEvent (QEvent *event)
 internally used More...
 
virtual void leaveEvent (QEvent *event)
 internally used More...
 
void drawDefaultLedgend (QPainter &p, const utils::Rect &where, bool horizontal, const std::vector< std::string > &rowNames, const std::vector< PenPtr > &pens)
 draws a default ledgen into the given quad More...
 
float winToDrawX (int winX) const
 converts a window x coordinate to logical drawing coordinate More...
 
float winToDrawY (int winY) const
 converts a window y coordinate to logical drawing coordinate More...
 
utils::Point32f winToDraw (const utils::Point &p) const
 converts a window coordinates to logical drawing coordinates More...
 
int drawToWinX (float drawX) const
 convert logical drawing x coordinate to window coordinate More...
 
int drawToWinY (float drawY) const
 convert logical drawing y coordinate to window coordinate More...
 
utils::Point drawToWin (const utils::Point32f &p) const
 convert logical drawing coordinates to window coordinates More...
 
utils::Rect32f getDynamicDataViewPort () const
 returns the current data viewport w.r.t. the current zoom More...
 
- Protected Member Functions inherited from icl::utils::Configurable
void addProperty (const std::string &name, const std::string &type, const std::string &info, const Any &value=Any(), const int volatileness=0, const std::string &tooltip=std::string()) throw (ICLException)
 This can be used by derived classes to store supported properties in the internal list. More...
 
void addChildConfigurable (Configurable *configurable, const std::string &childPrefix="")
 This adds another configurable as child. More...
 
void removeChildConfigurable (Configurable *configurable)
 removes the given child configurable More...
 
Propertyprop (const std::string &propertyName) throw (ICLException)
 this CAN be used e.g. to store a property value in internal property-list More...
 
const Propertyprop (const std::string &propertyName) const throw (ICLException)
 this CAN be used e.g. to store a property value in internal property-list More...
 
 Configurable (const std::string &ID="", bool ordered=true) throw (ICLException)
 create this configurable with given ID More...
 
void call_callbacks (const std::string &propertyName, const Configurable *caller) const
 calls all registered callbacks More...
 
- Static Protected Member Functions inherited from icl::qt::AbstractPlotWidget
template<char s>
static void draw_symbol (QPainter &p, int size, float x, float y)
 draws one of the Symbols (filled symbols are drawn by setting the QPainters brush manually) More...
 
- Protected Attributes inherited from icl::utils::Configurable
std::vector< Callbackcallbacks
 internally managed list of callbacks More...
 

Detailed Description

Easy to use widget component for 2D data visualization.

In contrast to it's parent class icl::LowLevelPlotWidget, the icl::PlotWidget interface is allinged with ICL's 2D image annotation framework (see icl::ICLDrawWidget).

Visualization Types

The PlotWidget has two types of content:

  1. Plotting Data (visualized as scatter-plot: PlotWidget::scatter, or series/function plot: PlotWidget::series, or bar-plot: PlotWidget::bars)
  2. Annotation data these are extra primitives that are used to show/highligh additional information in the data plot. Annotations are always drawn in the data coordinate space.

Only plotting data is used for automatic view-port estimation.

General Information

The PlotWidget internally uses a synchronized queue of darw commands. Draw commands can only added in a thread-safe manner if the PlotWidget is locked (see PlotWidget::lock() and PlotWidget::unlock() ). The PlotWidget does not support to reference to be visualized data using a shallow/pointer copy. Instead, the given data is always copied deeply into an internal buffer. By theses means, given data must not be kept in memory or synchronized mannually. While locked, the following operations for data visualization are available:

For annotation data, the following basic methods are provided. Again, for each of these, several convience methods are also available.

The methods, PlotWidget::title, PlotWidget::xlabel and PlotWidget::ylabel are just convenience function that use the derived Configurable's Configurable::setPropertyValue method in a direct manner.

General Information

GUI GUI Embedding The plot widget is also a component of ICL's icl::GUI framework. The component tag is "plot" its parameters are

Example:

// create some data
std::vector<float> sinData(100);
for(float i=0;i<100;++i){
sinData[i] = sin(i/100 * 2*M_PI);
}
GUI gui;
gui << Plot(0,6.283,-1.1,1.1).handle("plot").minSize(20,20) << Show();
// extract the handle
PlotHandle plot = gui["plot"];
plot->lock(); // lock the draw queue
plot->color(255,0,0); // set graph line color
plot->fill(255,0,0,100); // set graph fill (semi transparent)
plot->label("sin(x)"); // set the legend label
plot->series(sinData); // add data to visualize
plot->unlock(); // unlock the draw queue
plot.render(); // post an update event to Qt

General Information

EX More Examples Soon!*

Constructor & Destructor Documentation

icl::qt::PlotWidget::PlotWidget ( QWidget *  parent = 0)

Constructor with given parent.

Usually, the

icl::qt::PlotWidget::~PlotWidget ( )

Destrutor.

Member Function Documentation

template<class T >
ICLQt_API void icl::qt::PlotWidget::bars ( const T *  data,
int  num,
int  stride = 1 
)

adds bar plot data

Parameters
datadata pointer
numnumber of elements
stridedata increment to iterate through the data elements stride is given in sizeof(float) units
template<class T >
void icl::qt::PlotWidget::bars ( const std::vector< T > &  data)
inline

adds bar plot data from given std::vector

void icl::qt::PlotWidget::brush ( const QBrush &  brush)

sets the fill brush

This is more powerful then just setting the fill color using PlotWidget::fill. The brush overwrites the current fill color setting. In contrast to PlotWidget::fill, the brush can also be set up to fill areas with a given pattern

void icl::qt::PlotWidget::circle ( const utils::Point32f c,
float  r 
)

draws a circle annotation

void icl::qt::PlotWidget::circle ( float  cx,
float  cy,
float  r 
)

draws a circle annotation

virtual void icl::qt::PlotWidget::clear ( )
virtual

clears the draw queue

Reimplemented from icl::qt::LowLevelPlotWidget.

void icl::qt::PlotWidget::color ( int  r,
int  g,
int  b,
int  a = 255 
)

sets the line color

template<class VectorType >
void icl::qt::PlotWidget::color ( const VectorType &  c)
inline

convenience macro for types that provide and index operator []

Please note, that c needs 4 elements at least.

void icl::qt::PlotWidget::draw ( const utils::VisualizationDescription d)

draws a VisualizationDescription instance

Internally, the description is decomposed to normal function calls

void icl::qt::PlotWidget::fill ( int  r,
int  g,
int  b,
int  a = 255 
)

sets the fill color for series- and bar-plots

The fill color is also used for rect- and circle annotations

template<class VectorType >
void icl::qt::PlotWidget::fill ( const VectorType &  c)
inline

convenience macro for types that provide and index operator []

Please note, that c needs 4 elements at least.

void icl::qt::PlotWidget::grid ( int  nX,
int  nY,
const float *  xs,
const float *  ys,
int  stride = 1 
)

draws a grid-annoation

void icl::qt::PlotWidget::grid ( const utils::Array2D< utils::Point > &  data)

draws a grid-annoation

void icl::qt::PlotWidget::grid ( const utils::Array2D< utils::Point32f > &  data)
inline

draws a grid-annoation

void icl::qt::PlotWidget::grid ( int  nX,
int  nY,
const float *  xys 
)
inline

draws a grid-annoation

void icl::qt::PlotWidget::grid ( int  nX,
int  nY,
const utils::Point ps 
)
inline

draws a grid-annoation

void icl::qt::PlotWidget::grid ( int  nX,
int  nY,
const utils::Point32f ps 
)
inline

draws a grid-annoation

void icl::qt::PlotWidget::grid ( int  nX,
int  nY,
const std::vector< utils::Point32f > &  ps 
)
inline

draws a grid-annoation

void icl::qt::PlotWidget::grid ( int  nX,
int  nY,
const std::vector< utils::Point > &  ps 
)
inline

draws a grid-annoation

void icl::qt::PlotWidget::grid ( int  nX,
int  nY,
const std::vector< float > &  xys 
)
inline

draws a grid-annoation

void icl::qt::PlotWidget::grid ( int  nX,
int  nY,
const std::vector< float > &  xs,
const std::vector< float > &  ys 
)
inline

draws a grid-annoation

void icl::qt::PlotWidget::label ( const std::string &  primitiveLabel)

sets the legend label for the next scatter-, series- or bar-plot

void icl::qt::PlotWidget::line ( const utils::Point32f a,
const utils::Point32f b 
)

draws a line annotation using the current color

void icl::qt::PlotWidget::line ( float  x1,
float  y1,
float  x2,
float  y2 
)
inline

draws a line annotation given 4 coordinates

void icl::qt::PlotWidget::linestrip ( const std::vector< utils::Point32f > &  ps,
bool  closedLoop = true 
)

draws a line strip annotation

void icl::qt::PlotWidget::linestrip ( const std::vector< utils::Point > &  ps,
bool  closedLoop = true 
)

draws a line strip annotation

void icl::qt::PlotWidget::linestrip ( const utils::Point32f ps,
int  num,
bool  closedLoop = true 
)

draws a line strip annotation

void icl::qt::PlotWidget::linestrip ( const utils::Point ps,
int  num,
bool  closedLoop = true 
)

draws a line strip annotation

void icl::qt::PlotWidget::linestrip ( const float *  xs,
const float *  ys,
int  num,
bool  closedLoop = true,
int  stride = 1 
)

draws a line strip annotation

void icl::qt::PlotWidget::linewidth ( float  width)

sets the linewidth

void icl::qt::PlotWidget::lock ( )
inline

locks the draw queue

void icl::qt::PlotWidget::nocolor ( )
inline

sets a fully transparent line color

void icl::qt::PlotWidget::nofill ( )
inline

sets a fully transparent fill color

void icl::qt::PlotWidget::nolabel ( )
inline

calls label("")

void icl::qt::PlotWidget::nosym ( )
inline

resets the symbol to ' ' which means no symbols are shown

void icl::qt::PlotWidget::pen ( const QPen &  pen)

sets the line pen

This overwrites the current setting for linewidth and color. The pen can e.g. be used to draw dashed lines.

void icl::qt::PlotWidget::rect ( const utils::Point32f ul,
const utils::Point32f lr 
)

draws a rectangle annotation with given upper left and lower right coordinate

void icl::qt::PlotWidget::rect ( const utils::Rect r)

draws a rectangle annotation

void icl::qt::PlotWidget::rect ( const utils::Rect32f r)

draws a rectangle annotation

void icl::qt::PlotWidget::rect ( float  x,
float  y,
float  w,
float  h 
)

draws a rectangle annotation

void icl::qt::PlotWidget::reset ( )
inline

synonym for clear()

template<class T >
ICLQt_API void icl::qt::PlotWidget::scatter ( const T *  xs,
const T *  ys,
int  num,
int  xStride = 1,
int  yStride = 1,
bool  connect = false 
)

adds a scatter plot with given x- and y-data pointer

Parameters
xssource pointer for the x-values
yssource poitner for the y-value
numnumber of points
xStridepointer increment to to iterate through the elements of xs (in sizeof(float) units)
yStridepointer increment to to iterate through the elements of ys (in sizeof(float) units)
connectif set to true, successive points are connected using a line
void icl::qt::PlotWidget::scatter ( const std::vector< utils::Point32f > &  ps,
bool  connect = false 
)
inline

adds a scatter plot from given vector of points

void icl::qt::PlotWidget::scatter ( const std::vector< utils::Point > &  ps,
bool  connect = false 
)
inline

adds a scatter plot from given vector of points

template<class T >
void icl::qt::PlotWidget::scatter ( const math::FixedMatrix< T, 1, 2 > *  ps,
int  num,
bool  connect = false 
)
inline

adds a scatter plot from given set of of fixed vectors

template<class T >
void icl::qt::PlotWidget::scatter ( const math::FixedMatrix< T, 2, 1 > *  ps,
int  num,
bool  connect = false 
)
inline
void icl::qt::PlotWidget::scatter ( const std::vector< math::FixedColVector< float, 2 > > &  ps,
bool  connect = false 
)
inline

adds a scatter plot from given vector of fixed vectors

template<class T >
ICLQt_API void icl::qt::PlotWidget::series ( const T *  data,
int  num,
int  stride = 1 
)

adds series data

Parameters
datadata pointer
numnumber of elements
stridedata increment to iterate through the data elements stride is given in sizeof(float) units
template<class T >
void icl::qt::PlotWidget::series ( const std::vector< T > &  data)
inline

adds series data from given std::vector

void icl::qt::PlotWidget::sym ( char  s)

sets the current symbol

The symbol is used for series and scatter plots

void icl::qt::PlotWidget::sym ( char  s,
int  symsize 
)
inline

sets the current symbol and the symbol size

The symbol size is always given in pixels

void icl::qt::PlotWidget::symsize ( float  size)

sets the symbols size

void icl::qt::PlotWidget::text ( float  x,
float  y,
const std::string &  text 
)

draws a text annotation

Note.: the text anchor is always centered)

void icl::qt::PlotWidget::text ( const utils::Point32f p,
const std::string &  text 
)

draws a text annotation

Note.: the text anchor is always centered)

void icl::qt::PlotWidget::title ( const std::string &  title)
inline

sets the diagram title

Please note, that usually the property "borders.top" needs to be set to something around 18. Otherwise, the tiltle is placed within the drawing area

void icl::qt::PlotWidget::unlock ( )
inline

unlocks the draw queue

void icl::qt::PlotWidget::xlabel ( const std::string &  xlabel)
inline

sets the x-axis label

void icl::qt::PlotWidget::ylabel ( const std::string &  ylabel)
inline

sets the y-axis label

Member Data Documentation

Data* icl::qt::PlotWidget::m_data
private

internal data structure

internal data (pimpl)


The documentation for this class was generated from the following file: