|
Open PaperOpt
|
#include <SurfaceTNSubflat.h>


Public Member Functions | |
| SurfaceTNSubflat (float _zoffset, float sizeX, float sizeY, Array2D< float >, int _normfact, bool _interpolate, float _rmsmin, float _rmsmax, StructureObject *_el) | |
| SurfaceTNSubflat (float _zoffset, float sizeX, float sizeY, Array2D< float > &z, int _normfact, bool _interpolate, Array2D< V2< float > > &v, StructureObject *_el) | |
| SurfaceTNSubflat (float _zoffset, float sizeX, float sizeY, Array2D< float > &z, int _mNorm, int _nnorm, std::string _normfile, bool _interpolate, Array2D< V2< float > > &v, StructureObject *_el) | |
| SurfaceTNSubflat (float _zoffset, float sizeX, float sizeY, Array2D< float >, float _rmsmin, float _rmsmax, StructureObject *_el) | |
| virtual | ~SurfaceTNSubflat () |
| int | mIntercept (WavePacket &wp, double t1in, double t2in, int updown, double &t) const |
| double | mZposition (WavePacket &wp) const |
| SurfaceTNSubflat::SurfaceTNSubflat | ( | float | _zoffset, |
| float | sizeX, | ||
| float | sizeY, | ||
| Array2D< float > | , | ||
| int | _normfact, | ||
| bool | _interpolate, | ||
| float | _rmsmin, | ||
| float | _rmsmax, | ||
| StructureObject * | _el | ||
| ) |
CONSTRUCTOR we have used a lot of constructors because of different parameters to read topography and roughness. Creates a flat surface at _zoffset. Calculates normals from the topography z,sizeX and sizeY should be its size, resulting in _normfact times as many precalculated normals (typically _normfact = 1 to 3).
| _zoffset | Indicates actualy where is surface actualy exists |
| sizeX | Size of normal |
| sizeY | Size of normal |
| z | Replacement of topography file |
| _normfact | Represents how many normals can be calculated |
| _interpolate | Resolution of generated surface normal map. |
| _rmsmin | Root mean suare roughness of the paper over the small area |
| _rmsmax | Root mean suare roughness of the paper over the small area |
| _el | Instance of StructureObject class is used to appraoch next surface layer untill last one |
Set various constants
Set the topography size. dxtopo and dytopo are set later when reading the topography.
Set the size of the normal array. mXmax, mYMax, dxnorm and dynorm are set later when reading the topography.
Since we don't map different roughness values to the surface, we use the member 'rms' and ignore the matrix 'roughness'.
Read the topography and estimate the normals from the topography.

| SurfaceTNSubflat::SurfaceTNSubflat | ( | 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 z. No roughness mapping.
| _zoffset | Indicates actualy where is surface actualy exists |
| sizeX | Size of normal |
| sizeY | Size of normal |
| z | Instance Array2D vector to handle row and columns and to read topography |
| _normfact | Represents how many normal can be calculated |
| _interpolate | Resolution of generated surface normal map. |
| v | Replacement of roughness |
| _el | Instance of StructureObject class is used to appraoch next surface layer untill last one |
Set various constants
Set the topography size. dxtopo and dytopo are set when reading the topography.
Set the size of the normal array. mXmax, mYMax, dxnorm and dynorm are set when reading the topography.
Set the size of the roughness array. dxrough and dyrough are set below when the surface size is known.
Read the topography and the roughness, and estimate the normals from the topography.

| SurfaceTNSubflat::SurfaceTNSubflat | ( | float | _zoffset, |
| float | sizeX, | ||
| float | sizeY, | ||
| Array2D< float > & | z, | ||
| int | _mNorm, | ||
| int | _nnorm, | ||
| std::string | _normfile, | ||
| bool | _interpolate, | ||
| Array2D< V2< float > > & | v, | ||
| StructureObject * | _el | ||
| ) |
Set various constants
Set the topography size. dxtopo and dytopo are set later when reading the topography.
Set the remaining array sizes, etc. dx and dy for the normals and the roughness is set below when the surface size is known.
Read the topography, the normals and the roughness from files.

| SurfaceTNSubflat::SurfaceTNSubflat | ( | float | _zoffset, |
| float | sizeX, | ||
| float | sizeY, | ||
| Array2D< float > | ar, | ||
| float | _rmsmin, | ||
| float | _rmsmax, | ||
| StructureObject * | _el | ||
| ) |
Set various constants
Set the topography size. dxtopo and dytopo are set later when reading the topography.
We will not use normal mapping
Since we don't map different roughness values to the surface, we use the member 'rms' and ignore the matrix 'roughness'.
Read the topography and estimate the normals from the topography.

| SurfaceTNSubflat::~SurfaceTNSubflat | ( | ) | [virtual] |
Constructor that reads the topography as well as the normal and roughness mappings from files.
| int SurfaceTNSubflat::mIntercept | ( | WavePacket & | wp, |
| double | t1in, | ||
| double | t2in, | ||
| int | updown, | ||
| double & | t | ||
| ) | const [virtual] |
Find intersection between surfaces and return value of travelled distance
| wp | Wave Packet's object to calculate ditance of plane surface |
| t1in | Smaller distance of propagation |
| t2in | Smaller distance of propagation |
| ud | |
| t | Determines the propagation distance |
Update t1 and t2 so that they are within the volume spanned by the surface. If any of the components of wp.mDir is 0, we are impudent enough to change them to a small number.
Get the indices of the cell of t1. Note the need of 0.5 term imposed by the fact that cell is centered around the height point.
Very useful in many situations below
Abort if the wp is on the wrong side of the surface for t1. This is not the behaviour of SurfaceTopo / -topo_tri. If we end up exactly on a grid line, the result may not be correct.
Cell indices for t2. NOTE: one could use t2 to discover when the search should end instead of [x2,y2], but it is difficult to say if the algorithm would be faster / more simple...
Various variables needed in the algorithm
The main algorithm: test the cells along the path of the ray (wp).
Reimplemented from SurfaceTN.

| double SurfaceTNSubflat::mZposition | ( | WavePacket & | wp | ) | const [virtual] |
Find intersection between surfaces and return value of travelled distance
| wp | Instance of wave packet class |
Check on the boundary. There is really no good behavoiur if this case should be detected...
Reimplemented from SurfaceTN.
