ifw  0.0.1-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
QCPSelectionDecorator Class Reference

Controls how a plottable's data selection is drawn. More...

#include <qcustomplot.h>

Inheritance diagram for QCPSelectionDecorator:
QCPSelectionDecoratorBracket QCPSelectionDecoratorBracket QCPSelectionDecoratorBracket QCPSelectionDecoratorBracket QCPSelectionDecoratorBracket

Public Member Functions

 QCPSelectionDecorator ()
 
virtual ~QCPSelectionDecorator ()
 
QPen pen () const
 
QBrush brush () const
 
QCPScatterStyle scatterStyle () const
 
QCPScatterStyle::ScatterProperties usedScatterProperties () const
 
void setPen (const QPen &pen)
 
void setBrush (const QBrush &brush)
 
void setScatterStyle (const QCPScatterStyle &scatterStyle, QCPScatterStyle::ScatterProperties usedProperties=QCPScatterStyle::spPen)
 
void setUsedScatterProperties (const QCPScatterStyle::ScatterProperties &properties)
 
void applyPen (QCPPainter *painter) const
 
void applyBrush (QCPPainter *painter) const
 
QCPScatterStyle getFinalScatterStyle (const QCPScatterStyle &unselectedStyle) const
 
virtual void copyFrom (const QCPSelectionDecorator *other)
 
virtual void drawDecoration (QCPPainter *painter, QCPDataSelection selection)
 
 QCPSelectionDecorator ()
 
virtual ~QCPSelectionDecorator ()
 
QPen pen () const
 
QBrush brush () const
 
QCPScatterStyle scatterStyle () const
 
QCPScatterStyle::ScatterProperties usedScatterProperties () const
 
void setPen (const QPen &pen)
 
void setBrush (const QBrush &brush)
 
void setScatterStyle (const QCPScatterStyle &scatterStyle, QCPScatterStyle::ScatterProperties usedProperties=QCPScatterStyle::spPen)
 
void setUsedScatterProperties (const QCPScatterStyle::ScatterProperties &properties)
 
void applyPen (QCPPainter *painter) const
 
void applyBrush (QCPPainter *painter) const
 
QCPScatterStyle getFinalScatterStyle (const QCPScatterStyle &unselectedStyle) const
 
virtual void copyFrom (const QCPSelectionDecorator *other)
 
virtual void drawDecoration (QCPPainter *painter, QCPDataSelection selection)
 
 QCPSelectionDecorator ()
 
virtual ~QCPSelectionDecorator ()
 
QPen pen () const
 
QBrush brush () const
 
QCPScatterStyle scatterStyle () const
 
QCPScatterStyle::ScatterProperties usedScatterProperties () const
 
void setPen (const QPen &pen)
 
void setBrush (const QBrush &brush)
 
void setScatterStyle (const QCPScatterStyle &scatterStyle, QCPScatterStyle::ScatterProperties usedProperties=QCPScatterStyle::spPen)
 
void setUsedScatterProperties (const QCPScatterStyle::ScatterProperties &properties)
 
void applyPen (QCPPainter *painter) const
 
void applyBrush (QCPPainter *painter) const
 
QCPScatterStyle getFinalScatterStyle (const QCPScatterStyle &unselectedStyle) const
 
virtual void copyFrom (const QCPSelectionDecorator *other)
 
virtual void drawDecoration (QCPPainter *painter, QCPDataSelection selection)
 
 QCPSelectionDecorator ()
 
virtual ~QCPSelectionDecorator ()
 
QPen pen () const
 
QBrush brush () const
 
QCPScatterStyle scatterStyle () const
 
QCPScatterStyle::ScatterProperties usedScatterProperties () const
 
void setPen (const QPen &pen)
 
void setBrush (const QBrush &brush)
 
void setScatterStyle (const QCPScatterStyle &scatterStyle, QCPScatterStyle::ScatterProperties usedProperties=QCPScatterStyle::spPen)
 
void setUsedScatterProperties (const QCPScatterStyle::ScatterProperties &properties)
 
void applyPen (QCPPainter *painter) const
 
void applyBrush (QCPPainter *painter) const
 
QCPScatterStyle getFinalScatterStyle (const QCPScatterStyle &unselectedStyle) const
 
virtual void copyFrom (const QCPSelectionDecorator *other)
 
virtual void drawDecoration (QCPPainter *painter, QCPDataSelection selection)
 
 QCPSelectionDecorator ()
 
