Gtkmm-PLplot 3.0
A scientific plotting library for Gtkmm
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
Gtk::PLplot::PlotObject2DLine Class Reference

Line object for 2D plots. More...

#include <gtkmm-plplot/plotobject2dline.h>

Inheritance diagram for Gtk::PLplot::PlotObject2DLine:
Inheritance graph
[legend]

Public Member Functions

 PlotObject2DLine (double coord_x_begin, double coord_y_begin, double coord_x_end, double coord_y_end, Gdk::RGBA color=Gdk::RGBA("black"), LineStyle line_style=LineStyle::CONTINUOUS, double line_width=1.0)
 
 PlotObject2DLine (Gtk::Orientation orientation, double offset, Gdk::RGBA color=Gdk::RGBA("black"), LineStyle line_style=LineStyle::CONTINUOUS, double line_width=1.0)
 
virtual ~PlotObject2DLine ()
 
void set_line_style (LineStyle line_style)
 
LineStyle get_line_style ()
 
void set_line_width (double line_width)
 
double get_line_width ()
 
virtual bool is_logarithmic_x_compatible () override
 
virtual bool is_logarithmic_y_compatible () override
 
virtual void draw_plot_object (const Cairo::RefPtr< Cairo::Context > &cr, plstream *pls, PlotObjectAuxData &data) override
 
- Public Member Functions inherited from Gtk::PLplot::PlotObject2D
virtual ~PlotObject2D ()
 
void set_color (Gdk::RGBA color)
 
Gdk::RGBA get_color ()
 
- Public Member Functions inherited from Gtk::PLplot::PlotObject
virtual ~PlotObject ()
 
void show ()
 
void hide ()
 
bool is_showing () const
 
sigc::signal< void(void)> signal_changed ()
 
- Public Member Functions inherited from Gtk::PLplot::Object
virtual void set_manage ()
 

Protected Attributes

LineStyle line_style
 The linestyle that will be used to draw this line object in the plot.
 
double line_width
 The line width of the line object. Default is 1.0.
 
double coords_begin [2]
 coordinates of starting point (WORLD coordinates!)
 
double coords_end [2]
 coordinates of end point (WORLD coordinates!)
 
- Protected Attributes inherited from Gtk::PLplot::PlotObject2D
Gdk::RGBA color
 The color the dataset will be drawn in.
 
- Protected Attributes inherited from Gtk::PLplot::PlotObject
sigc::signal< void(void)> _signal_changed
 signal that gets emitted whenever any of the plot object properties is changed.
 

Private Member Functions

 PlotObject2DLine ()=delete
 no default constructor
 
PlotObject2DLineoperator= (const PlotObject2DLine &)=delete
 no assignment operator
 
 PlotObject2DLine (const PlotObject2DLine &source)=delete
 no default copy constructor;
 

Additional Inherited Members

- Protected Member Functions inherited from Gtk::PLplot::PlotObject2D
 PlotObject2D (Gdk::RGBA color)
 
- Protected Member Functions inherited from Gtk::PLplot::PlotObject
virtual void on_changed ()
 
 PlotObject ()
 
- Protected Member Functions inherited from Gtk::PLplot::Object
 Object ()
 

Detailed Description

Line object for 2D plots.

Constructor & Destructor Documentation

◆ PlotObject2DLine() [1/4]

Gtk::PLplot::PlotObject2DLine::PlotObject2DLine ( )
privatedelete

no default constructor

◆ PlotObject2DLine() [2/4]

Gtk::PLplot::PlotObject2DLine::PlotObject2DLine ( const PlotObject2DLine source)
privatedelete

no default copy constructor;

◆ PlotObject2DLine() [3/4]

Gtk::PLplot::PlotObject2DLine::PlotObject2DLine ( double  coord_x_begin,
double  coord_y_begin,
double  coord_x_end,
double  coord_y_end,
Gdk::RGBA  color = Gdk::RGBA("black"),
LineStyle  line_style = LineStyle::CONTINUOUS,
double  line_width = 1.0 
)

Constructor

This constructor initializes a new PlotObject2DLine instance, by setting the properties that will determine its appearance when rendered onto a plot

Parameters
coord_x_beginX coordinate of the starting point
coord_y_beginY coordinate of the starting point
coord_x_endX coordinate of the end point
coord_y_endY coordinate of the end point
colorthe line color
line_stylethe line style
line_widththe line width
Exceptions
Gtk::PLplot::Exception

◆ PlotObject2DLine() [4/4]

Gtk::PLplot::PlotObject2DLine::PlotObject2DLine ( Gtk::Orientation  orientation,
double  offset,
Gdk::RGBA  color = Gdk::RGBA("black"),
LineStyle  line_style = LineStyle::CONTINUOUS,
double  line_width = 1.0 
)

Constructor

This constructor initializes a new PlotObject2DLine instance, with either a horizontal or vertical orientation, by setting the properties that will determine its appearance when rendered onto a plot

Parameters
orientationMust be either Gtk::Orientation::HORIZONTAL or Gtk::Orientation::VERTICAL
offsetFor horizontal lines, the vertical offset and vice-versa for vertical lines
colorthe line color
line_stylethe line style
line_widththe line width
Exceptions
Gtk::PLplot::Exception

◆ ~PlotObject2DLine()

virtual Gtk::PLplot::PlotObject2DLine::~PlotObject2DLine ( )
virtual

Destructor

Member Function Documentation

◆ draw_plot_object()

virtual void Gtk::PLplot::PlotObject2DLine::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
crthe cairo context to draw to.
plsthe PLplot plstream object that will do the actual plotting on the Cairo context
dataadditional data sent from the Plot to influence drawing

Implements Gtk::PLplot::PlotObject.

◆ get_line_style()

LineStyle Gtk::PLplot::PlotObject2DLine::get_line_style ( )

Get the current line style

Returns
the current line style

◆ get_line_width()

double Gtk::PLplot::PlotObject2DLine::get_line_width ( )

Get the current line width

Returns
the current line width

◆ is_logarithmic_x_compatible()

virtual bool Gtk::PLplot::PlotObject2DLine::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::PlotObject2DLine::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=()

PlotObject2DLine & Gtk::PLplot::PlotObject2DLine::operator= ( const PlotObject2DLine )
privatedelete

no assignment operator

◆ set_line_style()

void Gtk::PLplot::PlotObject2DLine::set_line_style ( LineStyle  line_style)

Changes the line style

Parameters
line_styleThe new line style

◆ set_line_width()

void Gtk::PLplot::PlotObject2DLine::set_line_width ( double  line_width)

Changes the line width

Parameters
line_widthThe new line width
Exceptions
Gtk::PLplot::Exception

Member Data Documentation

◆ coords_begin

double Gtk::PLplot::PlotObject2DLine::coords_begin[2]
protected

coordinates of starting point (WORLD coordinates!)

◆ coords_end

double Gtk::PLplot::PlotObject2DLine::coords_end[2]
protected

coordinates of end point (WORLD coordinates!)

◆ line_style

LineStyle Gtk::PLplot::PlotObject2DLine::line_style
protected

The linestyle that will be used to draw this line object in the plot.

◆ line_width

double Gtk::PLplot::PlotObject2DLine::line_width
protected

The line width of the line object. Default is 1.0.