Public Member Functions
ParticleGraph Class Reference

Class for drawing particle trajectories. More...

#include <particlegraph.hpp>

Inheritance diagram for ParticleGraph:
Graph3D Graph

List of all members.

Public Member Functions

 ParticleGraph (const Geometry &g, const ParticleDataBase &pdb, int particlediv=10, bool qm_discr=true)
 Constructor for particle plotter.
virtual ~ParticleGraph ()
 Destructor.
void set_particle_div (size_t particle_div)
 Set particle divisor.
void set_qm_discretation (bool qm_discr)
 Enable q/m discretation.
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 add_color (const Color &color)
 Add a color to the list of trajectory colors.
void clear_colors (void)
 Clear the list of trajectory colors.

Detailed Description

Class for drawing particle trajectories.

Draws particle trajectories. Using the particlediv variable only one per particlediv trajectories is plotted. The different q/m values are discriminated by colors if enabled with qm_dircr. The trajectories are drawn with straight lines if the particle database interpolation is set to linear or curves if polynomial interpolation is used.

Implementation of Graph3D.


Constructor & Destructor Documentation

ParticleGraph::ParticleGraph ( const Geometry g,
const ParticleDataBase pdb,
int  particlediv = 10,
bool  qm_discr = true 
)

Constructor for particle plotter.

virtual ParticleGraph::~ParticleGraph ( ) [virtual]

Destructor.


Member Function Documentation

void ParticleGraph::add_color ( const Color color)

Add a color to the list of trajectory colors.

void ParticleGraph::clear_colors ( void  )

Clear the list of trajectory colors.

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

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

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

Implements Graph3D.

void ParticleGraph::set_particle_div ( size_t  particle_div)

Set particle divisor.

Zero for no plotting, one for plotting every particle, two for plotting every second particle, three for plotting every third particle, etc. Defaults to 10.

void ParticleGraph::set_qm_discretation ( bool  qm_discr)

Enable q/m discretation.

If q/m discretation is enabled, different q/m particles will be plotted with different colors. Default is enabled.


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