NRLib::RegularSurfaceRotated< A > Class Template Reference

#include <regularsurfacerotated.hpp>

Inheritance diagram for NRLib::RegularSurfaceRotated< A >:
Inheritance graph

Public Types

typedef std::vector< A >::iterator iterator
 
typedef std::vector< A >::const_iterator const_iterator
 
typedef std::vector< A >::reference reference
 
typedef std::vector< A >::const_reference const_reference
 

Public Member Functions

 RegularSurfaceRotated ()
 
 RegularSurfaceRotated (double x0, double y0, double lx, double ly, size_t nx, size_t ny, double angle, const A &value=A())
 
 RegularSurfaceRotated (const RegularSurface< A > &surface, double angle)
 
 RegularSurfaceRotated (double x0, double y0, double lx, double ly, Grid2D< A > grid, double angle)
 
 RegularSurfaceRotated (std::string filename, SurfaceFileFormat format=SURF_UNKNOWN, double angle=0.0, double x_ref=0.0, double y_ref=0.0, double lx=0.0, double ly=0.0, int *ilxl_area=NULL, double il0_ref=0.0, double xl0_ref=0.0)
 Read surface file on given format. More...
 
Surface< A > * Clone () const
 Generate a copy of the underlying object. More...
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
reference operator() (size_t i, size_t j)
 
reference operator() (size_t index)
 
const_reference operator() (size_t i, size_t j) const
 
const_reference operator() (size_t index) const
 
GetZ (double x, double y) const
 
GetZInside (double x, double y) const
 
bool IsInsideSurface (double x, double y) const
 Checks if point is inside definition area for surface. More...
 
bool EnclosesRectangle (double x_min, double x_max, double y_min, double y_max) const
 
void Assign (A c)
 Sets all values on the surface to a constant value. More...
 
void Add (A c)
 
void Subtract (A c)
 
void Multiply (A c)
 
void GetXY (size_t i, size_t j, double &x, double &y) const
 
void GetXY (size_t index, double &x, double &y) const
 
double GetDX () const
 
double GetDY () const
 
double GetLengthX () const
 
double GetLengthY () const
 
void SetDimensions (double x_min, double y_min, double lx, double ly)
 
void Resize (size_t ni, size_t nj, const A &val=A())
 Resize grid. Overrides Grid2D's resize. More...
 
size_t GetNI () const
 
size_t GetNJ () const
 
size_t GetN () const
 
bool IsMissing (A val) const
 Check if grid value is missing. More...
 
bool IsMissingAt (size_t i, size_t j) const
 
void SetMissing (size_t i, size_t j)
 
Min () const
 
Max () const
 
Avg () const
 
Avg (int &n_nodes) const
 
bool AddNonConform (const Surface< A > *s2)
 
bool SubtractNonConform (const Surface< A > *s2)
 
bool MultiplyNonConform (const Surface< A > *s2)
 
bool DivideNonConform (const Surface< A > *s2)
 
double GetXRef () const
 
double GetYRef () const
 
double GetXMin () const
 
double GetYMin () const
 
double GetXMax () const
 
double GetYMax () const
 
RegularSurface< A > ResampleSurface () const
 
double GetAngle () const
 
void SetAngle (double angle)
 
GetMissingValue () const
 
void SetMissingValue (A missing_val)
 
const std::stringGetName () const
 
void SetName (const std::string &name)
 
void ReadFromFile (std::string filename, SurfaceFileFormat format=SURF_UNKNOWN, double angle=0.0, double x_ref=0.0, double y_ref=0.0, double lx=0.0, double ly=0.0, int *ilxl_area=NULL, double il0_ref=0.0, double xl0_ref=0.0)
 Read surface file on given format. More...
 
void WriteToFile (const std::string &filename, SurfaceFileFormat format=SURF_STORM_BINARY) const
 Write surface to file on given format. If the file format does not support rotation, the resampled surface is written to file. More...
 

Member Typedef Documentation

◆ const_iterator

template<class A >
typedef std::vector<A>::const_iterator NRLib::RegularSurfaceRotated< A >::const_iterator

◆ const_reference

