Aquila
2.0 prealpha
Cognitive Robotics Architecture
|
QPainter subclass used internally. More...
#include <plot2d.h>
Public Member Functions | |
QCPPainter () | |
QCPPainter (QPaintDevice *device) | |
~QCPPainter () | |
QPixmap | scatterPixmap () const |
bool | antialiasing () const |
bool | pdfExportMode () const |
bool | scaledExportMode () const |
void | setScatterPixmap (const QPixmap pm) |
void | setAntialiasing (bool enabled) |
void | setPdfExportMode (bool enabled) |
void | setScaledExportMode (bool enabled) |
void | setPen (const QPen &pen) |
void | setPen (const QColor &color) |
void | setPen (Qt::PenStyle penStyle) |
void | drawLine (const QLineF &line) |
void | drawLine (const QPointF &p1, const QPointF &p2) |
void | save () |
void | restore () |
void | fixScaledPen () |
void | drawScatter (double x, double y, double size, QCP::ScatterStyle style) |
Protected Attributes | |
QPixmap | mScatterPixmap |
bool | mScaledExportMode |
bool | mPdfExportMode |
bool | mIsAntialiasing |
QStack< bool > | mAntialiasingStack |
QPainter subclass used internally.
This internal class is used to provide some extended functionality e.g. for tweaking position consistency between antialiased and non-antialiased painting and drawing common shapes (like scatter symbols). Further it provides workarounds for QPainter quirks.
QCPPainter::QCPPainter | ( | ) |
Creates a new QCPPainter instance and sets default values
QCPPainter::QCPPainter | ( | QPaintDevice * | device | ) |
Creates a new QCPPainter instance on the specified paint device and sets default values. Just like the analogous QPainter constructor, begins painting on device immediately.
QCPPainter::~QCPPainter | ( | ) |
|
inline |
void QCPPainter::drawLine | ( | const QLineF & | line | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Works around a Qt bug introduced with Qt 4.8 which makes drawing QLineF unpredictable when antialiasing is disabled.
|
inline |
void QCPPainter::drawScatter | ( | double | x, |
double | y, | ||
double | size, | ||
QCP::ScatterStyle | style | ||
) |
Draws a single scatter point with the specified style and size in pixels at the pixel position x and y.
If the style is ssPixmap, make sure to pass the respective pixmap with setScatterPixmap before calling this function.
void QCPPainter::fixScaledPen | ( | ) |
Provides a workaround for a QPainter bug that prevents scaling of pen widths for pens with width 0, although the QPainter::NonCosmeticDefaultPen render hint is set.
Changes the pen width from 0 to 1, if appropriate.
Does nothing if the QCPPainter is not in scaled export mode (setScaledExportMode).
|
inline |
void QCPPainter::restore | ( | ) |
Restores the painter (see QPainter::restore). Since QCPPainter adds some new internal state to QPainter, the save/restore functions are reimplemented to also save/restore those members.
void QCPPainter::save | ( | ) |
Saves the painter (see QPainter::save). Since QCPPainter adds some new internal state to QPainter, the save/restore functions are reimplemented to also save/restore those members.
|
inline |
|
inline |
void QCPPainter::setAntialiasing | ( | bool | enabled | ) |
Sets whether painting uses antialiasing or not. Use this method instead of using setRenderHint with QPainter::Antialiasing directly, as it allows QCPPainter to regain pixel exactness between antialiased and non-antialiased painting (Since Qt uses slightly different coordinate systems for AA/Non-AA painting).
void QCPPainter::setPdfExportMode | ( | bool | enabled | ) |
Sets whether the painter shall adjust its fixes/workarounds optimized for vectorized pdf export.
This means for example, that the antialiasing/non-antialiasing fix introduced with setAntialiasing is not used, since PDF is not rastered and thus works with floating point data natively.
void QCPPainter::setPen | ( | const QPen & | pen | ) |
Sets the pen of the painter and applies certain fixes to it, depending on the mode of this QCPPainter.
void QCPPainter::setPen | ( | const QColor & | color | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Sets the pen (by color) of the painter and applies certain fixes to it, depending on the mode of this QCPPainter.
void QCPPainter::setPen | ( | Qt::PenStyle | penStyle | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Sets the pen (by style) of the painter and applies certain fixes to it, depending on the mode of this QCPPainter.
void QCPPainter::setScaledExportMode | ( | bool | enabled | ) |
Sets whether the painter shall adjust its fixes/workarounds optimized for scaled export to rastered image formats.
For example this provides a workaround for a QPainter bug that prevents scaling of pen widths for pens with width 0, although the QPainter::NonCosmeticDefaultPen render hint is set.
void QCPPainter::setScatterPixmap | ( | const QPixmap | pm | ) |
Sets the pixmap that will be used to draw scatters with drawScatter, when the style is QCP::ssPixmap.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |