|
Core 1.0
|
Hemispheres. More...
#include <hemisphere.h>
Public Member Functions | |
| HemiSphere (const Vector &, const Vector &, const double &) | |
| Create a hemi-sphere. | |
| HemiSphere (const double &) | |
| Create a hemi-sphere centered at the origin and with vertical direction. | |
| ~HemiSphere () | |
| Empty. | |
| Vector | Normal (const Vector &) const |
| Compute the distance vector between the hemisphere and a point. | |
| double | R (const Vector &) const |
| Compute the distance between the hemisphere and a point. | |
| double | Signed (const Vector &) const |
| Compute the Euclidean signed distance between the hemisphere and a point. | |
| bool | Inside (const Vector &) const |
| Check if a point is inside the hemisphere. | |
| Box | GetBox () const |
| Compute the bouding box. | |
| Vector | Center () const |
| Gets the center of a hemisphere. | |
| double | Radius () const |
| Gets the radius of a hemisphere. | |
| Vector | GetAxis () const |
| Gets the axis of the hemisphere. | |
| Vector | Fibonacci (int, int) |
| Compute the i-th Fibonacci direction on the hemisphere. | |
| QVector< Vector > | PoissonInside (const double &, int, Random &=Random::R239) const |
| Create a Poisson Disc sampling of interioor of the hemisphere. | |
| void | Relaxation (QVector< Vector > &, const double &, int=1, const double &=1.0/8.0) const |
| Perform relaxation steps over the Poisson-Disc distribution. | |
| Vector | RandomInside (Random &=Random::R239) const |
| Generate a random vector inside the hemisphere. | |
Static Public Member Functions | |
| static Vector | FibonacciUnit (int, int) |
| Compute the i-th Fibonacci direction on the vertical unit hemisphere. | |
| static Vector | RandomDirection (const Vector &, Random &=Random::R239) |
| Generate a random direction. | |
Protected Attributes | |
| Vector | c = Vector::Null |
| Center. | |
| double | r = 1.0 |
| Radius. | |
| Vector | axis = Vector::Z |
| Axis. | |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const HemiSphere &hemisphere) |
| Overloaded output-stream operator. | |
Hemispheres.
Create a hemi-sphere.
| c | Center. |
| r | Radius. |
| a | Axis, should be normalized. |
|
explicit |
Create a hemi-sphere centered at the origin and with vertical direction.
| r | Radius. |
| Vector HemiSphere::Fibonacci | ( | int | i, |
| int | n ) |
Compute the i-th Fibonacci direction on the hemisphere.
| i | Point index. |
| n | Number of samples on the hemisphere. |
|
static |
Compute the i-th Fibonacci direction on the vertical unit hemisphere.
| i | Point index. |
| n | Number of samples on the hemisphere. |
| bool HemiSphere::Inside | ( | const Vector & | p | ) | const |
Check if a point is inside the hemisphere.
| p | Point. |
Compute the distance vector between the hemisphere and a point.
| p | Point. |
| QVector< Vector > HemiSphere::PoissonInside | ( | const double & | r, |
| int | n, | ||
| Random & | random = Random::R239 ) const |
Create a Poisson Disc sampling of interioor of the hemisphere.
Simple dart throwing algorithm.
| r | Radius of the spheres. |
| n | Maximum number of darts thrown inside the sphere. |
| random | Random number generator. |
| double HemiSphere::R | ( | const Vector & | p | ) | const |
Compute the distance between the hemisphere and a point.
| p | Point. |
|
static |
Generate a random direction.
| axis | Axis. |
| random | Random number generator. |
| Vector HemiSphere::RandomInside | ( | Random & | random = Random::R239 | ) | const |
Generate a random vector inside the hemisphere.
| random | Random number generator. |
| void HemiSphere::Relaxation | ( | QVector< Vector > & | p, |
| const double & | rp, | ||
| int | n = 1, | ||
| const double & | e = 1.0 / 8.0 ) const |
Perform relaxation steps over the Poisson-Disc distribution.
The points repel each other: every pair of points closer than four times the Poisson radius is moved apart, by an amount which decreases with the distance. The points are not constrained to stay in the hemisphere.
| p | Set of points. |
| rp | Radius of the Poisson distribution, as in HemiSphere::PoissonInside(). |
| n | Number of relaxation steps. |
| e | Relaxation coefficient, it is the fraction of the Poisson radius. |
| double HemiSphere::Signed | ( | const Vector & | p | ) | const |
Compute the Euclidean signed distance between the hemisphere and a point.
| p | Point. |
|
friend |
Overloaded output-stream operator.
| s | Stream. |
| hemisphere | The hemisphere. |