QTeXEngine: QTeXPaintEngine Class Reference

# QTeXPaintEngine Class Reference

`#include <QTeXEngine.h>`

List of all members.

## Public Member Functions
virtual bool | begin (QPaintDevice *)
virtual void | drawEllipse (const QRectF &)
virtual void | drawImage (const QRectF &, const QImage &, const QRectF &, Qt::ImageConversionFlags)
virtual void | drawLines (const QLineF *, int)
virtual void | drawPath (const QPainterPath &path)
virtual void | drawPixmap (const QRectF &, const QPixmap &, const QRectF &)
virtual void | drawPoints (const QPointF *points, int pointCount)
virtual void | drawPolygon (const QPointF *, int, PolygonDrawMode)
virtual void | drawRects (const QRectF *, int)
virtual void | drawTextItem (const QPointF &, const QTextItem &)
virtual bool | end ()
void | exportFontSizes (bool on=true)
| QTeXPaintEngine (const QString &, QTeXPaintDevice::Unit u=QTeXPaintDevice::pt)
void | setDocumentMode (bool on=true)
void | setEscapeTextMode (bool on=true)
| Enables/Disables escaping of special characters in texts.
void | setGrayScale (bool on=true)
| Enables/Disables gray scale output.
void | setOutputMode (QTeXPaintDevice::OutputMode mode)
| Set output syntax.
void | setTextHorizontalAlignment (Qt::Alignment alignment)
void | setUnit (QTeXPaintDevice::Unit u)
| Set length unit.
virtual QPaintEngine::Type | type () const
virtual void | updateState (const QPaintEngineState &)
| ~QTeXPaintEngine ()
## Private Types
## Private Member Functions
bool | addNewBrushColor ()
| Returns true if a new color command should be added.
bool | addNewPatternColor ()
bool | addNewPenColor ()
QString | beginScope ()
bool | changedClipping ()
QString | clipPath ()
QString | color (const QColor &col)
QPointF | convertPoint (const QPointF &p)
QString | defineColor (const QColor &c, const QString &name)
QString | drawPgfShape (Shape shape, const QString &path)
void | drawPixmap (const QPixmap &pix, const QRectF &p)
| Draws pixmap pix in a given rectangle.
QString | drawShape (Shape shape, const QString &path)
QString | drawTikzShape (Shape shape, const QString &path)
bool | emptyStringOperation ()
| Returns true if draw operation has NoBrush and NoPen.
QString | endScope ()
QString | indentString (const QString &s)
QString | path (const QPainterPath &path)
QString | pgfBrush (const QBrush &brush)
QString | pgfPath (const QPainterPath &path)
QString | pgfPen (const QPen &pen)
QString | pgfPoint (const QPointF &p)
double | resFactorX ()
double | resFactorY ()
QString | tikzBrush (const QBrush &brush)
QString | tikzPath (const QPainterPath &path)
QString | tikzPen (const QPen &pen)
QString | tikzPoint (const QPointF &p)
QString | unit ()
double | unitFactor ()
void | writeToFile (const QString &s)
## Private Attributes
QPainterPath | d_clip_path
QColor | d_current_color
bool | d_document_mode
bool | d_escape_text
bool | d_font_size
bool | d_gray_scale
Qt::Alignment | d_horizontal_alignment
bool | d_open_scope
QColor | d_pattern_color
bool | d_pgf_mode
int | d_pixmap_index
QTeXPaintDevice::Unit | d_unit
QFile * | file
QString | fname
| Name of the output file.

## Member Enumeration Documentation

enum QTeXPaintEngine::Shape`[private]`

Enumerator:

  Line |
  Polygon |
  Polyline |
  Rect |
  Ellipse |
  Path |
  Points |

## Constructor & Destructor Documentation

QTeXPaintEngine::QTeXPaintEngine | ( | const QString & | f,
|  | QTeXPaintDevice::Unit | u = `QTeXPaintDevice::pt` |
| ) |  |  |

References d_clip_path, d_current_color, d_document_mode, d_escape_text, d_font_size, d_gray_scale, d_horizontal_alignment, d_open_scope, d_pattern_color, and d_pgf_mode.

QTeXPaintEngine::~QTeXPaintEngine | ( |  | ) | `[inline]`

## Member Function Documentation

bool QTeXPaintEngine::addNewBrushColor | ( |  | ) | `[private]`

Returns true if a new color command should be added.

References changedClipping(), and d_current_color.

Referenced by tikzBrush().

bool QTeXPaintEngine::addNewPatternColor | ( |  | ) | `[private]`

References d_pattern_color.

