|
| Interval (double min, double max) |
| Construct a new Interval object.
|
|
| Interval (const Interval &a, const Interval &b) |
| Construct a new Interval object.
|
|
double | size () const |
| Get the minimum value of the interval.
|
|
bool | contains (double x) const |
| Check if the interval contains the given value.
|
|
bool | surrounds (double x) const |
| Check if the interval surrounds the given value.
|
|
double | clamp (double x) const |
| Clamp the value to the interval.
|
|
Interval | expand (double x) const |
| Expand the interval by the given value.
|
|
◆ Interval() [1/2]
Raytracer::Utils::Interval::Interval |
( |
double | min, |
|
|
double | max ) |
Construct a new Interval object.
This function constructs a new Interval object with the given minimum and maximum values.
- Parameters
-
min | The minimum value. |
max | The maximum value. |
- Returns
- A new Interval object.
◆ Interval() [2/2]
Construct a new Interval object.
This function constructs a new Interval object by combining the given Intervals. The new Interval is the smallest Interval that contains both of the given Intervals.
- Parameters
-
- Returns
- A new Interval object.
◆ clamp()
double Raytracer::Utils::Interval::clamp |
( |
double | x | ) |
const |
Clamp the value to the interval.
This function clamps the value to the interval. The function returns the clamped value.
- Parameters
-
- Returns
- The clamped value.
◆ contains()
bool Raytracer::Utils::Interval::contains |
( |
double | x | ) |
const |
Check if the interval contains the given value.
This function checks if the interval contains the given value. The function returns true if the interval contains the value, false otherwise.
- Parameters
-
- Returns
- True if the interval contains the value, false otherwise.
◆ expand()
Expand the interval by the given value.
This function expands the interval by the given value. The function returns the expanded interval.
- Parameters
-
x | The value to expand the interval by. |
- Returns
- The expanded interval.
◆ size()
double Raytracer::Utils::Interval::size |
( |
| ) |
const |
Get the minimum value of the interval.
This function returns the minimum value of the interval.
- Returns
- The minimum value of the interval.
◆ surrounds()
bool Raytracer::Utils::Interval::surrounds |
( |
double | x | ) |
const |
Check if the interval surrounds the given value.
This function checks if the interval surrounds the given value. The function returns true if the interval surrounds the value, false otherwise.
- Parameters
-
- Returns
- True if the interval surrounds the value, false otherwise.
◆ Empty
Initial value:=
Interval(+std::numeric_limits<double>::infinity(),
-std::numeric_limits<double>::infinity())
A constant empty interval.
This constant represents an empty interval.
◆ Universe
Initial value:=
Interval(-std::numeric_limits<double>::infinity(),
+std::numeric_limits<double>::infinity())
A constant universe interval.
This constant represents the universe interval.
The documentation for this class was generated from the following files:
- /Users/javii/Code/raytracer/include/utils/Interval.hpp
- /Users/javii/Code/raytracer/sources/utils/Interval.cpp