Grid Class Reference

`#include <Grid.h>`

Inheritance diagram for Grid:

## Public Member Functions

void | copy (Grid *)
void | enableZeroLineX (bool enable=true)
void | enableZeroLineY (bool enable=true)
| Grid ()
void | load (const QStringList &)
const QPen & | majPenX () const
const QPen & | majPenY () const
const QPen & | minPenX () const
const QPen & | minPenY () const
QString | saveToString ()
void | setMajPenX (const QPen &p)
void | setMajPenY (const QPen &p)
void | setMinPenX (const QPen &p)
void | setMinPenY (const QPen &p)
void | setXZeroLinePen (const QPen &p)
void | setYZeroLinePen (const QPen &p)
bool | xZeroLineEnabled ()
QwtPlotMarker * | xZeroLineMarker ()
const QPen & | xZeroLinePen ()
bool | yZeroLineEnabled ()
QwtPlotMarker * | yZeroLineMarker ()
const QPen & | yZeroLinePen ()

## Private Member Functions

void | draw (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &rect) const
| Draw the grid. More...
void | drawLines (QPainter *painter, const QRect &rect, Qt::Orientation orientation, const QwtScaleMap &map, const QwtValueList &values) const

## Private Attributes

QPen | d_maj_pen_y
QPen | d_min_pen_y
QwtPlotMarker * | mrkX
QwtPlotMarker * | mrkY

## Constructor & Destructor Documentation

## Grid()

Grid::Grid | ( |  | ) |

## Member Function Documentation

## copy()

void Grid::copy | ( | Grid * | grid | ) |

References enableZeroLineX(), enableZeroLineY(), majPenX(), majPenY(), minPenX(), minPenY(), setMajPenX(), setMajPenY(), setMinPenX(), setMinPenY(), xZeroLineEnabled(), and yZeroLineEnabled().

Referenced by Graph::copy(), minPenY(), and ApplicationWindow::setPreferences().

## draw()

void Grid::draw | ( | QPainter * | painter,
|  | const QwtScaleMap & | mx,
|  | const QwtScaleMap & | my,
|  | const QRect & | r
| ) |  | const

private

Draw the grid.

The grid is drawn into the bounding rectangle such that gridlines begin and end at the rectangle's borders. The X and Y maps are used to map the scale divisions into the drawing region screen.

Parameters

  painter | Painter
  mx | X axis map
  my | Y axis
  r | Contents rect of the plot canvas

References d_maj_pen_y, d_min_pen_y, and drawLines().

Referenced by yZeroLineMarker().

## drawLines()

void Grid::drawLines | ( | QPainter * | painter,
|  | const QRect & | rect,
|  | Qt::Orientation | orientation,
|  | const QwtScaleMap & | map,
|  | const QwtValueList & | values
| ) |  | const

private

References Graph::canvasFrameWidth().

Referenced by draw(), and yZeroLineMarker().

## enableZeroLineX()

void Grid::enableZeroLineX | ( | bool | enable = `true` | ) |

References Graph::axesLinewidth(), Graph::insertMarker(), and mrkX.

Referenced by AxesDialog::applyChangesToGrid(), copy(), load(), and xZeroLineEnabled().

## enableZeroLineY()

void Grid::enableZeroLineY | ( | bool | enable = `true` | ) |

References Graph::axesLinewidth(), Graph::insertMarker(), and mrkY.

Referenced by AxesDialog::applyChangesToGrid(), copy(), load(), and yZeroLineEnabled().

## load()

void Grid::load | ( | const QStringList & | grid | ) |

References ColorBox::defaultColor(), enableZeroLineX(), enableZeroLineY(), Graph::getPenStyle(), majPenX(), majPenY(), minPenX(), minPenY(), setMajPenX(), setMajPenY(), setMinPenX(), and setMinPenY().

Referenced by minPenY(), and ApplicationWindow::openGraph().

## majPenX()

const QPen& Grid::majPenX | ( |  | ) | const

inline

Referenced by copy(), load(), ApplicationWindow::readSettings(), ApplicationWindow::saveSettings(), saveToString(), AxesDialog::showGridOptions(), and ConfigDialog::showGridOptions().

## majPenY()

const QPen& Grid::majPenY | ( |  | ) | const

inline

References d_maj_pen_y.

Referenced by copy(), load(), ApplicationWindow::readSettings(), ApplicationWindow::saveSettings(), saveToString(), AxesDialog::showGridOptions(), and ConfigDialog::showGridOptions().

## minPenX()

const QPen& Grid::minPenX | ( |  | ) | const

inline

Referenced by copy(), load(), ApplicationWindow::readSettings(), ApplicationWindow::saveSettings(), saveToString(), AxesDialog::showGridOptions(), and ConfigDialog::showGridOptions().

## minPenY()

const QPen& Grid::minPenY | ( |  | ) | const

inline

References copy(), d_min_pen_y, load(), and saveToString().

Referenced by copy(), load(), ApplicationWindow::readSettings(), ApplicationWindow::saveSettings(), saveToString(), AxesDialog::showGridOptions(), and ConfigDialog::showGridOptions().

## saveToString()

QString Grid::saveToString | ( |  | ) |

References majPenX(), majPenY(), minPenX(), minPenY(), xZeroLineEnabled(), and yZeroLineEnabled().

Referenced by minPenY(), and Graph::saveToString().

## setMajPenX()

void Grid::setMajPenX | ( | const QPen & | p | ) |

inline

Referenced by AxesDialog::applyChangesToGrid(), copy(), load(), ApplicationWindow::readSettings(), and ConfigDialog::updateGrid().

## setMajPenY()

void Grid::setMajPenY | ( | const QPen & | p | ) |

inline

References d_maj_pen_y.

Referenced by AxesDialog::applyChangesToGrid(), copy(), load(), ApplicationWindow::readSettings(), and ConfigDialog::updateGrid().

## setMinPenX()

void Grid::setMinPenX | ( | const QPen & | p | ) |

inline

Referenced by AxesDialog::applyChangesToGrid(), copy(), load(), ApplicationWindow::readSettings(), and ConfigDialog::updateGrid().

## setMinPenY()

void Grid::setMinPenY | ( | const QPen & | p | ) |

inline

References d_min_pen_y.

Referenced by AxesDialog::applyChangesToGrid(), copy(), load(), ApplicationWindow::readSettings(), and ConfigDialog::updateGrid().

## setXZeroLinePen()

void Grid::setXZeroLinePen | ( | const QPen & | p | ) |

References mrkX.

Referenced by yZeroLineMarker().

## setYZeroLinePen()

void Grid::setYZeroLinePen | ( | const QPen & | p | ) |

References mrkY.

Referenced by yZeroLineMarker().

## xZeroLineEnabled()

bool Grid::xZeroLineEnabled | ( |  | ) |

inline

References enableZeroLineX(), and mrkX.

Referenced by copy(), saveToString(), and AxesDialog::showGridOptions().

## xZeroLineMarker()

QwtPlotMarker* Grid::xZeroLineMarker | ( |  | ) |

inline

References mrkX.

Referenced by Graph::setAxesLinewidth(), Graph::setAxisColor(), and Graph::showAxis().

## xZeroLinePen()

const QPen & Grid::xZeroLinePen | ( |  | ) |

References mrkX.

Referenced by yZeroLineMarker().

## yZeroLineEnabled()

bool Grid::yZeroLineEnabled | ( |  | ) |

inline

References enableZeroLineY(), and mrkY.

Referenced by copy(), saveToString(), and AxesDialog::showGridOptions().

## yZeroLineMarker()

QwtPlotMarker* Grid::yZeroLineMarker | ( |  | ) |

inline

References draw(), drawLines(), mrkY, setXZeroLinePen(), setYZeroLinePen(), xZeroLinePen(), and yZeroLinePen().

Referenced by Graph::setAxesLinewidth(), Graph::setAxisColor(), and Graph::showAxis().

## yZeroLinePen()

const QPen & Grid::yZeroLinePen | ( |  | ) |

References mrkY.

Referenced by yZeroLineMarker().

## Member Data Documentation

## d_maj_pen_y

QPen Grid::d_maj_pen_y

private

Referenced by draw(), majPenY(), and setMajPenY().

## d_min_pen_y

QPen Grid::d_min_pen_y

private

Referenced by draw(), minPenY(), and setMinPenY().

## mrkX

QwtPlotMarker* Grid::mrkX

private

Referenced by enableZeroLineX(), setXZeroLinePen(), xZeroLineEnabled(), xZeroLineMarker(), and xZeroLinePen().

## mrkY

QwtPlotMarker * Grid::mrkY

private

Referenced by enableZeroLineY(), setYZeroLinePen(), yZeroLineEnabled(), yZeroLineMarker(), and yZeroLinePen().

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

- qtiplot/src/plot2D/Grid.h
- qtiplot/src/plot2D/Grid.cpp