Referenced by tikzBrush().

bool QTeXPaintEngine::addNewPenColor | ( |  | ) | `[private]`

References changedClipping(), and d_current_color.

Referenced by drawPoints(), drawTextItem(), and tikzPen().

bool QTeXPaintEngine::begin | ( | QPaintDevice * | p | ) | `[virtual]`

References d_document_mode, d_pgf_mode, file, fname, path(), tikzPath(), and unit().

QString QTeXPaintEngine::beginScope | ( |  | ) | `[private]`

References clipPath(), d_current_color, d_pattern_color, d_pgf_mode, and indentString().

Referenced by writeToFile().

bool QTeXPaintEngine::changedClipping | ( |  | ) | `[private]`

References clipPath(), and d_clip_path.

Referenced by addNewBrushColor(), addNewPenColor(), and writeToFile().

QString QTeXPaintEngine::clipPath | ( |  | ) | `[private]`

References d_pgf_mode, path(), pgfPath(), and tikzPath().

Referenced by beginScope(), and changedClipping().

QString QTeXPaintEngine::color | ( | const QColor & | col | ) | `[private]`

References d_gray_scale.

Referenced by drawPoints(), drawTextItem(), emptyStringOperation(), pgfBrush(), pgfPen(), tikzBrush(), and tikzPen().

QPointF QTeXPaintEngine::convertPoint | ( | const QPointF & | p | ) | `[private]`

References resFactorX(), and resFactorY().

Referenced by drawEllipse(), drawPixmap(), drawPoints(), drawTextItem(), pgfPath(), and tikzPath().

QString QTeXPaintEngine::defineColor | ( | const QColor & | c,
|  | const QString & | name |
| ) |  |  | `[private]`

References d_gray_scale.

Referenced by pgfBrush(), and tikzBrush().

void QTeXPaintEngine::drawEllipse | ( | const QRectF & | rect | ) | `[virtual]`

References convertPoint(), d_pgf_mode, drawShape(), Ellipse, emptyStringOperation(), path(), pgfPoint(), resFactorX(), resFactorY(), tikzPoint(), unit(), and writeToFile().

void QTeXPaintEngine::drawImage | ( | const QRectF & | r,
|  | const QImage & | image,
|  | const QRectF & | sr,
|  | Qt::ImageConversionFlags | flags |
| ) |  |  | `[virtual]`

References drawPixmap().

void QTeXPaintEngine::drawLines | ( | const QLineF * | lines,
|  | int | lineCount |
| ) |  |  | `[virtual]`

References drawShape(), Line, path(), and writeToFile().

void QTeXPaintEngine::drawPath | ( | const QPainterPath & | path | ) | `[virtual]`

References drawShape(), emptyStringOperation(), path(), Path, and writeToFile().

QString QTeXPaintEngine::drawPgfShape | ( | Shape | shape,
|  | const QString & | path |
| ) |  |  | `[private]`

References Ellipse, Line, Path, pgfBrush(), pgfPen(), Points, Polygon, Polyline, and Rect.

Referenced by drawShape().

void QTeXPaintEngine::drawPixmap | ( | const QPixmap & | pix,
|  | const QRectF & | p |
| ) |  |  | `[private]`

Draws pixmap pix in a given rectangle.

References convertPoint(), d_pixmap_index, file, pgfPoint(), resFactorX(), resFactorY(), and unit().

void QTeXPaintEngine::drawPixmap | ( | const QRectF & | r,
|  | const QPixmap & | pm,
|  | const QRectF & | sr |
| ) |  |  | `[virtual]`

Referenced by drawImage().

void QTeXPaintEngine::drawPoints | ( | const QPointF * | points,
|  | int | pointCount |
| ) |  |  | `[virtual]`

References addNewPenColor(), color(), convertPoint(), d_current_color, d_pgf_mode, emptyStringOperation(), path(), pgfPoint(), tikzPoint(), and writeToFile().

void QTeXPaintEngine::drawPolygon | ( | const QPointF * | points,
|  | int | pointCount,
|  | PolygonDrawMode | mode |
| ) |  |  | `[virtual]`

References drawShape(), emptyStringOperation(), path(), Polygon, Polyline, and writeToFile().

void QTeXPaintEngine::drawRects | ( | const QRectF * | rects,
|  | int | rectCount |
| ) |  |  | `[virtual]`

References drawShape(), emptyStringOperation(), Path, path(), and writeToFile().

QString QTeXPaintEngine::drawShape | ( | Shape | shape,
|  | const QString & | path |
| ) |  |  | `[private]`

References d_pgf_mode, drawPgfShape(), and drawTikzShape().

Referenced by drawEllipse(), drawLines(), drawPath(), drawPolygon(), and drawRects().

void QTeXPaintEngine::drawTextItem | ( | const QPointF & | p,
|  | const QTextItem & | textItem |
| ) |  |  | `[virtual]`

References addNewPenColor(), color(), convertPoint(), d_current_color, d_escape_text, d_font_size, d_horizontal_alignment, pgfPoint(), and writeToFile().

QString QTeXPaintEngine::drawTikzShape | ( | Shape | shape,
|  | const QString & | path |
| ) |  |  | `[private]`

References Line, Polyline, tikzBrush(), and tikzPen().

Referenced by drawShape().

bool QTeXPaintEngine::emptyStringOperation | ( |  | ) | `[private]`

Returns true if draw operation has NoBrush and NoPen.

References color().

Referenced by drawEllipse(), drawPath(), drawPoints(), drawPolygon(), and drawRects().

bool QTeXPaintEngine::end | ( |  | ) | `[virtual]`

References d_document_mode, d_open_scope, d_pgf_mode, endScope(), and file.

QString QTeXPaintEngine::endScope | ( |  | ) | `[private]`

References d_pgf_mode.

Referenced by end(), and writeToFile().

void QTeXPaintEngine::exportFontSizes | ( | bool | on = `true` | ) | `[inline]`

References d_font_size.

Referenced by QTeXPaintDevice::exportFontSizes().

QString QTeXPaintEngine::indentString | ( | const QString & | s | ) | `[private]`

Referenced by beginScope(), and writeToFile().

QString QTeXPaintEngine::path | ( | const QPainterPath & | path | ) | `[private]`

References d_pgf_mode, pgfPath(), and tikzPath().

Referenced by begin(), clipPath(), drawEllipse(), drawLines(), drawPath(), drawPoints(), drawPolygon(), and drawRects().

QString QTeXPaintEngine::pgfBrush | ( | const QBrush & | brush | ) | `[private]`

References color(), and defineColor().

Referenced by drawPgfShape().

QString QTeXPaintEngine::pgfPath | ( | const QPainterPath & | path | ) | `[private]`

References convertPoint(), and pgfPoint().

Referenced by clipPath(), and path().

QString QTeXPaintEngine::pgfPen | ( | const QPen & | pen | ) | `[private]`

References color(), and unit().

Referenced by drawPgfShape().

QString QTeXPaintEngine::pgfPoint | ( | const QPointF & | p | ) | `[private]`

References unit().

Referenced by drawEllipse(), drawPixmap(), drawPoints(), drawTextItem(), and pgfPath().

double QTeXPaintEngine::resFactorX | ( |  | ) | `[private]`

References unitFactor().

Referenced by convertPoint(), drawEllipse(), and drawPixmap().

double QTeXPaintEngine::resFactorY | ( |  | ) | `[private]`

References unitFactor().

Referenced by convertPoint(), drawEllipse(), and drawPixmap().

void QTeXPaintEngine::setDocumentMode | ( | bool | on = `true` | ) | `[inline]`

References d_document_mode.

Referenced by QTeXPaintDevice::setDocumentMode().

void QTeXPaintEngine::setEscapeTextMode | ( | bool | on = `true` | ) | `[inline]`

Enables/Disables escaping of special characters in texts.

References d_escape_text.

Referenced by QTeXPaintDevice::setEscapeTextMode().

void QTeXPaintEngine::setGrayScale | ( | bool | on = `true` | ) | `[inline]`

Enables/Disables gray scale output.

References d_gray_scale.

Referenced by QTeXPaintDevice::setColorMode().

void QTeXPaintEngine::setOutputMode | ( | QTeXPaintDevice::OutputMode | mode | ) | `[inline]`

Set output syntax.

References d_pgf_mode, and QTeXPaintDevice::Pgf.

Referenced by QTeXPaintDevice::setOutputMode().

void QTeXPaintEngine::setTextHorizontalAlignment | ( | Qt::Alignment | alignment | ) | `[inline]`

References d_horizontal_alignment.

Referenced by QTeXPaintDevice::setTextHorizontalAlignment().

void QTeXPaintEngine::setUnit | ( | QTeXPaintDevice::Unit | u | ) | `[inline]`

Set length unit.

References d_unit.

Referenced by QTeXPaintDevice::setUnit().

QString QTeXPaintEngine::tikzBrush | ( | const QBrush & | brush | ) | `[private]`

References addNewBrushColor(), addNewPatternColor(), color(), d_current_color, d_pattern_color, and defineColor().

Referenced by drawTikzShape().

QString QTeXPaintEngine::tikzPath | ( | const QPainterPath & | path | ) | `[private]`

References convertPoint(), and tikzPoint().

Referenced by begin(), clipPath(), and path().

QString QTeXPaintEngine::tikzPen | ( | const QPen & | pen | ) | `[private]`

References addNewPenColor(), color(), d_current_color, and unit().

Referenced by drawTikzShape().

QString QTeXPaintEngine::tikzPoint | ( | const QPointF & | p | ) | `[private]`

References unit().

Referenced by drawEllipse(), drawPoints(), and tikzPath().

virtual QPaintEngine::Type QTeXPaintEngine::type | ( |  | ) | const`[inline, virtual]`

QString QTeXPaintEngine::unit | ( |  | ) | `[private]`

References QTeXPaintDevice::bp, QTeXPaintDevice::cm, d_unit, QTeXPaintDevice::em, QTeXPaintDevice::ex, QTeXPaintDevice::in, QTeXPaintDevice::mm, and QTeXPaintDevice::pt.

Referenced by begin(), drawEllipse(), drawPixmap(), pgfPen(), pgfPoint(), tikzPen(), and tikzPoint().

double QTeXPaintEngine::unitFactor | ( |  | ) | `[private]`

References QTeXPaintDevice::bp, QTeXPaintDevice::cm, d_unit, QTeXPaintDevice::em, QTeXPaintDevice::ex, QTeXPaintDevice::in, QTeXPaintDevice::mm, and QTeXPaintDevice::pt.

Referenced by resFactorX(), and resFactorY().

virtual void QTeXPaintEngine::updateState | ( | const QPaintEngineState & |  | ) | `[inline, virtual]`

void QTeXPaintEngine::writeToFile | ( | const QString & | s | ) | `[private]`

References beginScope(), changedClipping(), d_clip_path, d_open_scope, d_pgf_mode, endScope(), file, and indentString().

Referenced by drawEllipse(), drawLines(), drawPath(), drawPoints(), drawPolygon(), drawRects(), and drawTextItem().

## Member Data Documentation

QPainterPath QTeXPaintEngine::d_clip_path`[private]`

Referenced by changedClipping(), QTeXPaintEngine(), and writeToFile().

QColor QTeXPaintEngine::d_current_color`[private]`

Referenced by addNewBrushColor(), addNewPenColor(), beginScope(), drawPoints(), drawTextItem(), QTeXPaintEngine(), tikzBrush(), and tikzPen().

bool QTeXPaintEngine::d_document_mode`[private]`

Referenced by begin(), end(), QTeXPaintEngine(), and setDocumentMode().

bool QTeXPaintEngine::d_escape_text`[private]`

Referenced by drawTextItem(), QTeXPaintEngine(), and setEscapeTextMode().

bool QTeXPaintEngine::d_font_size`[private]`

Referenced by drawTextItem(), exportFontSizes(), and QTeXPaintEngine().

bool QTeXPaintEngine::d_gray_scale`[private]`

Referenced by color(), defineColor(), QTeXPaintEngine(), and setGrayScale().

Qt::Alignment QTeXPaintEngine::d_horizontal_alignment`[private]`

Referenced by drawTextItem(), QTeXPaintEngine(), and setTextHorizontalAlignment().

bool QTeXPaintEngine::d_open_scope`[private]`

Referenced by end(), QTeXPaintEngine(), and writeToFile().

QColor QTeXPaintEngine::d_pattern_color`[private]`

Referenced by addNewPatternColor(), beginScope(), QTeXPaintEngine(), and tikzBrush().

bool QTeXPaintEngine::d_pgf_mode`[private]`

Referenced by begin(), beginScope(), clipPath(), drawEllipse(), drawPoints(), drawShape(), end(), endScope(), path(), QTeXPaintEngine(), setOutputMode(), and writeToFile().

int QTeXPaintEngine::d_pixmap_index`[private]`

Referenced by drawPixmap().

QTeXPaintDevice::Unit QTeXPaintEngine::d_unit`[private]`

Referenced by setUnit(), unit(), and unitFactor().

QFile* QTeXPaintEngine::file`[private]`

Referenced by begin(), drawPixmap(), end(), and writeToFile().

QString QTeXPaintEngine::fname`[private]`

Name of the output file.

Referenced by begin().

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

- C:/qtiplot/3rdparty/QTeXEngine/src/QTeXEngine.h
- C:/qtiplot/3rdparty/QTeXEngine/src/QTeXPaintEngine.cpp