23#ifndef VCL_MESH_COMPONENTS_BOUNDING_BOX_H
24#define VCL_MESH_COMPONENTS_BOUNDING_BOX_H
26#include "base/component.h"
27#include "base/predicates.h"
29#include <vclib/space/core.h>
61 PointConcept PointType,
62 typename ParentElemType = void,
66 BoundingBox<PointType, ParentElemType, OPT>,
70 !std::is_same_v<ParentElemType, void>,
73 using Base = Component<
78 !std::is_same_v<ParentElemType, void>,
110 template<
typename Element>
111 void importFrom(
const Element& e,
bool =
true);
113 void serialize(std::ostream&
os)
const {
boundingBox().serialize(
os); }
115 void deserialize(std::istream& is) {
boundingBox().deserialize(is); }
136template<Po
intConcept Po
intType,
typename ParentElemType,
bool OPT>
137template<
typename Element>
138void BoundingBox<PointType, ParentElemType, OPT>::importFrom(
143 using ScalarType = PointType::ScalarType;
144 boundingBox() = e.boundingBox().template cast<ScalarType>();
161bool isBoundingBoxAvailableOn(
const auto& element)
181template<
typename S,
typename ElementType =
void,
bool OPT = false>
196template<
typename ElementType =
void,
bool OPT = false>
211template<
typename ElementType =
void,
bool OPT = false>
The Element class.
Definition element.h:75
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:41
The BoundingBox component class represents an axis aligned bounding box. This class is usually used a...
Definition bounding_box.h:72
const BoundingBoxType & boundingBox() const
Returns a const reference to the bounding box of this object.
Definition bounding_box.h:100
BoundingBoxType & boundingBox()
Returns a reference to the bounding box of this object.
Definition bounding_box.h:106
BoundingBox()=default
Initilizes the bounding box to an invalid bounding box.
A concept that checks whether a type T (that should be a Mesh) has the BoundingBox component (inherit...
Definition bounding_box.h:132
auto boundingBox(const PointType &p)
Compute the bounding box of a single point.
Definition bounding_box.h:59