Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.5new_solver
   Version 1.0.5dev
      Class Index
      File List
   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

Colormap Class Reference

Class for colormap type plots. More...

#include <colormap.hpp>

Inheritance diagram for Colormap:
Graph FieldGraph

List of all members.

Public Member Functions

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

Detailed Description

Class for colormap type plots.

Implementation of Graph. Used in Frame type plots.


Constructor & Destructor Documentation

Colormap::Colormap (  ) 

Default constructor for empty colormap graph.

Colormap::Colormap ( const Colormap colormap  ) 

Copy constructor.

Colormap::Colormap ( 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.

virtual Colormap::~Colormap (  )  [virtual]

Destructor.


Member Function Documentation

void Colormap::clear_data ( void   ) 

Clears colormap data.

virtual void Colormap::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.

interpolation_e Colormap::get_interpolation ( void   )  const

Set interpolation mode.

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

Get value of interpolated colormap data.

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

Get zrange for colormap plot.

zscale_e Colormap::get_zscale ( void   )  const

Get zscale mode.

Palette& Colormap::palette ( void   )  [inline]

Get a reference to colormap palette.

virtual void Colormap::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.

virtual void Colormap::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.

void Colormap::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.

void Colormap::set_interpolation ( interpolation_e  interpolation  ) 

Set interpolation mode.

Can be either INTERPOLATION_CLOSEST, INTERPOLATION_BILINEAR or INTERPOLATION_BICUBIC.

void Colormap::set_palette ( const Palette palette  ) 

Set colormap palette.

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

Set zrange for colormap plot.

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

Reimplemented in FieldGraph.

void Colormap::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.


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


Reference manual for Ion Beam Simulator 1.0.5dev
Generated by Doxygen 1.7.1 on Mon Feb 6 2012 15:07:16.