24#ifndef JKQTMATHTEXTNODE_H
25#define JKQTMATHTEXTNODE_H
26#include "jkqtmathtext/jkqtmathtext_imexport.h"
27#include "jkqtmathtext/jkqtmathtexttools.h"
139 T* pT=
dynamic_cast<T*
>(p);
141 if (pT!=
nullptr) lst.append(pT);
143 pT=
dynamic_cast<T*
>(p);
153 const T* pT=
dynamic_cast<const T*
>(p);
155 if (pT!=
nullptr) lst.append(pT);
157 pT=
dynamic_cast<const T*
>(p);
subclass representing a node in the syntax tree, that has two children
Definition jkqtmathtextnode.h:251
JKQTMathTextNode * getChild1()
first child node of this node
virtual void clearChildren(bool deleteChildren=true) override
returns the i-th child node
virtual void deleteChild(int i) override
delete the i-th child
const JKQTMathTextNode * getChild2() const
second child node of this node
virtual JKQTMathTextNode * replaceChild(int i, JKQTMathTextNode *newChild) override
returns the i-th child node
JKQTMathTextNode * getChild2()
second child node of this node
virtual const JKQTMathTextNode * getChild(int i) const override
returns the i-th child node
JKQTMathTextNode * child2
second child node of this node
Definition jkqtmathtextnode.h:284
JKQTMathTextDualChildNode(JKQTMathTextNode *_child1, JKQTMathTextNode *_child2, JKQTMathText *parentMathText)
JKQTMathTextNode * child1
first child node of this node
Definition jkqtmathtextnode.h:282
const JKQTMathTextNode * getChild1() const
first child node of this node
virtual ~JKQTMathTextDualChildNode() override
virtual int childCount() const override
returns the i-th child node
virtual JKQTMathTextNode * getChild(int i) override
returns the i-th child node
this class parses a mathematical markup string and can then draw the contained text/equation onto a Q...
Definition jkqtmathtext.h:192
mixin extending a node that does not produce any output, but provides a function modifyEnvironment() ...
Definition jkqtmathtextnode.h:322
virtual void modifyEnvironment(JKQTMathTextEnvironment ¤tEv) const =0
modifies the fiven JKQTMathTextEnvironment currrentEv
virtual ~JKQTMathTextModifyEnvironmentNodeMixIn()
Definition jkqtmathtextnode.h:324
subclass representing a node in the syntax tree, that has two children
Definition jkqtmathtextnode.h:202
virtual void setDrawBoxes(bool draw) override
enables the drawing of colored boxes (for DEBUGGING) around the actual output of the node
virtual const JKQTMathTextNode * getLastChild() const
returns the last child node
bool hasChildren() const
returns true if children exist
virtual ~JKQTMathTextMultiChildNode() override
virtual JKQTMathTextNode * replaceChild(int i, JKQTMathTextNode *newChild)=0
replaces the i-th child node with the node newChild , returns the replaced old node
virtual QList< const JKQTMathTextNode * > getChildren() const
returns a list of all child node
virtual int childCount() const =0
returns the number of child nodes
virtual JKQTMathTextNode * getChild(int i)=0
returns the i-th child node
virtual const JKQTMathTextNode * getFirstChild() const
returns the first child node
virtual const JKQTMathTextNode * getChild(int i) const =0
returns the i-th child node
virtual JKQTMathTextNode * getLastChild()
returns the last child node
JKQTMathTextMultiChildNode(JKQTMathText *parentMathText)
virtual void deleteChild(int i)=0
delete the i-th child
virtual void replaceAndDeleteChild(int i, JKQTMathTextNode *newChild)
replaces the i-th child node with the node newChild , deletes the replaced old node
bool isEmpty() const
returns true if there are no children
virtual QList< JKQTMathTextNode * > getChildren()
returns a list of all child node
virtual void clearChildren(bool deleteChildren=true)=0
clear all children, deleting them if deleteChildren==true
virtual JKQTMathTextNode * getFirstChild()
returns the first child node
subclass representing one node in the syntax tree
Definition jkqtmathtextnode.h:37
virtual JKQTMathTextNodeSize getSizeInternal(QPainter &painter, JKQTMathTextEnvironment currentEv) const =0
determine the size of the node, overwrite this function in derived classes
JKQTMathTextNode(JKQTMathText *parentMathText)
QList< const T * > getParents() const
returns the list of parent, parent-of-parent, ... that can be cast to type T
Definition jkqtmathtextnode.h:150
JKQTMathTextNode(const JKQTMathTextNode &)=delete
void doDrawBoxes(QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const
draws colored boxes (for DEBUGGING) around the actual output of the node
virtual void setDrawBoxes(bool draw)
enables the drawing of colored boxes (for DEBUGGING) around the actual output of the node
JKQTMathTextNode & operator=(const JKQTMathTextNode &)=delete
JKQTMathText * parentMathText
parent JKQTMathText object (required for several drawing operations
Definition jkqtmathtextnode.h:101
virtual bool toHtml(QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) const
convert node to HTML and returns true on success
virtual QString getTypeName() const
return the name of this class as a string
JKQTMathTextNode * parentNode
parent node of this node (i.e. one level up, ode nullptr )
Definition jkqtmathtextnode.h:103
virtual double draw(QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const =0
draw the contents at the designated position
bool drawBoxes
enables the drawing of colored boxes (for DEBUGGING) around the actual output of the node
Definition jkqtmathtextnode.h:105
void addToErrorList(const QString &error)
adds a new error to the JKQTMathText referenced by parentMathText
bool getDrawBoxes() const
returns the drawing of colored boxes (for DEBUGGING) around the actual output of the node is enabled
bool isSubSuperscriptAboveBelowNode() const
if true then following sub- and/or superscripts are placed below and above the node,...
void doDrawBoxes(QPainter &painter, double x, double y, const JKQTMathTextNodeSize &size) const
draws colored boxes (for DEBUGGING) around the actual output of the node
JKQTMathTextNode * getParentNode()
parent node of this node (i.e. one level up, ode nullptr )
const JKQTMathTextNode * getParentNode() const
parent node of this node (i.e. one level up, ode nullptr )
QList< T * > getParents()
returns the list of parent, parent-of-parent, ... that can be cast to type T
Definition jkqtmathtextnode.h:136
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: wi...
virtual ~JKQTMathTextNode()
void setParentNode(JKQTMathTextNode *node)
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
void setSubSuperscriptAboveBelowNode(bool __value)
if true then following sub- and/or superscripts are placed below and above the node,...
bool subSuperscriptAboveBelowNode
if true then following sub- and/or superscripts are placed below and above the node,...
Definition jkqtmathtextnode.h:111
base class for all derived classes that do not draw anything
Definition jkqtmathtextnode.h:296
virtual double draw(QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const override final
draw the contents at the designated position
JKQTMathTextNonDrawingBaseNode(JKQTMathText *parent)
virtual JKQTMathTextNodeSize getSizeInternal(QPainter &painter, JKQTMathTextEnvironment currentEv) const override final
determine the size of the node, overwrite this function in derived classes
virtual ~JKQTMathTextNonDrawingBaseNode() override
virtual bool toHtml(QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) const override final
convert node to HTML and returns true on success
subclass representing a node in the syntax tree, that has one child
Definition jkqtmathtextnode.h:174
void replaceAndDeleteChild(JKQTMathTextNode *newChild)
replaces the child node with the node newChild , deletes the replaced old node
const JKQTMathTextNode * getChild() const
child node of this node
JKQTMathTextSingleChildNode(JKQTMathTextNode *_child, JKQTMathText *parentMathText)
JKQTMathTextNode * getChild()
child node of this node
JKQTMathTextNode * replaceChild(JKQTMathTextNode *newChild)
replaces the child node with the node newChild , returns the replaced old node
virtual ~JKQTMathTextSingleChildNode() override
bool hasChild() const
returns true if the child is valie (!=nullptr )
JKQTMathTextNode * child
child node of this node
Definition jkqtmathtextnode.h:196
virtual void setDrawBoxes(bool draw) override
enables the drawing of colored boxes (for DEBUGGING) around the actual output of the node
#define JKQTMATHTEXT_LIB_EXPORT
Definition jkqtmathtext_imexport.h:108
describes the current drawing environment (base fontname ...)
Definition jkqtmathtexttools.h:304
beschreibt die Größe(n) eines Knotens
Definition jkqtmathtexttools.h:393