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 an empty bbox with defined width/height in the syntax tree More...

#include <jkqtmathtextwhitespacenode.h>

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

Public Types

enum  Units {
  EBUem ,
  EBUex
}
 

Public Member Functions

 JKQTMathTextEmptyBoxNode (JKQTMathText *parent, double width_, Units widthUnit_, double height_, Units heightUnit_)
 constructs a node
 
virtual ~JKQTMathTextEmptyBoxNode () override
 
virtual double draw (QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const override
 draw the contents at the designated position
 
double getHeight () const
 height of the (empty) box, units of this value defined in heightUnit
 
Units getHeightUnit () const
 units to interpret height
 
virtual QString getTypeName () const override
 return the name of this class as a string
 
double getWidth () const
 width of the (empty) box, units of this value defined in widthUnit
 
Units getWidthUnit () const
 units to interpret width
 
virtual bool toHtml (QString &html, JKQTMathTextEnvironment currentEv, JKQTMathTextEnvironment defaultEv) const override
 convert node to HTML and returns true on success
 
double Units2PixelWidth (double value, Units unit, JKQTMathTextEnvironment currentEv, QPaintDevice *pd) const
 converts Types type into its width in pixels, based on currentEv and pd
 
- 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}
 

Static Public Member Functions

static Units String2Units (QString type)
 converts Types type into a string
 
static QString Units2String (Units type)
 converts Types type into a string
 
- 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
 

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

double height
 height of the (empty) box, units of this value defined in heightUnit
 
Units heightUnit
 units to interpret height
 
double width
 width of the (empty) box, units of this value defined in widthUnit
 
Units widthUnit
 units to interpret width
 
- 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}
 

Detailed Description

subclass representing an empty bbox with defined width/height in the syntax tree

Member Enumeration Documentation

◆ Units

Enumerator
EBUem 

1em = width('M')

EBUex 

1ex = xHeight

Constructor & Destructor Documentation

◆ JKQTMathTextEmptyBoxNode()

JKQTMathTextEmptyBoxNode::JKQTMathTextEmptyBoxNode ( JKQTMathText parent,
double  width_,
Units  widthUnit_,
double  height_,
Units  heightUnit_ 
)
explicit

constructs a node

◆ ~JKQTMathTextEmptyBoxNode()

virtual JKQTMathTextEmptyBoxNode::~JKQTMathTextEmptyBoxNode ( )
overridevirtual

Member Function Documentation

◆ draw()

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

◆ getHeight()

double JKQTMathTextEmptyBoxNode::getHeight ( ) const

height of the (empty) box, units of this value defined in heightUnit

◆ getHeightUnit()

Units JKQTMathTextEmptyBoxNode::getHeightUnit ( ) const

units to interpret height

◆ getSizeInternal()

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

return the name of this class as a string

Reimplemented from JKQTMathTextNode.

◆ getWidth()

double JKQTMathTextEmptyBoxNode::getWidth ( ) const

width of the (empty) box, units of this value defined in widthUnit

◆ getWidthUnit()

Units JKQTMathTextEmptyBoxNode::getWidthUnit ( ) const

units to interpret width

◆ String2Units()

static Units JKQTMathTextEmptyBoxNode::String2Units ( QString  type)
static

converts Types type into a string

◆ toHtml()

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

◆ Units2PixelWidth()

double JKQTMathTextEmptyBoxNode::Units2PixelWidth ( double  value,
Units  unit,
JKQTMathTextEnvironment  currentEv,
QPaintDevice *  pd 
) const

converts Types type into its width in pixels, based on currentEv and pd

◆ Units2String()

static QString JKQTMathTextEmptyBoxNode::Units2String ( Units  type)
static

converts Types type into a string

Member Data Documentation

◆ height

double JKQTMathTextEmptyBoxNode::height
protected

height of the (empty) box, units of this value defined in heightUnit

◆ heightUnit

Units JKQTMathTextEmptyBoxNode::heightUnit
protected

units to interpret height

◆ width

double JKQTMathTextEmptyBoxNode::width
protected

width of the (empty) box, units of this value defined in widthUnit

◆ widthUnit

Units JKQTMathTextEmptyBoxNode::widthUnit
protected

units to interpret width


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