42 template <typename VV = V, typename std::enable_if_t<VectorTraits<VV>::supportNoInit,
int> = 0>
45 template <typename VV = V, typename std::enable_if_t<!VectorTraits<VV>::supportNoInit,
int> = 0>
104 for (
int i = 0; i <
elements; ++i )
115 for (
int i = 0; i <
elements; ++i )
123 for (
int i = 0; i <
elements; ++i )
135 for (
int i = 0; i <
elements; ++i )
150 for (
int i = 0; i <
elements; ++i )
162 for (
int i = 0; i <
elements; ++i )
177 return Box(
min - expansion,
max + expansion );
185 for (
int i = 0; i <
elements; ++i )
196 {
return !( *
this == a ); }
249 return box.
max.x - box.
min.x;
256 return box.
max.y - box.
min.y;
263 return box.
max.z - box.
min.z;
267template<
size_t I,
typename V>
268constexpr const V&
get(
const Box<V>& box )
noexcept {
return box[int(
I )]; }
269template<
size_t I,
typename V>
270constexpr V&
get(
Box<V>& box )
noexcept {
return box[int(
I )]; }
279template<
size_t I,
typename V>
280struct tuple_element<
I,
MR::
Box<V>> {
using type = V; };
283struct tuple_size<
MR::
Box<V>> : integral_constant<size_t, 2> {};
auto width(const Box< V > &box)
returns size along x axis
Definition MRMesh/MRBox.h:247
constexpr const V & get(const Box< V > &box) noexcept
get<0> returns min, get<1> returns max
Definition MRMesh/MRBox.h:268
std::array< Vector3< T >, 8 > getCorners(const Box< Vector3< T > > &box)
returns all corners of given box
Definition MRMesh/MRBox.h:200
auto height(const Box< V > &box)
returns size along y axis
Definition MRMesh/MRBox.h:254
auto depth(const Box< V > &box)
returns size along z axis
Definition MRMesh/MRBox.h:261
Box< V > transformed(const Box< V > &box, const AffineXf< V > &xf)
find the tightest box enclosing this one after transformation
Definition MRMesh/MRBox.h:229
Definition MRCameraOrientationPlugin.h:8
constexpr T sqr(T x) noexcept
Definition MRMesh/MRMeshFwd.h:600
Box
Definition MRMesh/MRMeshFwd.h:298
constexpr NoInit noInit
Definition MRMesh/MRMeshFwd.h:57
I
Definition MRMesh/MRMeshFwd.h:88
MRMESH_CLASS Vector3
Definition MRMesh/MRMeshFwd.h:137
Definition MRMesh/MRAffineXf.h:14
Box given by its min- and max- corners.
Definition MRMesh/MRBox.h:25
Box(const V &min, const V &max)
Definition MRMesh/MRBox.h:39
typename VTraits::BaseType T
Definition MRMesh/MRBox.h:28
void include(const V &pt)
minimally increases the box to include given point
Definition MRMesh/MRBox.h:82
V getBoxClosestPointTo(const V &pt) const
returns closest point in the box to given point
Definition MRMesh/MRBox.h:111
T getDistanceSq(const Box &b) const
Definition MRMesh/MRBox.h:146
T diagonal() const
computes length from min to max
Definition MRMesh/MRBox.h:69
void include(const Box &b)
minimally increases the box to include another box
Definition MRMesh/MRBox.h:92
Box expanded(const V &expansion) const
decreases min and increased max on given value
Definition MRMesh/MRBox.h:174
V max
Definition MRMesh/MRBox.h:31
Box insignificantlyExpanded() const
decreases min and increases max to their closest representable value
Definition MRMesh/MRBox.h:181
V center() const
computes center of the box
Definition MRMesh/MRBox.h:63
T getDistanceSq(const V &pt) const
Definition MRMesh/MRBox.h:158
V size() const
computes size of the box in all dimensions
Definition MRMesh/MRBox.h:66
bool intersects(const Box &b) const
checks whether this box intersects or touches given box
Definition MRMesh/MRBox.h:121
static constexpr int elements
Definition MRMesh/MRBox.h:29
T volume() const
computes the volume of this box
Definition MRMesh/MRBox.h:72
static Box fromMinAndSize(const V &min, const V &size)
Definition MRMesh/MRBox.h:51
Box()
create invalid box by default
Definition MRMesh/MRBox.h:38
const V & operator[](int e) const
min/max access by 0/1 index
Definition MRMesh/MRBox.h:34
bool operator!=(const Box &a) const
Definition MRMesh/MRBox.h:195
V min
Definition MRMesh/MRBox.h:31
Box intersection(const Box &b) const
computes intersection between this and other box
Definition MRMesh/MRBox.h:132
bool contains(const V &pt) const
checks whether given point is inside (including the surface) of the box
Definition MRMesh/MRBox.h:102
Box & intersect(const Box &b)
Definition MRMesh/MRBox.h:142
Box(const Box< U > &a)
Definition MRMesh/MRBox.h:49
bool valid() const
true if the box contains at least one point
Definition MRMesh/MRBox.h:54
Box(NoInit)
skip initialization of min/max
Definition MRMesh/MRBox.h:43
bool operator==(const Box &a) const
Definition MRMesh/MRBox.h:193
Definition MRMesh/MRMeshFwd.h:56
Definition MRVector2.h:18
T x
Definition MRVector2.h:24
Definition MRMesh/MRVector3.h:19
T x
Definition MRMesh/MRVector3.h:25
Definition MRMesh/MRVectorTraits.h:14
static constexpr int size
Definition MRMesh/MRVectorTraits.h:18
static constexpr auto && getElem(int i, U &&value)
Definition MRMesh/MRVectorTraits.h:28
T BaseType
Definition MRMesh/MRVectorTraits.h:17