SFCGAL  1.4.1
Public Member Functions | List of all members
SFCGAL::detail::Interval Class Reference

Represents an interval. More...

#include <Interval.h>

Public Member Functions

 Interval ()
 default constructor (empty interval) More...
 
 Interval (const double &value)
 collapsed interval constructor More...
 
 Interval (const double &v1, const double &v2)
 constructor with two values More...
 
 Interval (const Interval &other)
 copy constructor More...
 
Intervaloperator= (const Interval &other)
 assign operator More...
 
 ~Interval ()
 destructor More...
 
bool isEmpty () const
 indicates if the interval is empty More...
 
const double & lower () const
 returns the lower value More...
 
const double & upper () const
 returns the upper value More...
 
double width () const
 returns the with of the interval More...
 
void expandBy (const double &d)
 expand the interval More...
 
void expandToInclude (const Interval &other)
 expand the interval to include an other interval. More...
 
void expandToInclude (const double &value)
 expand the interval to include a value More...
 
bool intersects (const Interval &other) const
 test if this intersects other More...
 
bool operator== (const Interval &other) const
 compare two intervals More...
 
bool operator!= (const Interval &other) const
 compare two intervals More...
 
 Interval ()
 default constructor (empty interval) More...
 
 Interval (const double &value)
 collapsed interval constructor More...
 
 Interval (const double &v1, const double &v2)
 constructor with two values More...
 
 Interval (const Interval &other)
 copy constructor More...
 
Intervaloperator= (const Interval &other)
 assign operator More...
 
 ~Interval ()
 destructor More...
 
bool isEmpty () const
 indicates if the interval is empty More...
 
const double & lower () const
 returns the lower value More...
 
const double & upper () const
 returns the upper value More...
 
double width () const
 returns the with of the interval More...
 
void expandBy (const double &d)
 expand the interval More...
 
void expandToInclude (const Interval &other)
 expand the interval to include an other interval. More...
 
void expandToInclude (const double &value)
 expand the interval to include a value More...
 
bool intersects (const Interval &other) const
 test if this intersects other More...
 
bool operator== (const Interval &other) const
 compare two intervals More...
 
bool operator!= (const Interval &other) const
 compare two intervals More...
 

Detailed Description

Represents an interval.

Constructor & Destructor Documentation

◆ Interval() [1/8]

SFCGAL::detail::Interval::Interval ( )

default constructor (empty interval)

◆ Interval() [2/8]

SFCGAL::detail::Interval::Interval ( const double &  value)

collapsed interval constructor

◆ Interval() [3/8]

SFCGAL::detail::Interval::Interval ( const double &  v1,
const double &  v2 
)

constructor with two values

◆ Interval() [4/8]

SFCGAL::detail::Interval::Interval ( const Interval other)
default

copy constructor

◆ ~Interval() [1/2]

SFCGAL::detail::Interval::~Interval ( )
default

destructor

◆ Interval() [5/8]

SFCGAL::detail::Interval::Interval ( )

default constructor (empty interval)

◆ Interval() [6/8]

SFCGAL::detail::Interval::Interval ( const double &  value)

collapsed interval constructor

◆ Interval() [7/8]

SFCGAL::detail::Interval::Interval ( const double &  v1,
const double &  v2 
)

constructor with two values

◆ Interval() [8/8]

SFCGAL::detail::Interval::Interval ( const Interval other)

copy constructor

◆ ~Interval() [2/2]

SFCGAL::detail::Interval::~Interval ( )

destructor

Member Function Documentation

◆ expandBy() [1/2]

void SFCGAL::detail::Interval::expandBy ( const double &  d)

expand the interval

Warning
no effect if isEmpty()

◆ expandBy() [2/2]

void SFCGAL::detail::Interval::expandBy ( const double &  d)

expand the interval

Warning
no effect if isEmpty()

◆ expandToInclude() [1/4]

void SFCGAL::detail::Interval::expandToInclude ( const double &  value)

expand the interval to include a value

Warning
no effect if value is NaN

◆ expandToInclude() [2/4]

void SFCGAL::detail::Interval::expandToInclude ( const double &  value)

expand the interval to include a value

Warning
no effect if value is NaN

◆ expandToInclude() [3/4]

void SFCGAL::detail::Interval::expandToInclude ( const Interval other)

expand the interval to include an other interval.

Warning
no effect if other.isEmpty()

◆ expandToInclude() [4/4]

void SFCGAL::detail::Interval::expandToInclude ( const Interval other)

expand the interval to include an other interval.

Warning
no effect if other.isEmpty()

◆ intersects() [1/2]

auto SFCGAL::detail::Interval::intersects ( const Interval other) const

test if this intersects other

◆ intersects() [2/2]

bool SFCGAL::detail::Interval::intersects ( const Interval other) const

test if this intersects other

◆ isEmpty() [1/2]

auto SFCGAL::detail::Interval::isEmpty ( ) const

indicates if the interval is empty

◆ isEmpty() [2/2]

bool SFCGAL::detail::Interval::isEmpty ( ) const

indicates if the interval is empty

◆ lower() [1/2]

const double& SFCGAL::detail::Interval::lower ( ) const
inline

returns the lower value

◆ lower() [2/2]

const double& SFCGAL::detail::Interval::lower ( ) const
inline

returns the lower value

◆ operator!=() [1/2]

auto SFCGAL::detail::Interval::operator!= ( const Interval other) const

compare two intervals

Warning
false for empty intervals

◆ operator!=() [2/2]

bool SFCGAL::detail::Interval::operator!= ( const Interval other) const

compare two intervals

Warning
false for empty intervals

◆ operator=() [1/2]

auto SFCGAL::detail::Interval::operator= ( const Interval other)
default

assign operator

◆ operator=() [2/2]

Interval& SFCGAL::detail::Interval::operator= ( const Interval other)

assign operator

◆ operator==() [1/2]

auto SFCGAL::detail::Interval::operator== ( const Interval other) const

compare two intervals

Warning
true for empty intervals

◆ operator==() [2/2]

bool SFCGAL::detail::Interval::operator== ( const Interval other) const

compare two intervals

Warning
true for empty intervals

◆ upper() [1/2]

const double& SFCGAL::detail::Interval::upper ( ) const
inline

returns the upper value

◆ upper() [2/2]

const double& SFCGAL::detail::Interval::upper ( ) const
inline

returns the upper value

◆ width() [1/2]

double SFCGAL::detail::Interval::width ( ) const
inline

returns the with of the interval

◆ width() [2/2]

double SFCGAL::detail::Interval::width ( ) const
inline

returns the with of the interval