20 #ifndef Tulip_BOUNDINGBOX_H 21 #define Tulip_BOUNDINGBOX_H 25 #include <tulip/Vector.h> 26 #include <tulip/tulipconf.h> 85 BoundingBox(
const tlp::Vec3f &min,
const tlp::Vec3f &max,
bool checkMinMax =
false);
96 inline void init(
const tlp::Vec3f &coord) {
97 (*this)[0] = (*this)[1] = coord;
108 return ((*
this)[0] + (*
this)[1]) / 2.f;
118 return ((*
this)[1][0] - (*
this)[0][0]);
128 return ((*
this)[1][1] - (*
this)[0][1]);
138 return ((*
this)[1][2] - (*
this)[0][2]);
149 void expand(
const tlp::Vec3f &coord,
bool noCheck =
false);
158 inline void expand(
const std::vector<tlp::Vec3f> &coords) {
159 auto it = coords.begin();
161 for (++it; it < coords.end(); ++it)
181 void translate(
const tlp::Vec3f &vec);
190 void scale(
const tlp::Vec3f &factor);
198 bool isValid()
const;
207 bool contains(
const tlp::Vec3f &coord,
bool noCheck =
false)
const;
232 bool intersect(
const Vec3f &segStart,
const Vec3f &segEnd)
const;
265 void getCompleteBB(Vec3f bb[8])
const;
269 #endif // Tulip_BOUNDINGBOX_H
void expand(const std::vector< tlp::Vec3f > &coords)
Expands the bounding box to one containing all the point of the vector passed as parameter.
float width() const
Returns the width of the bounding box An assertion is raised in debug mode if the BoundingBox is not ...
This class represents the 3D bounding box of an object. It is mostly used to determine whether or not...
void init(const tlp::Vec3f &coord)
init the bounding box with the point passed as parameter.
Vec3f center() const
Returns the geometrical center of the bounding box. An assertion is raised in debug mode if the Bound...
float depth() const
Returns the depth of the bounding box An assertion is raised in debug mode if the bounding box is not...
float height() const
Returns the height of the bounding box An assertion is raised in debug mode if the bounding box is no...