29 #ifndef _GranOO_LibShape_Cylinder_hh_
30 #define _GranOO_LibShape_Cylinder_hh_
35 #include <vtkUnstructuredGrid.h>
61 static std::string
class_ID() {
return std::string(
"Cylinder");}
63 static void draw_gl(
double radius,
double length,
double xshift=0.,
bool draw_end_disk =
true);
96 GRANOO_DECLARE_SHAPE_COLLISION();
109 GRANOO_ACCESS_SHAPE_DIM(radius,
double,
_radius);
110 GRANOO_ACCESS_SHAPE_DIM(length,
double,
_length);
119 template<
class Archive>
void serialize(Archive&,
const unsigned int);
140 :
Cylinder(s._radius, s._length, s._frame) {
145 :
Cylinder(s._radius, s._length, frame) {
160 double max = get_radius()*2.;
161 if (get_length() >
max)
177 double minPoint[] = { xMin, yMin, zMin };
178 double maxPoint[] = { xMax, yMax, zMax };
189 m.
yy() = m.
zz() = yy_zz;
192 template<
class Archive>
195 ar & boost::serialization::base_object<Volume>(*
this);
205 #include <boost/serialization/export.hpp>
208 #include <boost/serialization/version.hpp>
210 GRANOO_SERIALIZE_SHAPE(Cylinder)
214 extern template class Core::ObjectFactoryInterface<Shape::Base, Shape::Cylinder>;
BOOST_CLASS_EXPORT_KEY(GranOO3::Shape::Box) namespace GranOO3
Definition: Box.hpp:319
BOOST_CLASS_VERSION(GranOO3::Core::Base, 1) namespace GranOO3
Definition: Base.hpp:277
#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
Definition: Cylinder.hpp:53
virtual std::istream & read_ascii(std::istream &in)
virtual void to_vtk(vtkUnstructuredGrid *data)
void make_equal_to(const Cylinder &)
Cylinder(double radius=0., double length=0., const Geom::Frame &frame=Geom::Frame::global)
Definition: Cylinder.hpp:128
void update_bounding_box()
void read_xml_element(const TiXmlElement *el)
Interference locate(const Geom::Point &, double radius) const
Cylinder & operator=(const Cylinder &)
ContactRegion
Definition: Cylinder.hpp:58
@ XMAX
Definition: Cylinder.hpp:58
@ RADIUS
Definition: Cylinder.hpp:58
@ XMIN
Definition: Cylinder.hpp:58
double get_greatest_dimension() const
Definition: Cylinder.hpp:159
static std::string desc()
double _radius
Definition: Cylinder.hpp:122
void set_contact_regions(const std::string ®ions)
Geom::Point farthest_point_along(const Geom::Vector &) const
std::ostream & to_povray(std::ostream &out, const Core::Color &) const
bool collide_inside(const Geom::Point &p1, double radius, Collision::Data &info) const
void update_bounding_sphere()
double _length
Definition: Cylinder.hpp:123
AABB aabb() const
Definition: Cylinder.hpp:168
void compute_inertia_tensor(double density, Geom::Tensor &) const
Definition: Cylinder.hpp:184
void serialize(Archive &, const unsigned int)
Definition: Cylinder.hpp:194
Interference locate(const Geom::Point &) const
static void draw_gl(double radius, double length, double xshift=0., bool draw_end_disk=true)
friend class boost::serialization::access
Definition: Cylinder.hpp:118
static std::string class_ID()
Definition: Cylinder.hpp:61
bool collide_outside(const Geom::Point &p1, double radius, Collision::Data &info) const
double get_volume() const
Definition: Cylinder.hpp:154
virtual std::ostream & write_ascii(std::ostream &out) const
ContactRegion _cRegion
Definition: Cylinder.hpp:124
Definition: Volume.hpp:103
void set_face_ID(const T &, Args... args)
Definition: Volume.hpp:185
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
Definition: StaticAABBTree.hpp:38