JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches

subclass representing a \begin{matrix} , \begin{tabular} , \begin{array} , ... node More...

#include <jkqtmathtextmatrixnode.h>

Inheritance diagram for JKQTMathTextMatrixNode:
[legend]
Collaboration diagram for JKQTMathTextMatrixNode:
[legend]

Classes

struct  LayoutInfo
 describes the layout of the whole node More...
 

Public Types

enum  LineType {
  LTnone ,
  LTline ,
  LTdoubleline ,
  LTheavyline ,
  LTdashed ,
  LTdoubleDashed ,
  LTdefault =LTnone
}
 types of lines More...
 

Public Member Functions

 JKQTMathTextMatrixNode (JKQTMathText *parent, const QString &columnSpec=QString())
 
 JKQTMathTextMatrixNode (JKQTMathText *parent, const QVector< QVector< JKQTMathTextNode * > > &children, const QString &columnSpec=QString())
 
virtual ~JKQTMathTextMatrixNode () override
 
virtual int childCount () const override
 returns the number of child nodes
 
virtual void clearChildren (bool deleteChildren=true) override
 clear all children, deleting them if deleteChildren==true
 
virtual void deleteChild (int i) override
 delete the i-th child
 
virtual double draw (QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const override
 draw the contents at the designated position
 
virtual const JKQTMathTextNodegetChild (int i) const override
 returns the i-th child node
 
virtual JKQTMathTextNodegetChild (int i) override
 returns the i-th child node
 
virtual QList< JKQTMathTextNode * > getChildren () override
 returns a list of all child node
 
QVector< QVector< JKQTMathTextNode * > > getChildrenMatrix () const
 returns the child nodes

 
int getColumns () const
 number of columns in the matrix
 
int getLines () const
 number of rows in the matrix
 
virtual QString getTypeName () const override
 return the name of this class as a string
 
virtual JKQTMathTextNodereplaceChild (int i, JKQTMathTextNode *newChild) override
 returns the i-th child node
 
void setChildren (const QVector< QVector< JKQTMathTextNode * > > &children)
 sets the child nodes

 
void setRowBottomLine (int col, LineType line)
 lines to the bottom of each row
 
void setTopLine (LineType line)
 line at the top of the table
 
virtual bool toHtml (QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) const override
 convert node to HTML and returns true on success
 
- Public Member Functions inherited from JKQTMathTextMultiChildNode
 JKQTMathTextMultiChildNode (JKQTMathText *parentMathText)
 
virtual ~JKQTMathTextMultiChildNode () override
 
virtual QList< const JKQTMathTextNode * > getChildren () const
 returns a list of all child node
 
virtual JKQTMathTextNodegetFirstChild ()
 returns the first child node
 
virtual const JKQTMathTextNodegetFirstChild () const
 returns the first child node
 
virtual JKQTMathTextNodegetLastChild ()
 returns the last child node
 
virtual const JKQTMathTextNodegetLastChild () const
 returns the last child node
 
bool hasChildren () const
 returns true if children exist
 
bool isEmpty () const
 returns true if there are no children
 
virtual void replaceAndDeleteChild (int i, JKQTMathTextNode *newChild)
 replaces the i-th child node with the node newChild , deletes the replaced old node
 
- Public Member Functions inherited from JKQTMathTextNode
 JKQTMathTextNode (const JKQTMathTextNode &)=delete
 
 JKQTMathTextNode (JKQTMathText *parentMathText)
 
virtual ~JKQTMathTextNode ()
 
bool getDrawBoxes () const
 returns the drawing of colored boxes (for DEBUGGING) around the actual output of the node is enabled
 
JKQTMathTextNodegetParentNode ()
 parent node of this node (i.e. one level up, ode nullptr )
 
const JKQTMathTextNodegetParentNode () const
 parent node of this node (i.e. one level up, ode nullptr )
 
JKQTMathTextNodeSize getSize (QPainter &painter, JKQTMathTextEnvironment currentEv) const
 determine the size of the node, calls getSizeInternal() implementation of the actual type
 
bool isSubSuperscriptAboveBelowNode () const
 if true then following sub- and/or superscripts are placed below and above the node, not besides it. This is activated when \sum\limits_{sub}^{sup} is used in LaTeX instead of simply \sum_{sub}^{sup}
 
JKQTMathTextNodeoperator= (const JKQTMathTextNode &)=delete
 
void setParentNode (JKQTMathTextNode *node)
 parent node of this node (i.e. one level up, ode nullptr )
 
void setSubSuperscriptAboveBelowNode (bool __value)
 if true then following sub- and/or superscripts are placed below and above the node, not besides it. This is activated when \sum\limits_{sub}^{sup} is used in LaTeX instead of simply \sum_{sub}^{sup}
 

Protected Member Functions

LayoutInfo calcLayout (QPainter &painter, const JKQTMathTextEnvironment &currentEv) const
 calclates the layout of the whole block/node
 
void clearChildrenImpl (bool deleteChildren)
 clear all children, deleting them if deleteChildren==true
 
virtual JKQTMathTextNodeSize getSizeInternal (QPainter &painter, JKQTMathTextEnvironment currentEv) const override
 determine the size of the node, overwrite this function in derived classes
 
void parseColumnSpec (const QString &columnspec)
 parses a column specifier
 
virtual void setDrawBoxes (bool draw) override
 enables the drawing of colored boxes (for DEBUGGING) around the actual output of the node
 
- Protected Member Functions inherited from JKQTMathTextNode
void addToErrorList (const QString &error)
 adds a new error to the JKQTMathText referenced by parentMathText
 
void doDrawBoxes (QPainter &painter, double x, double y, const JKQTMathTextNodeSize &size) const
 draws colored boxes (for DEBUGGING) around the actual output of the node
 
void doDrawBoxes (QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const
 draws colored boxes (for DEBUGGING) around the actual output of the node
 
template<class T >
QList< T * > getParents ()
 returns the list of parent, parent-of-parent, ... that can be cast to type T
 
template<class T >
QList< const T * > getParents () const
 returns the list of parent, parent-of-parent, ... that can be cast to type T
 

Static Protected Member Functions

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, width linewidth and color
 
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, width linewidth and color
 

Protected Attributes

QVector< QVector< JKQTMathTextNode * > > children
 child nodes making up the matrix, vector of rows
 
QVector< JKQTMathTextHorizontalAlignmentcolumnAlignment
 alignment of the columns
 
int columns
 number of columns in the matrix
 
QMap< int, LineTypehorizontalLineBottomRow
 lines to the bottom of each row
 
LineType horizontalLineTop
 line at the top of the table
 
int lines
 number of rows in the matrix
 
LineType verticalLineLeft
 line at the left of the table
 
QMap< int, LineTypeverticalLineRHSColumn
 lines to the right of each column
 
- Protected Attributes inherited from JKQTMathTextNode
bool drawBoxes
 enables the drawing of colored boxes (for DEBUGGING) around the actual output of the node
 
JKQTMathTextparentMathText
 parent JKQTMathText object (required for several drawing operations
 
JKQTMathTextNodeparentNode
 parent node of this node (i.e. one level up, ode nullptr )
 
bool subSuperscriptAboveBelowNode
 if true then following sub- and/or superscripts are placed below and above the node, not besides it. This is activated when \sum\limits_{sub}^{sup} is used in LaTeX instead of simply \sum_{sub}^{sup}
 

Additional Inherited Members

- Static Public Member Functions inherited from JKQTMathTextNode
static double getNonItalicXCorretion (QPainter &painter, double width_potentiallyitalic, const JKQTMathTextEnvironment &ev_potentiallyitalic, const JKQTMathTextNode *child)
 calculates the x-size-difference between the given (probably) italic (width externally calculated: width_potentiallyitalic, ev_potentiallyitalic) and the non-italic version of child
 

Detailed Description

subclass representing a \begin{matrix} , \begin{tabular} , \begin{array} , ... node

Definition of the matrix geometry

Two examples:

Member Enumeration Documentation

◆ LineType

types of lines

Enumerator
LTnone 

noline

LTline 

single line

LTdoubleline 

double line

LTheavyline 

heavier/thick line

LTdashed 

single dashed line

LTdoubleDashed 

double dashed line

LTdefault 

Constructor & Destructor Documentation

◆ JKQTMathTextMatrixNode() [1/2]

JKQTMathTextMatrixNode::JKQTMathTextMatrixNode ( JKQTMathText parent,
const QVector< QVector< JKQTMathTextNode * > > &  children,
const QString &  columnSpec = QString() 
)

◆ JKQTMathTextMatrixNode() [2/2]

JKQTMathTextMatrixNode::JKQTMathTextMatrixNode ( JKQTMathText parent,
const QString &  columnSpec = QString() 
)

◆ ~JKQTMathTextMatrixNode()

virtual JKQTMathTextMatrixNode::~JKQTMathTextMatrixNode ( )
overridevirtual

Member Function Documentation

◆ calcLayout()

LayoutInfo JKQTMathTextMatrixNode::calcLayout ( QPainter &  painter,
const JKQTMathTextEnvironment currentEv 
) const
protected

calclates the layout of the whole block/node

Note
This function does NOT call transformEnvironment(); it has to be called before calling this!

◆ childCount()

virtual int JKQTMathTextMatrixNode::childCount ( ) const
overridevirtual

returns the number of child nodes

Implements JKQTMathTextMultiChildNode.

◆ clearChildren()

virtual void JKQTMathTextMatrixNode::clearChildren ( bool  deleteChildren = true)
overridevirtual

clear all children, deleting them if deleteChildren==true

Implements JKQTMathTextMultiChildNode.

◆ clearChildrenImpl()

void JKQTMathTextMatrixNode::clearChildrenImpl ( bool  deleteChildren)
protected

clear all children, deleting them if deleteChildren==true

◆ deleteChild()

virtual void JKQTMathTextMatrixNode::deleteChild ( int  i)
overridevirtual

delete the i-th child

Implements JKQTMathTextMultiChildNode.

◆ draw()

virtual double JKQTMathTextMatrixNode::draw ( QPainter &  painter,
double  x,
double  y,
JKQTMathTextEnvironment  currentEv 
) const
overridevirtual

draw the contents at the designated position

Parameters
painterQPainter to use
xx-position, where the drawing starts [Pixel]
yY-position of the baseline, where the drawing starts [Pixel]
currentEvJKQTMathTextEnvironment object describing the current drawing environment/settings
Returns
the x position which to use for the next part of the text

Implements JKQTMathTextNode.

◆ drawHLine()

static void JKQTMathTextMatrixNode::drawHLine ( QPainter &  painter,
double  x,
double  y,
double  width,
LineType  lt,
double  linewidth,
double  linewidthHeavy,
QColor  color,
double  doublelineseparation 
)
staticprotected

draw a horizontal line starting at pixel position (x, y ) with length width, using linetype lt, width linewidth and color

◆ drawVLine()

static void JKQTMathTextMatrixNode::drawVLine ( QPainter &  painter,
double  x,
double  y,
double  height,
LineType  lt,
double  linewidth,
double  linewidthHeavy,
QColor  color,
double  doublelineseparation 
)
staticprotected

draw a vertical line starting at pixel position (x, y ) with length height, using linetype lt, width linewidth and color

◆ getChild() [1/2]

virtual const JKQTMathTextNode * JKQTMathTextMatrixNode::getChild ( int  i) const
overridevirtual

returns the i-th child node

Implements JKQTMathTextMultiChildNode.

◆ getChild() [2/2]

virtual JKQTMathTextNode * JKQTMathTextMatrixNode::getChild ( int  i)
overridevirtual

returns the i-th child node

Implements JKQTMathTextMultiChildNode.

◆ getChildren()

virtual QList< JKQTMathTextNode * > JKQTMathTextMatrixNode::getChildren ( )
overridevirtual

returns a list of all child node

Reimplemented from JKQTMathTextMultiChildNode.

◆ getChildrenMatrix()

QVector< QVector< JKQTMathTextNode * > > JKQTMathTextMatrixNode::getChildrenMatrix ( ) const

returns the child nodes

◆ getColumns()

int JKQTMathTextMatrixNode::getColumns ( ) const

number of columns in the matrix

◆ getLines()

int JKQTMathTextMatrixNode::getLines ( ) const

number of rows in the matrix

◆ getSizeInternal()

virtual JKQTMathTextNodeSize JKQTMathTextMatrixNode::getSizeInternal ( QPainter &  painter,
JKQTMathTextEnvironment  currentEv 
) const
overrideprotectedvirtual

determine the size of the node, overwrite this function in derived classes

Parameters
painterpainter to use for determining the size
currentEvcurrent environment object
Returns
all important box size parameters packed as JKQTMathTextNodeSize

Implements JKQTMathTextNode.

◆ getTypeName()

virtual QString JKQTMathTextMatrixNode::getTypeName ( ) const
overridevirtual

return the name of this class as a string

Reimplemented from JKQTMathTextNode.

◆ parseColumnSpec()

void JKQTMathTextMatrixNode::parseColumnSpec ( const QString &  columnspec)
protected

parses a column specifier

◆ replaceChild()

virtual JKQTMathTextNode * JKQTMathTextMatrixNode::replaceChild ( int  i,
JKQTMathTextNode newChild 
)
overridevirtual

returns the i-th child node

Implements JKQTMathTextMultiChildNode.

◆ setChildren()

void JKQTMathTextMatrixNode::setChildren ( const QVector< QVector< JKQTMathTextNode * > > &  children)

sets the child nodes

◆ setDrawBoxes()

virtual void JKQTMathTextMatrixNode::setDrawBoxes ( bool  draw)
overrideprotectedvirtual

enables the drawing of colored boxes (for DEBUGGING) around the actual output of the node

Reimplemented from JKQTMathTextMultiChildNode.

◆ setRowBottomLine()

void JKQTMathTextMatrixNode::setRowBottomLine ( int  col,
LineType  line 
)

lines to the bottom of each row

◆ setTopLine()

void JKQTMathTextMatrixNode::setTopLine ( LineType  line)

line at the top of the table

◆ toHtml()

virtual bool JKQTMathTextMatrixNode::toHtml ( QString &  html,
JKQTMathTextEnvironment  currentEv,
JKQTMathTextEnvironment  defaultEv 
) const
overridevirtual

convert node to HTML and returns true on success

Parameters
[out]htmlnew HTML code is APPENDED to this string
currentEvJKQTMathTextEnvironment object describing the current drawing environment/settings
defaultEvJKQTMathTextEnvironment object describing the default drawing environment/settings when starting to interpret a node tree
Returns
true on success

Reimplemented from JKQTMathTextNode.

Member Data Documentation

◆ children

QVector<QVector<JKQTMathTextNode*> > JKQTMathTextMatrixNode::children
protected

child nodes making up the matrix, vector of rows

◆ columnAlignment

QVector<JKQTMathTextHorizontalAlignment> JKQTMathTextMatrixNode::columnAlignment
protected

alignment of the columns

◆ columns

int JKQTMathTextMatrixNode::columns
protected

number of columns in the matrix

◆ horizontalLineBottomRow

QMap<int,LineType> JKQTMathTextMatrixNode::horizontalLineBottomRow
protected

lines to the bottom of each row

◆ horizontalLineTop

LineType JKQTMathTextMatrixNode::horizontalLineTop
protected

line at the top of the table

◆ lines

int JKQTMathTextMatrixNode::lines
protected

number of rows in the matrix

◆ verticalLineLeft

LineType JKQTMathTextMatrixNode::verticalLineLeft
protected

line at the left of the table

◆ verticalLineRHSColumn

QMap<int,LineType> JKQTMathTextMatrixNode::verticalLineRHSColumn
protected

lines to the right of each column


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