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 verbatim (plain-text) node with support for line-breaks in the syntax tree More...

#include <jkqtmathtextverbatimnode.h>

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

Classes

struct  LayoutInfo
 describes the layout of the whole node More...
 

Public Member Functions

 JKQTMathTextVerbatimNode (JKQTMathText *parent, const QString &text, bool visibleWhitespace=false, JKQTMathTextHorizontalAlignment _alignment=MTHALeft, double _linespacingFactor=1.0, JKQTMathTextVerticalOrientation _verticalOrientation=MTVOFirstLine, size_t tabSize_=4)
 
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
 
double getLineSpacingFactor () const
 spacing of the separate lines, as factor of the default line-spacing [Default: 1].
 
size_t getTabSize () const
 number of whitespaces, each tab character stands for
 
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)
 
bool getVisibleWhitespace () const
 when true, whitespaces are displayed with a visible character
 
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 JKQTMathTextTextBaseNode
 JKQTMathTextTextBaseNode (JKQTMathText *parent, const QString &text)
 
virtual ~JKQTMathTextTextBaseNode () override
 
QString getText () const
 text-contents 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
 
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}
 

Protected Member Functions

LayoutInfo calcLayout (QPainter &painter, const 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
 
virtual QString textTransform (const QString &text, const JKQTMathTextEnvironment &currentEv) const override
 transforms the text before sizing/drawing (may e.g. exchange special letters for other unicode symbols etc.)
 
virtual void transformEnvironment (JKQTMathTextEnvironment &currentEv) const
 sets all necessary settings in currentEv for drawing this node
 
- 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].
 
size_t tabSize
 number of whitespaces, each tab character stands for
 
JKQTMathTextVerticalOrientation verticalOrientation
 vertical orientation of the baseline of the whole block (with respect to the single lines)
 
bool visibleWhitespace
 when true, whitespaces are displayed with a visible character
 
- Protected Attributes inherited from JKQTMathTextTextBaseNode
QString text
 text-contents of the node
 
- 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}
 

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 verbatim (plain-text) node with support for line-breaks in the syntax tree

The layout of the lines can left-aligned, right-aligned or centered.

Constructor & Destructor Documentation

◆ JKQTMathTextVerbatimNode()

JKQTMathTextVerbatimNode::JKQTMathTextVerbatimNode ( JKQTMathText parent,
const QString &  text,
bool  visibleWhitespace = false,
JKQTMathTextHorizontalAlignment  _alignment = MTHALeft,
double  _linespacingFactor = 1.0,
JKQTMathTextVerticalOrientation  _verticalOrientation = MTVOFirstLine,
size_t  tabSize_ = 4 
)
explicit

Member Function Documentation

◆ calcLayout()

LayoutInfo JKQTMathTextVerbatimNode::calcLayout ( QPainter &  painter,
const JKQTMathTextEnvironment currentEv 
) const
protected

calclates the layout of the whole block/node

Note
This function does NOT call transformEnvironment(); it has to be called before calling this!

◆ draw()

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

◆ getAlignment()

JKQTMathTextHorizontalAlignment JKQTMathTextVerbatimNode::getAlignment ( ) const

alignment scheme used to lay out all lines

◆ getLineSpacingFactor()

double JKQTMathTextVerbatimNode::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.

◆ getSizeInternal()

virtual JKQTMathTextNodeSize JKQTMathTextVerbatimNode::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.

◆ getTabSize()

size_t JKQTMathTextVerbatimNode::getTabSize ( ) const

number of whitespaces, each tab character stands for

◆ getTypeName()

virtual QString JKQTMathTextVerbatimNode::getTypeName ( ) const
overridevirtual

return the name of this class as a string

Reimplemented from JKQTMathTextNode.

◆ getVerticalOrientation()

JKQTMathTextVerticalOrientation JKQTMathTextVerbatimNode::getVerticalOrientation ( ) const

vertical orientation of the baseline of the whole block (with respect to the single lines)

◆ getVisibleWhitespace()

bool JKQTMathTextVerbatimNode::getVisibleWhitespace ( ) const

when true, whitespaces are displayed with a visible character

◆ textTransform()

virtual QString JKQTMathTextVerbatimNode::textTransform ( const QString &  text,
const JKQTMathTextEnvironment currentEv 
) const
overrideprotectedvirtual

transforms the text before sizing/drawing (may e.g. exchange special letters for other unicode symbols etc.)

Reimplemented from JKQTMathTextTextBaseNode.

◆ toHtml()

virtual bool JKQTMathTextVerbatimNode::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 JKQTMathTextTextBaseNode.

◆ transformEnvironment()

virtual void JKQTMathTextVerbatimNode::transformEnvironment ( JKQTMathTextEnvironment currentEv) const
protectedvirtual

sets all necessary settings in currentEv for drawing this node

Member Data Documentation

◆ alignment

JKQTMathTextHorizontalAlignment JKQTMathTextVerbatimNode::alignment
protected

alignment scheme used to lay out all lines

◆ lineSpacingFactor

double JKQTMathTextVerbatimNode::lineSpacingFactor
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.

◆ tabSize

size_t JKQTMathTextVerbatimNode::tabSize
protected

number of whitespaces, each tab character stands for

◆ verticalOrientation

JKQTMathTextVerticalOrientation JKQTMathTextVerbatimNode::verticalOrientation
protected

vertical orientation of the baseline of the whole block (with respect to the single lines)

◆ visibleWhitespace

bool JKQTMathTextVerbatimNode::visibleWhitespace
protected

when true, whitespaces are displayed with a visible character


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