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 decorated text m (e.g. \vec \hat ...) node More...

#include <jkqtmathtextdecoratednode.h>

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

Public Types

enum  DecorationType {
  MTDvec ,
  MTDhat ,
  MTDwidehat ,
  MTDcheck ,
  MTDwidecheck ,
  MTDbreve ,
  MTDocirc ,
  MTDdot ,
  MTDddot ,
  MTDbar ,
  MTDarrow ,
  MTDoverline ,
  MTDdoubleoverline ,
  MTDunderline ,
  MTDunderlineDashed ,
  MTDunderlineDotted ,
  MTDdoubleunderline ,
  MTDtilde ,
  MTDwidetilde ,
  MTDacute ,
  MTDgrave ,
  MTDcancel ,
  MTDbcancel ,
  MTDxcancel ,
  MTDstrike ,
  MTDoverleftarrow ,
  MTDoverrightarrow ,
  MTDoverleftrightarrow ,
  MTDunderleftarrow ,
  MTDunderrightarrow ,
  MTDunderleftrightarrow
}
 types of decoration available in a JKQTMathTextDecoratedNode More...
 

Public Member Functions

 JKQTMathTextDecoratedNode (JKQTMathText *parent, DecorationType decoration, JKQTMathTextNode *child)
 
virtual ~JKQTMathTextDecoratedNode () override
 
virtual double draw (QPainter &painter, double x, double y, JKQTMathTextEnvironment currentEv) const override
 draw the contents at the designated position
 
DecorationType getDecoration () const
 type of decoration that is added to the child node
 
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}
 

Static Public Member Functions

static QString DecorationType2String (DecorationType mode)
 convert a DecorationType into a string
 
static DecorationType InstructionName2DecorationType (const QString &mode)
 returns the FracType corresponding to instructionName
 
static bool supportsInstructionName (const QString &instructionName)
 returns true, if the given instructionName can be converted to a FracType
 
- 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
 

Static Protected Member Functions

static const QHash< QString, DecorationType > & instructions ()
 lists all supported instructions
 

Protected Attributes

DecorationType decoration
 type of decoration that is added to the child node
 
- 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}
 

Detailed Description

subclass representing a decorated text m (e.g. \vec \hat ...) node

Member Enumeration Documentation

◆ DecorationType

types of decoration available in a JKQTMathTextDecoratedNode

Enumerator
MTDvec 

vector arrow over block

MTDhat 

small hat over block

MTDwidehat 

full-width hat over block

MTDcheck 

small v over block

MTDwidecheck 

full-width v over block

MTDbreve 

small cup (breve) over block

MTDocirc 

single circle over block

MTDdot 

single dot over block

MTDddot 

double dot over block

MTDbar 

bar over block

MTDarrow 

arrow over block

MTDoverline 

overline over block

MTDdoubleoverline 

double overline over block

MTDunderline 

underline under block

MTDunderlineDashed 

dashed line under block

MTDunderlineDotted 

dotted line under block

MTDdoubleunderline 

double line under block

MTDtilde 

small tilde over block

MTDwidetilde 

full width tilde over block

MTDacute 

small acute accent over block

MTDgrave 

small grave accent over block

MTDcancel 

cancel text with sloped line

MTDbcancel 

cancel text with backward sloped line

MTDxcancel 

cancel text with X

MTDstrike 

strikethrough text

MTDoverleftarrow 

left-pointing arrow over everything text

MTDoverrightarrow 

right-pointing arrow over everything text

MTDoverleftrightarrow 

left/right-pointing arrow over everything text

MTDunderleftarrow 

left-pointing arrow under everything text

MTDunderrightarrow 

right-pointing arrow under everything text

MTDunderleftrightarrow 

left/right-pointing arrow under everything text

Constructor & Destructor Documentation

◆ JKQTMathTextDecoratedNode()

JKQTMathTextDecoratedNode::JKQTMathTextDecoratedNode ( JKQTMathText parent,
DecorationType  decoration,
JKQTMathTextNode child 
)

◆ ~JKQTMathTextDecoratedNode()

virtual JKQTMathTextDecoratedNode::~JKQTMathTextDecoratedNode ( )
overridevirtual

Member Function Documentation

◆ DecorationType2String()

static QString JKQTMathTextDecoratedNode::DecorationType2String ( DecorationType  mode)
static

convert a DecorationType into a string

◆ draw()

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

◆ getDecoration()

DecorationType JKQTMathTextDecoratedNode::getDecoration ( ) const

type of decoration that is added to the child node

◆ getSizeInternal()

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

return the name of this class as a string

Reimplemented from JKQTMathTextNode.

◆ InstructionName2DecorationType()

static DecorationType JKQTMathTextDecoratedNode::InstructionName2DecorationType ( const QString &  mode)
static

returns the FracType corresponding to instructionName

See also
JKQTMathTextFracNode::FracType

◆ instructions()

static const QHash< QString, DecorationType > & JKQTMathTextDecoratedNode::instructions ( )
staticprotected

lists all supported instructions

◆ supportsInstructionName()

static bool JKQTMathTextDecoratedNode::supportsInstructionName ( const QString &  instructionName)
static

returns true, if the given instructionName can be converted to a FracType

See also
JKQTMathTextFracNode::FracType

◆ toHtml()

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

◆ decoration

DecorationType JKQTMathTextDecoratedNode::decoration
protected

type of decoration that is added to the child node


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