![]() |
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 a list of nodes in the syntax tree, layed out vertically More...
#include <jkqtmathtextverticallistnode.h>
Classes | |
| struct | LayoutInfo |
| describes the layout of the whole node More... | |
Public Member Functions | |
| JKQTMathTextVerticalListNode (JKQTMathText *parent, JKQTMathTextHorizontalAlignment _alignment=MTHACentered, double _linespacingFactor=1.0, JKQTMathTextLineSpacingMode spacingMode_=MTSMDefaultSpacing, JKQTMathTextVerticalOrientation _verticalOrientation=MTVOFirstLine) | |
| virtual | ~JKQTMathTextVerticalListNode () override |
| void | addChild (JKQTMathTextNode *n) |
| add a child node | |
| 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 | |
| JKQTMathTextHorizontalAlignment | getAlignment () const |
| alignment scheme used to lay out all lines | |
| virtual const JKQTMathTextNode * | getChild (int i) const override |
| returns the i-th child node | |
| virtual JKQTMathTextNode * | getChild (int i) override |
| returns the i-th child node | |
| virtual QList< JKQTMathTextNode * > | getChildren () override |
| returns a list of all child node | |
| double | getLineSpacingFactor () const |
| spacing of the separate lines, as factor of the default line-spacing [Default: 1]. | |
| JKQTMathTextLineSpacingMode | getSpacingMode () const |
| defines how the layout algorithm (see calcLayout() ) lays out the single lines | |
| virtual QString | getTypeName () const override |
| return the name of this class as a string | |
| JKQTMathTextVerticalOrientation | getVerticalOrientation () const |
| vertical orientation of the baseline of the whole block (with respect to the single lines) | |
| virtual JKQTMathTextNode * | replaceChild (int i, JKQTMathTextNode *newChild) override |
| returns the i-th child node | |
| void | setAlignment (JKQTMathTextHorizontalAlignment value) |
| alignment scheme used to lay out all lines | |
| void | setLineSpacingFactor (double value) |
| spacing of the separate lines, as factor of the default line-spacing [Default: 1]. | |
| void | setSpacingMode (JKQTMathTextLineSpacingMode value) |
| defines how the layout algorithm (see calcLayout() ) lays out the single lines | |
| void | setVerticalOrientation (JKQTMathTextVerticalOrientation value) |
| vertical orientation of the baseline of the whole block (with respect to the single lines) | |
| 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 JKQTMathTextNode * | getFirstChild () |
| returns the first child node | |
| virtual const JKQTMathTextNode * | getFirstChild () const |
| returns the first child node | |
| virtual JKQTMathTextNode * | getLastChild () |
| returns the last child node | |
| virtual const JKQTMathTextNode * | getLastChild () 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 | |
| virtual void | setDrawBoxes (bool draw) override |
| enables the drawing of colored boxes (for DEBUGGING) around the actual output of the 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 | |
| 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 | |
| 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 |
| 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, JKQTMathTextEnvironment currentEv) const |
| calclates the layout of the whole block/node | |
| virtual JKQTMathTextNodeSize | getSizeInternal (QPainter &painter, JKQTMathTextEnvironment currentEv) const override |
| determine the size of the node, overwrite this function in derived classes | |
| 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 | |
Protected Attributes | |
| JKQTMathTextHorizontalAlignment | alignment |
| alignment scheme used to lay out all lines | |
| double | lineSpacingFactor |
| spacing of the separate lines, as factor of the default line-spacing [Default: 1]. | |
| QList< JKQTMathTextNode * > | nodes |
| list of child nodes, each representing one line | |
| JKQTMathTextLineSpacingMode | spacingMode |
| defines how the layout algorithm (see calcLayout() ) lays out the single lines | |
| JKQTMathTextVerticalOrientation | verticalOrientation |
| vertical orientation of the baseline of the whole block (with respect to the single lines) | |
| Protected Attributes inherited from JKQTMathTextNode | |
| 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} | |
Private Member Functions | |
| void | clearChildrenImpl (bool deleteChildren) |
| internal implementation of clearChildren() that is non-virtual, so can be used in the destructor | |
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 | |
subclass representing a list of nodes in the syntax tree, layed out vertically
Each child can be thought of as a line, so this node represents a list of lines. The layout of the lines can left-aligned, right-aligned or centered.
|
explicit |
|
overridevirtual |
| void JKQTMathTextVerticalListNode::addChild | ( | JKQTMathTextNode * | n | ) |
add a child node
|
protected |
calclates the layout of the whole block/node
|
overridevirtual |
returns the number of child nodes
Implements JKQTMathTextMultiChildNode.
|
overridevirtual |
clear all children, deleting them if deleteChildren==true
Implements JKQTMathTextMultiChildNode.
|
private |
internal implementation of clearChildren() that is non-virtual, so can be used in the destructor
|
overridevirtual |
delete the i-th child
Implements JKQTMathTextMultiChildNode.
|
overridevirtual |
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 |
Implements JKQTMathTextNode.
| JKQTMathTextHorizontalAlignment JKQTMathTextVerticalListNode::getAlignment | ( | ) | const |
alignment scheme used to lay out all lines
|
overridevirtual |
returns the i-th child node
Implements JKQTMathTextMultiChildNode.
|
overridevirtual |
returns the i-th child node
Implements JKQTMathTextMultiChildNode.
|
overridevirtual |
returns a list of all child node
Reimplemented from JKQTMathTextMultiChildNode.
| double JKQTMathTextVerticalListNode::getLineSpacingFactor | ( | ) | const |
spacing of the separate lines, as factor of the default line-spacing [Default: 1].
This property can be used to move the lines closer together or farther apart.
|
overrideprotectedvirtual |
determine the size of the node, overwrite this function in derived classes
| painter | painter to use for determining the size |
| currentEv | current environment object |
Implements JKQTMathTextNode.
| JKQTMathTextLineSpacingMode JKQTMathTextVerticalListNode::getSpacingMode | ( | ) | const |
defines how the layout algorithm (see calcLayout() ) lays out the single lines
|
overridevirtual |
return the name of this class as a string
Reimplemented from JKQTMathTextNode.
| JKQTMathTextVerticalOrientation JKQTMathTextVerticalListNode::getVerticalOrientation | ( | ) | const |
vertical orientation of the baseline of the whole block (with respect to the single lines)
|
overridevirtual |
returns the i-th child node
Implements JKQTMathTextMultiChildNode.
| void JKQTMathTextVerticalListNode::setAlignment | ( | JKQTMathTextHorizontalAlignment | value | ) |
alignment scheme used to lay out all lines
| void JKQTMathTextVerticalListNode::setLineSpacingFactor | ( | double | value | ) |
spacing of the separate lines, as factor of the default line-spacing [Default: 1].
This property can be used to move the lines closer together or farther apart.
| void JKQTMathTextVerticalListNode::setSpacingMode | ( | JKQTMathTextLineSpacingMode | value | ) |
defines how the layout algorithm (see calcLayout() ) lays out the single lines
| void JKQTMathTextVerticalListNode::setVerticalOrientation | ( | JKQTMathTextVerticalOrientation | value | ) |
vertical orientation of the baseline of the whole block (with respect to the single lines)
|
overridevirtual |
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 from JKQTMathTextNode.
|
protected |
alignment scheme used to lay out all lines
|
protected |
spacing of the separate lines, as factor of the default line-spacing [Default: 1].
This property can be used to move the lines closer together or farther apart.
|
protected |
list of child nodes, each representing one line
|
protected |
defines how the layout algorithm (see calcLayout() ) lays out the single lines
|
protected |
vertical orientation of the baseline of the whole block (with respect to the single lines)