template<class A >
typedef std::vector<A>::const_reference NRLib::RegularSurfaceRotated< A >::const_reference

◆ iterator

template<class A >
typedef std::vector<A>::iterator NRLib::RegularSurfaceRotated< A >::iterator

◆ reference

template<class A >
typedef std::vector<A>::reference NRLib::RegularSurfaceRotated< A >::reference

Constructor & Destructor Documentation

◆ RegularSurfaceRotated() [1/5]

template<class A >
NRLib::RegularSurfaceRotated< A >::RegularSurfaceRotated

◆ RegularSurfaceRotated() [2/5]

template<class A >
NRLib::RegularSurfaceRotated< A >::RegularSurfaceRotated ( double  x0,
double  y0,
double  lx,
double  ly,
size_t  nx,
size_t  ny,
double  angle,
const A &  value = A() 
)

◆ RegularSurfaceRotated() [3/5]

template<class A >
NRLib::RegularSurfaceRotated< A >::RegularSurfaceRotated ( const RegularSurface< A > &  surface,
double  angle 
)

◆ RegularSurfaceRotated() [4/5]

template<class A >
NRLib::RegularSurfaceRotated< A >::RegularSurfaceRotated ( double  x0,
double  y0,
double  lx,
double  ly,
Grid2D< A >  grid,
double  angle 
)

◆ RegularSurfaceRotated() [5/5]

template<class A >
NRLib::RegularSurfaceRotated< A >::RegularSurfaceRotated ( std::string  filename,
SurfaceFileFormat  format = SURF_UNKNOWN,
double  angle = 0.0,
double  x_ref = 0.0,
double  y_ref = 0.0,
double  lx = 0.0,
double  ly = 0.0,
int *  ilxl_area = NULL,
double  il0_ref = 0.0,
double  xl0_ref = 0.0 
)

Read surface file on given format.

Parameters
filenameFile name.
formatFile format. If SURF_UNKNOWN we try to determine the format.
Exceptions
IOErrorIf we failed to open the file
FileFormatErrorIf we can not determine the file format, or the contents of the file does not match the file format.

References format.

Member Function Documentation

◆ Add()

template<class A >
void NRLib::RegularSurfaceRotated< A >::Add ( c)
inlinevirtual

Implements NRLib::Surface< A >.

◆ AddNonConform()

template<class A >
bool NRLib::RegularSurfaceRotated< A >::AddNonConform ( const Surface< A > *  s2)

The following routines are for binary operations with non-conform grids. Missing areas will shrink. Also works for identical definitions without missing, but is inefficient.

References NRLib::Surface< A >::GetZ(), NRLib::Surface< A >::IsMissing(), exprtk::details::value(), and exprtk::details::x().

◆ Assign()

template<class A >
void NRLib::RegularSurfaceRotated< A >::Assign ( c)
inline

Sets all values on the surface to a constant value.

◆ Avg() [1/2]

template<class A >
A NRLib::RegularSurfaceRotated< A >::Avg ( ) const
inline

◆ Avg() [2/2]

template<class A >
A NRLib::RegularSurfaceRotated< A >::Avg ( int &  n_nodes) const
inline

◆ begin() [1/2]

template<class A >
iterator NRLib::RegularSurfaceRotated< A >::begin ( )
inline

◆ begin() [2/2]

template<class A >
const_iterator NRLib::RegularSurfaceRotated< A >::begin ( ) const
inline

◆ Clone()

template<class A >
Surface< A > * NRLib::RegularSurfaceRotated< A >::Clone ( ) const
inlinevirtual

Generate a copy of the underlying object.

Implements NRLib::Surface< A >.

◆ DivideNonConform()

◆ EnclosesRectangle()

template<class A >
bool NRLib::RegularSurfaceRotated< A >::EnclosesRectangle ( double  x_min,
double  x_max,
double  y_min,
double  y_max 
) const
virtual

Implements NRLib::Surface< A >.

◆ end() [1/2]

template<class A >
iterator NRLib::RegularSurfaceRotated< A >::end ( )
inline

◆ end() [2/2]

template<class A >
const_iterator NRLib::RegularSurfaceRotated< A >::end ( ) const
inline

◆ GetAngle()

