#include <scene.hpp>
Collaboration diagram for Scene:
Public Types | |
enum | ecalc_t { CALC_BFIELD = 1, CALC_EFIELD, CALC_POTENTIAL } |
Public Member Functions | |
Scene (ElectroDynamics &dynamics) | |
~Scene () | |
void | calc (Screen &screen, ecalc_t ct=CALC_BFIELD) |
Calculate field values based on screen. | |
void | render_map (Screen &screen) |
Render field onto screen. | |
void | render_lic (Screen &screen) |
Render line integral convolutions of the field onto the screen. | |
void | render_lic_animation (Screen &screen, const char *name_prefix, int frames) |
Render line integral convolution animation of the field onto the screen. | |
void | set_coloring (size_t levels=0, bool use_log=false) |
Define coloring scheme used at render operations. | |
const Screen::color & | cmap (prec_t bf) |
bool | render_bline (Screen &screen, const vect3d &pos, const Screen::color &color, prec_t limit_dist=-1, const vect3d &limit_pos=vect3d(0, 0, 0), prec_t limit_pos_radius=0.0, bool backwards=false) |
Render a lines following the field from given position. | |
void | calibrate_bline_step (const vect3d &pos, prec_t step) |
Precalibrate field values for the render_bline_range() from the given position. | |
void | render_bline_range (Screen &screen, const vect3d &pos0, const vect3d &pos1, const Screen::color &color, prec_t first_factor=1.0, prec_t dist_limit=-1, const vect3d &line_end=vect3d(0, 0, 0), prec_t line_end_radius=0.0) |
Render a series of lines in the given range. | |
bool | find_untouching_bline (vect3d &result, const vect3d &pos0, vect3d &pos1, prec_t limit_dist=-1, prec_t limit_pos_radius=0.0) |
Find the position of a line close to any structures in the simulation. | |
prec_t | get_fmin () |
Get field minimum magnitude. | |
prec_t | get_fmax () |
Get field maximum magnitude. | |
prec_t | get_fadd () |
Get field correction add. | |
void | calibrate_field (prec_t min, prec_t max, prec_t add=0) |
Recalibrate fields to given values used at rendering, values outside the given range are truncated. | |
Static Public Member Functions | |
static prec_t | hf (prec_t a, prec_t b, prec_t phi) |
Friends | |
struct | calctask |
struct | lictask |
Classes | |
struct | calctask |
struct | lictask |
struct | value_map |
The idea is that the screen defines a projection. You first use the Scene to calculate a set of values that are stored withing the Scene object. Later this data can be visualized on the Screen with different parameters.
Definition at line 40 of file scene.hpp.
enum Scene::ecalc_t |
Scene::Scene | ( | ElectroDynamics & | dynamics | ) |
Scene::~Scene | ( | ) |
Calculate field values based on screen.
void Scene::render_map | ( | Screen & | screen | ) |
Render field onto screen.
void Scene::render_lic | ( | Screen & | screen | ) |
Render line integral convolutions of the field onto the screen.
void Scene::render_lic_animation | ( | Screen & | screen, | |
const char * | name_prefix, | |||
int | frames | |||
) |
Render line integral convolution animation of the field onto the screen.
void Scene::set_coloring | ( | size_t | levels = 0 , |
|
bool | use_log = false | |||
) |
Define coloring scheme used at render operations.
levels | Number of levels to use, with levels=0 meaning all levels | |
use_log | Use logarithmic scale for values |
const Screen::color& Scene::cmap | ( | prec_t | bf | ) |
bool Scene::render_bline | ( | Screen & | screen, | |
const vect3d & | pos, | |||
const Screen::color & | color, | |||
prec_t | limit_dist = -1 , |
|||
const vect3d & | limit_pos = vect3d(0, 0, 0) , |
|||
prec_t | limit_pos_radius = 0.0 , |
|||
bool | backwards = false | |||
) |
Render a lines following the field from given position.
pos | Start rendering from | |
color | Render with given color | |
limit_dist | Limit distance to draw the line, with -1 being infinite | |
limit_pos | When line comes to proximity terminate rendering | |
limit_pos_radius | Proximity to limit_pos that is used to terminate drawing | |
backwards | Draw backwards to the field direction |
Precalibrate field values for the render_bline_range() from the given position.
void Scene::render_bline_range | ( | Screen & | screen, | |
const vect3d & | pos0, | |||
const vect3d & | pos1, | |||
const Screen::color & | color, | |||
prec_t | first_factor = 1.0 , |
|||
prec_t | dist_limit = -1 , |
|||
const vect3d & | line_end = vect3d(0, 0, 0) , |
|||
prec_t | line_end_radius = 0.0 | |||
) |
Render a series of lines in the given range.
bool Scene::find_untouching_bline | ( | vect3d & | result, | |
const vect3d & | pos0, | |||
vect3d & | pos1, | |||
prec_t | limit_dist = -1 , |
|||
prec_t | limit_pos_radius = 0.0 | |||
) |
Find the position of a line close to any structures in the simulation.
prec_t Scene::get_fmin | ( | ) | [inline] |
prec_t Scene::get_fmax | ( | ) | [inline] |
prec_t Scene::get_fadd | ( | ) | [inline] |