Aquila  2.0 prealpha
Cognitive Robotics Architecture
 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
QCPGrid Class Reference

Responsible for drawing the grid of a QCPAxis. More...

#include <plot2d.h>

Inheritance diagram for QCPGrid:
QCPLayerable

Public Member Functions

 QCPGrid (QCPAxis *parentAxis)
 
 ~QCPGrid ()
 
bool subGridVisible () const
 
bool antialiasedSubGrid () const
 
bool antialiasedZeroLine () const
 
QPen pen () const
 
QPen subGridPen () const
 
QPen zeroLinePen () const
 
void setSubGridVisible (bool visible)
 
void setAntialiasedSubGrid (bool enabled)
 
void setAntialiasedZeroLine (bool enabled)
 
void setPen (const QPen &pen)
 
void setSubGridPen (const QPen &pen)
 
void setZeroLinePen (const QPen &pen)
 
- Public Member Functions inherited from QCPLayerable
 QCPLayerable (QCustomPlot *parentPlot)
 
 ~QCPLayerable ()
 
bool visible () const
 
QCustomPlotparentPlot () const
 
QCPLayerlayer () const
 
bool antialiased () const
 
void setVisible (bool on)
 
bool setLayer (QCPLayer *layer)
 
bool setLayer (const QString &layerName)
 
void setAntialiased (bool enabled)
 

Protected Member Functions

virtual void applyDefaultAntialiasingHint (QCPPainter *painter) const
 
virtual void draw (QCPPainter *painter)
 
void drawGridLines (QCPPainter *painter) const
 
void drawSubGridLines (QCPPainter *painter) const
 
- Protected Member Functions inherited from QCPLayerable
bool moveToLayer (QCPLayer *layer, bool prepend)
 
void applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const
 
virtual QRect clipRect () const
 

Protected Attributes

QCPAxismParentAxis
 
bool mSubGridVisible
 
bool mAntialiasedSubGrid
 
bool mAntialiasedZeroLine
 
QPen mPen
 
QPen mSubGridPen
 
QPen mZeroLinePen
 
- Protected Attributes inherited from QCPLayerable
bool mVisible
 
QCustomPlotmParentPlot
 
QCPLayermLayer
 
bool mAntialiased
 

Friends

class QCPAxis
 

Detailed Description

Responsible for drawing the grid of a QCPAxis.

This class is tightly bound to QCPAxis. Every axis owns a grid instance internally and uses it to draw the grid. Normally, you don't need to interact with the QCPGrid instance, because QCPAxis reproduces the grid interface in its own interface.

The axis and grid drawing was split into two classes to allow them to be placed on different layers (both QCPAxis and QCPGrid inherit from QCPLayerable). So it is possible to have the grid at the background and the axes in the foreground, and any plottables/items in between. This described situation is the default setup, see QCPLayer documentation.

Constructor & Destructor Documentation

QCPGrid::QCPGrid ( QCPAxis parentAxis)

Creates a QCPGrid instance and sets default values.

You shouldn't instantiate grids on their own, since every QCPAxis brings its own QCPGrid internally

QCPGrid::~QCPGrid ( )

Member Function Documentation

bool QCPGrid::antialiasedSubGrid ( ) const
inline
bool QCPGrid::antialiasedZeroLine ( ) const
inline
void QCPGrid::applyDefaultAntialiasingHint ( QCPPainter painter) const
protectedvirtual

Implements QCPLayerable.

void QCPGrid::draw ( QCPPainter painter)
protectedvirtual

Implements QCPLayerable.

void QCPGrid::drawGridLines ( QCPPainter painter) const
protected
void QCPGrid::drawSubGridLines ( QCPPainter painter) const
protected
QPen QCPGrid::pen ( ) const
inline
void QCPGrid::setAntialiasedSubGrid ( bool  enabled)

Sets whether sub grid lines are drawn antialiased.

void QCPGrid::setAntialiasedZeroLine ( bool  enabled)

Sets whether zero lines are drawn antialiased.

void QCPGrid::setPen ( const QPen &  pen)

Sets the pen with which (major) grid lines are drawn.

void QCPGrid::setSubGridPen ( const QPen &  pen)

Sets the pen with which sub grid lines are drawn.

void QCPGrid::setSubGridVisible ( bool  visible)

Sets whether grid lines at sub tick marks are drawn.

See Also
setSubGridPen
void QCPGrid::setZeroLinePen ( const QPen &  pen)

Sets the pen with which zero lines are drawn.

Zero lines are lines at coordinate 0 which may be drawn with a different pen than other grid lines. To disable zero lines and just draw normal grid lines at zero, set pen to Qt::NoPen.

QPen QCPGrid::subGridPen ( ) const
inline
bool QCPGrid::subGridVisible ( ) const
inline
QPen QCPGrid::zeroLinePen ( ) const
inline

Friends And Related Function Documentation

friend class QCPAxis
friend

Member Data Documentation

bool QCPGrid::mAntialiasedSubGrid
protected
bool QCPGrid::mAntialiasedZeroLine
protected
QCPAxis* QCPGrid::mParentAxis
protected
QPen QCPGrid::mPen
protected
QPen QCPGrid::mSubGridPen
protected
bool QCPGrid::mSubGridVisible
protected
QPen QCPGrid::mZeroLinePen
protected

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