Go to the documentation of this file.
39 ,
Max(
vtkm::NegativeInfinity64())
46 template <
typename T1,
typename T2>
91 return (this->Max - this->Min);
109 return 0.5 * (this->Max + this->
Min);
113 return vtkm::Nan64();
123 template <
typename T>
126 this->Min = vtkm::Min(this->Min,
static_cast<vtkm::Float64>(value));
127 this->Max = vtkm::Max(this->Max,
static_cast<vtkm::Float64>(value));
140 this->Min = vtkm::Min(this->Min, range.
Min);
141 this->Max = vtkm::Max(this->Max, range.
Max);
153 unionRange.
Include(otherRange);
162 return vtkm::Range(vtkm::Max(this->Min, otherRange.
Min), vtkm::Min(this->Max, otherRange.
Max));
173 return ((this->Min == otherRange.
Min) && (this->Max == otherRange.
Max));
179 return ((this->Min != otherRange.
Min) || (this->Max != otherRange.
Max));
187 return stream <<
"[" << range.
Min <<
".." << range.
Max <<
"]";
199 return NUM_COMPONENTS;
208 return (component == 0) ? range.
Min : range.
Max;
214 return (component == 0) ? range.
Min : range.
Max;
231 template <
typename NewComponentType>
233 template <
typename NewComponentType>
236 template <vtkm::IdComponent destSize>
240 const vtkm::IdComponent maxComponent = (destSize < NUM_COMPONENTS) ? destSize : NUM_COMPONENTS;
243 dest[component] = GetComponent(src, component);
251 #endif //vtk_m_Range_h
static constexpr vtkm::IdComponent GetNumberOfComponents(const vtkm::Range &)
Definition: Range.h:197
static VTKM_EXEC_CONT void SetComponent(vtkm::Range &range, vtkm::IdComponent component, ComponentType value)
Definition: Range.h:218
A tag for vectors that are "true" vectors (i.e.
Definition: VecTraits.h:21
Groups connected points that have the same field value.
Definition: Atomic.h:19
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
VTKM_EXEC_CONT Range(const T1 &min, const T2 &max)
Definition: Range.h:47
VTKM_EXEC_CONT void Include(const T &value)
Expand range to include a value.
Definition: Range.h:124
VTKM_EXEC_CONT void Include(const vtkm::Range &range)
Expand range to include other range.
Definition: Range.h:136
vtkm::Range & operator=(const vtkm::Range &src)=default
VTKM_EXEC_CONT vtkm::Float64 Center() const
Returns the center of the range.
Definition: Range.h:105
VTKM_EXEC_CONT vtkm::Float64 Length() const
Returns the length of the range.
Definition: Range.h:87
vtkm::Float64 BaseComponentType
Definition: Range.h:194
static VTKM_EXEC_CONT ComponentType & GetComponent(vtkm::Range &range, vtkm::IdComponent component)
Definition: Range.h:211
VTKM_EXEC_CONT vtkm::Range Intersection(const vtkm::Range &otherRange) const
Return the intersection of this and another range.
Definition: Range.h:160
static const VTKM_EXEC_CONT ComponentType & GetComponent(const vtkm::Range &range, vtkm::IdComponent component)
Definition: Range.h:205
VTKM_CONT std::ostream & operator<<(std::ostream &stream, const vtkm::Bounds &bounds)
Helper function for printing bounds during testing.
Definition: Bounds.h:237
#define VTKM_CONT
Definition: ExportMacros.h:57
VTKM_EXEC_CONT bool IsNonEmpty() const
Determine if the range is valid (i.e.
Definition: Range.h:66
vtkm::Float64 ComponentType
Definition: Range.h:193
VTKM_EXEC_CONT Range()
Definition: Range.h:37
VTKM_EXEC_CONT bool operator==(const vtkm::Range &otherRange) const
Definition: Range.h:171
VTKM_EXEC_CONT vtkm::Range Union(const vtkm::Range &otherRange) const
Return the union of this and another range.
Definition: Range.h:150
static VTKM_EXEC_CONT void CopyInto(const vtkm::Range &src, vtkm::Vec< ComponentType, destSize > &dest)
Definition: Range.h:237
A short fixed-length array.
Definition: Types.h:767
VTKM_EXEC_CONT bool Contains(const T &value) const
Determines if a value is within the range.
Definition: Range.h:75
vtkm::Float64 Min
Definition: Range.h:33
double Float64
Definition: Types.h:155
#define VTKM_NEVER_EXPORT
Definition: ExportMacros.h:93
vtkm::Float64 Max
Definition: Range.h:34
The VecTraits class gives several static members that define how to use a given type as a vector.
Definition: VecTraits.h:66
VTKM_EXEC_CONT bool operator!=(const vtkm::Range &otherRange) const
Definition: Range.h:177
VTKM_EXEC_CONT vtkm::Range operator+(const vtkm::Range &otherRange) const
Operator for union
Definition: Range.h:168
Represent a continuous scalar range of values.
Definition: Range.h:31