Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.6dev
      Class Index
      File List
   Version 1.0.6
   Version 1.0.5new_solver
   Version 1.0.5dev
   Version 1.0.5b
   Version 1.0.4dev
   Version 1.0.4
Publications


Hosted by Get Ion Beam Simulator at SourceForge.net. Fast, secure and Free Open Source software downloads
MeshColormap Class Reference

Class for colormap type plots on a regular rectangular mesh. More...

#include <meshcolormap.hpp>

Inheritance diagram for MeshColormap:
Colormap Graph FieldGraph

Public Member Functions

 MeshColormap ()
 Default constructor for empty colormap graph. More...
 
 MeshColormap (const MeshColormap &colormap)
 Copy constructor. More...
 
 MeshColormap (const double datarange[4], size_t n, size_t m, const std::vector< double > &data)
 Constructor for colormap from data. More...
 
virtual ~MeshColormap ()
 Destructor. More...
 
void clear_data (void)
 Clears colormap data. More...
 
void set_data (const double datarange[4], size_t n, size_t m, const std::vector< double > &data)
 Define colormap from data. More...
 
bool has_data (void) const
 Does colormap have data? More...
 
interpolation_e get_interpolation (void) const
 Set interpolation mode. More...
 
void set_interpolation (interpolation_e interpolation)
 Set interpolation mode. More...
 
virtual double zscale (double val)
 Scale value val according to zscale mode. More...
 
virtual double zscale_inv (double val)
 Inverse scale value val according to zscale mode. More...
 
zscale_e get_zscale (void) const
 Get zscale mode. More...
 
void set_zscale (zscale_e zscale)
 Set zscale mode. More...
 
virtual void plot (cairo_t *cairo, const Coordmapper *cm, const double range[4])
 Plot graph with cairo. More...
 
virtual void plot_sample (cairo_t *cairo, double x, double y, double width, double height)
 Plot sample for legend. More...
 
virtual void get_bbox (double bbox[4])
 Get bounding box of graph. More...
 
void set_palette (const Palette &palette)
 Set colormap palette. More...
 
virtual Palettepalette (void)
 Get a reference to colormap palette. More...
 
const Palettepalette (void) const
 Get a reference to colormap palette. More...
 
void get_zrange (double &min, double &max) const
 Get zrange for colormap plot. More...
 
void set_zrange (double min, double max)
 Set zrange for colormap plot. More...
 
double get_value (double x, double y) const
 Get value of interpolated colormap data. More...
 
- Public Member Functions inherited from Colormap
virtual ~Colormap ()
 Destructor. More...
 
- Public Member Functions inherited from Graph
virtual ~Graph ()
 Virtual destructor. More...
 

Detailed Description

Class for colormap type plots on a regular rectangular mesh.

Implementation of Colormap. Used in Frame type plots.

Constructor & Destructor Documentation

◆ MeshColormap() [1/3]

MeshColormap::MeshColormap ( )

Default constructor for empty colormap graph.

◆ MeshColormap() [2/3]

MeshColormap::MeshColormap ( const MeshColormap colormap)

Copy constructor.

◆ MeshColormap() [3/3]

MeshColormap::MeshColormap ( const double  datarange[4],
size_t  n,
size_t  m,
const std::vector< double > &  data 
)

Constructor for colormap from data.

Data is defined as n by m array of data, where x and y ranges are defined in datarange in order xmin, ymin, xmax, ymax. Z-values are defined in vector data in y major order. Internal copy of the data from data is made.

◆ ~MeshColormap()

MeshColormap::~MeshColormap ( )
virtual

Destructor.

Member Function Documentation

◆ clear_data()

void MeshColormap::clear_data ( void  )

Clears colormap data.

◆ get_bbox()

void MeshColormap::get_bbox ( double  bbox[4])
virtual

Get bounding box of graph.

Returns the bounding box of the graph in array bbox in order xmin, ymin, xmax, ymax.

Implements Graph.

Reimplemented in FieldGraph.

