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 one node in the syntax tree More...

#include <jkqtmathtextnode.h>

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

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
 
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
 
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}
 
JKQTMathTextNodeoperator= (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
 
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}
 

Detailed Description

subclass representing one node in the syntax tree

Constructor & Destructor Documentation

◆ JKQTMathTextNode() [1/2]

JKQTMathTextNode::JKQTMathTextNode ( JKQTMathText parentMathText)
explicit

◆ JKQTMathTextNode() [2/2]

JKQTMathTextNode::JKQTMathTextNode ( const JKQTMathTextNode )
delete

◆ ~JKQTMathTextNode()

virtual JKQTMathTextNode::~JKQTMathTextNode ( )
virtual

Member Function Documentation

◆ addToErrorList()

void JKQTMathTextNode::addToErrorList ( const QString &  error)
protected

adds a new error to the JKQTMathText referenced by parentMathText

See also
JKQTMathText::addToErrorList()

◆ doDrawBoxes() [1/2]

void JKQTMathTextNode::doDrawBoxes ( QPainter &  painter,
double  x,
double  y,
const JKQTMathTextNodeSize size 
) const
protected

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

Parameters
painterQPainter to use
xx-position, where the drawing starts [Pixel]
yY-position of the baseline, where the drawing starts [Pixel]
sizesize of the node, result of getSize(), see JKQTMathTextNodeSize

◆ doDrawBoxes() [2/2]

void JKQTMathTextNode::doDrawBoxes ( QPainter &  painter,
double  x,
double  y,
JKQTMathTextEnvironment  currentEv 
) const
protected

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

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
Note
This version of the function calls getSize() internally. There is a second variant that skips this call and expects the node size info as parameter. This can be used in draw() implementations that call getSize() themselves to speed up drawing.

◆ draw()

virtual double JKQTMathTextNode::draw ( QPainter &  painter,
double  x,
double  y,
JKQTMathTextEnvironment  currentEv 
) const
pure virtual

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

Implemented in JKQTMathTextBoxInstructionNode, JKQTMathTextBraceNode, JKQTMathTextDecoratedNode, JKQTMathTextFracNode, JKQTMathTextHorizontalListNode, JKQTMathTextSimpleInstructionNode, JKQTMathTextMatrixNode, JKQTMathTextModifiedTextPropsInstructionNode, JKQTMathTextBlockNode, JKQTMathTextSqrtNode, JKQTMathTextSubscriptNode, JKQTMathTextSuperscriptNode, JKQTMathTextSymbolNode, JKQTMathTextTextNode, JKQTMathTextVerbatimNode, JKQTMathTextVerticalListNode, JKQTMathTextWhitespaceNode, JKQTMathTextEmptyBoxNode, JKQTMathTextPhantomNode, and JKQTMathTextNonDrawingBaseNode.

◆ getDrawBoxes()

bool JKQTMathTextNode::getDrawBoxes ( ) const

returns the drawing of colored boxes (for DEBUGGING) around the actual output of the node is enabled

◆ getNonItalicXCorretion()

static double JKQTMathTextNode::getNonItalicXCorretion ( QPainter &  painter,
double  width_potentiallyitalic,
const JKQTMathTextEnvironment ev_potentiallyitalic,
const JKQTMathTextNode child 
)
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

◆ getParentNode() [1/2]

JKQTMathTextNode * JKQTMathTextNode::getParentNode ( )

parent node of this node (i.e. one level up, ode nullptr )

◆ getParentNode() [2/2]

const JKQTMathTextNode * JKQTMathTextNode::getParentNode ( ) const

parent node of this node (i.e. one level up, ode nullptr )

◆ getParents() [1/2]

template<class T >
QList< T * > JKQTMathTextNode::getParents ( )
inlineprotected

returns the list of parent, parent-of-parent, ... that can be cast to type T

◆ getParents() [2/2]

template<class T >
QList< const T * > JKQTMathTextNode::getParents ( ) const
inlineprotected

returns the list of parent, parent-of-parent, ... that can be cast to type T

◆ getSize()

JKQTMathTextNodeSize JKQTMathTextNode::getSize ( QPainter &  painter,
JKQTMathTextEnvironment  currentEv 
) const

determine the size of the node, calls getSizeInternal() implementation of the actual type

See also
getSizeInternal()
Parameters
painterpainter to use for determining the size
currentEvcurrent environment object
Returns
all important box size parameters packed as JKQTMathTextNodeSize

◆ getSizeInternal()

virtual JKQTMathTextNodeSize JKQTMathTextNode::getSizeInternal ( QPainter &  painter,
JKQTMathTextEnvironment  currentEv 
) const
protectedpure virtual

◆ getTypeName()

◆ isSubSuperscriptAboveBelowNode()

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

◆ operator=()

JKQTMathTextNode & JKQTMathTextNode::operator= ( const JKQTMathTextNode )
delete

◆ setDrawBoxes()

virtual void JKQTMathTextNode::setDrawBoxes ( bool  draw)
virtual

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

Reimplemented in JKQTMathTextMatrixNode, JKQTMathTextSingleChildNode, and JKQTMathTextMultiChildNode.

◆ setParentNode()

void JKQTMathTextNode::setParentNode ( JKQTMathTextNode node)

parent node of this node (i.e. one level up, ode nullptr )

◆ setSubSuperscriptAboveBelowNode()

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

◆ toHtml()

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

Member Data Documentation

◆ drawBoxes

bool JKQTMathTextNode::drawBoxes
protected

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

◆ parentMathText

JKQTMathText* JKQTMathTextNode::parentMathText
protected

parent JKQTMathText object (required for several drawing operations

◆ parentNode

JKQTMathTextNode* JKQTMathTextNode::parentNode
protected

parent node of this node (i.e. one level up, ode nullptr )

◆ subSuperscriptAboveBelowNode

bool JKQTMathTextNode::subSuperscriptAboveBelowNode
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


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