|
Open PaperOpt
|
#include <SurfaceTN.h>


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 |
| 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.
| _zoffset | |
| sizeX | |
| sizeY | |
| z | Instance Array2D vector to handle row and columns |
| _normfact | |
| _interpolate | |
| _rmsmin | |
| _rmsmax | |
| _el | Instance 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.

| 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.
| _zoffset | |
| sizeX | |
| sizeY | |
| z | Instance Array2D vector to handle row and columns |
| _normfact | |
| _interpolate | |
| v | Instance of Array2D class |
| _el | Instance 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.

| 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.

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
| 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

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

| const V2<float> SurfaceTN::FindRoughness | ( | WavePacket & | wp | ) | const [inline, protected] |
Returns the roughness interval with respect to the lateral position of wp.


| 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


| 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
| wp | Instance of wave packet class |
| t1in | |
| t2in | |
| ud | |
| t |
Reimplemented from Surface.
Reimplemented in SurfaceTNSubflat.


| virtual double SurfaceTN::mZposition | ( | WavePacket & | wp | ) | const [inline, virtual] |
| wp | Instance of wave packet class |
Reimplemented from Surface.
Reimplemented in SurfaceTNSubflat.

| int SurfaceTN::Process | ( | WavePacket & | wp, |
| int | updown, | ||
| int | internal | ||
| ) | const [virtual] |
/*Determines the new direction after scattering and determine wp must intersect surface
| wp | Instance 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.

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

| 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

bool SurfaceTN::detailed_roughness [protected] |
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] |