1D parameter domain for curves.
More...
#include <MathUtils_Domain.hxx>
|
| constexpr | Domain1D ()=default |
| | Default constructor - creates empty domain [0, 0].
|
| constexpr | Domain1D (double theMin, double theMax) |
| | Construct from bounds.
|
| constexpr double | Length () const |
| | Returns the length of the domain.
|
| constexpr double | Mid () const |
| | Returns the midpoint of the domain.
|
| bool | Contains (double theU, double theTol=0.0) const |
| | Check if value is within domain.
|
| double | Clamp (double theU) const |
| | Clamp value to domain bounds.
|
| bool | IsLarge (double theThreshold=1000.0) const |
| | Check if domain is "large" (effectively unbounded for optimization). Large domains allow skipping bounds checking for performance.
|
| bool | IsFullPeriod (double thePeriod, double theTol=1.0e-10) const |
| | Check if domain covers a full periodic range.
|
| constexpr double | Lerp (double theT) const |
| | Interpolate within domain.
|
| double | Normalize (double theU) const |
| | Normalize parameter to [0, 1] range.
|
| bool | IsFinite (double theInfLimit=1.0e100) const |
| | Check if domain has finite bounds (not effectively infinite).
|
| bool | IsEqual (const Domain1D &theOther, double theTol=1.0e-10) const |
| | Check if this domain equals another within tolerance.
|
|
| double | Min = 0.0 |
| | Lower bound of the domain.
|
| double | Max = 0.0 |
| | Upper bound of the domain.
|
1D parameter domain for curves.
Represents a parameter range [Min, Max] with utility methods for:
- Bounds checking (Contains)
- Parameter clamping (Clamp)
- Domain analysis (IsLarge, IsFullPeriod)
- Note
- This is a lightweight value type designed for efficiency. All methods are inline and constexpr where possible.
◆ Domain1D() [1/2]
| MathUtils::Domain1D::Domain1D |
( |
| ) |
|
|
constexprdefault |
Default constructor - creates empty domain [0, 0].
◆ Domain1D() [2/2]
| MathUtils::Domain1D::Domain1D |
( |
double | theMin, |
|
|
double | theMax ) |
|
inlineconstexpr |
Construct from bounds.
- Parameters
-
| theMin | lower bound |
| theMax | upper bound |
◆ Clamp()
| double MathUtils::Domain1D::Clamp |
( |
double | theU | ) |
const |
|
inline |
Clamp value to domain bounds.
- Parameters
-
| theU | parameter value to clamp |
- Returns
- clamped value in [Min, Max]
◆ Contains()
| bool MathUtils::Domain1D::Contains |
( |
double | theU, |
|
|
double | theTol = 0.0 ) const |
|
inline |
Check if value is within domain.
- Parameters
-
| theU | parameter value to check |
| theTol | tolerance for boundary check |
- Returns
- true if theU is in [Min - theTol, Max + theTol]
◆ IsEqual()
| bool MathUtils::Domain1D::IsEqual |
( |
const Domain1D & | theOther, |
|
|
double | theTol = 1.0e-10 ) const |
|
inline |
Check if this domain equals another within tolerance.
- Parameters
-
| theOther | domain to compare with |
| theTol | tolerance for comparison |
- Returns
- true if domains are equal within tolerance
◆ IsFinite()
| bool MathUtils::Domain1D::IsFinite |
( |
double | theInfLimit = 1.0e100 | ) |
const |
|
inline |
Check if domain has finite bounds (not effectively infinite).
- Parameters
-
| theInfLimit | threshold for "infinity" (default 1e100) |
- Returns
- true if both Min and Max are within finite range
◆ IsFullPeriod()
| bool MathUtils::Domain1D::IsFullPeriod |
( |
double | thePeriod, |
|
|
double | theTol = 1.0e-10 ) const |
|
inline |
Check if domain covers a full periodic range.
- Parameters
-
| thePeriod | period of the parameter (e.g., 2*PI for angles) |
| theTol | tolerance |
- Returns
- true if domain covers at least one full period
◆ IsLarge()
| bool MathUtils::Domain1D::IsLarge |
( |
double | theThreshold = 1000.0 | ) |
const |
|
inline |
Check if domain is "large" (effectively unbounded for optimization). Large domains allow skipping bounds checking for performance.
- Parameters
-
| theThreshold | size threshold (default 1000) |
- Returns
- true if Length() > theThreshold
◆ Length()
| double MathUtils::Domain1D::Length |
( |
| ) |
const |
|
inlineconstexpr |
Returns the length of the domain.
◆ Lerp()
| double MathUtils::Domain1D::Lerp |
( |
double | theT | ) |
const |
|
inlineconstexpr |
Interpolate within domain.
- Parameters
-
| theT | interpolation parameter in [0, 1] |
- Returns
- Min + theT * Length()
◆ Mid()
| double MathUtils::Domain1D::Mid |
( |
| ) |
const |
|
inlineconstexpr |
Returns the midpoint of the domain.
◆ Normalize()
| double MathUtils::Domain1D::Normalize |
( |
double | theU | ) |
const |
|
inline |
Normalize parameter to [0, 1] range.
- Parameters
-
- Returns
- (theU - Min) / Length(), or 0.5 if Length() == 0
◆ Max
| double MathUtils::Domain1D::Max = 0.0 |
Upper bound of the domain.
◆ Min
| double MathUtils::Domain1D::Min = 0.0 |
Lower bound of the domain.
The documentation for this struct was generated from the following file: