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 brace node More...

#include <jkqtmathtextbracenode.h>

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

Classes

struct  NodeSize
 defines the size of the node (JKQTMathTextNodeSize) and additional information
More...
 

Public Member Functions

 JKQTMathTextBraceNode (JKQTMathText *parent, JKQTMathTextBraceType openbrace, JKQTMathTextBraceType closebrace, JKQTMathTextNode *child)
 
virtual ~JKQTMathTextBraceNode () override
 
virtual double draw (QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const override
 draw the contents at the designated position
 
JKQTMathTextBraceType getClosebrace () const
 closing brace
 
JKQTMathTextBraceType getOpenbrace () const
 opening brace
 
virtual QString getTypeName () const override
 return the name of this class as a string
 
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 JKQTMathTextSingleChildNode
 JKQTMathTextSingleChildNode (JKQTMathTextNode *_child, JKQTMathText *parentMathText)
 
virtual ~JKQTMathTextSingleChildNode () override
 
JKQTMathTextNodegetChild ()
 child node of this node
 
const JKQTMathTextNodegetChild () const
 child node of this node
 
bool hasChild () const
 returns true if the child is valie (!=nullptr )
 
void replaceAndDeleteChild (JKQTMathTextNode *newChild)
 replaces the child node with the node newChild , deletes the replaced old node
 
JKQTMathTextNodereplaceChild (JKQTMathTextNode *newChild)
 replaces the child node with the node newChild , returns 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}
 

Protected Member Functions

QSizeF calcBraceSize (const QFont &fm, QPaintDevice *pd, JKQTMathTextBraceType bracetype, const JKQTMathTextNodeSize &childSize) const
 calculate the width and height of a brace, based on childSize
 
void calcBraceSizes (NodeSize &out, QPainter &painter, const JKQTMathTextEnvironment &currentEv, const JKQTMathTextNodeSize &childSize) const
 calculate the width of the braces, fills JKQTMathTextBraceNode::NodeSize::openBraceWidth/JKQTMathTextBraceNodeNodeSize::closeBraceWidth and JKQTMathTextBraceNode::NodeSize::openBraceHeight/JKQTMathTextBraceNodeNodeSize::closeBraceHeight in out, based on childSize
 
virtual JKQTMathTextNodeSize getSizeInternal (QPainter &painter, JKQTMathTextEnvironment currentEv) const override
 determine the size of the node, overwrite this function in derived classes
 
NodeSize getSizeInternalAndBrace (QPainter &painter, JKQTMathTextEnvironment currentEv) const
 
- 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

JKQTMathTextBraceType closebrace
 closing brace
 
JKQTMathTextBraceType openbrace
 opening brace
 
- Protected Attributes inherited from JKQTMathTextSingleChildNode
JKQTMathTextNodechild
 child node of this 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 brace node

This node supports the brace-types encoded by JKQTMathTextBraceType:

In addition it is possible to switch the opening and the closing braces independently on and off.

Constructor & Destructor Documentation

◆ JKQTMathTextBraceNode()

JKQTMathTextBraceNode::JKQTMathTextBraceNode ( JKQTMathText parent,
JKQTMathTextBraceType  openbrace,
JKQTMathTextBraceType  closebrace,
JKQTMathTextNode child 
)

◆ ~JKQTMathTextBraceNode()

virtual JKQTMathTextBraceNode::~JKQTMathTextBraceNode ( )
overridevirtual

Member Function Documentation

◆ calcBraceSize()

QSizeF JKQTMathTextBraceNode::calcBraceSize ( const QFont &  fm,
QPaintDevice *  pd,
JKQTMathTextBraceType  bracetype,
const JKQTMathTextNodeSize childSize 
) const
protected

calculate the width and height of a brace, based on childSize

Parameters
fmQFontMetricsF object describing the font of the current environment
bracetypebrace type
childSizesize of the child node surrounded by the node
Returns
width and hieght of the brace

◆ calcBraceSizes()

void JKQTMathTextBraceNode::calcBraceSizes ( NodeSize out,
QPainter &  painter,
const JKQTMathTextEnvironment currentEv,
const JKQTMathTextNodeSize childSize 
) const
protected

calculate the width of the braces, fills JKQTMathTextBraceNode::NodeSize::openBraceWidth/JKQTMathTextBraceNodeNodeSize::closeBraceWidth and JKQTMathTextBraceNode::NodeSize::openBraceHeight/JKQTMathTextBraceNodeNodeSize::closeBraceHeight in out, based on childSize

Parameters
[out]outthis function fills JKQTMathTextBraceNode::NodeSize::openBraceWidth/JKQTMathTextBraceNodeNodeSize::closeBraceWidth and JKQTMathTextBraceNode::NodeSize::openBraceHeight/JKQTMathTextBraceNodeNodeSize::closeBraceHeight in out
paintera QPainter used for size-calculation/drawing
currentEvfont environment
childSizesize of the child node surrounded by the node

◆ draw()

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

◆ getClosebrace()

JKQTMathTextBraceType JKQTMathTextBraceNode::getClosebrace ( ) const

closing brace

◆ getOpenbrace()

JKQTMathTextBraceType JKQTMathTextBraceNode::getOpenbrace ( ) const

opening brace

◆ getSizeInternal()

virtual JKQTMathTextNodeSize JKQTMathTextBraceNode::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
Note
This function internally calls getSizeInternalAndBrace() and returns part of its results.

Implements JKQTMathTextNode.

◆ getSizeInternalAndBrace()

NodeSize JKQTMathTextBraceNode::getSizeInternalAndBrace ( QPainter &  painter,
JKQTMathTextEnvironment  currentEv 
) const
protected

calculates the size of this node (also returned by getSizeInternal() ) and of the brace

◆ getTypeName()

virtual QString JKQTMathTextBraceNode::getTypeName ( ) const
overridevirtual

return the name of this class as a string

Reimplemented from JKQTMathTextNode.

◆ toHtml()

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

◆ closebrace

JKQTMathTextBraceType JKQTMathTextBraceNode::closebrace
protected

closing brace

◆ openbrace

JKQTMathTextBraceType JKQTMathTextBraceNode::openbrace
protected

opening brace


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