|
Open PaperOpt
|
#include <Halftone.h>
Public Member Functions | |
| Halftone () | |
| Halftone (ScatteringParameters *pScatteringParameters, float zOffset, std::vector< float > &rLambdas, float xmin, float xmax, float ymin, float ymax, float screenAngle, float dropletHeight, float dropletWidth, float dropletSpacing) | |
| virtual | ~Halftone () |
| void | setSurface (SurfaceTNInk *pSurface) |
| int | drop_process (WavePacket &wp, int updown) const |
| double | GetZmax () const |
Protected Member Functions | |
| void | WriteInfo (int nbr) |
Friends | |
| class | SurfaceTNInk |
| Halftone::Halftone | ( | ) | [inline] |
| Halftone::Halftone | ( | ScatteringParameters * | pScatteringParameters, |
| float | zOffset, | ||
| std::vector< float > & | rLambdas, | ||
| float | xmin, | ||
| float | xmax, | ||
| float | ymin, | ||
| float | ymax, | ||
| float | screenAngle, | ||
| float | dropletHeight, | ||
| float | dropletWidth, | ||
| float | dropletSpacing | ||
| ) |
New constructor.
| pScatteringParameters | pointer to the scattering parameters this halftone has. |
| zOffset | offset of the surface this ink layer belongs too. |
| rLambdas | the simulation wavelengths. |
| xmin | minimum x position of the ink layer. |
| xmax | maximum x position of the ink layer. |
| ymin | minimum y position of the ink layer. |
| ymax | maximum y position of the ink layer. |
| screenAngle | angle between edge of surface and edge of the ink layer. |
| dropletHeight | height of the droplets in micrometer. |
| dropletWidth | width of the ink droplets in micrometer. |
| dropletSpacing | distance between droplets in micrometer. |
Compute the z-value of the droplet centres.
Update the halftone boundary slightly and check that it is within the surface boundary.
| Halftone::~Halftone | ( | ) | [virtual] |
| int Halftone::drop_process | ( | WavePacket & | wp, |
| int | updown | ||
| ) | const |
This method sets the surface this ink layer belongs to.
| wp | Process the wave packet |
| updown |
If we are not within the boundaries -- abort.
Calculate the surface intersection point with respect to the screen angle coordinate system
Calculate the vector components from the closest ink drop centre to the surface intersection point.
Abort if we miss the drop
Find the sphere centre with respect to the global coordinate system
If hitting the surface from above
Find the sphere intersection: first get the coefficients of the quadratic equation. Choose the smaller of the solutions. Move the wp to this point and let it scatter.
If we hit outside the halftone boundary -- abort
If reflected
Multiple scattering: if reflected towards the surface continue (The two latter arguments should have no effect.)
If reflected away
If transmitted, continue below.
If coming from beneath, the correct Sposition and Snormal should already be set. Let it scatter.
If reflected back
If tranmitted into the drop, continue below.
Move the wp slightly more into the drop, to avoid the same intersection point from being found again.
Get the scatter, absorption and extinction coordinates respectively.
Get the randomized free path before being scattered or absorbed, and the distance to the drop boundary. hull_ind indicates the current wp positioning.
If scattered within the drop or absorbed.
Absorbed
Scattered. NOTE: Uniform distribution of new wp direction -- use of Henyey-Greenstein phase function or similar not implemented!
If the wp hits the drop boundary.
If hull intersection
If transmitted
Multiple scattering: if transmitted towards the surface continue (The two latter arguments should have no effect.)
If transmitted away
If halftone boundary hit
If contact area intersection
If transmitted to the layer(s) below
Too many loops -- abort.


| double Halftone::GetZmax | ( | ) | const [inline] |
| void Halftone::setSurface | ( | SurfaceTNInk * | pSurface | ) |
This method sets the surface this ink layer belongs to.
| pSurface | pointer to the surface this ink layer belongs to. |
| void Halftone::WriteInfo | ( | int | nbr | ) | [protected] |
friend class SurfaceTNInk [friend] |