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
|
subclass representing one node in the syntax tree More...
#include <jkqtmathtextnode.h>
Public Member Functions | |
JKQTMathTextNode (const JKQTMathTextNode &)=delete | |
JKQTMathTextNode (JKQTMathText *parentMathText) | |
virtual | ~JKQTMathTextNode () |
virtual double | draw (QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const =0 |
draw the contents at the designated position | |
bool | getDrawBoxes () const |
returns the drawing of colored boxes (for DEBUGGING) around the actual output of the node is enabled | |
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 ) | |
JKQTMathTextNodeSize | getSize (QPainter &painter, JKQTMathTextEnvironment currentEv) const |
determine the size of the node, calls getSizeInternal() implementation of the actual type | |
virtual QString | getTypeName () const |
return the name of this class as a string | |
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} | |
JKQTMathTextNode & | operator= (const JKQTMathTextNode &)=delete |
virtual void | setDrawBoxes (bool draw) |
enables the drawing of colored boxes (for DEBUGGING) around the actual output of the node | |
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} | |
virtual bool | toHtml (QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) const |
convert node to HTML and returns true on success | |
Static Public Member Functions | |
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 | |
Protected Member Functions | |
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 | |
virtual JKQTMathTextNodeSize | getSizeInternal (QPainter &painter, JKQTMathTextEnvironment currentEv) const =0 |
determine the size of the node, overwrite this function in derived classes | |
Protected Attributes | |
bool | drawBoxes |
enables the drawing of colored boxes (for DEBUGGING) around the actual output of the node | |
JKQTMathText * | parentMathText |
parent JKQTMathText object (required for several drawing operations | |
JKQTMathTextNode * | parentNode |
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} | |
subclass representing one node in the syntax tree
|
explicit |
|
delete |
|
virtual |
|
protected |
adds a new error to the JKQTMathText referenced by parentMathText
|
protected |
draws colored boxes (for DEBUGGING) around the actual output of the node
painter | QPainter to use |
x | x-position, where the drawing starts [Pixel] |
y | Y-position of the baseline, where the drawing starts [Pixel] |
size | size of the node, result of getSize(), see JKQTMathTextNodeSize |
|
protected |
draws colored boxes (for DEBUGGING) around the actual output of the node
painter | QPainter to use |
x | x-position, where the drawing starts [Pixel] |
y | Y-position of the baseline, where the drawing starts [Pixel] |
currentEv | JKQTMathTextEnvironment object describing the current drawing environment/settings |
|
pure virtual |
draw the contents at the designated position
painter | QPainter to use |
x | x-position, where the drawing starts [Pixel] |
y | Y-position of the baseline, where the drawing starts [Pixel] |
currentEv | JKQTMathTextEnvironment object describing the current drawing environment/settings |
Implemented in JKQTMathTextBoxInstructionNode, JKQTMathTextBraceNode, JKQTMathTextDecoratedNode, JKQTMathTextFracNode, JKQTMathTextHorizontalListNode, JKQTMathTextSimpleInstructionNode, JKQTMathTextMatrixNode, JKQTMathTextModifiedTextPropsInstructionNode, JKQTMathTextBlockNode, JKQTMathTextSqrtNode, JKQTMathTextSubscriptNode, JKQTMathTextSuperscriptNode, JKQTMathTextSymbolNode, JKQTMathTextTextNode, JKQTMathTextVerbatimNode, JKQTMathTextVerticalListNode, JKQTMathTextWhitespaceNode, JKQTMathTextEmptyBoxNode, JKQTMathTextPhantomNode, and JKQTMathTextNonDrawingBaseNode.
bool JKQTMathTextNode::getDrawBoxes | ( | ) | const |
returns the drawing of colored boxes (for DEBUGGING) around the actual output of the node is enabled
|
static |
calculates the x-size-difference between the given (probably) italic (width externally calculated: width_potentiallyitalic, ev_potentiallyitalic) and the non-italic version of child
JKQTMathTextNode * JKQTMathTextNode::getParentNode | ( | ) |
parent node of this node (i.e. one level up, ode nullptr
)
const JKQTMathTextNode * JKQTMathTextNode::getParentNode | ( | ) | const |
parent node of this node (i.e. one level up, ode nullptr
)
|
inlineprotected |
returns the list of parent, parent-of-parent, ... that can be cast to type T
|
inlineprotected |
returns the list of parent, parent-of-parent, ... that can be cast to type T
JKQTMathTextNodeSize JKQTMathTextNode::getSize | ( | QPainter & | painter, |
JKQTMathTextEnvironment | currentEv | ||
) | const |
determine the size of the node, calls getSizeInternal() implementation of the actual type
painter | painter to use for determining the size |
currentEv | current environment object |
|
protectedpure virtual |
determine the size of the node, overwrite this function in derived classes
painter | painter to use for determining the size |
currentEv | current environment object |
Implemented in JKQTMathTextBoxInstructionNode, JKQTMathTextBraceNode, JKQTMathTextDecoratedNode, JKQTMathTextFracNode, JKQTMathTextHorizontalListNode, JKQTMathTextSimpleInstructionNode, JKQTMathTextMatrixNode, JKQTMathTextModifiedTextPropsInstructionNode, JKQTMathTextBlockNode, JKQTMathTextSqrtNode, JKQTMathTextSubscriptNode, JKQTMathTextSuperscriptNode, JKQTMathTextSymbolNode, JKQTMathTextTextNode, JKQTMathTextVerbatimNode, JKQTMathTextVerticalListNode, JKQTMathTextWhitespaceNode, JKQTMathTextEmptyBoxNode, JKQTMathTextPhantomNode, and JKQTMathTextNonDrawingBaseNode.
|
virtual |
return the name of this class as a string
Reimplemented in JKQTMathTextBoxInstructionNode, JKQTMathTextBraceNode, JKQTMathTextDecoratedNode, JKQTMathTextFracNode, JKQTMathTextHorizontalListNode, JKQTMathTextSimpleInstructionNode, JKQTMathTextMatrixNode, JKQTMathTextModifiedTextPropsInstructionNode, JKQTMathTextModifiedEnvironmentInstructionNode, JKQTMathTextNoopNode, JKQTMathTextBlockNode, JKQTMathTextSqrtNode, JKQTMathTextSubscriptNode, JKQTMathTextSuperscriptNode, JKQTMathTextSymbolNode, JKQTMathTextTextNode, JKQTMathTextVerbatimNode, JKQTMathTextVerticalListNode, JKQTMathTextWhitespaceNode, JKQTMathTextEmptyBoxNode, and JKQTMathTextPhantomNode.
bool JKQTMathTextNode::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}
The default is c false
|
delete |
|
virtual |
enables the drawing of colored boxes (for DEBUGGING) around the actual output of the node
Reimplemented in JKQTMathTextMatrixNode, JKQTMathTextSingleChildNode, and JKQTMathTextMultiChildNode.
void JKQTMathTextNode::setParentNode | ( | JKQTMathTextNode * | node | ) |
parent node of this node (i.e. one level up, ode nullptr
)
void JKQTMathTextNode::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}
The default is c false
|
virtual |
convert node to HTML and returns true
on success
[out] | html | new HTML code is APPENDED to this string |
currentEv | JKQTMathTextEnvironment object describing the current drawing environment/settings | |
defaultEv | JKQTMathTextEnvironment object describing the default drawing environment/settings when starting to interpret a node tree |
true
on success Reimplemented in JKQTMathTextBoxInstructionNode, JKQTMathTextBraceNode, JKQTMathTextDecoratedNode, JKQTMathTextFracNode, JKQTMathTextHorizontalListNode, JKQTMathTextSimpleInstructionNode, JKQTMathTextMatrixNode, JKQTMathTextModifiedTextPropsInstructionNode, JKQTMathTextBlockNode, JKQTMathTextSqrtNode, JKQTMathTextSubscriptNode, JKQTMathTextSuperscriptNode, JKQTMathTextSymbolNode, JKQTMathTextTextBaseNode, JKQTMathTextVerbatimNode, JKQTMathTextVerticalListNode, JKQTMathTextWhitespaceNode, JKQTMathTextEmptyBoxNode, JKQTMathTextPhantomNode, and JKQTMathTextNonDrawingBaseNode.
|
protected |
enables the drawing of colored boxes (for DEBUGGING) around the actual output of the node
|
protected |
parent JKQTMathText object (required for several drawing operations
|
protected |
parent node of this node (i.e. one level up, ode nullptr
)
|
protected |
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}
The default is c false