Core 1.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
Array2 Class Reference

A base two-dimensional array structure. More...

#include <array.h>

Inheritance diagram for Array2:
Box2 ArrayIndex2 ArrayInteger2 ColorField ScalarField2 VectorField2

Public Member Functions

 Array2 ()
 Empty array, with empty box.
 
 Array2 (const Box2 &, int, int)
 Create the array structure. More...
 
 Array2 (const Box2 &, int)
 Create the array structure. More...
 
Array2 DownSample (int) const
 Downsample the array. More...
 
Array2 UpSample (int) const
 Upsample the array. More...
 
 ~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 size of the vertex array.
 
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. More...
 
Box2 Cell (int, int) const
 Return the geometry of the cell. More...
 
void HalfCell (int, int, bool, Triangle2 &, Triangle2 &) const
 Return the geometry of the cell. More...
 
Vector2 CellCenter (int, int) const
 Return the center of the cell. More...
 
void Scale (const Vector2 &)
 Scales the array structure. More...
 
void Scale (const double &)
 Scales the array structure. More...
 
Box2 GetBox () const
 Get the box of the array.
 
Box2 UnitCell () const
 Return the geometry of a generic cell. More...
 
Vector2 CellDiagonal () const
 Return the cell diagonal vector.
 
double CellArea () const
 Return the area of a cell. More...
 
Vector2 ArrayVertex (int, int) const
 Compute the coordinates of a point on the grid. More...
 
Vector2 ArrayVertex (const QPoint &) const
 Compute the coordinates of a point on the grid. More...
 
QVector< Vector2ArrayVertexes (const QVector< QPoint > &) const
 Compute the coordinates of a set of points on the grid. More...
 
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. More...
 
void Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const
 Draw the cells of the grid. More...
 
void Subdivide ()
 Change the resolution. More...
 
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. More...
 
int VertexBorderIndex (int, int) const
 Compute the index of a point on the boundary of the domain. More...
 
void VertexInteger (const Vector2 &, int &, int &) const
 Compute the coordinates of a vertex inside a cell. More...
 
QPoint VertexInteger (const Vector2 &) const
 Compute the coordinates of a vertex inside a cell. More...
 
QPoint VertexInteger (const Vector2 &, double &, double &) const
 Compute the point on the grid given an input point. More...
 
QRect VertexIntegerArea (const Box2 &) const
 Compute the integer coordinates of the vertices embedding a box. More...
 
QRect VertexIntegerArea (const Circle2 &) const
 Compute the integer coordinates of the vertices embedding a circle. More...
 
QRect VertexIntegerArea (const QRect &) const
 Compute the integer coordinates span of the vertices embedding a rectangle. More...
 
void CellInteger (const Vector2 &, int &, int &) const
 Compute the coordinates of a vertex inside a cell. More...
 
void CellInteger (const Vector2 &, int &, int &, double &, double &) const
 Compute the point on the grid given an input point. More...
 
QPoint CellInteger (const Vector2 &) const
 Compute the coordinates of a vertex inside a cell. More...
 
QPoint CellInteger (const Vector2 &, double &, double &) const
 Compute the point on the grid given an input point. More...
 
QRect CellIntegerArea (const Box2 &) const
 Compute the integer coordinates of the cells of the array embedding an input box. More...
 
QRect CellIntegerArea (const Circle2 &) const
 Compute the integer coordinates of the cells of the array embedding an input circle. More...
 
void Translate (const Vector2 &)
 Translate the array. More...
 
Vector2 Center () const
 Return the center of the array.
 
constexpr bool InsideVertexIndex (int, int) const
 Check if the indexes are within range. More...
 
constexpr bool OutsideVertexIndex (int, int) const
 Check if the indexes are outside or on the border. More...
 
constexpr bool InsideVertexIndex (const QPoint &) const
 Check if the indexes are within range. More...
 
constexpr bool InsideVertexIndex (int, int, int) const
 Check if the indexes are within k-range. More...
 
bool Inside (const Vector2 &) const
 Check if a point is in the rectangular domain. More...
 
constexpr bool BorderVertexIndex (int, int) const
 Check if the indexes are on the border. More...
 
constexpr bool BorderVertexIndex (const QPoint &) const
 Check if the indexes are on the border. More...
 
constexpr int VertexIndex (int, int) const
 Compute the index of a given cell. More...
 
constexpr int VertexIndex (const QPoint &) const
 Compute the index of a given cell. More...
 
QPoint Next (const QPoint &, int) const
 Compute the point next to another one. More...
 
QImage CreateEmptyImage () const
 Create an image with the same size as the array. More...
 
QString Statistics () const
 Get statistics.
 
void ClampVertexIndex (int &, int &) const
 Clamp vertex indexes to the size of the array. More...
 

Static Public Member Functions

static int NeighborCode (int, int)
 Convert a direction to an 8 bit integer code. More...
 
static QPoint codeToDir (int)
 Convert an 8 bit integer code direction into a direction vector. More...
 

Protected Member Functions

constexpr void InverseVertexIndex (int, int &, int &) const
 Compute the coordinates of a given cell. More...
 
constexpr QPoint InverseVertexIndex (int) const
 Compute the coordinates of a given cell. More...
 
constexpr int CellIndex (int, int) const
 Compute the index of a given cell. More...
 
constexpr int CellIndex (const QPoint &) const
 Compute the index of a given cell. More...
 
constexpr bool InsideCellIndex (int, int) const
 Check if the indexes are within range. More...
 
constexpr bool InsideCellIndex (const QPoint &) const
 Check if the indexes are within range. More...
 
void InverseCellIndex (int, int &, int &) const
 Compute the coordinates of a given cell. More...
 
- Protected Member Functions inherited from Box2
 Box2 ()
 Empty.
 
 Box2 (const double &)
 Create a square box centered at the origin and of given half side length. More...
 
 Box2 (const double &, const double &)
 Create a box centered at the origin and of given dimensions. More...
 
 Box2 (const Vector2 &)
 Create a box from a single vertex. More...
 
 Box2 (const Vector2 &, const Vector2 &)
 Create a box. More...
 
 Box2 (const Vector2 &, const double &)
 Creates a box. More...
 
 Box2 (const Box &)
 Create a box in the plane given a box. More...
 
 Box2 (const Box2 &, const Box2 &)
 Create a box embedding two boxes. More...
 
 Box2 (const Box2 &, const Matrix2 &)
 Creates an axis aligned bounding box from a box and a transformation matrix. More...
 
 Box2 (const Box2 &, const Frame2 &)
 Creates an axis aligned bounding box from a box and a frame. More...
 
 Box2 (const QVector< Vector2 > &)
 Compute the bounding box of a set of points. More...
 
 Box2 (const QSize &)
 Create a box from a Qt size. More...
 