template<class A >
double NRLib::RegularSurfaceRotated< A >::GetAngle ( ) const
inline

◆ GetDX()

template<class A >
double NRLib::RegularSurfaceRotated< A >::GetDX ( ) const
inline

◆ GetDY()

template<class A >
double NRLib::RegularSurfaceRotated< A >::GetDY ( ) const
inline

◆ GetLengthX()

template<class A >
double NRLib::RegularSurfaceRotated< A >::GetLengthX ( ) const
inline

◆ GetLengthY()

template<class A >
double NRLib::RegularSurfaceRotated< A >::GetLengthY ( ) const
inline

◆ GetMissingValue()

template<class A >
A NRLib::RegularSurfaceRotated< A >::GetMissingValue ( ) const
inline

◆ GetN()

template<class A >
size_t NRLib::RegularSurfaceRotated< A >::GetN ( ) const
inline

◆ GetName()

template<class A >
const std::string & NRLib::RegularSurfaceRotated< A >::GetName ( ) const
inline

◆ GetNI()

template<class A >
size_t NRLib::RegularSurfaceRotated< A >::GetNI ( ) const
inline

◆ GetNJ()

template<class A >
size_t NRLib::RegularSurfaceRotated< A >::GetNJ ( ) const
inline

◆ GetXMax()

template<class A >
double NRLib::RegularSurfaceRotated< A >::GetXMax ( ) const
inlinevirtual

Implements NRLib::Surface< A >.

◆ GetXMin()

template<class A >
double NRLib::RegularSurfaceRotated< A >::GetXMin ( ) const
inlinevirtual

Implements NRLib::Surface< A >.

◆ GetXRef()

template<class A >
double NRLib::RegularSurfaceRotated< A >::GetXRef ( ) const
inline

◆ GetXY() [1/2]

template<class A >
void NRLib::RegularSurfaceRotated< A >::GetXY ( size_t  i,
size_t  j,
double &  x,
double &  y 
) const

References exprtk::details::x().

◆ GetXY() [2/2]

template<class A >
void NRLib::RegularSurfaceRotated< A >::GetXY ( size_t  index,
double &  x,
double &  y 
) const

References index, and exprtk::details::x().

◆ GetYMax()

template<class A >
double NRLib::RegularSurfaceRotated< A >::GetYMax ( ) const
inlinevirtual

Implements NRLib::Surface< A >.

◆ GetYMin()

template<class A >
double NRLib::RegularSurfaceRotated< A >::GetYMin ( ) const
inlinevirtual

Implements NRLib::Surface< A >.

◆ GetYRef()

template<class A >
double NRLib::RegularSurfaceRotated< A >::GetYRef ( ) const
inline

◆ GetZ()

template<class A >
A NRLib::RegularSurfaceRotated< A >::GetZ ( double  x,
double  y 
) const
virtual

Return z. Returns missing if we are outside the grid. Returns also values when not all grid cell corners are present, e.g. when (x,y) is just outside the grid.

Implements NRLib::Surface< A >.

References exprtk::details::x(), and exprtk::details::z.

◆ GetZInside()

template<class A >
A NRLib::RegularSurfaceRotated< A >::GetZInside ( double  x,
double  y 
) const

Return z. Returns missing if not all grid cell corners are present, e.g. when (x,y) is just outside the grid.

References exprtk::details::x(), and exprtk::details::z.

◆ IsInsideSurface()

template<class A >
bool NRLib::RegularSurfaceRotated< A >::IsInsideSurface ( double  x,
double  y 
) const
virtual

Checks if point is inside definition area for surface.

Implements NRLib::Surface< A >.

References exprtk::details::x(), and exprtk::details::z.

◆ IsMissing()

template<class A >
bool NRLib::RegularSurfaceRotated< A >::IsMissing ( val) const
inlinevirtual

Check if grid value is missing.

Reimplemented from NRLib::Surface< A >.

◆ IsMissingAt()

template<class A >
bool NRLib::RegularSurfaceRotated< A >::IsMissingAt ( size_t  i,
size_t  j 
) const
inline

◆ Max()

template<class A >
A NRLib::RegularSurfaceRotated< A >::Max ( ) const
inlinevirtual

Implements NRLib::Surface< A >.

◆ Min()

template<class A >
A NRLib::RegularSurfaceRotated< A >::Min ( ) const
inlinevirtual

Implements NRLib::Surface< A >.

◆ Multiply()

template<class A >
void NRLib::RegularSurfaceRotated< A >::Multiply ( c)
inlinevirtual

Implements NRLib::Surface< A >.

◆ MultiplyNonConform()

◆ operator()() [1/4]

template<class A >
reference NRLib::RegularSurfaceRotated< A >::operator() ( size_t  i,
size_t  j 
)
inline

◆ operator()() [2/4]

template<class A >
const_reference NRLib::RegularSurfaceRotated< A >::operator() ( size_t  i,
size_t  j 
) const
inline

◆ operator()() [3/4]

template<class A >
reference NRLib::RegularSurfaceRotated< A >::operator() ( size_t  index)
inline

References index.

◆ operator()() [4/4]

template<class A >
const_reference NRLib::RegularSurfaceRotated< A >::operator() ( size_t  index) const
inline

References index.

◆ ReadFromFile()

template<class A >
void NRLib::RegularSurfaceRotated< A >::ReadFromFile ( std::string  filename,
SurfaceFileFormat  format = SURF_UNKNOWN,
double  angle = 0.0,
double  x_ref = 0.0,
double  y_ref = 0.0,
double  lx = 0.0,
double  ly = 0.0,
int *  ilxl_area = NULL,
double  il0_ref = 0.0,
double  xl0_ref = 0.0 
)

Read surface file on given format.

Parameters
filenameFile name.
formatFile format. If SURF_UNKNOWN we try to determine the format.
Exceptions
IOErrorIf we failed to open the file
FileFormatErrorIf we can not determine the file format, or the contents of the file does not match the file format.

References NRLib::FindSurfaceFileType(), format, NRLib::ReadIrapClassicAsciiSurf(), NRLib::ReadMulticolumnAsciiSurf(), NRLib::ReadSgriSurf(), NRLib::ReadStormBinarySurf(), NRLib::SURF_IRAP_CLASSIC_ASCII, NRLib::SURF_MULT_ASCII, NRLib::SURF_SGRI, NRLib::SURF_STORM_BINARY, NRLib::SURF_UNKNOWN, and NRLib::ToString().

◆ ResampleSurface()

◆ Resize()

template<class A >
void NRLib::RegularSurfaceRotated< A >::Resize ( size_t  ni,
size_t  nj,
const A &  val = A() 
)

Resize grid. Overrides Grid2D's resize.

References exprtk::details::value().

◆ SetAngle()

template<class A >
void NRLib::RegularSurfaceRotated< A >::SetAngle ( double  angle)
inline

◆ SetDimensions()

template<class A >
void NRLib::RegularSurfaceRotated< A >::SetDimensions ( double  x_min,
double  y_min,
double  lx,
double  ly 
)

◆ SetMissing()

template<class A >
void NRLib::RegularSurfaceRotated< A >::SetMissing ( size_t  i,
size_t  j 
)
inline

◆ SetMissingValue()

template<class A >
void NRLib::RegularSurfaceRotated< A >::SetMissingValue ( missing_val)
inline

◆ SetName()

template<class A >
void NRLib::RegularSurfaceRotated< A >::SetName ( const std::string name)
inline

References name.

◆ Subtract()

template<class A >
void NRLib::RegularSurfaceRotated< A >::Subtract ( c)
inline

◆ SubtractNonConform()

◆ WriteToFile()

template<class A >
void NRLib::RegularSurfaceRotated< A >::WriteToFile ( const std::string filename,
SurfaceFileFormat  format = SURF_STORM_BINARY 
) const

Write surface to file on given format. If the file format does not support rotation, the resampled surface is written to file.

Exceptions
IOErrorIf we failed to open the file

References format, NRLib::SURF_IRAP_CLASSIC_ASCII, NRLib::SURF_STORM_BINARY, NRLib::ToString(), NRLib::WriteIrapClassicAsciiSurf(), and NRLib::WriteStormBinarySurf().


The documentation for this class was generated from the following file: