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::PlotDataSurface Class Reference

a class for surface datasets More...

#include <gtkmm-plplot/plotdatasurface.h>

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

Public Member Functions

 PlotDataSurface (const std::vector< double > &x, const std::vector< double > &y, double **z)
 
 PlotDataSurface (const std::valarray< double > &x, const std::valarray< double > &y, double **z)
 
 PlotDataSurface (unsigned int nx, unsigned int ny, double **z)
 
virtual ~PlotDataSurface ()
 
std::vector< double > get_vector_x ()
 
std::vector< double > get_vector_y ()
 
double ** get_array2d_z ()
 
- Public Member Functions inherited from Gtk::PLplot::PlotData
virtual ~PlotData ()
 
void set_name (Glib::ustring name)
 
Glib::ustring get_name ()
 
void show ()
 
void hide ()
 
bool is_showing () const
 
sigc::signal< void(void)> signal_changed ()
 
sigc::signal< void(void)> signal_data_modified ()
 
virtual void draw_plot_data (const Cairo::RefPtr< Cairo::Context > &cr, plstream *pls)
 
- Public Member Functions inherited from Gtk::PLplot::Object
virtual void set_manage ()
 

Protected Attributes

std::vector< double > x
 The X-grid coordinates of the dataset, which are assumed to correspond to the first dimension of Z.
 
std::vector< double > y
 The Y-grid coordinates of the dataset, which are assumed to correspond to the second dimension of Z.
 
double ** z
 The Z-values of the dataset. This is an array of arrays whose first dimension must correspond to the length of x, while the second must correspond to the length of y.
 
- Protected Attributes inherited from Gtk::PLplot::PlotData
sigc::signal< void(void)> _signal_changed
 signal that gets emitted whenever any of the dataset proprties is changed.
 
sigc::signal< void(void)> _signal_data_modified
 signal that gets emitted whenever the X- and Y-datasets have been modified.
 

Private Member Functions

 PlotDataSurface ()=delete
 no default constructor
 
 PlotDataSurface (const PlotDataSurface &)=delete
 no copy constructor
 
PlotDataSurfaceoperator= (const PlotDataSurface &)=delete
 no assignment operator
 

Additional Inherited Members

- Protected Member Functions inherited from Gtk::PLplot::PlotData
virtual void on_changed ()
 
virtual void on_data_modified ()
 
 PlotData ()
 
- Protected Member Functions inherited from Gtk::PLplot::Object
 Object ()
 

Detailed Description

a class for surface datasets

Instances of this class will hold a single (and the only possible) dataset for a surface plot types like PlotContour and PlotContourShades. The input data can be provided as std::vector (X and Y), std::valarray (X and Y), double** (Z, array of arrays) and boost:multi_array (Z). This datatype is demonstrated in Example 7: a Simple contour plot.

Constructor & Destructor Documentation

◆ PlotDataSurface() [1/5]

Gtk::PLplot::PlotDataSurface::PlotDataSurface ( )
privatedelete

no default constructor

◆ PlotDataSurface() [2/5]

Gtk::PLplot::PlotDataSurface::PlotDataSurface ( const PlotDataSurface )
privatedelete

no copy constructor

◆ PlotDataSurface() [3/5]

Gtk::PLplot::PlotDataSurface::PlotDataSurface ( const std::vector< double > &  x,
const std::vector< double > &  y,
double **  z 
)

Constructor

Initializes a new dataset for a PlotContour.

Parameters
xthe X-grid coordinates of the dataset, provided as a std::vector. Have to match the first dimension of z
ythe Y-grid coordinates of the dataset, provided as a std::vector. Have to match the second dimension of z
zthe actual surface data, provided as a dynamically allocated array of dynamically allocated arrays. The constructor will initialize its own deep-copy of this variable.
Exceptions
Gtk::PLplot::Exception

◆ PlotDataSurface() [4/5]

Gtk::PLplot::PlotDataSurface::PlotDataSurface ( const std::valarray< double > &  x,
const std::valarray< double > &  y,
double **  z 
)

Constructor

Initializes a new dataset for a PlotContour.

Parameters
xthe X-grid coordinates of the dataset, provided as a std::valarray. Have to match the first dimension of z
ythe Y-grid coordinates of the dataset, provided as a std::valarray. Have to match the second dimension of z
zthe actual surface data, provided as a dynamically allocated array of dynamically allocated arrays. The constructor will initialize its own deep-copy of this variable.

◆ PlotDataSurface() [5/5]

Gtk::PLplot::PlotDataSurface::PlotDataSurface ( unsigned int  nx,
unsigned int  ny,
double **  z 
)

Constructor

Initializes a new dataset for a PlotContour. The X- and Y-values will be set to a vector of the appropriate size with elements set to correspond to their array subscript.

Parameters
nxthe extent of z along the first dimension
nythe extent of z along the second dimension
zthe actual surface data, provided as a dynamically allocated array of dynamically allocated arrays. The constructor will initialize its own deep-copy of this variable.

◆ ~PlotDataSurface()

virtual Gtk::PLplot::PlotDataSurface::~PlotDataSurface ( )
virtual

Destructor

Member Function Documentation

◆ get_array2d_z()

double ** Gtk::PLplot::PlotDataSurface::get_array2d_z ( )

Free the memory with free_array2d().

Returns
a copy of the dataset Z-values

◆ get_vector_x()

std::vector< double > Gtk::PLplot::PlotDataSurface::get_vector_x ( )
Returns
a copy of the dataset X-values

◆ get_vector_y()

std::vector< double > Gtk::PLplot::PlotDataSurface::get_vector_y ( )
Returns
a copy of the dataset Y-values

◆ operator=()

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

no assignment operator

Member Data Documentation

◆ x

std::vector<double> Gtk::PLplot::PlotDataSurface::x
protected

The X-grid coordinates of the dataset, which are assumed to correspond to the first dimension of Z.

◆ y

std::vector<double> Gtk::PLplot::PlotDataSurface::y
protected

The Y-grid coordinates of the dataset, which are assumed to correspond to the second dimension of Z.

◆ z

double** Gtk::PLplot::PlotDataSurface::z
protected

The Z-values of the dataset. This is an array of arrays whose first dimension must correspond to the length of x, while the second must correspond to the length of y.