IBSimu  1.0.4
Public Member Functions | Friends
Label Class Reference

Class for labels in plots. More...

#include <label.hpp>

List of all members.

Public Member Functions

 Label ()
 Label (const Label &label)
 Label (const std::string &text)
 ~Label ()
Labeloperator= (const Label &label)
void set_font_size (double size)
 Set label font size.
void set_font_family (const std::string &family)
 Set label font family.
void set_font_slant (cairo_font_slant_t slant)
 Set label font slant.
void set_font_weight (cairo_font_weight_t weight)
 Set label font weight.
void set_color (const Color &color)
 Set label color.
void set_location (double x, double y)
 Set label location.
void set_rotation (double angle)
 Set label rotation.
void set_alignment (double x, double y, bool yzeroext=false)
 Set label alignment.
void set_text (const std::string &text)
 Set label text.
std::string get_text (void) const
 Get label text.
void draw (cairo_t *cairo)
 Draw label.
void get_extents (cairo_t *cairo, cairo_text_extents_t *extents)
 Get text extents of label.
void get_bbox (cairo_t *cairo, double bbox[4])
 Get bounding box of label.

Friends

std::ostream & operator<< (std::ostream &os, const Label &label)

Detailed Description

Class for labels in plots.

Label can be used to draw text labels with latex formatting.


Constructor & Destructor Documentation

Label::Label ( )
Label::Label ( const Label label)
Label::Label ( const std::string &  text)
Label::~Label ( )

Member Function Documentation

void Label::draw ( cairo_t *  cairo)

Draw label.

void Label::get_bbox ( cairo_t *  cairo,
double  bbox[4] 
)

Get bounding box of label.

The bounding box takes in account the label rotation and aligment. The bounding box is always the size of the label in the direction of the axes. Bounding box is (xmin, ymin, xmax, ymax).

void Label::get_extents ( cairo_t *  cairo,
cairo_text_extents_t *  extents 
)

Get text extents of label.

The extents are independent of label rotation or alignment.

std::string Label::get_text ( void  ) const

Get label text.

Label& Label::operator= ( const Label label)
void Label::set_alignment ( double  x,
double  y,
bool  yzeroext = false 
)

Set label alignment.

Alignment of label relative to the set location point. Alignment (0,0) means the text is up and right from the point. (1,1) means the text is down and left from the point. Is either of aligment parameters is NaN or infinite, the text is laid so that the cursor starting position is at the set point.

If yzeroext is true, the label alignment in y-direction is made using the extents of character zero ("0") instead of the text itself.

void Label::set_color ( const Color color)

Set label color.

void Label::set_font_family ( const std::string &  family)

Set label font family.

void Label::set_font_size ( double  size)

Set label font size.

void Label::set_font_slant ( cairo_font_slant_t  slant)

Set label font slant.

void Label::set_font_weight ( cairo_font_weight_t  weight)

Set label font weight.

void Label::set_location ( double  x,
double  y 
)

Set label location.

void Label::set_rotation ( double  angle)

Set label rotation.

Rotation is set in radians. The positive angle direction is counter-clockwise.

void Label::set_text ( const std::string &  text)

Set label text.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Label label 
) [friend]

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