4 #include "MCRCProgramming.hpp"
5 #include "flumy_export.hpp"
10 class ConvexPolyedra2D;
38 const MP_real & ox = 0.,
39 const MP_real & oy = 0.);
47 const MP_real & ox = 0.,
48 const MP_real & oy = 0.,
49 const MP_real & oz = 0.);
63 const MP_real & ox = 0.,
64 const MP_real & oy = 0.);
72 const MP_real & ox = 0.,
73 const MP_real & oy = 0.,
74 const MP_real & oz = 0.);
76 MP_real
getDx()
const {
return _dx; }
78 MP_real
getDy()
const {
return _dy; }
80 MP_real
getDz()
const {
return _dz; }
82 MP_int
getNx()
const {
return _nx; }
84 MP_int
getNy()
const {
return _ny; }
86 MP_int
getNz()
const {
return _nz; }
88 MP_real
getOx()
const {
return _ox; }
90 MP_real
getOy()
const {
return _oy; }
92 MP_real
getOz()
const {
return _oz; }
102 const MP_real & z = 0.);
110 MP_real
getZLoc()
const {
return _location.get_elevation(); }
123 MP_real
getHeight()
const {
return is3D() ? (_nz-1) * _dz : MP_MAX_REAL_VALUE; }
125 bool is3D()
const {
return (_nz > 1 && _dz < MP_MAX_REAL_VALUE); }
131 friend std::ostream & operator <<(std::ostream & os,
const GridParams & grid);
148 ConvexPolyedra2D &
rel2Grid(ConvexPolyedra2D & polyedra)
const;
149 ConvexPolyedra2D &
grid2Rel(ConvexPolyedra2D & polyedra)
const;
Base class for 3D grid description.
Definition: GridParams.hpp:28
Point2D grid2Geo(const MP_int &ix, const MP_int &iy) const
MP_real getOy() const
Assessor get to protected member variable _oy.
Definition: GridParams.hpp:90
MP_int getNbNodes() const
Return the number of grid nodes.
Definition: GridParams.hpp:96
virtual ~GridParams()
Destructor.
Definition: GridParams.hpp:53
MP_real getOx() const
Assessor get to protected member variable _ox.
Definition: GridParams.hpp:88
MP_int _nx
Number of nodes along abscissa axis Ox (must be greater than 0)
Definition: GridParams.hpp:164
GridParams()
Default constructor.
MP_int _nz
Number of nodes along elevation axis Oz (must be greater than 0)
Definition: GridParams.hpp:168
MP_real _dy
Mesh size (m) along ordinate axis Oy (must be greater than 0)
Definition: GridParams.hpp:160
bool is_on_grid_nearest(const Point2D &point) const
bool is3D() const
Return true if the grid has 3 dimensions (nz > 1 and dz < MP_MAX_REAL_VALUE)
Definition: GridParams.hpp:125
void setLocation(const Point3D &location)
Localize the grid in the geographical system.
GridParams & operator=(const GridParams &)
Operator =.
Point3D & geo2Rel(Point3D &point) const
MP_real getLength() const
Return total length of the grid (in meters). It corresponds to the grid size along abscissa axis Ox.
Definition: GridParams.hpp:117
MP_real getOz() const
Assessor get to protected member variable _oz.
Definition: GridParams.hpp:92
Point2D grid2Rel(const MP_int &ix, const MP_int &iy) const
bool is_on_grid(const Point2D &point) const
bool isCompatibleWith(const GridParams &grid, bool check_geo=false) const
Return true if the given grid has same parameters.
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.
MP_real getHeight() const
Return total height of the grid (in meters). It corresponds to the grid size along elevation axis Oz...
Definition: GridParams.hpp:123
MP_real _rotation
Definition: GridParams.hpp:179
MP_real _cosrot
Definition: GridParams.hpp:181
MP_real getZLoc() const
Assessor get location elevation.
Definition: GridParams.hpp:110
ConvexPolyedra2D & grid2Rel(ConvexPolyedra2D &polyedra) const
MP_real _sinrot
Definition: GridParams.hpp:183
MP_real _oz
Origin offset along z-axis (m)
Definition: GridParams.hpp:174
MP_int getNx() const
Assessor get to protected member variable _nx.
Definition: GridParams.hpp:82
MP_real getWidth() const
Return total width of the grid (in meters). It corresponds to the grid size along ordinate axis Oy.
Definition: GridParams.hpp:120
MP_real getDy() const
Assessor get to protected member variable _dy.
Definition: GridParams.hpp:78
Point2D & geo2Grid(Point2D &point, bool round=true) const
MP_int getNz() const
Assessor get to protected member variable _nz.
Definition: GridParams.hpp:86
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.
virtual void reset(const GridParams &grid)
Reset 2D grid parameters to new values.
MP_real _dx
Mesh size (m) along abscissa axis Ox (must be greater than 0)
Definition: GridParams.hpp:158
Point2D & rel2Grid(Point2D &point, bool round=true) const
Point3D _location
Front bottom left corner (m) of the grid (Geographical Location)
Definition: GridParams.hpp:176
ConvexPolyedra2D & rel2Grid(ConvexPolyedra2D &polyedra) const
void setLocation(const Point2D &location)
Localize the grid in the geographical system.
MP_real getRotation() const
Point2D & grid2Rel(Point2D &point) const
Point2D getOrigin() const
Assessor get to origin 2D point _ox,_oy.
MP_real _dz
Mesh size (m) along elevation axis Oz (must be greater than 0)
Definition: GridParams.hpp:162
void getApexRel(Point2D &p1, Point2D &p2, Point2D &p3, Point2D &p4) const
Return the 4 apex relative points.
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.
void setLocation(const MP_real &x, const MP_real &y, const MP_real &z=0.)
Localize the grid in the geographical system.
Point2D & geo2Rel(Point2D &point) const
Point2D & rel2Geo(Point2D &point) const
MP_real _ox
Origin offset along x-axis (m)
Definition: GridParams.hpp:170
MP_real getDz() const
Assessor get to protected member variable _dz.
Definition: GridParams.hpp:80
MP_int _ny
Number of nodes along ordinate axis Oy (must be greater than 0)
Definition: GridParams.hpp:166
MP_int getNy() const
Assessor get to protected member variable _ny.
Definition: GridParams.hpp:84
Point3D & rel2Geo(Point3D &point) const
MP_real _oy
Origin offset along y-axis (m)
Definition: GridParams.hpp:172
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.
const Point3D & getLocation() const
Return the location of the grid.
MP_real getDx() const
Assessor get to protected member variable _dx.
Definition: GridParams.hpp:76
GridParams(const GridParams &grid)
Copy constructor.
void setRotation(const MP_real &rot)
Rotate the grid around z-axis in the geographical system.
Storage class for 2D points.
Definition: Point2D.hpp:13