Vector2operator[] (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. More...
 
double Height () const
 Compute the height of a box. More...
 
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. More...
 
Vector2 Vertex (int, int, int, int) const
 Compute the coordinates of a grid aligned point. More...
 
Box2 Sub (int) const
 Computes the sub-box in the n-th quadrant. More...
 
double R (const Vector2 &) const
 Compute the squared distance between the box and a point. More...
 
double Signed (const Vector2 &) const
 Computes the signed distance between the box and a point. More...
 
double R (const Box2 &) const
 Compute the squared Euclidean distance between two boxes. More...
 
void Translate (const Vector2 &)
 Translates a box. More...
 
void Scale (const Vector2 &)
 Scales a box. More...
 
void Scale (const double &)
 Scales a box. More...
 
Box2 Translated (const Vector2 &) const
 Translated box. More...
 
Box2 Scaled (const double &) const
 Scales a box and return the scaled box. More...
 
Box2 Scaled (const Vector2 &) const
 Scales a box and return the scaled box. More...
 
Box2 Scaled (const QSize &) const
 Scales a box according to a Qt size. More...
 
Box2 ScaledTo (const double &) const
 Scale the box so that the largest side should equal the argument value. More...
 
Box2 Rotated (const double &) const
 Compute the box embedding the rotated box. More...
 
Box2 Rotated (const Matrix2 &) const
 Compute the box embedding the rotated box. More...
 
Box2 Centered () const
 Compute the box translated to origin. More...
 
void SetCubic ()
 Creates the tightest embedding cube from an arbitrarilly shaped box. More...
 
void SetInscribedCubic ()
 Creates the biggest cube inscribed in the box. More...
 
Box2 Cube () const
 Return the tightest embedding cube from an arbitrarilly shaped box. More...
 
void Extend (const double &)
 Extend the limits of the box by a given distance. More...
 
void Extend (const Vector2 &)
 Extend the limits of the box given a point. More...
 
Box2 Extended (const double &) const
 Extend the limits of the box by a given distance. More...
 
void SetParallelepipedic (int, int &, int &)
 Inflates a box so that its dimensions should be a fraction of its maximum side length. More...
 
void SetParallelepipedic (const double &, int &, int &)
 Creates a parallelepipedic box whose dimensions are integer multiples of a given input reference size. More...
 
bool Inside (const Vector2 &) const
 Test if a point is inside the box. More...
 
bool Inside (const Vector2 &, const double &) const
 Test if a point lies withing a given range of the box. More...
 
bool Intersect (const Box2 &) const
 Check if the box intersects another box. More...
 
double OverlapArea (const Box2 &) const
 Computes the overlapping area of two boxes. More...
 
Box2 Intersection (const Box2 &) const
 Computes the intersection between two boxes. More...
 
Box ToBox (const double &, const double &) const
 Convert a planar Box2 to a Box. More...
 
int Quadrant (const Vector2 &) const
 Computes quadrant index of a vertex with respect to the box center. More...
 
bool Intersect (const Ray2 &, double &, double &) const
 Computes the intersection between a box and a ray. More...
 
bool Intersect (const Ray2 &) const
 Computes the intersection between a box and a ray. More...
 
bool Intersect (const Line2 &, double &, double &) const
 Computes the intersection between a box and a line. More...
 
bool Intersect (const Segment2 &, double &, double &) const
 Compute the intersection between a box and a segment. More...
 
bool Intersect (const Line2 &) const
 Check the intersection between a box and a line. More...
 
bool Intersect (const Segment2 &) const
 Check the intersection between a box and a segment. More...
 
void Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const
 Draw a rectangle. More...
 
Vector2 RandomInside (Random &=Random::R239) const
 Generate a random vector inside the box. More...
 
Vector2 RandomOn (Random &=Random::R239) const
 Generate a random vector on the perimeter of the box. More...
 
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. More...
 
Box2 Tile (int, int) const
 Return the tiled the box using integer coordinates. More...
 
Box2 Tile (const QRect &) const
 Return the tiled the box using integer coordinates. More...
 
QVector< Vector2Poisson (const double &, int, Random &=Random::R239) const
 Compute a Poisson disc distribution inside a box. More...
 

Protected Attributes

int ny = 0
 Sizes.
 
Vector2 celldiagonal = Vector2::Null
 Cell diagonal.
 
Vector2 inversecelldiagonal = Vector2::Null
 Inverse cell diagonal.
 
- Protected Attributes inherited from Box2
Vector2 b
 Lower and upper vertices of the box.
 

Static Protected Attributes

static const QPoint next [8] = { QPoint(1, 0), QPoint(1, 1), QPoint(0, 1), QPoint(-1, 1), QPoint(-1, 0), QPoint(-1, -1), QPoint(0, -1), QPoint(1, -1) }
 Array of points in the 1-ring neighborhood.
 
static const double length [8] = { 1.0, sqrt(2.0), 1.0, sqrt(2.0), 1.0, sqrt(2.0), 1.0, sqrt(2.0) }
 Length to the i-th neighbor.
 
static const double inverselength [8] = { 1.0, 1.0 / sqrt(2.0), 1.0, 1.0 / sqrt(2.0), 1.0, 1.0 / sqrt(2.0), 1.0, 1.0 / sqrt(2.0) }
 Inverse length.
 
- Static Protected Attributes inherited from Box2
static const double epsilon = 1.0e-5
 Epsilon value used to check intersections and some round off errors.
 
static const Box2 Infinity
 Huge bounding box, which should enclose any other.
 
static const Box2 Null
 Null box, equivalent to. More...
 
static const Box2 Unit
 Unit box, defined as. More...
 

Friends

std::ostream & operator<< (std::ostream &, const Array2 &)
 Overloaded. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from Box2
static Box2 MinMax (const Vector2 &, const Vector2 &)
 Create a box from any two points. More...
 

Detailed Description

A base two-dimensional array structure.

An array is a two-dimensional rectangle virtually decomposed into cells.

Constructor & Destructor Documentation

◆ Array2() [1/2]

Array2::Array2 ( const Box2 box,
int  x,
int  y 
)
explicit

Create the array structure.

Parameters
boxThe box.
x,ySize of the array.

◆ Array2() [2/2]

Array2::Array2 ( const Box2 box,
int  n 
)
explicit

Create the array structure.

Parameters
boxThe box.
nSize of the array.

Member Function Documentation

◆ ArrayVertex() [1/2]

Vector2 Array2::ArrayVertex ( const QPoint &  p) const
inline

Compute the coordinates of a point on the grid.

Parameters
pPoint.

◆ ArrayVertex() [2/2]

Vector2 Array2::ArrayVertex ( int  i,
int  j 
) const
inline

Compute the coordinates of a point on the grid.

Parameters
i,jInteger coordinates.

◆ ArrayVertexes()

QVector< Vector2 > Array2::ArrayVertexes ( const QVector< QPoint > &  s) const

Compute the coordinates of a set of points on the grid.

See also
ArrayVertex
Parameters
pSet of point.

◆ BorderVertexIndex() [1/2]

constexpr bool Array2::BorderVertexIndex ( const QPoint &  p) const
inlineconstexpr

Check if the indexes are on the border.

Parameters
pPoint.

◆ BorderVertexIndex() [2/2]

constexpr bool Array2::BorderVertexIndex ( int  i,
int  j 
) const
inlineconstexpr

Check if the indexes are on the border.

Parameters
i,jInteger coordinates of the vertex.

◆ Cell() [1/2]

Box2 Array2::Cell ( int  c) const

Return the geometry of the cell.

Parameters
cInteger cell index.

◆ Cell() [2/2]

Box2 Array2::Cell ( int  i,
int  j 
) const

Return the geometry of the cell.

Parameters
i,jInteger coordinates of the cell.

◆ CellArea()

double Array2::CellArea ( ) const

Return the area of a cell.

This is convenience function, which is the same as the following code, but more efficient:

Array2 array;
double a=array.UnitCell().Area();
A base two-dimensional array structure.
Definition: array.h:12
Box2 UnitCell() const
Return the geometry of a generic cell.
Definition: array2.cpp:211
double Area() const
Compute the surface area of a box.
Definition: box.h:688

◆ CellCenter()

Vector2 Array2::CellCenter ( int  i,
int  j 
) const

Return the center of the cell.

Parameters
i,jInteger coordinates of the cell.

◆ CellIndex() [1/2]

constexpr int Array2::CellIndex ( const QPoint &  p) const
inlineconstexprprotected

Compute the index of a given cell.

Parameters
pPoint.

◆ CellIndex() [2/2]

constexpr int Array2::CellIndex ( int  i,
int  j 
) const
inlineconstexprprotected

Compute the index of a given cell.

Parameters
i,jInteger coordinates of the cell.

◆ CellInteger() [1/4]

QPoint Array2::CellInteger ( const Vector2 p) const
inline

Compute the coordinates of a vertex inside a cell.

Parameters
pPoint.

◆ CellInteger() [2/4]

QPoint Array2::CellInteger ( const Vector2 p,
double &  u,
double &  v 
) const
inline

Compute the point on the grid given an input point.

Parameters
pPoint.
u,vCoordinates of the point in the corresponding cell.

◆ CellInteger() [3/4]

void Array2::CellInteger ( const Vector2 p,
int &  i,
int &  j 
) const
inline

Compute the coordinates of a vertex inside a cell.

Parameters
pPoint.
i,jInteger coordinates of the cell.

◆ CellInteger() [4/4]

void Array2::CellInteger ( const Vector2 p,
int &  i,
int &  j,
double &  u,
double &  v 
) const
inline

Compute the point on the grid given an input point.

Parameters
pPoint.
i,jInteger coordinates of the cell.
u,vCoordinates of the point in the corresponding cell.

◆ CellIntegerArea() [1/2]

QRect Array2::CellIntegerArea ( const Box2 box) const

Compute the integer coordinates of the cells of the array embedding an input box.

The coordinates are clamped to the size of the array.

Parameters
boxThe box.

◆ CellIntegerArea() [2/2]

QRect Array2::CellIntegerArea ( const Circle2 circle) const

Compute the integer coordinates of the cells of the array embedding an input circle.

The coordinates are clamped to the size of the array.

Parameters
circleThe circle.

◆ ClampVertexIndex()

void Array2::ClampVertexIndex ( int &  i,
int &  j 
) const
inline

Clamp vertex indexes to the size of the array.

Parameters
i,jVertex indexes

◆ codeToDir()

QPoint Array2::codeToDir ( int  c)
static

Convert an 8 bit integer code direction into a direction vector.

Parameters
cDirection code.

◆ CreateEmptyImage()

QImage Array2::CreateEmptyImage ( ) const
inline

Create an image with the same size as the array.

This is a convenience function for:

QImage image(a.GetSizeX(), a.GetSizeY(), QImage::Format_ARGB32);
int GetSizeX() const
Get the vertex size of the array for x axis.
Definition: array.h:176
int GetSizeY() const
Get the vertex size of the array for y axis.
Definition: array.h:184

◆ DownSample()

Array2 Array2::DownSample ( int  d) const
inline

Downsample the array.

Parameters
dSampling factor.

◆ Draw()

void Array2::Draw ( QGraphicsScene &  scene,
const QPen &  pen = QPen(),
const QBrush &  brush = QBrush() 
) const

Draw the cells of the grid.

Parameters
sceneGraphics scene.
penThe pen.
brushThe brush.

◆ HalfCell()

void Array2::HalfCell ( int  i,
int  j,
bool  d,
Triangle2 ta,
Triangle2 tb 
) const

Return the geometry of the cell.

Parameters
i,jInteger coordinates of the cell.
dBoolean, direct diagonal if true, opposite diagonal otherwize.
ta,tbReturned triangles.

◆ ImageGrid()

QImage Array2::ImageGrid ( const Box2 box,
const double &  a 
) const

Create a texture with a regular grid.

Parameters
boxThe box.
aDistance between lines.

◆ Inside()

bool Array2::Inside ( const Vector2 p) const
inline

Check if a point is in the rectangular domain.

Parameters
pPoint.

◆ InsideCellIndex() [1/2]

constexpr bool Array2::InsideCellIndex ( const QPoint &  p) const
inlineconstexprprotected

Check if the indexes are within range.

Parameters
pPoint.

◆ InsideCellIndex() [2/2]

constexpr bool Array2::InsideCellIndex ( int  i,
int  j 
) const
inlineconstexprprotected

Check if the indexes are within range.

Parameters
i,jInteger coordinates of the vertex.

◆ InsideVertexIndex() [1/3]

constexpr bool Array2::InsideVertexIndex ( const QPoint &  p) const
inlineconstexpr

Check if the indexes are within range.

Parameters
pPoint.

◆ InsideVertexIndex() [2/3]

constexpr bool Array2::InsideVertexIndex ( int  i,
int  j 
) const
inlineconstexpr

Check if the indexes are within range.

Parameters
i,jInteger coordinates of the vertex.

◆ InsideVertexIndex() [3/3]

constexpr bool Array2::InsideVertexIndex ( int  i,
int  j,
int  k 
) const
inlineconstexpr

Check if the indexes are within k-range.

Parameters
i,jInteger coordinates of the vertex.
kThickness of the boundary around the domain

◆ InverseCellIndex()

void Array2::InverseCellIndex ( int  c,
int &  i,
int &  j 
) const
inlineprotected

Compute the coordinates of a given cell.

Parameters
cIndex of the cell.
i,jInteger coordinates of the cell.

◆ InverseVertexIndex() [1/2]

constexpr QPoint Array2::InverseVertexIndex ( int  c) const
inlineconstexprprotected

Compute the coordinates of a given cell.

Parameters
cIndex of the cell.

◆ InverseVertexIndex() [2/2]

constexpr void Array2::InverseVertexIndex ( int  c,
int &  i,
int &  j 
) const
inlineconstexprprotected

Compute the coordinates of a given cell.

Parameters
cIndex of the cell.
i,jInteger coordinates of the cell.

◆ NeighborCode()

int Array2::NeighborCode ( int  a,
int  b 
)
static

Convert a direction to an 8 bit integer code.

Parameters
a,bNeighbor direction vector.

◆ Next()

QPoint Array2::Next ( const QPoint &  p,
int  n 
) const
inline

Compute the point next to another one.

Parameters
pPoint.
nNext neighbor, should be in [0,7].

◆ OutsideVertexIndex()

constexpr bool Array2::OutsideVertexIndex ( int  i,
int  j 
) const
inlineconstexpr

Check if the indexes are outside or on the border.

Parameters
i,jInteger coordinates of the vertex.

◆ Scale() [1/2]

void Array2::Scale ( const double &  s)

Scales the array structure.

Parameters
sScaling factor.

◆ Scale() [2/2]

void Array2::Scale ( const Vector2 s)

Scales the array structure.

Parameters
sScaling vector.

◆ Subdivide()

void Array2::Subdivide ( )

Change the resolution.

Increases the resolution by two.

◆ Translate()

void Array2::Translate ( const Vector2 t)

Translate the array.

Centering the array can be coded as:

a.Translate(-a.Center());
Vector2 Center() const
Return the center of the array.
Definition: array2.cpp:270
void Translate(const Vector2 &)
Translate the array.
Definition: array2.cpp:262
Parameters
tTranslation vector.

◆ UnitCell()

Box2 Array2::UnitCell ( ) const

Return the geometry of a generic cell.

This is a box, centered at origin, with the right size.

◆ UpSample()

Array2 Array2::UpSample ( int  u) const
inline

Upsample the array.

Parameters
uSampling factor.

◆ VertexBorder()

QPoint Array2::VertexBorder ( int  k) const

Compute the k-th point on the boundary of the domain.

Parameters
kInteger index.

◆ VertexBorderIndex()

int Array2::VertexBorderIndex ( int  i,
int  j 
) const

Compute the index of a point on the boundary of the domain.

Parameters
i,jCoordinates.

◆ VertexIndex() [1/2]

constexpr int Array2::VertexIndex ( const QPoint &  p) const
inlineconstexpr

Compute the index of a given cell.

Parameters
pPoint.

◆ VertexIndex() [2/2]

constexpr int Array2::VertexIndex ( int  i,
int  j 
) const
inlineconstexpr

Compute the index of a given cell.

Parameters
i,jInteger coordinates of the cell.

◆ VertexInteger() [1/3]

QPoint Array2::VertexInteger ( const Vector2 p) const
inline

Compute the coordinates of a vertex inside a cell.

Parameters
pPoint.

◆ VertexInteger() [2/3]

QPoint Array2::VertexInteger ( const Vector2 p,
double &  u,
double &  v 
) const
inline

Compute the point on the grid given an input point.

Parameters
pPoint.
u,vCoordinates of the point in the corresponding cell.

◆ VertexInteger() [3/3]

void Array2::VertexInteger ( const Vector2 p,
int &  i,
int &  j 
) const
inline

Compute the coordinates of a vertex inside a cell.

Parameters
pPoint.
i,jInteger coordinates of the cell.

◆ VertexIntegerArea() [1/3]

QRect Array2::VertexIntegerArea ( const Box2 box) const

Compute the integer coordinates of the vertices embedding a box.

The coordinates are clamped to the size of the array.

Parameters
boxBox.

◆ VertexIntegerArea() [2/3]

QRect Array2::VertexIntegerArea ( const Circle2 circle) const

Compute the integer coordinates of the vertices embedding a circle.

The coordinates are clamped to the size of the array.

Parameters
circleCircle.

◆ VertexIntegerArea() [3/3]

QRect Array2::VertexIntegerArea ( const QRect &  rect) const

Compute the integer coordinates span of the vertices embedding a rectangle.

Parameters
rectRectangle.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  s,
const Array2 a 
)
friend

Overloaded.

Parameters
sStream.
aThe array.