29 #ifndef _GranOO_LibShape__Polyhedron_Corehh_
30 #define _GranOO_LibShape__Polyhedron_Corehh_
36 #include <boost/serialization/string.hpp>
37 #include <boost/serialization/vector.hpp>
39 #include <vtkUnstructuredGrid.h>
58 static std::string
class_ID() {
return std::string(
"Polyhedron");}
76 void to_vtk(
const unsigned int shift,
unsigned int* conn,
unsigned int* cell_type,
double* point)
const;
89 void set_input_file(std::stringstream &stringStream,
bool update =
true,
bool translate_to_centroid =
true);
90 void set_input_file(
const std::string &offFile,
bool update =
true,
bool translate_to_centroid =
true);
117 bool overlap(
const Sphere &,
double margin, std::vector<std::string> &facet)
const;
121 GRANOO_DECLARE_SHAPE_COLLISION();
132 template<
class Archive>
void save(Archive& ar,
const unsigned int version)
const;
133 template<
class Archive>
void load(Archive& ar,
const unsigned int version);
153 template<
class Archive>
156 ar << boost::serialization::base_object<Volume>(*
this);
158 std::stringstream out;
161 std::string str = out.str();
165 template<
class Archive>
168 ar >> boost::serialization::base_object<Volume>(*
this);
172 std::stringstream stream(str);
181 #include <boost/serialization/export.hpp>
184 #include <boost/serialization/version.hpp>
186 GRANOO_SERIALIZE_SHAPE(Polyhedron)
191 extern template class Core::ObjectFactoryInterface<Shape::Base, Shape::Polyhedron>;
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
Definition: ObjectFactory.hpp:235
Definition: Tensor.hpp:62
Definition: Vector.hpp:75
Definition: Polyhedron.hpp:54
BOOST_SERIALIZATION_SPLIT_MEMBER()
void read_xml_element(const TiXmlElement *element)
unsigned int get_number_of_vertex() const
void set_input_file(const std::string &offFile, bool update=true, bool translate_to_centroid=true)
bool collide_inside(const Geom::Point &p1, double radius, Collision::Data &info) const
double compute_distance(const Geom::Point &)
void set_input_file(std::stringstream &stringStream, bool update=true, bool translate_to_centroid=true)
void set_input_offset_file(const std::string &offFile)
void load(Archive &ar, const unsigned int version)
Definition: Polyhedron.hpp:167
virtual std::istream & read_ascii(std::istream &in)
std::ostream & to_povray(std::ostream &out, const Core::Color &) const
bool collide_outside(const Geom::Point &p1, double radius, Collision::Data &info) const
void update_bounding_box()
Geom::Point farthest_point_along(const Geom::Vector &) const
Geom::Point initial_centroid() const
Polyhedron(const Polyhedron &s)
PolyhedronCore _polyhedron_core
Definition: Polyhedron.hpp:137
void draw_gl_edge() const
virtual void to_vtk(vtkUnstructuredGrid *data)
Interference locate(const Geom::Point &, double radius) const
std::map< std::string, std::vector< int > > _map_facet
Definition: Polyhedron.hpp:138
Polyhedron(const Polyhedron &polyhedron, const Geom::Frame &frame)
Geom::Point basefacet_center(const unsigned int basefacetIndex) const
void update_bounding_sphere()
double area_of_facet_crossed_by_vector(const Geom::Point &, const Geom::Vector &, unsigned int &, Geom::Vector &) const
void to_vtk(const unsigned int shift, unsigned int *conn, unsigned int *cell_type, double *point) const
virtual std::ostream & write_ascii(std::ostream &out) const
void make_equal_to(const Polyhedron &)
void compute_inertia_tensor(double density, Geom::Tensor &) const
bool basefacet_from_normal(const Geom::Vector &normal, unsigned int &basefacetIndex) const
static std::string desc()
const std::map< std::string, std::vector< int > > & get_facet_map() const
Definition: Polyhedron.hpp:104
void set_output_file(const std::string &offFile)
Polyhedron(const Geom::Frame &frame)
friend class boost::serialization::access
Definition: Polyhedron.hpp:131
void save(Archive &ar, const unsigned int version) const
Definition: Polyhedron.hpp:155
unsigned int vtk_conn_number() const
Polyhedron(std::string fileName, const Geom::Frame &frame)
bool overlap(const Sphere &, double margin, std::vector< std::string > &facet) const
PolyhedronCore & get_polyhedron_core()
Definition: Polyhedron.hpp:143
double get_volume() const
double get_greatest_dimension() const
Polyhedron & operator=(const Polyhedron &)
unsigned int get_number_of_facet() const
static std::string class_ID()
Definition: Polyhedron.hpp:58
Interference locate(const Geom::Point &) const
Definition: Sphere.hpp:50
Definition: Volume.hpp:103
void update_bounding_shape()
Definition: Volume.cpp:96
Definition: PolyhedronCore.hpp:38
void to_off_format(std::stringstream &offString, bool basefacet=true) const
Creates an std::stringstream with the polyhedron contents, in OFF file format.
Definition: PolyhedronCore.cpp:256
Interference
Definition: Volume.hpp:100
Definition: Common.hpp:198
Definition: StaticAABBTree.hpp:38