VAPOR3 3.9.4
Public Types | Public Member Functions | Public Attributes | List of all members
VAPoR::TextLabel Class Reference

Utitlity wrapper for Font class. More...

#include <TextLabel.h>

Public Types

enum  Alignment {
  Left , Center , Right , Top ,
  Bottom
}
 

Public Member Functions

 TextLabel (GLManager *glManager, const std::string &fontName, unsigned int fontSize)
 
void DrawText (const glm::vec3 &position, const std::string &text)
 
void DrawText (const glm::vec2 &position, const std::string &text)
 
FontGetFont () const
 

Public Attributes

std::string FontName
 
unsigned int FontSize
 
glm::vec4 BackgroundColor
 
glm::vec4 ForegroundColor
 
Alignment HorizontalAlignment
 
Alignment VerticalAlignment
 
float Padding
 

Detailed Description

Utitlity wrapper for Font class.

Creates a 2D label for a point in 2D or 3D space

Author
Stanislaw Jaroszynski
Date
August, 2018

Definition at line 21 of file TextLabel.h.

Member Enumeration Documentation

◆ Alignment

Enumerator
Left 
Center 
Right 
Top 
Bottom 

Definition at line 25 of file TextLabel.h.

Constructor & Destructor Documentation

◆ TextLabel()

VAPoR::TextLabel::TextLabel ( GLManager glManager,
const std::string &  fontName,
unsigned int  fontSize 
)

Member Function Documentation

◆ DrawText() [1/2]

void VAPoR::TextLabel::DrawText ( const glm::vec2 &  position,
const std::string &  text 
)

◆ DrawText() [2/2]

void VAPoR::TextLabel::DrawText ( const glm::vec3 &  position,
const std::string &  text 
)

Draws a floating text label if a 3D perspective is used or simply text if using a pixel coordinate space matrix. Formatting is determined by the public variables.

Parameters
[in]positionwill be transformed according to the current ModelViewProjection matrix
[in]textwill be drawn

◆ GetFont()

Font * VAPoR::TextLabel::GetFont ( ) const

Member Data Documentation

◆ BackgroundColor

glm::vec4 VAPoR::TextLabel::BackgroundColor

Definition at line 29 of file TextLabel.h.

◆ FontName

std::string VAPoR::TextLabel::FontName

Definition at line 27 of file TextLabel.h.

◆ FontSize

unsigned int VAPoR::TextLabel::FontSize

Definition at line 28 of file TextLabel.h.

◆ ForegroundColor

glm::vec4 VAPoR::TextLabel::ForegroundColor

Definition at line 30 of file TextLabel.h.

◆ HorizontalAlignment

Alignment VAPoR::TextLabel::HorizontalAlignment

Definition at line 31 of file TextLabel.h.

◆ Padding

float VAPoR::TextLabel::Padding

Definition at line 33 of file TextLabel.h.

◆ VerticalAlignment

Alignment VAPoR::TextLabel::VerticalAlignment

Definition at line 32 of file TextLabel.h.


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