Go to the documentation of this file.
19 #ifndef viskores_Bounds_h
20 #define viskores_Bounds_h
69 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
116 return (this->X.
IsNonEmpty() && this->Y.IsNonEmpty() && this->Z.IsNonEmpty());
121 template <
typename T>
124 return (this->X.
Contains(point[0]) && this->Y.Contains(point[1]) && this->Z.Contains(point[2]));
137 return (this->X.
Length() * this->Y.Length() * this->Z.Length());
155 return (this->X.
Length() * this->Y.Length());
202 template <
typename T>
231 unionBounds.
Include(otherBounds);
250 return this->
Union(otherBounds);
256 return ((this->X == bounds.
X) && (this->Y == bounds.
Y) && (this->Z == bounds.
Z));
262 return ((this->X != bounds.
X) || (this->Y != bounds.
Y) || (this->Z != bounds.
Z));
270 return stream <<
"{ X:" << bounds.
X <<
", Y:" << bounds.
Y <<
", Z:" << bounds.
Z <<
" }";
282 return NUM_COMPONENTS;
343 template <
typename NewComponentType>
345 template <
typename NewComponentType>
350 template <viskores::IdComponent destSize>
355 (destSize < NUM_COMPONENTS) ? destSize : NUM_COMPONENTS;
358 dest[component] = GetComponent(src, component);
365 #endif //viskores_Bounds_h
static void SetComponent(viskores::Bounds &bounds, viskores::IdComponent component, const ComponentType &value)
Definition: Bounds.h:324
viskores::VecTraits< viskores::Range >::BaseComponentType BaseComponentType
Definition: Bounds.h:277
viskores::Range Intersection(const viskores::Range &otherRange) const
Return the intersection of this and another range.
Definition: Range.h:172
viskores::Float64 Length() const
Returns the length of the range.
Definition: Range.h:99
viskores::Float64 Center() const
Returns the center of the range.
Definition: Range.h:117
Bounds(const T1 &minX, const T2 &maxX, const T3 &minY, const T4 &maxY, const T5 &minZ, const T6 &maxZ)
Construct a bounds with the minimum and maximum coordinates in the x, y, and z directions.
Definition: Bounds.h:70
viskores::Vec< viskores::Float64, 3 > Vec3f_64
Vec3f_64 corresponds to a 3-dimensional vector of 64-bit floating point values.
Definition: Types.h:1076
bool IsNonEmpty() const
Determine if the bounds are valid (i.e.
Definition: Bounds.h:114
Represent an axis-aligned 3D bounds in space.
Definition: Bounds.h:37
viskores::Vec3f_64 MinCorner() const
Returns the min point of the bounds
Definition: Bounds.h:180
viskores::Float64 Min
The minumum value of the range (inclusive).
Definition: Range.h:42
viskores::Bounds Union(const viskores::Bounds &otherBounds) const
Return the union of this and another bounds.
Definition: Bounds.h:228
bool operator!=(const viskores::Bounds &bounds) const
Definition: Bounds.h:260
viskores::Vec3f_64 MaxCorner() const
Returns the max point of the bounds
Definition: Bounds.h:191
viskores::Float64 Area() const
Returns the area of the bounds in the X-Y-plane.
Definition: Bounds.h:151
A tag for vectors that are "true" vectors (i.e.
Definition: VecTraits.h:31
bool IsNonEmpty() const
Determine if the range is valid (i.e.
Definition: Range.h:78
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
viskores::Bounds operator+(const viskores::Bounds &otherBounds) const
Operator for union
Definition: Bounds.h:248
#define VISKORES_EXEC_CONT
Definition: ExportMacros.h:60
static constexpr viskores::IdComponent GetNumberOfComponents(const viskores::Bounds &)
Definition: Bounds.h:280
viskores::Float64 Max
Tha maximum value of the range (inclusive).
Definition: Range.h:44
viskores::Bounds Intersection(const viskores::Bounds &otherBounds) const
Return the intersection of this and another range.
Definition: Bounds.h:238
static ComponentType & GetComponent(viskores::Bounds &bounds, viskores::IdComponent component)
Definition: Bounds.h:306
bool Contains(const viskores::Vec< T, 3 > &point) const
Determines if a point coordinate is within the bounds.
Definition: Bounds.h:122
#define VISKORES_CONT
Definition: ExportMacros.h:65
std::ostream & operator<<(std::ostream &stream, const viskores::Bounds &bounds)
Helper function for printing bounds during testing.
Definition: Bounds.h:268
Groups connected points that have the same field value.
Definition: Atomic.h:27
Traits that can be queried to treat any type as a Vec.
Definition: VecTraits.h:69
static void CopyInto(const viskores::Bounds &src, viskores::Vec< ComponentType, destSize > &dest)
Definition: Bounds.h:351
bool operator==(const viskores::Bounds &bounds) const
Definition: Bounds.h:254
#define VISKORES_ASSERT(condition)
Definition: Assert.h:51
viskores::Vec3f_64 Center() const
Returns the center of the range.
Definition: Bounds.h:169
viskores::Range Z
The range of values in the Z direction.
Definition: Bounds.h:47
Represent a continuous scalar range of values.
Definition: Range.h:39
Bounds()
Construct an empty bounds.
Definition: Bounds.h:52
Bounds(const viskores::Range &xRange, const viskores::Range &yRange, const viskores::Range &zRange)
Construct a bounds with a given range in the x, y, and z dimensions.
Definition: Bounds.h:58
void Include(const viskores::Bounds &bounds)
Expand bounds to include other bounds.
Definition: Bounds.h:216
viskores::Float64 Volume() const
Returns the volume of the bounds.
Definition: Bounds.h:133
viskores::Range Y
The range of values in the Y direction.
Definition: Bounds.h:44
void Include(const viskores::Vec< T, 3 > &point)
Expand bounds to include a point.
Definition: Bounds.h:203
Bounds(const viskores::Vec< T, 3 > &minPoint, const viskores::Vec< T, 3 > &maxPoint)
Initialize bounds with the minimum corner point and the maximum corner point.
Definition: Bounds.h:97
static const ComponentType & GetComponent(const viskores::Bounds &bounds, viskores::IdComponent component)
Definition: Bounds.h:288
Bounds(const T bounds[6])
Initialize bounds with an array of 6 values in the order xmin, xmax, ymin, ymax, zmin,...
Definition: Bounds.h:86
viskores::Bounds & operator=(const viskores::Bounds &src)=default
void Include(const T &value)
Expand range to include a value.
Definition: Range.h:136
bool Contains(const T &value) const
Determines if a value is within the range.
Definition: Range.h:87
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:169
viskores::Range X
The range of values in the X direction.
Definition: Bounds.h:41