30 #ifndef _GranOO_LibShape_Box_hh_
31 #define _GranOO_LibShape_Box_hh_
36 #include <vtkUnstructuredGrid.h>
59 GRANOO_OBJECT_FACTORY(
Box);
62 static std::string
class_ID() {
return std::string(
"Box");}
68 Box(
double dimX,
double dimY,
double dimZ,
const Geom::Frame& frame);
95 GRANOO_DECLARE_SHAPE_COLLISION();
113 GRANOO_ACCESS_SHAPE_DIM(lx,
double,
_lx);
114 GRANOO_ACCESS_SHAPE_DIM(ly,
double,
_ly);
115 GRANOO_ACCESS_SHAPE_DIM(lz,
double,
_lz);
140 template<
class Archive>
void serialize(Archive&,
const unsigned int);
156 set_face_ID(
"xMin",
"xMax",
"yMin",
"yMax",
"zMin",
"zMax");
165 :
Box(0., 0., 0., Geom::Frame::global) {
171 :
Box(b._lx, b._ly, b._lz, b._frame) {
176 :
Box(b._lx, b._ly, b._lz, frame) {
181 :
Box(0., 0., 0., frame) {
197 double max = get_lx();
200 else if (get_lz() >
max)
216 double minPoint[] = { xMin, yMin, zMin };
217 double maxPoint[] = { xMax, yMax, zMax };
226 m.
xx() = mass*(get_ly()*get_ly()+get_lz()*get_lz())/12.;
227 m.
yy() = mass*(get_lx()*get_lx()+get_lz()*get_lz())/12.;
228 m.
zz() = mass*(get_lx()*get_lx()+get_ly()*get_ly())/12.;
306 template<
class Archive>
309 ar & boost::serialization::base_object<Volume>(*
this);
318 #include <boost/serialization/export.hpp>
325 extern template class Core::ObjectFactoryInterface<Shape::Base, Shape::Box>;
BOOST_CLASS_EXPORT_KEY(GranOO3::Shape::Box) namespace GranOO3
Definition: Box.hpp:319
#define SafeModeAssert(condition, message)
Definition: Macro.hpp:47
Definition: ObjectFactory.hpp:235
static const Frame & global
Definition: Frame.hpp:76
Definition: Tensor.hpp:62
Definition: Vector.hpp:75
const Geom::Frame & local_frame() const
Definition: Base.hpp:133
double _lz
Definition: Box.hpp:146
Geom::Point get_zmax_center(const Geom::Frame &frame=Geom::Frame::global) const
Definition: Box.hpp:255
double _ly
Definition: Box.hpp:145
void read_xml_element(const TiXmlElement *el)
static std::string class_ID()
Definition: Box.hpp:62
Geom::Point get_zmin_center(const Geom::Frame &frame=Geom::Frame::global) const
Definition: Box.hpp:261
Geom::Point get_ymin_center(const Geom::Frame &frame=Geom::Frame::global) const
Definition: Box.hpp:249
Geom::Point get_point3() const
Definition: Box.hpp:277
Geom::Point get_point8() const
Definition: Box.hpp:302
Geom::Point get_point4() const
Definition: Box.hpp:282
Geom::Point get_point2() const
Definition: Box.hpp:272
Geom::Point get_xmax_center(const Geom::Frame &frame=Geom::Frame::global) const
Definition: Box.hpp:232
virtual void to_vtk(vtkUnstructuredGrid *data)
void update_bounding_sphere()
double _lx
Definition: Box.hpp:144
double get_volume() const
Definition: Box.hpp:102
static std::string desc()
std::ostream & to_povray(std::ostream &out, const Core::Color &) const
Geom::Point get_point6() const
Definition: Box.hpp:292
Geom::Point farthest_point_along(const Geom::Vector &) const
Box()
Definition: Box.hpp:164
Interference locate(const Geom::Point &, double radius) const
virtual std::istream & read_ascii(std::istream &in)
Geom::Point get_point1() const
Definition: Box.hpp:267
double get_greatest_dimension() const
Definition: Box.hpp:196
Geom::Point get_point7() const
Definition: Box.hpp:297
Interference locate(const Geom::Point &) const
bool collide_inside(const Geom::Point &p1, double radius, Collision::Data &info) const
void update_bounding_box()
Geom::Point get_point5() const
Definition: Box.hpp:287
void compute_inertia_tensor(double, Geom::Tensor &) const
Definition: Box.hpp:223
friend class boost::serialization::access
Definition: Box.hpp:139
Geom::Point get_xmin_center(const Geom::Frame &frame=Geom::Frame::global) const
Definition: Box.hpp:237
bool collide_outside(const Geom::Point &p1, double radius, Collision::Data &info) const
AABB aabb() const
Definition: Box.hpp:207
Box & operator=(const Box &)
virtual std::ostream & write_ascii(std::ostream &out) const
void serialize(Archive &, const unsigned int)
Definition: Box.hpp:308
Geom::Point get_ymax_center(const Geom::Frame &frame=Geom::Frame::global) const
Definition: Box.hpp:243
void make_equal_to(const Box &)
void set_length(double x, double y, double z)
Definition: Box.hpp:185
Definition: Volume.hpp:103
void update_bounding_shape()
Definition: Volume.cpp:96
void set_face_ID(const T &, Args... args)
Definition: Volume.hpp:185
bool is_bounding_shape() const
Definition: Volume.hpp:206
static AABB new_lonely_aabb(double minPoint[3], double maxPoint[3], unsigned int primtiveIndex=-1)
Creates a new 'lonely' AABB with given extreme points.
Definition: StaticAABBTree.cpp:415
Interference
Definition: Volume.hpp:100
Definition: Common.hpp:198
T max(const T v0, const T v1)
Definition: Exprtk.hpp:1463
x y * z
Definition: Exprtk.hpp:11139
x y t t *t x y t t t x y t t t x *y t *t t x *y t *t t x y t t t x y t t t x(y+z)
Definition: StaticAABBTree.hpp:38