|
| Box2 | EnlargedCell (int, int) const |
| | Compute the geometry of a cell, slightly enlarged.
|
| constexpr void | InverseVertexIndex (int, int &, int &) const |
| | Compute the coordinates of a given vertex.
|
| constexpr QPoint | InverseVertexIndex (int) const |
| | Compute the coordinates of a given vertex.
|
| constexpr int | CellIndex (int, int) const |
| | Compute the index of a given cell.
|
| constexpr int | CellIndex (const QPoint &) const |
| | Compute the index of a given cell.
|
| constexpr bool | InsideCellIndex (int, int) const |
| | Check if the indexes are within range.
|
| constexpr bool | InsideCellIndex (const QPoint &) const |
| | Check if the indexes are within range.
|
| void | InverseCellIndex (int, int &, int &) const |
| | Compute the coordinates of a given cell.
|
|
| Array2 () |
| | Empty array, with empty box.
|
| | Array2 (const Box2 &, int, int) |
| | Create the lattice structure.
|
| | Array2 (const Box2 &, int) |
| | Create the lattice structure.
|
| | Array2 (const Array &) |
| | Create the lattice structure.
|
| Array2 | DownSample (int) const |
| | Downsample the array.
|
| Array2 | UpSample (int) const |
| | Upsample the array.
|
|
| ~Array2 () |
| | Empty.
|
|
int | VertexSize () const |
| | Return the size of the vertex array.
|
|
int | GetSizeX () const |
| | Get the vertex size of the array for x axis.
|
|
int | GetSizeY () const |
| | Get the vertex size of the array for y axis.
|
|
int | VertexBorderSize () const |
| | Return the number of vertices on the boundary of the rectangle.
|
|
int | CellSize () const |
| | Return the size of the cell array.
|
|
int | CellSizeX () const |
| | Get the cell size of the array for x axis.
|
|
int | CellSizeY () const |
| | Get the cell size of the array for y axis.
|
|
QSize | GetQtSize () const |
| | Return the Qt size of the vertex array.
|
| Box2 | Cell (int) const |
| | Return the geometry of the cell.
|
| Box2 | Cell (int, int) const |
| | Return the geometry of the cell.
|
| void | HalfCell (int, int, bool, Triangle2 &, Triangle2 &) const |
| | Return the geometry of the cell.
|
| Vector2 | CellCenter (int, int) const |
| | Return the center of the cell.
|
| void | Scale (const Vector2 &) |
| | Scales the lattice structure.
|
| void | Scale (const double &) |
| | Scales the array structure.
|
|
Box2 | GetBox () const |
| | Get the box of the array.
|
| Box2 | UnitCell () const |
| | Return the geometry of a generic cell.
|
|
Vector2 | CellDiagonal () const |
| | Return the cell diagonal vector.
|
| double | CellArea () const |
| | Return the area of a cell.
|
| Vector2 | ArrayVertex (int, int) const |
| | Compute the coordinates of a point on the lattice.
|
| Vector2 | ArrayVertex (const QPoint &) const |
| | Compute the coordinates of a point on the lattice.
|
| QVector< Vector2 > | ArrayVertexes (const QVector< QPoint > &) const |
| | Compute the coordinates of a set of points on the lattice.
|
|
Vector2 | Size () const |
| | Return the size of the array.
|
|
QRect | AreaInteger () const |
| | Return the range of integer values for the domain.
|
| QImage | ImageGrid (const Box2 &, const double &) const |
| | Create a texture with a regular grid.
|
| void | Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
| | Draw the cells of the lattice.
|
| void | Subdivide () |
| | Change the resolution.
|
|
bool | IsEmpty () const |
| | Detect if the array is empty, i.e., any dimension equal to zero.
|
| QPoint | VertexBorder (int) const |
| | Compute the k-th point on the boundary of the domain.
|
| int | VertexBorderIndex (int, int) const |
| | Compute the index of a point on the boundary of the domain.
|
| void | VertexInteger (const Vector2 &, int &, int &) const |
| | Compute the coordinates of a vertex inside a cell.
|
| QPoint | VertexInteger (const Vector2 &) const |
| | Compute the coordinates of a vertex inside a cell.
|
| QPoint | VertexInteger (const Vector2 &, double &, double &) const |
| | Compute the integer coordinates of the cell containing a point, which are those of its first vertex, and the local coordinates of the point in the cell.
|
| QRect | VertexIntegerArea (const Box2 &) const |
| | Compute the integer coordinates of the vertices embedding a box.
|
| QRect | VertexIntegerArea (const Circle2 &) const |
| | Compute the integer coordinates of the vertices embedding a circle.
|
| QRect | VertexIntegerArea (const QRect &) const |
| | Compute the integer coordinates span of the vertices embedding a rectangle.
|
| QRect | VertexIntegerArea (int, int, int) const |
| | Compute the integer coordinates of the vertices embedding a cell with prescribed integer radius.
|
| void | CellInteger (const Vector2 &, int &, int &) const |
| | Compute the coordinates of a vertex inside a cell.
|
| void | CellInteger (const Vector2 &, int &, int &, double &, double &) const |
| | Compute the point on the lattice given an input point.
|
| QPoint | CellInteger (const Vector2 &) const |
| | Compute the coordinates of a vertex inside a cell.
|
| QPoint | CellInteger (const Vector2 &, double &, double &) const |
| | Compute the point on the lattice given an input point.
|
| QRect | CellIntegerArea (const Box2 &) const |
| | Compute the integer coordinates of the cells of the array embedding an input box.
|
| QRect | CellIntegerArea (const Circle2 &) const |
| | Compute the integer coordinates of the cells of the array embedding an input circle.
|
| void | Translate (const Vector2 &) |
| | Translate the array.
|
|
Vector2 | Center () const |
| | Return the center of the array.
|
| constexpr bool | InsideVertexIndex (int, int) const |
| | Check if the indexes are within range.
|
| constexpr bool | OutsideVertexIndex (int, int) const |
| | Check if the indexes are outside or on the border.
|
| constexpr bool | InsideVertexIndex (const QPoint &) const |
| | Check if the indexes are within range.
|
| constexpr bool | InsideVertexIndex (int, int, int) const |
| | Check if the indexes are within k-range.
|
| bool | Inside (const Vector2 &) const |
| | Check if a point is in the rectangular domain.
|
| constexpr bool | BorderVertexIndex (int, int) const |
| | Check if the indexes are on the border.
|
| constexpr bool | BorderVertexIndex (const QPoint &) const |
| | Check if the indexes are on the border.
|
| constexpr int | VertexIndex (int, int) const |
| | Compute the index of a given vertex.
|
| constexpr int | VertexIndex (const QPoint &) const |
| | Compute the index of a given vertex.
|
| QPoint | Next (const QPoint &, int) const |
| | Compute the point next to another one.
|
|
QString | Statistics () const |
| | Get statistics.
|
| void | ClampVertexIndex (int &, int &) const |
| | Clamp vertex indexes to the size of the array.
|
| Vector2 | VertexUV (const Vector2 &) const |
| | Compute the coordinates of a point inside the box given uv coordinates.
|
|
| Box2 () |
| | Empty.
|
| | Box2 (const double &) |
| | Create a square box centered at the origin and of given half side length.
|
| | Box2 (const double &, const double &) |
| | Create a box centered at the origin and of given dimensions.
|
| | Box2 (const Vector2 &) |
| | Create a box from a single vertex.
|
| | Box2 (const Vector2 &, const Vector2 &) |
| | Create a box.
|
| | Box2 (const Vector2 &, const double &) |
| | Creates a box.
|
| | Box2 (const Vector2 &, const double &, const double &) |
| | Create a box given a center point and its width, length, and height.
|
| | Box2 (const Box &) |
| | Create a box in the plane given a box.
|
| | Box2 (const Box2 &, const Box2 &) |
| | Create a box embedding two boxes.
|
| | Box2 (const Box2 &, const Matrix2 &) |
| | Creates an axis aligned bounding box from a box and a transformation matrix.
|
| | Box2 (const Box2 &, const Frame2 &) |
| | Creates an axis aligned bounding box from a box and a frame.
|
| | Box2 (const Box2 &, const FrameScaled2 &) |
| | Creates an axis aligned bounding box from a box and a frame.
|
| | Box2 (const QVector< Vector2 > &) |
| | Compute the bounding box of a set of points.
|
| | Box2 (const QSize &) |
| | Create a box from a Qt size.
|
|
Vector2 & | operator[] (int) |
| | Returns either end vertex of the box.
|
|
Vector2 | operator[] (int) const |
| | Overloaded.
|
|
Vector2 | Size () const |
| | Compute the size (width and height) of a box.
|
| double | Width () const |
| | Compute the width of a box.
|
| double | Height () const |
| | Compute the height of a box.
|
|
Vector2 | Diagonal () const |
| | Returns the diagonal of the box.
|
|
double | Radius () const |
| | Returns the radius of the box, i.e. the length of the half diagonal of the box.
|
|
double | Area () const |
| | Compute the surface area of a box.
|
|
double | Perimeter () const |
| | Compute the perimeter of the box.
|
|
Vector2 | Center () const |
| | Returns the center of the box.
|
| Vector2 | Vertex (int) const |
| | Returns the k-th vertex of the box.
|
| Segment2 | Edge (int) const |
| | Returns the k-th edge of the box.
|
| Vector2 | Vertex (int, int, int, int) const |
| | Compute the coordinates of a grid aligned point.
|
| Vector2 | VertexUV (const Vector2 &) const |
| | Compute the coordinates of a point inside the box given uv coordinates.
|
| Box2 | Sub (int) const |
| | Computes the sub-box in the n-th quadrant.
|
| double | R (const Vector2 &) const |
| | Compute the squared distance between the box and a point.
|
| Vector2 | Normal (const Vector2 &) const |
| | Compute the distance vector between the box and a point.
|
| double | Signed (const Vector2 &) const |
| | Computes the signed distance between the box and a point.
|
| double | R (const Box2 &) const |
| | Compute the squared Euclidean distance between two boxes.
|
| void | Translate (const Vector2 &) |
| | Translates a box.
|
| void | Scale (const Vector2 &) |
| | Scales a box.
|
| void | Scale (const double &) |
| | Scales a box.
|
| Box2 | Translated (const Vector2 &) const |
| | Translated box.
|
| Box2 | Scaled (const double &) const |
| | Scales a box and return the scaled box.
|
| Box2 | Scaled (const Vector2 &) const |
| | Scales a box and return the scaled box.
|
| Box2 | Scaled (const QSize &) const |
| | Scales a box according to a Qt size.
|
| Box2 | ScaledTo (const double &) const |
| | Scale the box so that the largest side should equal the argument value.
|
| Box2 | ScaledCentered (const double &) const |
| | Scales a box while preserving its center.
|
| Box2 | Rotated (const double &) const |
| | Compute the box embedding the rotated box.
|
| Box2 | Rotated (const Matrix2 &) const |
| | Compute the box embedding the rotated box.
|
| Box2 | Centered () const |
| | Compute the box translated to origin.
|
| Box2 | InscribedCube () const |
| | Creates the biggest cube inscribed in the box.
|
| Box2 | Cube () const |
| | Return the tightest embedding cube from an arbitrarilly shaped box.
|
| void | Extend (const double &) |
| | Extend the limits of the box by a given distance.
|
| void | Extend (const Vector2 &) |
| | Extend the limits of the box given a point.
|
| Box2 | Extended (const double &) const |
| | Extend the limits of the box by a given distance.
|
| void | SetParallelepipedic (int, int &, int &) |
| | Inflates a box so that its dimensions should be a fraction of its maximum side length.
|
| void | SetParallelepipedic (const double &, int &, int &) |
| | Creates a parallelepipedic box whose dimensions are integer multiples of a given input reference size.
|
| bool | Inside (const Vector2 &) const |
| | Test if a point is inside the box.
|
| bool | Inside (const Vector2 &, const double &) const |
| | Test if a point lies withing a given range of the box.
|
| bool | Intersect (const Box2 &) const |
| | Check if the box intersects another box.
|
| double | OverlapArea (const Box2 &) const |
| | Computes the overlapping area of two boxes.
|
| Box2 | Intersection (const Box2 &) const |
| | Computes the intersection between two boxes.
|
| Box | ToBox (const double &, const double &) const |
| | Convert a planar Box2 to a Box.
|
| int | Quadrant (const Vector2 &) const |
| | Computes quadrant index of a vertex with respect to the box center.
|
| bool | Intersect (const Ray2 &, double &, double &) const |
| | Computes the intersection between a box and a ray.
|
| bool | Intersect (const Ray2 &) const |
| | Computes the intersection between a box and a ray.
|
| bool | Intersect (const Line2 &, double &, double &) const |
| | Computes the intersection between a box and a line.
|
| bool | Intersect (const Segment2 &, double &, double &) const |
| | Compute the intersection between a box and a segment.
|
| bool | Intersect (const Line2 &) const |
| | Check the intersection between a box and a line.
|
| bool | Intersect (const Segment2 &) const |
| | Check the intersection between a box and a segment.
|
| void | Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
| | Draw a rectangle.
|
| Vector2 | RandomInside (Random &=Random::R239) const |
| | Generate a random vector inside the box.
|
| Vector2 | RandomOn (Random &=Random::R239) const |
| | Generate a random vector on the perimeter of the box.
|
|
QRectF | GetQtRect () const |
| | Create the Qt rectangle.
|
| QRect | TileRange (const Box2 &) const |
| | Compute the range of index for tiling the argument box so that it covers the box.
|
| Box2 | Tile (int, int) const |
| | Return the tiled the box using integer coordinates.
|
| Box2 | Tile (const QRect &) const |
| | Return the tiled the box using integer coordinates.
|
| Segment2 | GetSegment (const double &, bool=true) const |
| | Compute the horizontal or vertical segment dividing the box into u and 1-u parts.
|
| Ia | AxisInterval (const Vector2 &) const |
| | Project a the vertexes of the box onto an axis.
|
| QVector< Vector2 > | Poisson (const double &, int, Random &=Random::R239) const |
| | Compute a Poisson disc distribution inside a box.
|
| QVector< Vector2 > | Poisson (const double &, int, const QVector< Vector2 > &, bool=true, Random &=Random::R239) const |
| | Compute a Poisson disc distribution inside a box.
|
| QVector< Vector2 > | GridSampling (double) const |
| | Compute a regular grid sampling inside the box.
|
| QVector< Vector2 > | GridSampling (double, Random &) const |
| | Compute a jittered grid sampling inside the box.
|
A loose-grid for fast spatial queries.
The grid is defined by an array, and each cell stores a set of indexes of elements straddling the cell.
In general, when used with a scalar field, the domain of the loose grid should be slightly larger than the domain of the scalar field, so that queries performed at the vertexes of the scalar field should not lie on the boundary and cause potential errors.
Box2()
Empty.
Definition box.h:321
RelaxedArray2(const Array2 &)
Create a loose grid from an array.
Definition relaxedarray2.cpp:42
A base two-dimensional field of real values.
Definition scalarfield.h:331
Vector2()
Empty.
Definition evector.h:637
The array has nx-1 by ny-1 cells, and nx and ny should be at least two.
The Add() functions compute the cells covered by the bounding box of an element with Array2::CellIntegerArea(), and store the index of the element in the cells that intersect it. The cells are slightly enlarged, by a relative tolerance of RelaxedArray2::Epsilon, so that an element touching the boundary of a cell is stored in the cell: this guarantees that the set of a cell contains all the elements that contain a point of the cell, including the points of its boundary, which belong to the cell of higher coordinates, and also the points on the maximum boundary of the domain. An element that is outside the domain is not stored.
The triangles should be counterclockwise, as Triangle2::Intersect(const Box2&) const only works for this orientation. The indexes of the elements should be positive, and the indexes in use should be consecutive to get a meaningful sparsity.
- See also
- ScalarField2