Text object for 2D plots.
More...
#include <gtkmm-plplot/plotobject2dtext.h>
|
double | justification |
| text justification. Must be [0,1]
|
|
Glib::ustring | text |
| text that should be plotted
|
|
double | coords [2] |
| text coordinates
|
|
double | scale_factor |
| text scale factor
|
|
Gdk::RGBA | color |
| The color the dataset will be drawn in.
|
|
sigc::signal< void(void)> | _signal_changed |
| signal that gets emitted whenever any of the plot object properties is changed.
|
|
Text object for 2D plots.
This object is used in Example 2: Logarithmic axes and box styles
◆ PlotObject2DText() [1/3]
Gtk::PLplot::PlotObject2DText::PlotObject2DText |
( |
| ) |
|
|
privatedelete |
◆ PlotObject2DText() [2/3]
Gtk::PLplot::PlotObject2DText::PlotObject2DText |
( |
const PlotObject2DText & |
source | ) |
|
|
privatedelete |
no default copy constructor;
◆ PlotObject2DText() [3/3]
Gtk::PLplot::PlotObject2DText::PlotObject2DText |
( |
Glib::ustring |
text, |
|
|
double |
coord_x, |
|
|
double |
coord_y, |
|
|
Gdk::RGBA |
color = Gdk::RGBA("black") |
|
) |
| |
Constructor
This constructor initializes a new PlotObject2DText instance, defined by its contents (text) as well as its position and color. More properties can be set using the other methods that are offered by this class.
- Parameters
-
text | What will be printed on the plot |
coord_x | X-coordinate of the text |
coord_y | Y-coordinate of the text |
color | The color text color |
◆ ~PlotObject2DText()
virtual Gtk::PLplot::PlotObject2DText::~PlotObject2DText |
( |
| ) |
|
|
virtual |
◆ draw_plot_object()
virtual void Gtk::PLplot::PlotObject2DText::draw_plot_object |
( |
const Cairo::RefPtr< Cairo::Context > & |
cr, |
|
|
plstream * |
pls, |
|
|
PlotObjectAuxData & |
data |
|
) |
| |
|
overridevirtual |
Method to draw the object
This method is virtual allowing inheriting classes to implement their own method with the same signature.
- Parameters
-
cr | the cairo context to draw to. |
pls | the PLplot plstream object that will do the actual plotting on the Cairo context |
data | additional data sent from the Plot to influence drawing |
Implements Gtk::PLplot::PlotObject.
◆ get_coordinates()
void Gtk::PLplot::PlotObject2DText::get_coordinates |
( |
double & |
coord_x, |
|
|
double & |
coord_y |
|
) |
| |
Get current text coordinates
- Parameters
-
coord_x | X-coordinate |
coord_y | Y-coordinate |
◆ get_justification()
double Gtk::PLplot::PlotObject2DText::get_justification |
( |
| ) |
|
Get current text justification
0.0 corresponds to left justified, 1.0 to right justified. Only values in [0.0, 1.0] are valid
- Returns
- Current text justification
◆ get_scale_factor()
double Gtk::PLplot::PlotObject2DText::get_scale_factor |
( |
| ) |
|
Get current text scale factor
Use this parameter to get the current text font size
- Returns
- Text scale factor
◆ get_text()
Glib::ustring Gtk::PLplot::PlotObject2DText::get_text |
( |
| ) |
|
Get current text
- Returns
- Current text
◆ is_logarithmic_x_compatible()
virtual bool Gtk::PLplot::PlotObject2DText::is_logarithmic_x_compatible |
( |
| ) |
|
|
overridevirtual |
Check if the object can be used in a plot with a logarithmic X-axis
- Returns
true
if compatible, false
if not
Implements Gtk::PLplot::PlotObject2D.
◆ is_logarithmic_y_compatible()
virtual bool Gtk::PLplot::PlotObject2DText::is_logarithmic_y_compatible |
( |
| ) |
|
|
overridevirtual |
Check if the object can be used in a plot with a logarithmic Y-axis
- Returns
true
if compatible, false
if not
Implements Gtk::PLplot::PlotObject2D.
◆ operator=()
◆ set_coordinates()
void Gtk::PLplot::PlotObject2DText::set_coordinates |
( |
double |
coord_x, |
|
|
double |
coord_y |
|
) |
| |
Set new text coordinates
- Parameters
-
coord_x | X-coordinate |
coord_y | Y-coordinate |
◆ set_justification()
void Gtk::PLplot::PlotObject2DText::set_justification |
( |
double |
justification | ) |
|
Set text justification
0.0 corresponds to left justified, 1.0 to right justified. Only values in [0.0, 1.0] are valid
- Parameters
-
justification | New text justification |
- Exceptions
-
◆ set_scale_factor()
void Gtk::PLplot::PlotObject2DText::set_scale_factor |
( |
double |
scale_factor | ) |
|
Set text scale factor
Use this parameter to increase or decrease the text font size
- Parameters
-
scale_factor | New text scale factor |
◆ set_text()
void Gtk::PLplot::PlotObject2DText::set_text |
( |
Glib::ustring |
text | ) |
|
◆ coords
double Gtk::PLplot::PlotObject2DText::coords[2] |
|
protected |
◆ justification
double Gtk::PLplot::PlotObject2DText::justification |
|
protected |
text justification. Must be [0,1]
◆ scale_factor
double Gtk::PLplot::PlotObject2DText::scale_factor |
|
protected |
◆ text
Glib::ustring Gtk::PLplot::PlotObject2DText::text |
|
protected |
text that should be plotted