Go to the documentation of this file.
11 #ifndef vtk_m_Bounds_h
12 #define vtk_m_Bounds_h
48 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
94 return (this->X.
IsNonEmpty() && this->Y.IsNonEmpty() && this->Z.IsNonEmpty());
102 return (this->X.
Contains(point[0]) && this->Y.Contains(point[1]) && this->Z.Contains(point[2]));
115 return (this->X.
Length() * this->Y.Length() * this->Z.Length());
133 return (this->X.
Length() * this->Y.Length());
174 template <
typename T>
203 unionBounds.
Include(otherBounds);
225 return ((this->X == bounds.
X) && (this->Y == bounds.
Y) && (this->Z == bounds.
Z));
231 return ((this->X != bounds.
X) || (this->Y != bounds.
Y) || (this->Z != bounds.
Z));
239 return stream <<
"{ X:" << bounds.
X <<
", Y:" << bounds.
Y <<
", Z:" << bounds.
Z <<
" }";
251 return NUM_COMPONENTS;
311 template <
typename NewComponentType>
313 template <
typename NewComponentType>
317 template <vtkm::IdComponent destSize>
321 const vtkm::IdComponent maxComponent = (destSize < NUM_COMPONENTS) ? destSize : NUM_COMPONENTS;
324 dest[component] = GetComponent(src, component);
331 #endif //vtk_m_Bounds_h
static VTKM_EXEC_CONT void CopyInto(const vtkm::Bounds &src, vtkm::Vec< ComponentType, destSize > &dest)
Definition: Bounds.h:318
VTKM_EXEC_CONT vtkm::Vec3f_64 Center() const
Returns the center of the range.
Definition: Bounds.h:147
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
VTKM_EXEC_CONT void Include(const vtkm::Bounds &bounds)
Expand bounds to include other bounds.
Definition: Bounds.h:188
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
VTKM_EXEC_CONT vtkm::Float64 Area() const
Returns the area of the bounds in the X-Y-plane.
Definition: Bounds.h:129
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
VTKM_EXEC_CONT vtkm::Bounds Union(const vtkm::Bounds &otherBounds) const
Return the union of this and another bounds.
Definition: Bounds.h:200
static VTKM_EXEC_CONT void SetComponent(vtkm::Bounds &bounds, vtkm::IdComponent component, const ComponentType &value)
Definition: Bounds.h:292
VTKM_EXEC_CONT void Include(const T &value)
Expand range to include a value.
Definition: Range.h:124
VTKM_EXEC_CONT Bounds(const vtkm::Range &xRange, const vtkm::Range &yRange, const vtkm::Range &zRange)
Definition: Bounds.h:41
static const VTKM_EXEC_CONT ComponentType & GetComponent(const vtkm::Bounds &bounds, vtkm::IdComponent component)
Definition: Bounds.h:257
VTKM_EXEC_CONT vtkm::Vec3f_64 MaxCorner() const
Returns the max point of the bounds
Definition: Bounds.h:166
static constexpr vtkm::IdComponent GetNumberOfComponents(const vtkm::Bounds &)
Definition: Bounds.h:249
VTKM_EXEC_CONT bool Contains(const vtkm::Vec< T, 3 > &point) const
Determines if a point coordinate is within the bounds.
Definition: Bounds.h:100
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_EXEC_CONT bool operator==(const vtkm::Bounds &bounds) const
Definition: Bounds.h:223
static VTKM_EXEC_CONT ComponentType & GetComponent(vtkm::Bounds &bounds, vtkm::IdComponent component)
Definition: Bounds.h:274
vtkm::VecTraits< vtkm::Range >::BaseComponentType BaseComponentType
Definition: Bounds.h:246
VTKM_EXEC_CONT vtkm::Bounds Intersection(const vtkm::Bounds &otherBounds) const
Return the intersection of this and another range.
Definition: Bounds.h:210
vtkm::Vec< vtkm::Float64, 3 > Vec3f_64
Vec3f_64 corresponds to a 3-dimensional vector of 64-bit floating point values.
Definition: Types.h:1026
VTKM_EXEC_CONT void Include(const vtkm::Vec< T, 3 > &point)
Expand bounds to include a point.
Definition: Bounds.h:175
VTKM_EXEC_CONT vtkm::Range Intersection(const vtkm::Range &otherRange) const
Return the intersection of this and another range.
Definition: Range.h:160
VTKM_EXEC_CONT Bounds(const T1 &minX, const T2 &maxX, const T3 &minY, const T4 &maxY, const T5 &minZ, const T6 &maxZ)
Definition: Bounds.h:49
VTKM_CONT std::ostream & operator<<(std::ostream &stream, const vtkm::Bounds &bounds)
Helper function for printing bounds during testing.
Definition: Bounds.h:237
vtkm::Range Z
Definition: Bounds.h:33
#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_EXEC_CONT bool operator!=(const vtkm::Bounds &bounds) const
Definition: Bounds.h:229
Represent an axis-aligned 3D bounds in space.
Definition: Bounds.h:29
vtkm::Bounds & operator=(const vtkm::Bounds &src)=default
VTKM_EXEC_CONT vtkm::Bounds operator+(const vtkm::Bounds &otherBounds) const
Operator for union
Definition: Bounds.h:220
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
VTKM_EXEC_CONT Bounds()
Definition: Bounds.h:36
VTKM_EXEC_CONT bool IsNonEmpty() const
Determine if the bounds are valid (i.e.
Definition: Bounds.h:92
double Float64
Definition: Types.h:155
vtkm::Range X
Definition: Bounds.h:31
vtkm::Range Y
Definition: Bounds.h:32
#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 vtkm::Vec3f_64 MinCorner() const
Returns the min point of the bounds
Definition: Bounds.h:158
VTKM_EXEC_CONT vtkm::Float64 Volume() const
Returns the volume of the bounds.
Definition: Bounds.h:111
VTKM_EXEC_CONT Bounds(const vtkm::Vec< T, 3 > &minPoint, const vtkm::Vec< T, 3 > &maxPoint)
Initialize bounds with the minimum corner point and the maximum corner point.
Definition: Bounds.h:76
VTKM_EXEC_CONT Bounds(const T bounds[6])
Initialize bounds with an array of 6 values in the order xmin, xmax, ymin, ymax, zmin,...
Definition: Bounds.h:65
Represent a continuous scalar range of values.
Definition: Range.h:31