Class xlifepp::BoundingBox#

class BoundingBox#

Collaboration diagram for xlifepp::BoundingBox:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "3" [label="std::vector< T >" tooltip="std::vector< T >"] "2" [label="std::vector< RealPair >" tooltip="std::vector< RealPair >"] "1" [label="xlifepp::BoundingBox" tooltip="xlifepp::BoundingBox" fillcolor="#BFBFBF"] "2" -> "3" [dir=forward tooltip="template-instance"] "1" -> "2" [dir=forward tooltip="usage"] }

utility class to describe a bounding box

Public Functions

inline BoundingBox()#

void constructor

BoundingBox(const Point &p0, const Point &p1)#

general constructor 1D box

BoundingBox(const Point &p0, const Point &p1, const Point &p2)#

general constructor 2D box

BoundingBox(const Point &p0, const Point &p1, const Point &p2, const Point &p3)#

general constructor 3D box

BoundingBox(const std::vector<Point> &vp)#

genereal constructor from a set of points

inline BoundingBox(const std::vector<RealPair> &bds)#

basic constructor

BoundingBox(real_t xmin, real_t xmax)#

basic constructor 1D box

BoundingBox(real_t xmin, real_t xmax, real_t ymin, real_t ymax)#

basic constructor 2D box

BoundingBox(real_t xmin, real_t xmax, real_t ymin, real_t ymax, real_t zmin, real_t zmax)#

basic constructor 3D box

string_t asString() const#

format as string: [a,b]x[c,d]x[e,f]

inline std::vector<RealPair> bounds() const#

return bound in all direction

inline RealPair &bounds(dimen_t i)#

return box bounds in direction i (from 1 to dim), non const

RealPair bounds(dimen_t i) const#

return box bounds in direction i (from 1 to dim)

real_t diameter() const#

return the max of (xmax-xmin, ymax -ymin, zmax-zmin);

real_t diameter2() const#

return sqrt((xmax-xmin)^2+(ymax -ymin)^2+ (zmax-zmin)^2)

inline dimen_t dim() const#

dimension of the bounding box

BoundingBox &homothetize(const Parameter &p1)#

apply a homothety on a BoundingBox (1 key)

BoundingBox &homothetize(const Parameter &p1, const Parameter &p2)#

apply a homothety on a BoundingBox (2 keys)

BoundingBox &homothetize(const Point &c, real_t factor = 1.)#

apply a homothety on a BoundingBox

BoundingBox &homothetize(real_t factor)#

apply a homothety on a BoundingBox

Point maxPoint() const#

return the max point (right,top,back)

Point minPoint() const#

return the min point (left,bottom,front)

BoundingBox &operator+=(const BoundingBox &bb)#

merge a bounding box to the current one

BoundingBox &operator^=(const BoundingBox &bb)#

intersect a bounding box to the current one (may be void)

BoundingBox &pointReflect(const Parameter &p1)#

apply a point reflection on a BoundingBox (1 key)

BoundingBox &pointReflect(const Point &c)#

apply a point reflection on a BoundingBox

std::vector<Point> points()#

return the vertices of the bounding box

void print(std::ostream &os) const#

print BoundingBox

BoundingBox &reflect2d(const Parameter &p1)#

apply a reflection2d on a BoundingBox (1 key)

BoundingBox &reflect2d(const Parameter &p1, const Parameter &p2)#

apply a reflection2d on a BoundingBox (2 keys)

BoundingBox &reflect2d(const Point &c, real_t dx, real_t dy = 0.)#

apply a reflection2d on a BoundingBox

BoundingBox &reflect2d(const Point &c, std::vector<real_t> d = std::vector<real_t>(2, 0.))#

apply a reflection2d on a BoundingBox

BoundingBox &reflect3d(const Parameter &p1)#

apply a reflection3d on a BoundingBox (1 key)

BoundingBox &reflect3d(const Parameter &p1, const Parameter &p2)#

apply a reflection3d on a BoundingBox (2 keys)

BoundingBox &reflect3d(const Point &c, real_t nx, real_t ny, real_t nz = 0.)#

apply a reflection3d on a BoundingBox

BoundingBox &reflect3d(const Point &c, std::vector<real_t> n = std::vector<real_t>(3, 0.))#

apply a reflection3d on a BoundingBox

BoundingBox &rotate2d(const Parameter &p1)#

apply a rotation on a BoundingBox (1 key)

BoundingBox &rotate2d(const Parameter &p1, const Parameter &p2)#

apply a rotation on a BoundingBox (2 keys)

BoundingBox &rotate2d(const Point &c, real_t angle = 0.)#

apply a rotation on a BoundingBox

BoundingBox &rotate3d(const Parameter &p1)#

apply a rotation on a BoundingBox (1 key)

BoundingBox &rotate3d(const Parameter &p1, const Parameter &p2)#

apply a rotation on a BoundingBox (2 keys)

BoundingBox &rotate3d(const Parameter &p1, const Parameter &p2, const Parameter &p3)#

apply a rotation on a BoundingBox (3 keys)

apply a rotation on a BoundingBox (2 keys)

BoundingBox &rotate3d(const Point &c, real_t dx, real_t dy, real_t angle)#

apply a rotation on a BoundingBox

BoundingBox &rotate3d(const Point &c, real_t dx, real_t dy, real_t dz, real_t angle)#

apply a rotation on a BoundingBox

BoundingBox &rotate3d(const Point &c, std::vector<real_t> d = std::vector<real_t>(3, 0.), real_t angle = 0.)#

apply a rotation on a BoundingBox

BoundingBox &rotate3d(real_t dx, real_t dy, real_t angle)#

apply a rotation on a BoundingBox

BoundingBox &rotate3d(real_t dx, real_t dy, real_t dz, real_t angle)#

apply a rotation on a BoundingBox

BoundingBox &transform(const Transformation &t)#

apply a geometrical transformation on a BoundingBox

BoundingBox &translate(const Parameter &p1)#

apply a translation on a BoundingBox (1 key)

BoundingBox &translate(real_t ux, real_t uy = 0., real_t uz = 0.)#

apply a translation on a BoundingBox (3 reals version)

BoundingBox &translate(std::vector<real_t> u = std::vector<real_t>(3, 0.))#

apply a translation on a BoundingBox (vector version)

inline RealPair xbounds() const#

return box bounds in first direction, if exists

inline RealPair ybounds() const#

return box bounds in second direction, if exists

inline RealPair zbounds() const#

return box bounds in third direction, if exists