QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | List of all members
Qwt3D::Label Class Reference

A Qt string or an output device dependent string. More...

#include <qwt3d_label.h>

Inheritance diagram for Qwt3D::Label:
Qwt3D::Drawable

Classes

class  PrivateData
 

Public Member Functions

 Label (const Label &other)
 Default constructor.
 
 Label (Label &&other) noexcept
 
Labeloperator= (const Label &other)
 Copy assignment operator.
 
Labeloperator= (Label &&other) noexcept
 Move assignment operator.
 
 Label (const QString &family, int pointSize, int weight=QFont::Normal, bool italic=false)
 
void setFont (QString const &family, int pointSize, int weight=QFont::Normal, bool italic=false)
 Sets the label font.
 
void adjust (int gap)
 Adds an additional shift to the anchor point.
 
double gap () const
 
void setPosition (Qwt3D::Triple pos, ANCHOR a=BottomLeft)
 Sets the label position and anchor point.
 
void setRelPosition (Tuple rpos, ANCHOR a)
 Sets the label position relative to the viewport.
 
Qwt3D::Triple first () const
 
Qwt3D::Triple second () const
 
ANCHOR anchor () const
 
virtual void setColor (double r, double g, double b, double a=1) override
 Sets the label color from RGBA components.
 
virtual void setColor (Qwt3D::RGBA rgba) override
 Sets the label color from an RGBA object.
 
void setString (QString const &s)
 Sets the label text string.
 
virtual void draw () override
 Draws the label.
 
- Public Member Functions inherited from Qwt3D::Drawable
virtual void saveGLState ()
 
virtual void restoreGLState ()
 
void attach (Drawable *)
 
void detach (Drawable *)
 
void detachAll ()
 
Qwt3D::Triple relativePosition (Qwt3D::Triple rel)
 Calculates world coordinates from relative viewport position.
 

Static Public Member Functions

static void useDeviceFonts (bool val)
 Enables or disables device font rendering for all labels.
 

Additional Inherited Members

- Protected Member Functions inherited from Qwt3D::Drawable
void Enable (GLenum what, GLboolean val)
 
Qwt3D::Triple ViewPort2World (Qwt3D::Triple win, bool *err=nullptr)
 Converts viewport coordinates to world coordinates (glUnProject)
 
Qwt3D::Triple World2ViewPort (Qwt3D::Triple obj, bool *err=nullptr)
 Converts world coordinates to viewport coordinates (glProject)
 
 Drawable (Drawable &&other) noexcept
 
Drawableoperator= (Drawable &&other) noexcept
 
- Protected Attributes inherited from Qwt3D::Drawable
Qwt3D::RGBA color
 
GLdouble modelMatrix [16]
 
GLdouble projMatrix [16]
 
GLint viewport [4]
 

Detailed Description

A Qt string or an output device dependent string.

Label provides text rendering on 3D plots, supporting both Qt string representation and device-dependent string output.

Constructor & Destructor Documentation

◆ Label()

Label::Label ( const Label other)

Default constructor.

Constructs a Label with specified font parameters

Parameters
familyFont family name
pointSizeFont point size
weightFont weight
italicWhether font is italic

Destructor

Copy constructor

Move constructor

Member Function Documentation

◆ adjust()

void Label::adjust ( int  gap)

Adds an additional shift to the anchor point.

Parameters
gapGap value in pixels

The shift direction depends on the anchor type: left aligned -->, right aligned <–, top aligned top-down, bottom aligned bottom-up. The unit is user space dependent (one pixel on screen - play around to get satisfying results).

◆ draw()

void Label::draw ( )
overridevirtual

Draws the label.

Reimplemented from Qwt3D::Drawable.

◆ setColor() [1/2]

void Label::setColor ( double  r,
double  g,
double  b,
double  a = 1 
)
overridevirtual

Sets the label color from RGBA components.

Parameters
rRed component
gGreen component
bBlue component
aAlpha component

Reimplemented from Qwt3D::Drawable.

◆ setColor() [2/2]

void Label::setColor ( Qwt3D::RGBA  rgba)
overridevirtual

Sets the label color from an RGBA object.

Parameters
rgbaRGBA color value

Reimplemented from Qwt3D::Drawable.

◆ setFont()

void Label::setFont ( QString const &  family,
int  pointSize,
int  weight = QFont::Normal,
bool  italic = false 
)

Sets the label font.

Parameters
familyFont family name
pointSizeFont point size
weightFont weight
italicWhether font is italic

◆ setPosition()

void Label::setPosition ( Qwt3D::Triple  pos,
ANCHOR  a = BottomLeft 
)

Sets the label position and anchor point.

Parameters
posPosition triple in world coordinates
aAnchor type defining how the label aligns relative to pos

Anchor example: TopCenter (*) resp. BottomRight (X): +-—*-—+ | Pixmap | +------—X

◆ setRelPosition()

void Label::setRelPosition ( Tuple  rpos,
ANCHOR  a 
)

Sets the label position relative to the viewport.

Parameters
rposRelative position tuple (x,y)
aAnchor type defining how the label aligns

◆ setString()

void Label::setString ( QString const &  s)

Sets the label text string.

Parameters
sText string to display

◆ useDeviceFonts()

void Label::useDeviceFonts ( bool  val)
static

Enables or disables device font rendering for all labels.

Parameters
valTrue to use device fonts, false to use Qt-based rendering

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