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 list of nodes in the syntax tree, layed out horizontally More...

#include <jkqtmathtexthorizontallistnode.h>

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

Public Member Functions

 JKQTMathTextHorizontalListNode (JKQTMathText *parent)
 
virtual ~JKQTMathTextHorizontalListNode () 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
 
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
 
virtual QString getTypeName () const override
 return the name of this class as a string
 
virtual void modifyEnvironment (JKQTMathTextEnvironment &currentEv) const override
 modifies the fiven JKQTMathTextEnvironment currrentEv
 
virtual JKQTMathTextNodereplaceChild (int i, JKQTMathTextNode *newChild) override
 returns the i-th child node
 
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
 
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
 
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}
 
- Public Member Functions inherited from JKQTMathTextModifyEnvironmentNodeMixIn
virtual ~JKQTMathTextModifyEnvironmentNodeMixIn ()
 

Protected Member Functions

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

QList< JKQTMathTextNode * > nodes
 list of all nodes within the line
 
- 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}
 

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
 

Detailed Description

subclass representing a list of nodes in the syntax tree, layed out horizontally

This type of node also implements typesetting sub-/superscript above/below the previous node (if JKQTMathTextNode::is() is true for that previus node. The drawing is done as defined in the following image:

In addition this node also ensures that subscripts are moved to the left for italic previous text or nodes that require such a shift (e.g. \nabla or \int ):

This is implemented using JKQTMathTextNodeSize::baselineXCorrection .

In addition this class implements execution of instructions derived from JKQTMathTextModifyEnvironmentNodeMixIn.

See also
JKQTMathTextVerticalListNode

Constructor & Destructor Documentation

◆ JKQTMathTextHorizontalListNode()

JKQTMathTextHorizontalListNode::JKQTMathTextHorizontalListNode ( JKQTMathText parent)
explicit

◆ ~JKQTMathTextHorizontalListNode()

virtual JKQTMathTextHorizontalListNode::~JKQTMathTextHorizontalListNode ( )
overridevirtual

Member Function Documentation

◆ addChild()

void JKQTMathTextHorizontalListNode::addChild ( JKQTMathTextNode n)

add a child node

◆ childCount()

virtual int JKQTMathTextHorizontalListNode::childCount ( ) const
overridevirtual

returns the number of child nodes

Implements JKQTMathTextMultiChildNode.

◆ clearChildren()

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

clear all children, deleting them if deleteChildren==true

Implements JKQTMathTextMultiChildNode.

◆ clearChildrenImpl()

void JKQTMathTextHorizontalListNode::clearChildrenImpl ( bool  deleteChildren)
private

internal implementation of clearChildren() that is non-virtual, so can be used in the destructor

◆ deleteChild()

virtual void JKQTMathTextHorizontalListNode::deleteChild ( int  i)
overridevirtual

delete the i-th child

Implements JKQTMathTextMultiChildNode.

◆ draw()

virtual double JKQTMathTextHorizontalListNode::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.

◆ getChild() [1/2]

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

returns the i-th child node

Implements JKQTMathTextMultiChildNode.

◆ getChild() [2/2]

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

returns the i-th child node

Implements JKQTMathTextMultiChildNode.

◆ getChildren()

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

returns a list of all child node

Reimplemented from JKQTMathTextMultiChildNode.

◆ getSizeInternal()

virtual JKQTMathTextNodeSize JKQTMathTextHorizontalListNode::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 JKQTMathTextHorizontalListNode::getTypeName ( ) const
overridevirtual

return the name of this class as a string

Reimplemented from JKQTMathTextNode.

◆ modifyEnvironment()

virtual void JKQTMathTextHorizontalListNode::modifyEnvironment ( JKQTMathTextEnvironment currentEv) const
overridevirtual

modifies the fiven JKQTMathTextEnvironment currrentEv

Implements JKQTMathTextModifyEnvironmentNodeMixIn.

◆ replaceChild()

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

returns the i-th child node

Implements JKQTMathTextMultiChildNode.

◆ toHtml()

virtual bool JKQTMathTextHorizontalListNode::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

◆ nodes

QList<JKQTMathTextNode*> JKQTMathTextHorizontalListNode::nodes
protected

list of all nodes within the line


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