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
ParticleGraph Class Reference

Class for drawing particle trajectories. More...

#include <particlegraph.hpp>

Inheritance diagram for ParticleGraph:
Graph3D Graph

Public Member Functions

 ParticleGraph (const Geometry &g, const ParticleDataBase &pdb, uint32_t particle_div=11, uint32_t particle_offset=0, bool qm_discr=true)
 Constructor for particle plotter. More...
 
virtual ~ParticleGraph ()
 Destructor. More...
 
void set_particle_div (uint32_t particle_div, uint32_t particle_offset)
 Set particle divisor and offset. More...
 
void set_qm_discretation (bool qm_discr)
 Enable q/m discretation. 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 add_color (const Vec3D &color)
 Add a color to the list of trajectory colors. More...
 
void clear_colors (void)
 Clear the list of trajectory colors. More...
 
- Public Member Functions inherited from Graph3D
 Graph3D (const Mesh &mesh)
 Constructor. More...
 
virtual ~Graph3D ()
 Virtual destructor. More...
 
void set_view (view_e view, int level)
 Set the view of 3D drawable. More...
 
- Public Member Functions inherited from Graph
virtual ~Graph ()
 Virtual destructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from Graph3D
const Mesh_mesh
 Mesh of simulation. More...
 
view_e _view
 Geometry view direction. More...
 
int _vb [3]
 Coordinate index for first, second and third axes. More...
 
int _level
 Level of slice in mesh units. More...
 
double _level_si
 Level in meters. More...
 

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::ParticleGraph ( const Geometry g,
const ParticleDataBase pdb,
uint32_t  particle_div = 11,
uint32_t  particle_offset = 0,
bool  qm_discr = true 
)

Constructor for particle plotter.

◆ ~ParticleGraph()

ParticleGraph::~ParticleGraph ( )
virtual

Destructor.

Member Function Documentation

◆ add_color()

void ParticleGraph::add_color ( const Vec3D color)

Add a color to the list of trajectory colors.

◆ clear_colors()

void ParticleGraph::clear_colors ( void  )

Clear the list of trajectory colors.

◆ get_bbox()

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.

◆ plot()

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.

◆ plot_sample()

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.

◆ set_particle_div()

void ParticleGraph::set_particle_div ( uint32_t  particle_div,
uint32_t  particle_offset 
)

Set particle divisor and offset.

Set particle_div to zero for no plotting, one for plotting every particle, two for plotting every second particle, three for plotting every third particle, etc. Defaults to

  1. Plotter skips the first particle_offset particles.

◆ set_qm_discretation()

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 files:


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