virtual ~QCPSelectionDecorator ()
 
QPen pen () const
 
QBrush brush () const
 
QCPScatterStyle scatterStyle () const
 
QCPScatterStyle::ScatterProperties usedScatterProperties () const
 
void setPen (const QPen &pen)
 
void setBrush (const QBrush &brush)
 
void setScatterStyle (const QCPScatterStyle &scatterStyle, QCPScatterStyle::ScatterProperties usedProperties=QCPScatterStyle::spPen)
 
void setUsedScatterProperties (const QCPScatterStyle::ScatterProperties &properties)
 
void applyPen (QCPPainter *painter) const
 
void applyBrush (QCPPainter *painter) const
 
QCPScatterStyle getFinalScatterStyle (const QCPScatterStyle &unselectedStyle) const
 
virtual void copyFrom (const QCPSelectionDecorator *other)
 
virtual void drawDecoration (QCPPainter *painter, QCPDataSelection selection)
 

Protected Member Functions

virtual bool registerWithPlottable (QCPAbstractPlottable *plottable)
 
virtual bool registerWithPlottable (QCPAbstractPlottable *plottable)
 
virtual bool registerWithPlottable (QCPAbstractPlottable *plottable)
 
virtual bool registerWithPlottable (QCPAbstractPlottable *plottable)
 
virtual bool registerWithPlottable (QCPAbstractPlottable *plottable)
 

Protected Attributes

QPen mPen
 
QBrush mBrush
 
QCPScatterStyle mScatterStyle
 
QCPScatterStyle::ScatterProperties mUsedScatterProperties
 
QCPAbstractPlottablemPlottable
 

Friends

class QCPAbstractPlottable
 

Detailed Description

Controls how a plottable's data selection is drawn.

Each QCPAbstractPlottable instance has one QCPSelectionDecorator (accessible via QCPAbstractPlottable::selectionDecorator) and uses it when drawing selected segments of its data.

The selection decorator controls both pen (setPen) and brush (setBrush), as well as the scatter style (setScatterStyle) if the plottable draws scatters. Since a QCPScatterStyle is itself composed of different properties such as color shape and size, the decorator allows specifying exactly which of those properties shall be used for the selected data point, via setUsedScatterProperties.

A QCPSelectionDecorator subclass instance can be passed to a plottable via QCPAbstractPlottable::setSelectionDecorator, allowing greater customizability of the appearance of selected segments.

Use copyFrom to easily transfer the settings of one decorator to another one. This is especially useful since plottables take ownership of the passed selection decorator, and thus the same decorator instance can not be passed to multiple plottables.

Selection decorators can also themselves perform drawing operations by reimplementing drawDecoration, which is called by the plottable's draw method. The base class QCPSelectionDecorator does not make use of this however. For example, QCPSelectionDecoratorBracket draws brackets around selected data segments.

Constructor & Destructor Documentation

QCPSelectionDecorator::QCPSelectionDecorator ( )

Creates a new QCPSelectionDecorator instance with default values

QCPSelectionDecorator::~QCPSelectionDecorator ( )
virtual
QCPSelectionDecorator::QCPSelectionDecorator ( )
virtual QCPSelectionDecorator::~QCPSelectionDecorator ( )
virtual
QCPSelectionDecorator::QCPSelectionDecorator ( )
virtual QCPSelectionDecorator::~QCPSelectionDecorator ( )
virtual
QCPSelectionDecorator::QCPSelectionDecorator ( )
virtual QCPSelectionDecorator::~QCPSelectionDecorator ( )
virtual
QCPSelectionDecorator::QCPSelectionDecorator ( )
virtual QCPSelectionDecorator::~QCPSelectionDecorator ( )
virtual

Member Function Documentation

void QCPSelectionDecorator::applyBrush ( QCPPainter painter) const

Sets the brush of painter to the brush of this selection decorator.

See Also
applyPen, getFinalScatterStyle
void QCPSelectionDecorator::applyBrush ( QCPPainter painter) const
void QCPSelectionDecorator::applyBrush ( QCPPainter painter) const
void QCPSelectionDecorator::applyBrush ( QCPPainter painter) const
void QCPSelectionDecorator::applyBrush ( QCPPainter painter) const
void QCPSelectionDecorator::applyPen ( QCPPainter painter) const

Sets the pen of painter to the pen of this selection decorator.

See Also
applyBrush, getFinalScatterStyle
void QCPSelectionDecorator::applyPen ( QCPPainter painter) const
void QCPSelectionDecorator::applyPen ( QCPPainter painter) const
void QCPSelectionDecorator::applyPen ( QCPPainter painter) const
void QCPSelectionDecorator::applyPen ( QCPPainter painter) const
QBrush QCPSelectionDecorator::brush ( ) const
inline
QBrush QCPSelectionDecorator::brush ( ) const
inline
QBrush QCPSelectionDecorator::brush ( ) const
inline
QBrush QCPSelectionDecorator::brush ( ) const
inline
QBrush QCPSelectionDecorator::brush ( ) const
inline
virtual void QCPSelectionDecorator::copyFrom ( const QCPSelectionDecorator other)
virtual
virtual void QCPSelectionDecorator::copyFrom ( const QCPSelectionDecorator other)
virtual
void QCPSelectionDecorator::copyFrom ( const QCPSelectionDecorator other)
virtual

Copies all properties (e.g. color, fill, scatter style) of the other selection decorator to this selection decorator.

virtual void QCPSelectionDecorator::copyFrom ( const QCPSelectionDecorator other)
virtual
virtual void QCPSelectionDecorator::copyFrom ( const QCPSelectionDecorator other)
virtual
virtual void QCPSelectionDecorator::drawDecoration ( QCPPainter painter,
QCPDataSelection  selection 
)
virtual
virtual void QCPSelectionDecorator::drawDecoration ( QCPPainter painter,
QCPDataSelection  selection 
)
virtual
virtual void QCPSelectionDecorator::drawDecoration ( QCPPainter painter,
QCPDataSelection  selection 
)
virtual
void QCPSelectionDecorator::drawDecoration ( QCPPainter painter,
QCPDataSelection  selection 
)
virtual

This method is called by all plottables' draw methods to allow custom selection decorations to be drawn. Use the passed painter to perform the drawing operations. selection carries the data selection for which the decoration shall be drawn.

The default base class implementation of QCPSelectionDecorator has no special decoration, so this method does nothing.

Reimplemented in QCPSelectionDecoratorBracket, QCPSelectionDecoratorBracket, QCPSelectionDecoratorBracket, QCPSelectionDecoratorBracket, and QCPSelectionDecoratorBracket.

virtual void QCPSelectionDecorator::drawDecoration ( QCPPainter painter,
QCPDataSelection  selection 
)
virtual
QCPScatterStyle QCPSelectionDecorator::getFinalScatterStyle ( const QCPScatterStyle unselectedStyle) const
QCPScatterStyle QCPSelectionDecorator::getFinalScatterStyle ( const QCPScatterStyle unselectedStyle) const
QCPScatterStyle QCPSelectionDecorator::getFinalScatterStyle ( const QCPScatterStyle unselectedStyle) const

Returns the scatter style that the parent plottable shall use for selected scatter points. The plottable's original (unselected) scatter style must be passed as unselectedStyle. Depending on the setting of setUsedScatterProperties, the returned scatter style is a mixture of this selecion decorator's scatter style (setScatterStyle), and unselectedStyle.

See Also
applyPen, applyBrush, setScatterStyle
QCPScatterStyle QCPSelectionDecorator::getFinalScatterStyle ( const QCPScatterStyle unselectedStyle) const
QCPScatterStyle QCPSelectionDecorator::getFinalScatterStyle ( const QCPScatterStyle unselectedStyle) const
QPen QCPSelectionDecorator::pen ( ) const
inline
QPen QCPSelectionDecorator::pen ( ) const
inline
QPen QCPSelectionDecorator::pen ( ) const
inline
QPen QCPSelectionDecorator::pen ( ) const
inline
QPen QCPSelectionDecorator::pen ( ) const
inline
virtual bool QCPSelectionDecorator::registerWithPlottable ( QCPAbstractPlottable plottable)
protectedvirtual
virtual bool QCPSelectionDecorator::registerWithPlottable ( QCPAbstractPlottable plottable)
protectedvirtual
virtual bool QCPSelectionDecorator::registerWithPlottable ( QCPAbstractPlottable plottable)
protectedvirtual
virtual bool QCPSelectionDecorator::registerWithPlottable ( QCPAbstractPlottable plottable)
protectedvirtual
bool QCPSelectionDecorator::registerWithPlottable ( QCPAbstractPlottable plottable)
protectedvirtual
QCPScatterStyle QCPSelectionDecorator::scatterStyle ( ) const
inline
QCPScatterStyle QCPSelectionDecorator::scatterStyle ( ) const
inline
QCPScatterStyle QCPSelectionDecorator::scatterStyle ( ) const
inline
QCPScatterStyle QCPSelectionDecorator::scatterStyle ( ) const
inline
QCPScatterStyle QCPSelectionDecorator::scatterStyle ( ) const
inline
void QCPSelectionDecorator::setBrush ( const QBrush &  brush)
void QCPSelectionDecorator::setBrush ( const QBrush &  brush)
void QCPSelectionDecorator::setBrush ( const QBrush &  brush)

