32 # include <vcl_msvc_warnings.h> 74 Type
const corner2[3]);
85 Type xmax, Type ymax, Type zmax);
153 std::vector<vgl_point_3d<Type> >
vertices()
const;
180 inline bool contains(Type
const& x, Type
const& y, Type
const& z)
const {
242 std::ostream&
print(std::ostream&)
const;
245 std::ostream&
write(std::ostream&)
const;
248 std::istream&
read(std::istream&);
259 template <
class Type>
264 template <
class Type>
268 template <
class T,
class ITER>
271 for (; begin != end; ++begin)
272 bounding_box.
add(*begin);
275 #define VGL_BOX_3D_INSTANTIATE(T) extern "please include vgl/vgl_box_3d.hxx first" 277 #endif // vgl_box_3d_h void set_min_position(Type const m[3])
Modify min corner point. Max corner point only changed if necessary to avoid empty box.
bool is_empty() const
Return true if this box is empty.
Type centroid_y() const
Get y component of centroid.
void set_min_x(Type m)
Set min x ordinate of box (other sides unchanged).
void set_depth(Type depth)
Set depth (z), centroid unchanged.
void set_width(Type width)
Set width (x), centroid unchanged.
Type min_z() const
Get min z.
Represents a cartesian 3D point.
bool contains(Type const &x, Type const &y, Type const &z) const
Return true if (x,y,z) is inside this box, ie x_min <= x <= x_max etc.
std::ostream & write(std::ostream &) const
Write "x0 y0 z0 x1 y1 z1(endl)" to stream.
void expand_about_centroid(Type expand)
Add to width and height, centroid unchanged.
std::ostream & operator<<(std::ostream &s, vgl_orient_box_3d< Type > const &p)
Write box to stream.
Type max_z() const
Get max z.
void vgl_box_3d_bounds(ITER begin, ITER end, vgl_box_3d< T > &bounding_box)
Calculate the bounding box of a sequence of points or boxes.
void set_max_position(Type const m[3])
Modify max corner point. Min corner point only changed if necessary to avoid empty box.
void set_max_point(vgl_point_3d< Type > const &max_pt)
Modify max corner point. Min corner point only changed if necessary to avoid empty box.
Type max_y() const
Get max y.
void set_height(Type height)
Set height (y), centroid unchanged.
void set_max_x(Type m)
Set max x ordinate of box (other sides unchanged).
void add(vgl_point_3d< Type > const &p)
Add a point to this box.
void set_min_y(Type m)
Set min y ordinate of box (other sides unchanged).
vgl_point_3d< Type > min_point() const
Return lower left corner of box.
vgl_box_3d()
Default constructor (creates empty box).
void set_centroid(Type const c[3])
Move box so centroid lies at c (size unchanged).
Type min_x() const
Get min x.
void set_centroid_x(Type cx)
Move box so centroid lies at cx (size unchanged).
Type centroid_z() const
Get z component of centroid.
void scale_about_centroid(double s)
Scale width, height and depth, centroid unchanged.
void set_min_point(vgl_point_3d< Type > const &min_pt)
Modify min corner point. Max corner point only changed if necessary to avoid empty box.
std::ostream & print(std::ostream &) const
Write "<vgl_box_3d x0,y0,z0 to x1,y1,z1>" to stream.
std::istream & read(std::istream &)
Read x0,y0,z0,x1,y1,z1 from stream.
void set_centroid_y(Type cy)
Move box so centroid lies at cy (size unchanged).
Type depth() const
Get depth of this box (= z dimension).
void set_max_y(Type m)
Set max y ordinate of box (other sides unchanged).
void empty()
Make the box empty.
Type centroid_x() const
Get x component of centroid.
vgl_point_3d< Type > centroid() const
Get the centroid point.
std::vector< vgl_point_3d< Type > > vertices() const
Return the 8 vertices of the box.
Type height() const
Get height of this box (= y dimension).
bool contains(vgl_point_3d< Type > const &p) const
Return true iff the point p is inside this box.
void set_centroid_z(Type cz)
Move box so centroid lies at cz (size unchanged).
vgl_point_3d< Type > max_point() const
Return upper right corner of box.
std::istream & operator>>(std::istream &is, vgl_orient_box_3d< Type > &p)
Read box from stream.
void set_max_z(Type m)
Set max z ordinate of box (other sides unchanged).
void set_centroid(vgl_point_3d< Type > const &c)
Move box so centroid lies at c (size unchanged).
Type min_y() const
Get min y.
Type width() const
Get width of this box (= x dimension).
bool operator==(vgl_box_3d< Type > const &b) const
Equality test.
Represents a cartesian 3D box.
Type volume() const
Get volume of this box.
void set_min_z(Type m)
Set min z ordinate of box (other sides unchanged).
void scale_about_origin(double s)
Scale width, height and depth, keeping scaled position of origin unchanged.
Type max_x() const
Get max x.