GCOP
1.0
|
#include <dem.h>
Public Member Functions | |
Dem () | |
Dem (const char *fname, double cs=1.0, double ds=1.0, const double *o=0) | |
Dem (double w, double h, double cs=1.0, double ds=1.0, const double *o=0) | |
Dem (const Dem &dem) | |
virtual | ~Dem () |
virtual bool | IsValid (double x, double y) const |
virtual double | Get (double x, double y) const |
double | GetNormal (double n[3], double x, double y) const |
const double * | GetNormal (double x, double y) const |
virtual void | Get (double *p, int i, int j) const |
void | Set (int i, int j, double z) |
void | Set (double x, double y, double z, double s=0) |
void | Clear () |
void | Scale (double s) |
bool | Inside (double x, double y, double z) const |
void | Load (const char *fname) |
const double * | GetNormal (int i, int j) const |
void | ComputeNormals () |
void | Dilate (double r, bool cube=true) |
void | AddBoundary (double h) |
void | Convolve (double sigma, bool cn=true, double thresh=0) |
void | Point2Index (int &i, int &j, double x, double y) const |
void | Index2Point (double &x, double &y, int i, int j) const |
Static Public Member Functions | |
static double | bilinterp (const double *z, int w, int h, double xi, double yi, double eps=1e-10) |
Public Attributes | |
double | w |
width | |
double | h |
height | |
double | cs |
cell size | |
double | ds |
data scale (height scale) | |
double | o [3] |
origin | |
int | ni |
number of rows | |
int | nj |
number of columns | |
double * | data |
raw data (could be postprocessed) | |
double * | odata |
original raw data | |
double * | normals |
normals | |
double | eps |
numerical tolerance for interpolation |
Digital Elevation Map (Dem).
Author: Marin Kobilarov -- Copyright (C) 2004
Dem::Dem | ( | const char * | fname, |
double | cs = 1.0 , |
||
double | ds = 1.0 , |
||
const double * | o = 0 |
||
) |
Initialize the Dem using a PPM file.
fname | name of PPM file |
cs | cell size |
ds | data size |
o | origin - a 3x1 array (optional) |
References ComputeNormals(), Load(), and odata.
Dem::Dem | ( | double | w, |
double | h, | ||
double | cs = 1.0 , |
||
double | ds = 1.0 , |
||
const double * | o = 0 |
||
) |
void Dem::AddBoundary | ( | double | h | ) |
double Dem::bilinterp | ( | const double * | z, |
int | w, | ||
int | h, | ||
double | xi, | ||
double | yi, | ||
double | eps = 1e-10 |
||
) | [static] |
void Dem::Clear | ( | ) |
void Dem::ComputeNormals | ( | ) |
void Dem::Convolve | ( | double | sigma, |
bool | cn = true , |
||
double | thresh = 0 |
||
) |
Apply Gaussian convolution filter with std deviation sigma
sigma | standard deviation (sigma=0) has no effect |
cn | flag to recompute normals (set to false in order to speedup processing when computing normals is not necessary) |
only | consider values above thresh |
void Dem::Dilate | ( | double | r, |
bool | cube = true |
||
) |
double Dem::Get | ( | double | x, |
double | y | ||
) | const [virtual] |
Get evelation at point (x,y)
x | x-coordinate |
y | y-coordinate |
References bilinterp(), cs, data, h, IsValid(), ni, nj, and o.
Referenced by ComputeNormals(), gcop::DemView::Init(), Inside(), gcop::PqpDem< T, _nx, _nu, _np >::PqpDem(), and gcop::DemView::RenderFrame().
void Dem::Get | ( | double * | p, |
int | i, | ||
int | j | ||
) | const [virtual] |
double Dem::GetNormal | ( | double | n[3], |
double | x, | ||
double | y | ||
) | const |
const double * Dem::GetNormal | ( | double | x, |
double | y | ||
) | const |
const double * Dem::GetNormal | ( | int | i, |
int | j | ||
) | const |
void Dem::Index2Point | ( | double & | x, |
double & | y, | ||
int | i, | ||
int | j | ||
) | const |
Referenced by gcop::Body3dDemController< nu >::GetTraj().
bool Dem::Inside | ( | double | x, |
double | y, | ||
double | z | ||
) | const |
bool gcop::Dem::IsValid | ( | double | x, |
double | y | ||
) | const [inline, virtual] |
void Dem::Load | ( | const char * | fname | ) |
void Dem::Point2Index | ( | int & | i, |
int & | j, | ||
double | x, | ||
double | y | ||
) | const |
Referenced by gcop::Body3dDemController< nu >::GetTraj().
void Dem::Scale | ( | double | s | ) |
void Dem::Set | ( | int | i, |
int | j, | ||
double | z | ||
) |
void Dem::Set | ( | double | x, |
double | y, | ||
double | z, | ||
double | s = 0 |
||
) |
Set height at point (x,y)
x | x-coordinate |
y | y-coordinate |
z | height |
s | size of point - optionally instead of setting single point one case set a square of points to height z, effectively creating a prallellepiped at point (x,y) with side s and height z |
double gcop::Dem::cs |
cell size
Referenced by Convolve(), Dilate(), Get(), GetNormal(), Index2Point(), gcop::DemView::Init(), Load(), Point2Index(), and Set().
double* gcop::Dem::data |
raw data (could be postprocessed)
Referenced by AddBoundary(), Clear(), Convolve(), Dem(), Dilate(), Get(), GetNormal(), Load(), Scale(), Set(), and ~Dem().
double gcop::Dem::ds |
data scale (height scale)
Referenced by Load().
double gcop::Dem::eps |
numerical tolerance for interpolation
Referenced by bilinterp(), IsValid(), and Set().
double gcop::Dem::h |
height
Referenced by AddBoundary(), Get(), GetNormal(), Index2Point(), IsValid(), Load(), Point2Index(), gcop::DemView::RenderFrame(), and Set().
int gcop::Dem::ni |
number of rows
Referenced by AddBoundary(), Clear(), ComputeNormals(), Convolve(), Dem(), Dilate(), Get(), GetNormal(), gcop::DemView::Init(), Load(), gcop::PqpDem< T, _nx, _nu, _np >::PqpDem(), gcop::DemView::RenderFrame(), Scale(), and Set().
int gcop::Dem::nj |
number of columns
Referenced by AddBoundary(), Clear(), ComputeNormals(), Convolve(), Dem(), Dilate(), Get(), GetNormal(), gcop::DemView::Init(), Load(), gcop::PqpDem< T, _nx, _nu, _np >::PqpDem(), gcop::DemView::RenderFrame(), Scale(), and Set().
double* gcop::Dem::normals |
normals
Referenced by ComputeNormals(), Dem(), GetNormal(), Load(), gcop::DemView::RenderFrame(), and ~Dem().
double gcop::Dem::o[3] |
origin
Referenced by Dem(), Get(), GetNormal(), Index2Point(), IsValid(), Point2Index(), gcop::DemView::RenderFrame(), and Set().
double* gcop::Dem::odata |
original raw data
Referenced by Convolve(), Dem(), Dilate(), and ~Dem().
double gcop::Dem::w |
width
Referenced by IsValid(), Load(), and gcop::DemView::RenderFrame().