◆ get_interpolation()

interpolation_e MeshColormap::get_interpolation ( void  ) const

Set interpolation mode.

◆ get_value()

double MeshColormap::get_value ( double  x,
double  y 
) const

Get value of interpolated colormap data.

◆ get_zrange()

void MeshColormap::get_zrange ( double &  min,
double &  max 
) const

Get zrange for colormap plot.

◆ get_zscale()

zscale_e MeshColormap::get_zscale ( void  ) const

Get zscale mode.

◆ has_data()

bool MeshColormap::has_data ( void  ) const

Does colormap have data?

◆ palette() [1/2]

virtual Palette& MeshColormap::palette ( void  )
inlinevirtual

Get a reference to colormap palette.

Implements Colormap.

◆ palette() [2/2]

const Palette& MeshColormap::palette ( void  ) const
inline

Get a reference to colormap palette.

◆ plot()

void MeshColormap::plot ( cairo_t *  cairo,
const Coordmapper cm,
const double  range[4] 
)
virtual

Plot graph with cairo.

Plot the graph using cairo and coordinate mapper cm. The visible range of plot is given in array range in order xmin, ymin, xmax, ymax. The graph should be able to handle any range values. Also min > max.

Called by Frame during drawing.

Implements Graph.

Reimplemented in FieldGraph.

◆ plot_sample()

void MeshColormap::plot_sample ( cairo_t *  cairo,
double  x,
double  y,
double  width,
double  height 
)
virtual

Plot sample for legend.

Plot graph sample for legend at cairo coordinates (x,y).

Implements Graph.

Reimplemented in FieldGraph.

◆ set_data()

void MeshColormap::set_data ( const double  datarange[4],
size_t  n,
size_t  m,
const std::vector< double > &  data 
)

Define colormap from data.

Data is defined as n by m array of data, where x and y ranges are defined in datarange in order xmin, ymin, xmax, ymax. Z-values are defined in vector data in y major order. Internal copy of the data from data is made.

Overrides old data and resets z ranges.

◆ set_interpolation()

void MeshColormap::set_interpolation ( interpolation_e  interpolation)

Set interpolation mode.

Can be either INTERPOLATION_CLOSEST, INTERPOLATION_BILINEAR or INTERPOLATION_BICUBIC.

◆ set_palette()

void MeshColormap::set_palette ( const Palette palette)

Set colormap palette.

◆ set_zrange()

void MeshColormap::set_zrange ( double  min,
double  max 
)

Set zrange for colormap plot.

The zrange defaults to automatically scaled ranging for colormap input data.

◆ set_zscale()

void MeshColormap::set_zscale ( zscale_e  zscale)

Set zscale mode.

Set a prescaling for z-axis. Defaults to ZSCALE_LINEAR, which is a linear scaling from the z-axis to palette. Other possibilities are ZSCALE_LOG, which is a standard logarithmic scaling from z-axis to palette (providing magnification close to zero) and ZSCALE_RELLOG, which is a special relative logrithmic scaling following the relation

\[ \frac{\log(0.001+x)-\log(0.001)}{\log(1.001)-\log(0.001)} \]

, where x is prescaled to range [0,1]. The z-ranges completely contained on the negative side are inverted to positive and z-ranges both on negative and positive sides are scaled separately to provide magnification close to zero.

◆ zscale()

double MeshColormap::zscale ( double  val)
virtual

Scale value val according to zscale mode.

Scales value val, where zmin <= val <= zmax into the range between 0.0 and 1.0 according to zscale mode.

Implements Colormap.

◆ zscale_inv()

double MeshColormap::zscale_inv ( double  val)
virtual

Inverse scale value val according to zscale mode.

Inverse function of zscale(). Scales value val, where 0 <= val <= 1 into the range between zmin and zmax according to zscale mode.

Implements Colormap.


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


Reference manual for Ion Beam Simulator 1.0.6dev
Generated by Doxygen 1.9.1 on Thu Sep 11 2025 09:37:24.