Flumy [Free API]
Process based model for meandering chanelized systems
Public Member Functions | Protected Attributes | Friends | List of all members
GridParams Class Reference

Base class for 3D grid description. More...

Inheritance diagram for GridParams:
GridReal Topo

Detailed Description

Base class for 3D grid description.

This class only store grid parameters which are:

The size of the grid is:

Grid origin node is the front bottom left corner of the grid.
2D grid has an "infinite" height (dz=infinite and nz=1).

Public Member Functions

 GridParams ()
 Default constructor. More...
 
 GridParams (const MP_real &dx, const MP_real &dy, const MP_int &nx, const MP_int &ny, const MP_real &ox=0., const MP_real &oy=0.)
 Constructor from 2D grid parameters. More...
 
 GridParams (const MP_real &dx, const MP_real &dy, const MP_real &dz, const MP_int &nx, const MP_int &ny, const MP_int &nz, const MP_real &ox=0., const MP_real &oy=0., const MP_real &oz=0.)
 Constructor from 3D grid parameters. More...
 
 GridParams (const GridParams &grid)
 Copy constructor. More...
 
virtual ~GridParams ()
 Destructor. More...
 
GridParamsoperator= (const GridParams &)
 Operator =. More...
 
virtual void reset (const GridParams &grid)
 Reset 2D grid parameters to new values. More...
 
void reset (const MP_real &dx, const MP_real &dy, const MP_int &nx, const MP_int &ny, const MP_real &ox=0., const MP_real &oy=0.)
 Reset 2D grid parameters to new values. More...
 
void reset (const MP_real &dx, const MP_real &dy, const MP_real &dz, const MP_int &nx, const MP_int &ny, const MP_int &nz, const MP_real &ox=0., const MP_real &oy=0., const MP_real &oz=0.)
 Reset 3D grid parameters to new values. More...
 
MP_real getDx () const
 Assessor get to protected member variable _dx. More...
 
MP_real getDy () const
 Assessor get to protected member variable _dy. More...
 
MP_real getDz () const
 Assessor get to protected member variable _dz. More...
 
MP_int getNx () const
 Assessor get to protected member variable _nx. More...
 
MP_int getNy () const
 Assessor get to protected member variable _ny. More...
 
MP_int getNz () const
 Assessor get to protected member variable _nz. More...
 
MP_real getOx () const
 Assessor get to protected member variable _ox. More...
 
MP_real getOy () const
 Assessor get to protected member variable _oy. More...
 
MP_real getOz () const
 Assessor get to protected member variable _oz. More...
 
Point2D getOrigin () const
 Assessor get to origin 2D point _ox,_oy. More...
 
MP_int getNbNodes () const
 Return the number of grid nodes. More...
 
void getApexRel (Point2D &p1, Point2D &p2, Point2D &p3, Point2D &p4) const
 Return the 4 apex relative points. More...
 
void setLocation (const MP_real &x, const MP_real &y, const MP_real &z=0.)
 Localize the grid in the geographical system. More...
 
void setLocation (const Point3D &location)
 Localize the grid in the geographical system. More...
 
void setLocation (const Point2D &location)
 Localize the grid in the geographical system. More...
 
const Point3D & getLocation () const
 Return the location of the grid. More...
 
MP_real getZLoc () const
 Assessor get location elevation. More...
 
void setRotation (const MP_real &rot)
 Rotate the grid around z-axis in the geographical system. More...
 
MP_real getRotation () const
 
MP_real getLength () const
 Return total length of the grid (in meters).
It corresponds to the grid size along abscissa axis Ox. More...
 
MP_real getWidth () const
 Return total width of the grid (in meters).
It corresponds to the grid size along ordinate axis Oy. More...
 
MP_real getHeight () const
 Return total height of the grid (in meters).
It corresponds to the grid size along elevation axis Oz. More...
 
bool is3D () const
 Return true if the grid has 3 dimensions (nz > 1 and dz < MP_MAX_REAL_VALUE) More...
 
bool isCompatibleWith (const GridParams &grid, bool check_geo=false) const
 Return true if the given grid has same parameters. More...
 
Point2Drel2Geo (Point2D &point) const
 
Point2Drel2Grid (Point2D &point, bool round=true) const
 
Point2Dgeo2Rel (Point2D &point) const
 
Point2Dgeo2Grid (Point2D &point, bool round=true) const
 
Point2Dgrid2Rel (Point2D &point) const
 
Point2D grid2Rel (const MP_int &ix, const MP_int &iy) const
 
Point2D grid2Geo (const MP_int &ix, const MP_int &iy) const
 
Point3D & rel2Geo (Point3D &point) const
 
Point3D & geo2Rel (Point3D &point) const
 
ConvexPolyedra2D & rel2Grid (ConvexPolyedra2D &polyedra) const
 
ConvexPolyedra2D & grid2Rel (ConvexPolyedra2D &polyedra) const
 
bool is_on_grid (const Point2D &point) const
 
bool is_on_grid_nearest (const Point2D &point) const
 

Protected Attributes

MP_real _dx
 Mesh size (m) along abscissa axis Ox (must be greater than 0) More...
 
MP_real _dy
 Mesh size (m) along ordinate axis Oy (must be greater than 0) More...
 
MP_real _dz
 Mesh size (m) along elevation axis Oz (must be greater than 0) More...
 
MP_int _nx
 Number of nodes along abscissa axis Ox (must be greater than 0) More...
 
MP_int _ny
 Number of nodes along ordinate axis Oy (must be greater than 0) More...
 
MP_int _nz
 Number of nodes along elevation axis Oz (must be greater than 0) More...
 
MP_real _ox
 Origin offset along x-axis (m) More...
 
MP_real _oy
 Origin offset along y-axis (m) More...
 
MP_real _oz
 Origin offset along z-axis (m) More...
 
Point3D _location
 Front bottom left corner (m) of the grid (Geographical Location) More...
 
MP_real _rotation
 
MP_real _cosrot
 
MP_real _sinrot
 

Friends

std::ostream & operator<< (std::ostream &os, const GridParams &grid)
 Print grid parameters in an output stream. More...
 

Constructor & Destructor Documentation

◆ GridParams() [1/4]

GridParams::GridParams ( )

Default constructor.

◆ GridParams() [2/4]

GridParams::GridParams ( const MP_real &  dx,
const MP_real &  dy,
const MP_int &  nx,
const MP_int &  ny,
const MP_real &  ox = 0.,
const MP_real &  oy = 0. 
)

Constructor from 2D grid parameters.

◆ GridParams() [3/4]

GridParams::GridParams ( const MP_real &  dx,
const MP_real &  dy,
const MP_real &  dz,
const MP_int &  nx,
const MP_int &  ny,
const MP_int &  nz,
const MP_real &  ox = 0.,
const MP_real &  oy = 0.,
const MP_real &  oz = 0. 
)

Constructor from 3D grid parameters.

◆ GridParams() [4/4]

GridParams::GridParams ( const GridParams grid)

Copy constructor.

◆ ~GridParams()

virtual GridParams::~GridParams ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ geo2Grid()

Point2D& GridParams::geo2Grid ( Point2D point,
bool  round = true 
) const

◆ geo2Rel() [1/2]

Point2D& GridParams::geo2Rel ( Point2D point) const

◆ geo2Rel() [2/2]

Point3D& GridParams::geo2Rel ( Point3D &  point) const

◆ getApexRel()

void GridParams::getApexRel ( Point2D p1,
Point2D p2,
Point2D p3,
Point2D p4 
) const

Return the 4 apex relative points.

◆ getDx()

MP_real GridParams::getDx ( ) const
inline

Assessor get to protected member variable _dx.

◆ getDy()

MP_real GridParams::getDy ( ) const
inline

Assessor get to protected member variable _dy.

◆ getDz()

MP_real GridParams::getDz ( ) const
inline

Assessor get to protected member variable _dz.

◆ getHeight()

MP_real GridParams::getHeight ( ) const
inline

Return total height of the grid (in meters).
It corresponds to the grid size along elevation axis Oz.

◆ getLength()

MP_real GridParams::getLength ( ) const
inline

Return total length of the grid (in meters).
It corresponds to the grid size along abscissa axis Ox.

◆ getLocation()

const Point3D& GridParams::getLocation ( ) const

Return the location of the grid.

◆ getNbNodes()

MP_int GridParams::getNbNodes ( ) const
inline

Return the number of grid nodes.

◆ getNx()

MP_int GridParams::getNx ( ) const
inline

Assessor get to protected member variable _nx.

◆ getNy()

MP_int GridParams::getNy ( ) const
inline

Assessor get to protected member variable _ny.

◆ getNz()

MP_int GridParams::getNz ( ) const
inline

Assessor get to protected member variable _nz.

◆ getOrigin()

Point2D GridParams::getOrigin ( ) const

Assessor get to origin 2D point _ox,_oy.

◆ getOx()

MP_real GridParams::getOx ( ) const
inline

Assessor get to protected member variable _ox.

◆ getOy()

MP_real GridParams::getOy ( ) const
inline

Assessor get to protected member variable _oy.

◆ getOz()

MP_real GridParams::getOz ( ) const
inline

Assessor get to protected member variable _oz.

◆ getRotation()

MP_real GridParams::getRotation ( ) const

◆ getWidth()

MP_real GridParams::getWidth ( ) const
inline

Return total width of the grid (in meters).
It corresponds to the grid size along ordinate axis Oy.

◆ getZLoc()

MP_real GridParams::getZLoc ( ) const
inline

Assessor get location elevation.

◆ grid2Geo()

Point2D GridParams::grid2Geo ( const MP_int &  ix,
const MP_int &  iy 
) const

◆ grid2Rel() [1/3]

Point2D GridParams::grid2Rel ( const MP_int &  ix,
const MP_int &  iy 
) const

◆ grid2Rel() [2/3]

ConvexPolyedra2D& GridParams::grid2Rel ( ConvexPolyedra2D &  polyedra) const

◆ grid2Rel() [3/3]

Point2D& GridParams::grid2Rel ( Point2D point) const

◆ is3D()

bool GridParams::is3D ( ) const
inline

Return true if the grid has 3 dimensions (nz > 1 and dz < MP_MAX_REAL_VALUE)

◆ is_on_grid()

bool GridParams::is_on_grid ( const Point2D point) const

◆ is_on_grid_nearest()

bool GridParams::is_on_grid_nearest ( const Point2D point) const

◆ isCompatibleWith()

bool GridParams::isCompatibleWith ( const GridParams grid,
bool  check_geo = false 
) const

Return true if the given grid has same parameters.

◆ operator=()

GridParams& GridParams::operator= ( const GridParams )

Operator =.

◆ rel2Geo() [1/2]

Point2D& GridParams::rel2Geo ( Point2D point) const

◆ rel2Geo() [2/2]

Point3D& GridParams::rel2Geo ( Point3D &  point) const

◆ rel2Grid() [1/2]

ConvexPolyedra2D& GridParams::rel2Grid ( ConvexPolyedra2D &  polyedra) const

◆ rel2Grid() [2/2]

Point2D& GridParams::rel2Grid ( Point2D point,
bool  round = true 
) const

◆ reset() [1/3]

virtual void GridParams::reset ( const GridParams grid)
virtual

Reset 2D grid parameters to new values.

Reimplemented in GridReal.

◆ reset() [2/3]

void GridParams::reset ( const MP_real &  dx,
const MP_real &  dy,
const MP_int &  nx,
const MP_int &  ny,
const MP_real &  ox = 0.,
const MP_real &  oy = 0. 
)

Reset 2D grid parameters to new values.

◆ reset() [3/3]

void GridParams::reset ( const MP_real &  dx,
const MP_real &  dy,
const MP_real &  dz,
const MP_int &  nx,
const MP_int &  ny,
const MP_int &  nz,
const MP_real &  ox = 0.,
const MP_real &  oy = 0.,
const MP_real &  oz = 0. 
)

Reset 3D grid parameters to new values.

◆ setLocation() [1/3]

void GridParams::setLocation ( const MP_real &  x,
const MP_real &  y,
const MP_real &  z = 0. 
)

Localize the grid in the geographical system.

◆ setLocation() [2/3]

void GridParams::setLocation ( const Point2D location)

Localize the grid in the geographical system.

◆ setLocation() [3/3]

void GridParams::setLocation ( const Point3D &  location)

Localize the grid in the geographical system.

◆ setRotation()

void GridParams::setRotation ( const MP_real &  rot)

Rotate the grid around z-axis in the geographical system.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const GridParams grid 
)
friend

Print grid parameters in an output stream.

Member Data Documentation

◆ _cosrot

MP_real GridParams::_cosrot
protected

Cosinus of rotation (internal use)

◆ _dx

MP_real GridParams::_dx
protected

Mesh size (m) along abscissa axis Ox (must be greater than 0)

◆ _dy

MP_real GridParams::_dy
protected

Mesh size (m) along ordinate axis Oy (must be greater than 0)

◆ _dz

MP_real GridParams::_dz
protected

Mesh size (m) along elevation axis Oz (must be greater than 0)

◆ _location

Point3D GridParams::_location
protected

Front bottom left corner (m) of the grid (Geographical Location)

◆ _nx

MP_int GridParams::_nx
protected

Number of nodes along abscissa axis Ox (must be greater than 0)

◆ _ny

MP_int GridParams::_ny
protected

Number of nodes along ordinate axis Oy (must be greater than 0)

◆ _nz

MP_int GridParams::_nz
protected

Number of nodes along elevation axis Oz (must be greater than 0)

◆ _ox

MP_real GridParams::_ox
protected

Origin offset along x-axis (m)

◆ _oy

MP_real GridParams::_oy
protected

Origin offset along y-axis (m)

◆ _oz

MP_real GridParams::_oz
protected

Origin offset along z-axis (m)

◆ _rotation

MP_real GridParams::_rotation
protected

Rotation around Oz axis (degrees - counterclockwise starting from West->East direction) (West->East = 0° , South->North = 90°)

◆ _sinrot

MP_real GridParams::_sinrot
protected

Sinus of rotation (internal use)