Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGLText Class Reference

GL Text.

To draw a 3D text in a GL window. This class uses uses FTGL to render text. FTGL is a package making the interface between the Free Type fonts and GL.

Definition at line 19 of file TGLText.h.

Public Member Functions

 TGLText ()
 
 TGLText (Double_t x, Double_t y, Double_t z, const char *text)
 TGLext normal constructor.
 
 ~TGLText () override
 
void BBox (const char *string, float &llx, float &lly, float &llz, float &urx, float &ury, float &urz)
 Calculate bounding-box for given string.
 
void Copy (TAttText &atttext) const
 Copy this text attributes to a new TAttText.
 
FTFontGetFont ()
 
virtual Short_t GetTextAlign () const
 Return the text alignment.
 
virtual Float_t GetTextAngle () const
 Return the text angle.
 
virtual Color_t GetTextColor () const
 Return the text color.
 
virtual Font_t GetTextFont () const
 Return the text font.
 
virtual Float_t GetTextSize () const
 Return the text size.
 
virtual Float_t GetTextSizePercent (Float_t size)
 Return the text in percent of the pad size.
 
virtual Float_t GetTextSizePixels (TVirtualPad &pad) const
 Return the text size in pixels for specified pad.
 
virtual Float_t GetTextSizeRelative (TVirtualPad &pad) const
 Return the text size in relative units.
 
TClassIsA () const override
 
virtual void Modify ()
 Change current text attributes if necessary.
 
virtual void ModifyOn (TVirtualPad &pad)
 Change current text attributes if necessary on specified pad.
 
void PaintBBox (const char *text)
 
void PaintGLText (Double_t x, Double_t y, Double_t z, const char *text)
 Draw text.
 
virtual void ResetAttText (Option_t *toption="")
 Reset this text attributes to default values.
 
virtual void SaveTextAttributes (std::ostream &out, const char *name, Int_t alidef=12, Float_t angdef=0, Int_t coldef=1, Int_t fondef=61, Float_t sizdef=1)
 Save text attributes as C++ statement(s) on output stream out.
 
void SetGLTextAngles (Double_t a1, Double_t a2, Double_t a3)
 Set the text rotation angles.
 
void SetGLTextFont (Font_t fontnumber)
 
virtual void SetTextAlign (Short_t align=11)
 Set the text alignment.
 
virtual void SetTextAngle (Float_t tangle=0)
 Set the text angle.
 
virtual void SetTextAttributes ()
 Invoke the DialogCanvas Text attributes.
 
virtual void SetTextColor (Color_t tcolor=1)
 Set the text color.
 
void SetTextColor (TColorNumber lcolor)
 
virtual void SetTextColorAlpha (Color_t tcolor, Float_t talpha)
 Set a transparent text color.
 
virtual void SetTextFont (Font_t tfont=62)
 Set the text font.
 
virtual void SetTextSize (Float_t tsize=1)
 Set the text size.
 
virtual void SetTextSizePixels (Int_t npixels)
 Set the text size in pixel.
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 

Protected Attributes

Short_t fTextAlign
 Text alignment.
 
Float_t fTextAngle
 Text angle.
 
Color_t fTextColor
 Text color.
 
Font_t fTextFont
 Text font.
 
Float_t fTextSize
 Text size.
 

Private Member Functions

 TGLText (const TGLText &)=delete
 
TGLTextoperator= (const TGLText &)=delete
 

Private Attributes

Double_t fAngle1
 
Double_t fAngle2
 
Double_t fAngle3
 
FTFontfGLTextFont
 
Double_t fX
 
Double_t fY
 
Double_t fZ
 

#include <TGLText.h>

Inheritance diagram for TGLText:
TAttText

Constructor & Destructor Documentation

◆ TGLText() [1/3]

TGLText::TGLText ( const TGLText & )
privatedelete

◆ TGLText() [2/3]

TGLText::TGLText ( )

Definition at line 52 of file TGLText.cxx.

◆ TGLText() [3/3]

TGLText::TGLText ( Double_t x,
Double_t y,
Double_t z,
const char * text )

TGLext normal constructor.

Definition at line 68 of file TGLText.cxx.

◆ ~TGLText()

TGLText::~TGLText ( )
override

Definition at line 83 of file TGLText.cxx.

Member Function Documentation

◆ BBox()

