CGAL::Regular_grid_2<StreamLinesTraits_2>

Definition

The template parameter StreamLinesTraits_2 has to be instantiated by a model of the concept StreamLinesTraits_2.
This class provides a 2D vector field specified by a set of sample points defined on a regular grid, with a bilinear interpolation scheme over its cells (i.e. for each point p in a cell c, the vector value is interpolated from the vertices of c).

Types

typedef StreamLinesTraits_2::FT FT; the scalar type.
typedef StreamLinesTraits_2::Point_2
Point_2; the point type.
typedef StreamLinesTraits_2::Vector_2
Vector_2; the vector type.

Creation

Regular_grid_2<StreamLinesTraits_2> rgrid ( int x_samples, int y_samples, FT x_size, FT y_size);
Generate a regular grid rgrid whose size is x_size by y_size, while x_samples and y_samples specify the number of samples on x and y.

Modifiers

In addition to the minimum interface required by the concept definition, the class Regular_grid_2<StreamLinesTraits_2> provides the following function to fill the vector field with the user data.

void rgrid.set_xy ( int i, int j, Vector_2 v)
Attribute the vector v to the position (i,j) on the regular grid.

Access Functions

std::pair<int, int> rgrid.get_dimension () returns the dimension of the grid.

std::pair<FT, FT> rgrid.get_size () returns the size of the grid.

Is Model for the Concepts

VectorField_2

See Also

Triangular_field_2<StreamLinesTraits_2>