Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
MathUtils::Domain1D Struct Reference

1D parameter domain for curves. More...

#include <MathUtils_Domain.hxx>

Public Member Functions

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.
 

Data Fields

double Min = 0.0
 Lower bound of the domain.
 
double Max = 0.0
 Upper bound of the domain.
 

Detailed Description

1D parameter domain for curves.

Represents a parameter range [Min, Max] with utility methods for:

Note
This is a lightweight value type designed for efficiency. All methods are inline and constexpr where possible.

Constructor & Destructor Documentation

◆ Domain1D() [1/2]

constexpr MathUtils::Domain1D::Domain1D ( )
constexprdefault

Default constructor - creates empty domain [0, 0].

◆ Domain1D() [2/2]

constexpr MathUtils::Domain1D::Domain1D ( double theMin,
double theMax )
inlineconstexpr

Construct from bounds.

Parameters
theMinlower bound
theMaxupper bound

Member Function Documentation

◆ Clamp()

double MathUtils::Domain1D::Clamp ( double theU) const
inline

Clamp value to domain bounds.

Parameters
theUparameter 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
theUparameter value to check
theToltolerance 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
theOtherdomain to compare with
theToltolerance 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
theInfLimitthreshold 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
thePeriodperiod of the parameter (e.g., 2*PI for angles)
theToltolerance
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
theThresholdsize threshold (default 1000)
Returns
true if Length() > theThreshold

◆ Length()

constexpr double MathUtils::Domain1D::Length ( ) const
inlineconstexpr

Returns the length of the domain.

◆ Lerp()

constexpr double MathUtils::Domain1D::Lerp ( double theT) const
inlineconstexpr

Interpolate within domain.

Parameters
theTinterpolation parameter in [0, 1]
Returns
Min + theT * Length()

◆ Mid()

constexpr 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
theUparameter value
Returns
(theU - Min) / Length(), or 0.5 if Length() == 0

Field Documentation

◆ 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: