#include <lefer.hpp>
◆ DensityGrid()
lefer::DensityGrid::DensityGrid |
( |
int |
flow_field_width, |
|
|
int |
flow_field_height, |
|
|
double |
d_sep, |
|
|
int |
cell_capacity |
|
) |
| |
The constructor for DensityGrid class
The Jobard and Lefer algortihm works around a "supporting" 2D grid, called of "density grid". Each cell (or coordinate) in this density grid is responsible for keeping tracking of curves that are already drawn into that specific area of the flow field.
In the cell_capacity
argument, you can specify an amount of space you want to pre-allocate for each cell in the density grid before the algorithm starts to run. This might improve drawstically the performance of the algorithm, because you avoid the need for frequents resizing and reallocation of the std::vector
objects that represents each cell.
In other words, if you pre-allocate enough space for each cell in the density grid, then, the algorithm does not have to spend time resizing the cell every time it hits the maximum capacity for that cell.
- Parameters
-
flow_field_width | the width of the flow field. |
flow_field_height | the height of the flow field. |
d_sep | the "separation distance", i.e., the amount of distance that each curve must be from neighbouring curves. |
cell_capacity | the capacity (or "space") you want to allocate for each cell in the density grid. |
◆ get_density_col()
int lefer::DensityGrid::get_density_col |
( |
double |
x | ) |
|
◆ get_density_index() [1/2]
int lefer::DensityGrid::get_density_index |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
◆ get_density_index() [2/2]
int lefer::DensityGrid::get_density_index |
( |
int |
col, |
|
|
int |
row |
|
) |
| |
◆ get_density_row()
int lefer::DensityGrid::get_density_row |
( |
double |
y | ) |
|
◆ insert_coord()
void lefer::DensityGrid::insert_coord |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
◆ insert_curve_coords()
void lefer::DensityGrid::insert_curve_coords |
( |
Curve * |
curve | ) |
|
◆ is_valid_next_step()
bool lefer::DensityGrid::is_valid_next_step |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
◆ off_boundaries()
bool lefer::DensityGrid::off_boundaries |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
The documentation for this class was generated from the following files: