Open PaperOpt
SurfaceTN Class Reference

#include <SurfaceTN.h>

Inheritance diagram for SurfaceTN:
Collaboration diagram for SurfaceTN:

List of all members.

Public Member Functions

 SurfaceTN (float _zoffset, float sizeX, float sizeY, Array2D< float > &z, int _normfact, bool _interpolate, float _rmsmin, float _rmsmax, StructureObject *_el)
 SurfaceTN (float _zoffset, float sizeX, float sizeY, Array2D< float > &z, int _normfact, bool _interpolate, Array2D< V2< float > > &v, StructureObject *_el)
 SurfaceTN (float _zoffset, float _xmax, float _ymax, Array2D< V3< float > > &v1, bool _interpolate, Array2D< V2< float > > &v, StructureObject *_el)
 SurfaceTN (int _normfact, int _interpolate, Array2D< V2< float > > &v)
 SurfaceTN (float _zoffset, float sizeX, float sizeY, Array2D< float > &z, int _normfact, int _interpolate, float _rmsmin, float _rmsmax, StructureObject *_el)
 SurfaceTN (float _zoffset, float sizeX, float sizeY, Array2D< float > &z, int _normfact, int _interpolate, Array2D< V2< float > > &v, StructureObject *_el)
virtual ~SurfaceTN ()
virtual int mIntercept (WavePacket &wp, double t1in, double t2in, int updown, double &t) const
virtual int Process (WavePacket &wp, int updown, int internal) const
virtual double mZposition (WavePacket &wp) const

Protected Member Functions

 SurfaceTN (int _mNorm, int _nnorm, int _mrough, int _nrough)
void FindSnormal (WavePacket &wp, int updown) const
virtual bool ReadNormals (std::string _normfile)
virtual void CreateRandomNormals (int thetamax)
virtual void CreateNormals (Array2D< float > &z, int mtopo, int ntopo, float dxtopo, float dytopo, int normfact)
virtual bool ReadRoughness (std::string roughfile)
virtual void WriteInfo (bool topobased, std::string _topofile, std::string _normfile, std::string _roughfile)
const V2< float > FindRoughness (WavePacket &wp) const

Protected Attributes

int mNorm
int nnorm
double dxnorm
double dynorm
bool interpolate
Array2D< V3< double > > normals
bool normal_mapping
int mrough
int nrough
double dxrough
double dyrough
Array2D< V2< float > > roughness
bool detailed_roughness

Constructor & Destructor Documentation

SurfaceTN::SurfaceTN ( float  _zoffset,
float  sizeX,
float  sizeY,
Array2D< float > &  z,
int  _normfact,
bool  _interpolate,
float  _rmsmin,
float  _rmsmax,
StructureObject _el 
)

Constructor that creates normals from an actual topography file. No roughness mapping.

Parameters:
_zoffset
sizeX
sizeY
zInstance Array2D vector to handle row and columns
_normfact
_interpolate
_rmsmin
_rmsmax
_elInstance of StructureObject

Set various constants

Since we don't map different roughness values to the surface, we use the member 'rms' and ignore the matrix 'roughness'.

Set the size of the normal array. mXmax, mYMax, dxnorm and dynorm are set later during the normal estimations.

Estimate the normals from the topography.

Here is the call graph for this function:

SurfaceTN::SurfaceTN ( float  _zoffset,
float  sizeX,
float  sizeY,
Array2D< float > &  z,
int  _normfact,
bool  _interpolate,
Array2D< V2< float > > &  v,
StructureObject _el 
)

Constructor that creates normals from an actual topography file. No roughness mapping.

Parameters:
_zoffset
sizeX
sizeY
zInstance Array2D vector to handle row and columns
_normfact
_interpolate
vInstance of Array2D class
_elInstance of StructureObject

Set various constants

Set the size of the roughness array. dxrough and dyrough are set later below when the surface size is known.

Set the size of the normal array. dxnorm and dynorm are set later during the normal estimations.

Estimate the normals from the topography and read the roughness from file.

Here is the call graph for this function:

SurfaceTN::SurfaceTN ( float  _zoffset,
float  _xmax,
float  _ymax,
Array2D< V3< float > > &  v1,
bool  _interpolate,
Array2D< V2< float > > &  v,
StructureObject _el 
)

Set various constants

Set the sizes of the normal and roughness arrays, etc.

Read the normal and roughness mappings from files.

Here is the call graph for this function:

SurfaceTN::SurfaceTN ( int  _normfact,
int  _interpolate,
Array2D< V2< float > > &  v 
)

Constructor that creates normals from an actual topography file. Roughness mapping from file.

