|
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 |
| Compute the Euclidean signed distance between the hemisphere and a point. | |
| 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, int=0, Random &=Random::R239) const |
| Create a Poisson Disc sampling of interioor of the hemisphere. | |
| void | Relaxation (QVector< Vector > &, int=1, const double &=1.0/8.0) const |
| Perform a relaxation step 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.
|
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 |
Compute the Euclidean signed distance between the hemisphere and a point.
| p | Point. |
Compute the distance vector between the hemisphere and a point.
| p | Point. |
| QVector< Vector > HemiSphere::PoissonInside | ( | const double & | r, |
| int | n, | ||
| int | relax = 0, | ||
| 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, |
| int | n = 1, | ||
| const double & | e = 1.0/8.0 ) const |
Perform a relaxation step over the Poisson-Disc distribution.
| p | Set of points. |
| e | Relaxation coefficient, it is the fraction of the Poisson radius. |
| n | Number of relaxation steps. |
| 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. |