Go to the documentation of this file.
43 ,
Max(
vtkm::NegativeInfinity64())
50 template <
typename T1,
typename T2>
95 return (this->Max - this->Min);
113 return 0.5 * (this->Max + this->
Min);
117 return vtkm::Nan64();
127 template <
typename T>
130 this->Min = vtkm::Min(this->Min,
static_cast<vtkm::Float64>(value));
131 this->Max = vtkm::Max(this->Max,
static_cast<vtkm::Float64>(value));
144 this->Min = vtkm::Min(this->Min, range.
Min);
145 this->Max = vtkm::Max(this->Max, range.
Max);
157 unionRange.
Include(otherRange);
166 return vtkm::Range(vtkm::Max(this->Min, otherRange.
Min), vtkm::Min(this->Max, otherRange.
Max));
177 return ((this->Min == otherRange.
Min) && (this->Max == otherRange.
Max));
183 return ((this->Min != otherRange.
Min) || (this->Max != otherRange.
Max));
191 return stream <<
"[" << range.
Min <<
".." << range.
Max <<
"]";
203 return NUM_COMPONENTS;
212 return (component == 0) ? range.
Min : range.
Max;
218 return (component == 0) ? range.
Min : range.
Max;
235 template <
typename NewComponentType>
237 template <
typename NewComponentType>
240 template <vtkm::IdComponent destSize>
244 const vtkm::IdComponent maxComponent = (destSize < NUM_COMPONENTS) ? destSize : NUM_COMPONENTS;
247 dest[component] = GetComponent(src, component);
255 #endif //vtk_m_Range_h
bool operator!=(const vtkm::Range &otherRange) const
Definition: Range.h:181
bool operator==(const vtkm::Range &otherRange) const
Definition: Range.h:175
static constexpr vtkm::IdComponent GetNumberOfComponents(const vtkm::Range &)
Definition: Range.h:201
Range()
Construct a range with a given minimum and maximum.
Definition: Range.h:41
A tag for vectors that are "true" vectors (i.e.
Definition: VecTraits.h:23
bool Contains(const T &value) const
Determines if a value is within the range.
Definition: Range.h:79
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
Base type to use to index small lists.
Definition: Types.h:194
vtkm::Float64 Length() const
Returns the length of the range.
Definition: Range.h:91
std::ostream & operator<<(std::ostream &stream, const vtkm::Bounds &bounds)
Helper function for printing bounds during testing.
Definition: Bounds.h:248
vtkm::Range operator+(const vtkm::Range &otherRange) const
Operator for union
Definition: Range.h:172
vtkm::Float64 Center() const
Returns the center of the range.
Definition: Range.h:109
vtkm::Range & operator=(const vtkm::Range &src)=default
vtkm::Float64 BaseComponentType
Definition: Range.h:198
Range(const T1 &min, const T2 &max)
Definition: Range.h:51
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Float64 ComponentType
Definition: Range.h:197
void Include(const T &value)
Expand range to include a value.
Definition: Range.h:128
A short fixed-length array.
Definition: Types.h:357
static void CopyInto(const vtkm::Range &src, vtkm::Vec< ComponentType, destSize > &dest)
Definition: Range.h:241
vtkm::Float64 Min
The minumum value of the range (inclusive).
Definition: Range.h:34
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:161
vtkm::Range Union(const vtkm::Range &otherRange) const
Return the union of this and another range.
Definition: Range.h:154
#define VTKM_NEVER_EXPORT
Definition: ExportMacros.h:90
void Include(const vtkm::Range &range)
Expand range to include other range.
Definition: Range.h:140
vtkm::Float64 Max
Tha maximum value of the range (inclusive).
Definition: Range.h:36
Traits that can be queried to treat any type as a Vec.
Definition: VecTraits.h:61
static ComponentType & GetComponent(vtkm::Range &range, vtkm::IdComponent component)
Definition: Range.h:215
static const ComponentType & GetComponent(const vtkm::Range &range, vtkm::IdComponent component)
Definition: Range.h:209
bool IsNonEmpty() const
Determine if the range is valid (i.e.
Definition: Range.h:70
static void SetComponent(vtkm::Range &range, vtkm::IdComponent component, ComponentType value)
Definition: Range.h:222
vtkm::Range Intersection(const vtkm::Range &otherRange) const
Return the intersection of this and another range.
Definition: Range.h:164
Represent a continuous scalar range of values.
Definition: Range.h:31