SurfaceTN::SurfaceTN ( float  _zoffset,
float  sizeX,
float  sizeY,
Array2D< float > &  z,
int  _normfact,
int  _interpolate,
float  _rmsmin,
float  _rmsmax,
StructureObject _el 
)
SurfaceTN::SurfaceTN ( float  _zoffset,
float  sizeX,
float  sizeY,
Array2D< float > &  z,
int  _normfact,
int  _interpolate,
Array2D< V2< float > > &  v,
StructureObject _el 
)
virtual SurfaceTN::~SurfaceTN ( ) [inline, virtual]
SurfaceTN::SurfaceTN ( int  _mNorm,
int  _nnorm,
int  _mrough,
int  _nrough 
) [inline, protected]

Constructor to be used by subclasses only


Member Function Documentation

void SurfaceTN::CreateNormals ( Array2D< float > &  z,
int  mtopo,
int  ntopo,
float  dxtopo,
float  dytopo,
int  normfact 
) [protected, virtual]

Approximate the derivatives using central difference quotients (and half of post- and predifference quotients around the edges).

Use hermite interpolation to calculate extra normals when normfact>1

Use the central difference qoutients immediately when normfact==1

Here is the caller graph for this function:

void SurfaceTN::CreateRandomNormals ( int  thetamax) [protected, virtual]

Here is the call graph for this function:

const V2<float> SurfaceTN::FindRoughness ( WavePacket wp) const [inline, protected]

Returns the roughness interval with respect to the lateral position of wp.

Here is the call graph for this function:

Here is the caller graph for this function:

void SurfaceTN::FindSnormal ( WavePacket wp,
int  updown 
) const [protected]

Don't interpolate the surface normal

Interpolate the surface normal

Turn the normal into the right direction

Here is the call graph for this function:

Here is the caller graph for this function:

int SurfaceTN::mIntercept ( WavePacket wp,
double  t1in,
double  t2in,
int  updown,
double &  t 
) const [virtual]

Save surface normal and position for next SURFSCAT if wp hit the surface

Parameters:
wpInstance of wave packet class
t1in
t2in
ud
t

Reimplemented from Surface.

Reimplemented in SurfaceTNSubflat.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual double SurfaceTN::mZposition ( WavePacket wp) const [inline, virtual]
Parameters:
wpInstance of wave packet class

Reimplemented from Surface.

Reimplemented in SurfaceTNSubflat.

Here is the caller graph for this function:

int SurfaceTN::Process ( WavePacket wp,
int  updown,
int  internal 
) const [virtual]

/*Determines the new direction after scattering and determine wp must intersect surface

Parameters:
wpInstance of wave packet class
up_down

If not internal, compute the surface interception point, if any.

Move the wp to the surface and pick up the computed surface normal stored in Snormal

Find the refractive indices of the surrounding layers. Discard layers that are too thin.

Calculate the local coordinate system direction cosines for x and y. The local coordinate system is defined so that the wave packet lies in the local xz-plane (BSDF standard notation).

Transform the wave packet to the local coordinate system.

Rotate the polarization vector and select only the local s- and p- polarization.

Calculate reflection or transmission of the wave packet. If roughness mapping should be used, find the roughness.

Rotate the trajectory cosines for the reflected wave packet.

Rotate the polarization to the global coordinate system.

If reflected, we want to stay in the same layer

Return the number of HomogeneousLayers to pass if going up, or minus the number of HomogeneousLayers to pass if going down.

Reimplemented from Surface.

Here is the call graph for this function:

bool SurfaceTN::ReadNormals ( std::string  _normfile) [protected, virtual]

Here is the caller graph for this function:

bool SurfaceTN::ReadRoughness ( std::string  roughfile) [protected, virtual]
void SurfaceTN::WriteInfo ( bool  topobased,
std::string  _topofile,
std::string  _normfile,
std::string  _roughfile 
) [protected, virtual]

Topography

Normals;

Roughness

Here is the call graph for this function:


Member Data Documentation

double SurfaceTN::dxnorm [protected]
double SurfaceTN::dxrough [protected]
double SurfaceTN::dynorm [protected]
double SurfaceTN::dyrough [protected]
bool SurfaceTN::interpolate [protected]
int SurfaceTN::mNorm [protected]
int SurfaceTN::mrough [protected]
int SurfaceTN::nnorm [protected]
bool SurfaceTN::normal_mapping [protected]
Array2D< V3<double> > SurfaceTN::normals [protected]
int SurfaceTN::nrough [protected]
Array2D< V2<float> > SurfaceTN::roughness [protected]

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