24#ifndef JKQTMATHTEXTMATRIXNODE_H
25#define JKQTMATHTEXTMATRIXNODE_H
26#include "jkqtmathtext/jkqtmathtext_imexport.h"
27#include "jkqtmathtext/jkqtmathtexttools.h"
28#include "jkqtmathtext/nodes/jkqtmathtextnode.h"
63 void setChildren(
const QVector<QVector<JKQTMathTextNode*> >& children);
103 return cellwidth[line].operator[](col);
106 return cellwidth[line].operator[](col);
147 static void drawVLine(QPainter& painter,
double x,
double y,
double height,
LineType lt,
double linewidth,
double linewidthHeavy, QColor color,
double doublelineseparation);
149 static void drawHLine(QPainter& painter,
double x,
double y,
double width,
LineType lt,
double linewidth,
double linewidthHeavy, QColor color,
double doublelineseparation);
this class parses a mathematical markup string and can then draw the contained text/equation onto a Q...
Definition jkqtmathtext.h:192
subclass representing a \begin{matrix} , \begin{tabular} , \begin{array} , ... node
Definition jkqtmathtextmatrixnode.h:47
void setTopLine(LineType line)
line at the top of the table
void parseColumnSpec(const QString &columnspec)
parses a column specifier
virtual void clearChildren(bool deleteChildren=true) override
clear all children, deleting them if deleteChildren==true
LayoutInfo calcLayout(QPainter &painter, const JKQTMathTextEnvironment ¤tEv) const
calclates the layout of the whole block/node
QVector< QVector< JKQTMathTextNode * > > children
child nodes making up the matrix, vector of rows
Definition jkqtmathtextmatrixnode.h:129
virtual QString getTypeName() const override
return the name of this class as a string
JKQTMathTextMatrixNode(JKQTMathText *parent, const QString &columnSpec=QString())
LineType horizontalLineTop
line at the top of the table
Definition jkqtmathtextmatrixnode.h:139
void clearChildrenImpl(bool deleteChildren)
clear all children, deleting them if deleteChildren==true
virtual bool toHtml(QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) const override
convert node to HTML and returns true on success
int lines
number of rows in the matrix
Definition jkqtmathtextmatrixnode.h:144
virtual double draw(QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const override
draw the contents at the designated position
virtual void setDrawBoxes(bool draw) override
enables the drawing of colored boxes (for DEBUGGING) around the actual output of the node
QVector< QVector< JKQTMathTextNode * > > getChildrenMatrix() const
returns the child nodes
virtual void deleteChild(int i) override
delete the i-th child
LineType
types of lines
Definition jkqtmathtextmatrixnode.h:50
@ LTnone
noline
Definition jkqtmathtextmatrixnode.h:51
@ LTheavyline
heavier/thick line
Definition jkqtmathtextmatrixnode.h:54
@ LTline
single line
Definition jkqtmathtextmatrixnode.h:52
@ LTdoubleDashed
double dashed line
Definition jkqtmathtextmatrixnode.h:56
@ LTdashed
single dashed line
Definition jkqtmathtextmatrixnode.h:55
@ LTdoubleline
double line
Definition jkqtmathtextmatrixnode.h:53
void setRowBottomLine(int col, LineType line)
lines to the bottom of each row
LineType verticalLineLeft
line at the left of the table
Definition jkqtmathtextmatrixnode.h:135
static void drawVLine(QPainter &painter, double x, double y, double height, LineType lt, double linewidth, double linewidthHeavy, QColor color, double doublelineseparation)
draw a vertical line starting at pixel position (x, y ) with length height, using linetype lt,...
virtual int childCount() const override
returns the number of child nodes
QMap< int, LineType > verticalLineRHSColumn
lines to the right of each column
Definition jkqtmathtextmatrixnode.h:133
virtual JKQTMathTextNodeSize getSizeInternal(QPainter &painter, JKQTMathTextEnvironment currentEv) const override
determine the size of the node, overwrite this function in derived classes
static void drawHLine(QPainter &painter, double x, double y, double width, LineType lt, double linewidth, double linewidthHeavy, QColor color, double doublelineseparation)
draw a horizontal line starting at pixel position (x, y ) with length width, using linetype lt,...
virtual ~JKQTMathTextMatrixNode() override
int columns
number of columns in the matrix
Definition jkqtmathtextmatrixnode.h:142
virtual JKQTMathTextNode * replaceChild(int i, JKQTMathTextNode *newChild) override
returns the i-th child node
virtual JKQTMathTextNode * getChild(int i) override
returns the i-th child node
QVector< JKQTMathTextHorizontalAlignment > columnAlignment
alignment of the columns
Definition jkqtmathtextmatrixnode.h:131
void setChildren(const QVector< QVector< JKQTMathTextNode * > > &children)
sets the child nodes
QMap< int, LineType > horizontalLineBottomRow
lines to the bottom of each row
Definition jkqtmathtextmatrixnode.h:137
JKQTMathTextMatrixNode(JKQTMathText *parent, const QVector< QVector< JKQTMathTextNode * > > &children, const QString &columnSpec=QString())
virtual const JKQTMathTextNode * getChild(int i) const override
returns the i-th child node
int getLines() const
number of rows in the matrix
int getColumns() const
number of columns in the matrix
virtual QList< JKQTMathTextNode * > getChildren() override
returns a list of all child node
subclass representing a node in the syntax tree, that has two children
Definition jkqtmathtextnode.h:202
subclass representing one node in the syntax tree
Definition jkqtmathtextnode.h:37
#define JKQTMATHTEXT_LIB_EXPORT
Definition jkqtmathtext_imexport.h:108
describes the current drawing environment (base fontname ...)
Definition jkqtmathtexttools.h:304
describes the layout of the whole node
Definition jkqtmathtextmatrixnode.h:96
double bottomPadding
Definition jkqtmathtextmatrixnode.h:115
QVector< double > rowascent
ascents of the rows
Definition jkqtmathtextmatrixnode.h:111
QVector< QVector< double > > cellwidth
widths of the cells
Definition jkqtmathtextmatrixnode.h:101
const double & getCellwidth(int line, int col) const
Definition jkqtmathtextmatrixnode.h:105
double topPadding
Definition jkqtmathtextmatrixnode.h:114
QVector< double > colwidth
widths of the columns
Definition jkqtmathtextmatrixnode.h:99
QVector< double > rowheight
heights of the rows
Definition jkqtmathtextmatrixnode.h:109
double leftPadding
Definition jkqtmathtextmatrixnode.h:112
double & getCellwidth(int line, int col)
Definition jkqtmathtextmatrixnode.h:102
double rightPadding
Definition jkqtmathtextmatrixnode.h:113
beschreibt die Größe(n) eines Knotens
Definition jkqtmathtexttools.h:393