8 #include <glm/gtc/epsilon.hpp> 22 template<
typename Type>
41 m_start(
std::min(lhs, rhs)),
42 m_end(
std::max(lhs, rhs))
50 m_start(other.m_start),
77 return m_end - m_start;
86 template<
typename T = Type>
87 typename std::enable_if<!std::is_floating_point<T>::value,
bool>::type
IsEmpty()
const 89 return m_start == m_end;
92 template<
typename T = Type>
93 typename std::enable_if<std::is_floating_point<T>::value,
bool>::type
IsEmpty()
const 95 return glm::epsilonEqual(m_start, m_end, glm::epsilon<Type>());
134 m_end = std::max(m_end, newStart);
145 m_start = std::min(m_start, newEnd);
156 m_end = m_start + std::max(Type(), newLength);
188 return CYIRange<Type>(m_start, m_start + std::max(newLength, Type()));
217 return m_start <= position && position < m_end;
226 m_start = other.m_start;
273 return m_start == other.m_start && m_end == other.m_end;
278 return m_start != other.m_start || m_end != other.m_end;
CYIRange(const CYIRange< Type > &other)
Definition: YiRange.h:49
CYIRange< Type > operator+=(Type delta)
Definition: YiRange.h:235
CYIRange< Type > Expanded(Type amount) const
Definition: YiRange.h:194
bool operator!=(const CYIRange< Type > &other) const
Definition: YiRange.h:276
void SetLength(Type newLength)
Definition: YiRange.h:154
Type GetStart() const
Definition: YiRange.h:59
CYIRange< Type > operator-=(Type delta)
Definition: YiRange.h:246
CYIRange< Type > WithStart(Type newStart) const
Definition: YiRange.h:165
CYIRange(Type lhs, Type rhs)
Definition: YiRange.h:40
Definition: YiTypeTraits.h:169
static CYIRange CreateEmptyRange(Type m_start)
Definition: YiRange.h:111
void SetStart(Type newStart)
Definition: YiRange.h:131
void SetEnd(Type newEnd)
Definition: YiRange.h:143
bool IsNotEmpty() const
Definition: YiRange.h:102
Type GetEnd() const
Definition: YiRange.h:67
CYIRange< Type > WithLength(Type newLength) const
Definition: YiRange.h:186
CYIRange()
Definition: YiRange.h:29
CYIRange< Type > Shifted(Type delta) const
Definition: YiRange.h:203
CYIRange< Type > operator-(Type delta) const
Definition: YiRange.h:266
static CYIRange CreateWithStartAndLength(Type startValue, Type length)
Definition: YiRange.h:119
CYIRange< Type > operator+(Type delta) const
Definition: YiRange.h:257
bool operator==(const CYIRange< Type > &other) const
Definition: YiRange.h:271
Type GetLength() const
Definition: YiRange.h:75
Definition: YiTypeTraits.h:335
bool Contains(Type position) const
Definition: YiRange.h:215
Definition: YiTypeTraits.h:290
CYIRange< Type > WithEnd(Type newEnd) const
Definition: YiRange.h:176
CYIRange< Type > & operator=(const CYIRange< Type > &other)
Definition: YiRange.h:224