void TGLText::BBox ( const char * string,
float & llx,
float & lly,
float & llz,
float & urx,
float & ury,
float & urz )

Calculate bounding-box for given string.

Definition at line 154 of file TGLText.cxx.

◆ Class()

static TClass * TGLText::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TGLText::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TGLText::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 46 of file TGLText.h.

◆ Copy()

void TAttText::Copy ( TAttText & atttext) const
inherited

Copy this text attributes to a new TAttText.

Definition at line 300 of file TAttText.cxx.

◆ DeclFileName()

static const char * TGLText::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 46 of file TGLText.h.

◆ GetFont()

FTFont * TGLText::GetFont ( )
inline

Definition at line 37 of file TGLText.h.

◆ GetTextAlign()

virtual Short_t TAttText::GetTextAlign ( ) const
inlinevirtualinherited

Return the text alignment.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 35 of file TAttText.h.

◆ GetTextAngle()

virtual Float_t TAttText::GetTextAngle ( ) const
inlinevirtualinherited

Return the text angle.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 36 of file TAttText.h.

◆ GetTextColor()

virtual Color_t TAttText::GetTextColor ( ) const
inlinevirtualinherited

Return the text color.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 37 of file TAttText.h.

◆ GetTextFont()

virtual Font_t TAttText::GetTextFont ( ) const
inlinevirtualinherited

Return the text font.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 38 of file TAttText.h.

◆ GetTextSize()

virtual Float_t TAttText::GetTextSize ( ) const
inlinevirtualinherited

Return the text size.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 39 of file TAttText.h.

◆ GetTextSizePercent()

Float_t TAttText::GetTextSizePercent ( Float_t size)
virtualinherited

Return the text in percent of the pad size.

Return the text size in percent of the pad size.

If the font precision is greater than 2, the text size returned is the size in pixel converted into percent of the pad size, otherwise the size returned is the same as the size given as input parameter.

Definition at line 316 of file TAttText.cxx.

◆ GetTextSizePixels()

Float_t TAttText::GetTextSizePixels ( TVirtualPad & pad) const
virtualinherited

Return the text size in pixels for specified pad.

Return the text size in pixels for the specified pad.

If the font precision less than 3 size defined as percent of pad size and scaled to minimal pad size

Definition at line 350 of file TAttText.cxx.

◆ GetTextSizeRelative()

Float_t TAttText::GetTextSizeRelative ( TVirtualPad & pad) const
virtualinherited

Return the text size in relative units.

If the font precision grater then 2 use pad dimensions to get value

Definition at line 333 of file TAttText.cxx.

◆ IsA()

TClass * TGLText::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TAttText.

Definition at line 46 of file TGLText.h.

◆ Modify()

void TAttText::Modify ( )
virtualinherited

Change current text attributes if necessary.

Definition at line 364 of file TAttText.cxx.

◆ ModifyOn()

void TAttText::ModifyOn ( TVirtualPad & pad)
virtualinherited

Change current text attributes if necessary on specified pad.

Definition at line 373 of file TAttText.cxx.

◆ operator=()

TGLText & TGLText::operator= ( const TGLText & )
privatedelete

◆ PaintBBox()

void TGLText::PaintBBox ( const char * text)

Definition at line 139 of file TGLText.cxx.

◆ PaintGLText()

void TGLText::PaintGLText ( Double_t x,
Double_t y,
Double_t z,
const char * text )

Draw text.

Definition at line 92 of file TGLText.cxx.

◆ ResetAttText()

void TAttText::ResetAttText ( Option_t * toption = "")
virtualinherited

Reset this text attributes to default values.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 387 of file TAttText.cxx.

◆ SaveTextAttributes()

void TAttText::SaveTextAttributes ( std::ostream & out,
const char * name,
Int_t alidef = 12,
Float_t angdef = 0,
Int_t coldef = 1,
Int_t fondef = 61,
Float_t sizdef = 1 )
virtualinherited

Save text attributes as C++ statement(s) on output stream out.

Definition at line 399 of file TAttText.cxx.

◆ SetGLTextAngles()

void TGLText::SetGLTextAngles ( Double_t a1,
Double_t a2,
Double_t a3 )

Set the text rotation angles.

Definition at line 163 of file TGLText.cxx.

◆ SetGLTextFont()

void TGLText::SetGLTextFont ( Font_t fontnumber)

Definition at line 173 of file TGLText.cxx.

◆ SetTextAlign()

virtual void TAttText::SetTextAlign ( Short_t align = 11)
inlinevirtualinherited

Set the text alignment.

Reimplemented in TVirtualX, TGQuartz, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 48 of file TAttText.h.

◆ SetTextAngle()

virtual void TAttText::SetTextAngle ( Float_t tangle = 0)
inlinevirtualinherited

Set the text angle.

Reimplemented in TGWin32VirtualXProxy, and TGraphNode.

Definition at line 49 of file TAttText.h.

◆ SetTextAttributes()

void TAttText::SetTextAttributes ( )
virtualinherited

Invoke the DialogCanvas Text attributes.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 418 of file TAttText.cxx.

◆ SetTextColor() [1/2]

virtual void TAttText::SetTextColor ( Color_t tcolor = 1)
inlinevirtualinherited

Set the text color.

Reimplemented in TVirtualX, TGQuartz, TGWin32, TGX11, TPDF, TPostScript, TSVG, TTeXDump, and TGWin32VirtualXProxy.

Definition at line 50 of file TAttText.h.

◆ SetTextColor() [2/2]

void TAttText::SetTextColor ( TColorNumber lcolor)
inherited

Definition at line 453 of file TAttText.cxx.

◆ SetTextColorAlpha()

void TAttText::SetTextColorAlpha ( Color_t tcolor,
Float_t talpha )
virtualinherited

Set a transparent text color.

Parameters
tcolordefines the text color
talphadefines the percentage of opacity from 0. (fully transparent) to 1. (fully opaque).
Note
talpha is ignored (treated as 1) if the TCanvas has no GL support activated.

Definition at line 430 of file TAttText.cxx.

◆ SetTextFont()

virtual void TAttText::SetTextFont ( Font_t tfont = 62)
inlinevirtualinherited

Set the text font.

Reimplemented in TVirtualX, TGQuartz, TGWin32, TGX11, and TGWin32VirtualXProxy.

Definition at line 52 of file TAttText.h.

◆ SetTextSize()

virtual void TAttText::SetTextSize ( Float_t tsize = 1)
inlinevirtualinherited

Set the text size.

Reimplemented in TVirtualX, TGQuartz, TGWin32, TGX11, and TGWin32VirtualXProxy.

Definition at line 53 of file TAttText.h.

◆ SetTextSizePixels()

void TAttText::SetTextSizePixels ( Int_t npixels)
virtualinherited

Set the text size in pixel.

Set the text size in pixels.

If the font precision is greater than 2, the text size is set to npixels, otherwise the text size is computed as a percent of the pad size.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 441 of file TAttText.cxx.

◆ Streamer()

void TGLText::Streamer ( TBuffer & )
overridevirtual

Reimplemented from TAttText.

◆ StreamerNVirtual()

void TGLText::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 46 of file TGLText.h.

Member Data Documentation

◆ fAngle1

Double_t TGLText::fAngle1
private

Definition at line 27 of file TGLText.h.

◆ fAngle2

Double_t TGLText::fAngle2
private

Definition at line 28 of file TGLText.h.

◆ fAngle3

Double_t TGLText::fAngle3
private

Definition at line 29 of file TGLText.h.

◆ fGLTextFont

FTFont* TGLText::fGLTextFont
private

Definition at line 30 of file TGLText.h.

◆ fTextAlign

Short_t TAttText::fTextAlign
protectedinherited

Text alignment.

Definition at line 26 of file TAttText.h.

◆ fTextAngle

Float_t TAttText::fTextAngle
protectedinherited

Text angle.

Definition at line 24 of file TAttText.h.

◆ fTextColor

Color_t TAttText::fTextColor
protectedinherited

Text color.

Definition at line 27 of file TAttText.h.

◆ fTextFont

Font_t TAttText::fTextFont
protectedinherited

Text font.

Definition at line 28 of file TAttText.h.

◆ fTextSize

Float_t TAttText::fTextSize
protectedinherited

Text size.

Definition at line 25 of file TAttText.h.

◆ fX

Double_t TGLText::fX
private

Definition at line 24 of file TGLText.h.

◆ fY

Double_t TGLText::fY
private

Definition at line 25 of file TGLText.h.

◆ fZ

Double_t TGLText::fZ
private

Definition at line 26 of file TGLText.h.


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