Sets the brush that will be used by the parent plottable to draw selected data segments.

void QCPSelectionDecorator::setBrush ( const QBrush &  brush)
void QCPSelectionDecorator::setBrush ( const QBrush &  brush)
void QCPSelectionDecorator::setPen ( const QPen &  pen)
void QCPSelectionDecorator::setPen ( const QPen &  pen)
void QCPSelectionDecorator::setPen ( const QPen &  pen)
void QCPSelectionDecorator::setPen ( const QPen &  pen)

Sets the pen that will be used by the parent plottable to draw selected data segments.

void QCPSelectionDecorator::setPen ( const QPen &  pen)
void QCPSelectionDecorator::setScatterStyle ( const QCPScatterStyle scatterStyle,
QCPScatterStyle::ScatterProperties  usedProperties = QCPScatterStyle::spPen 
)
void QCPSelectionDecorator::setScatterStyle ( const QCPScatterStyle scatterStyle,
QCPScatterStyle::ScatterProperties  usedProperties = QCPScatterStyle::spPen 
)
void QCPSelectionDecorator::setScatterStyle ( const QCPScatterStyle scatterStyle,
QCPScatterStyle::ScatterProperties  usedProperties = QCPScatterStyle::spPen 
)
void QCPSelectionDecorator::setScatterStyle ( const QCPScatterStyle scatterStyle,
QCPScatterStyle::ScatterProperties  usedProperties = QCPScatterStyle::spPen 
)
void QCPSelectionDecorator::setScatterStyle ( const QCPScatterStyle scatterStyle,
QCPScatterStyle::ScatterProperties  usedProperties = QCPScatterStyle::spPen 
)

Sets the scatter style that will be used by the parent plottable to draw scatters in selected data segments.

usedProperties specifies which parts of the passed scatterStyle will be used by the plottable. The used properties can also be changed via setUsedScatterProperties.

void QCPSelectionDecorator::setUsedScatterProperties ( const QCPScatterStyle::ScatterProperties &  properties)
void QCPSelectionDecorator::setUsedScatterProperties ( const QCPScatterStyle::ScatterProperties &  properties)
void QCPSelectionDecorator::setUsedScatterProperties ( const QCPScatterStyle::ScatterProperties &  properties)

Use this method to define which properties of the scatter style (set via setScatterStyle) will be used for selected data segments. All properties of the scatter style that are not specified in properties will remain as specified in the plottable's original scatter style.

See Also
QCPScatterStyle::ScatterProperty
void QCPSelectionDecorator::setUsedScatterProperties ( const QCPScatterStyle::ScatterProperties &  properties)
void QCPSelectionDecorator::setUsedScatterProperties ( const QCPScatterStyle::ScatterProperties &  properties)
QCPScatterStyle::ScatterProperties QCPSelectionDecorator::usedScatterProperties ( ) const
inline
QCPScatterStyle::ScatterProperties QCPSelectionDecorator::usedScatterProperties ( ) const
inline
QCPScatterStyle::ScatterProperties QCPSelectionDecorator::usedScatterProperties ( ) const
inline
QCPScatterStyle::ScatterProperties QCPSelectionDecorator::usedScatterProperties ( ) const
inline
QCPScatterStyle::ScatterProperties QCPSelectionDecorator::usedScatterProperties ( ) const
inline

Friends And Related Function Documentation

Member Data Documentation

QBrush QCPSelectionDecorator::mBrush
protected
QPen QCPSelectionDecorator::mPen
protected
QCPAbstractPlottable * QCPSelectionDecorator::mPlottable
protected
QCPScatterStyle QCPSelectionDecorator::mScatterStyle
protected
QCPScatterStyle::ScatterProperties QCPSelectionDecorator::mUsedScatterProperties
protected

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