GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
GranOO3::Shape::Polyhedron Class Reference

#include <Polyhedron.hpp>

Inheritance diagram for GranOO3::Shape::Polyhedron:
Inheritance graph
[legend]

Public Member Functions

 Polyhedron ()
 
 Polyhedron (std::string fileName, const Geom::Frame &frame)
 
 Polyhedron (const Polyhedron &polyhedron, const Geom::Frame &frame)
 
 Polyhedron (const Geom::Frame &frame)
 
 Polyhedron (const Polyhedron &s)
 
virtual ~Polyhedron ()
 
void read_xml_element (const TiXmlElement *element)
 
virtual std::ostream & write_ascii (std::ostream &out) const
 
virtual std::istream & read_ascii (std::istream &in)
 
virtual void to_vtk (vtkUnstructuredGrid *data)
 
std::string info () const
 
void to_vtk (const unsigned int shift, unsigned int *conn, unsigned int *cell_type, double *point) const
 
unsigned int vtk_conn_number () const
 
void make_equal_to (const Polyhedron &)
 
void update_bounding_box ()
 
void update_bounding_sphere ()
 
double get_greatest_dimension () const
 
AABB aabb () const
 
void set_input_file (std::stringstream &stringStream, bool update=true, bool translate_to_centroid=true)
 
void set_input_file (const std::string &offFile, bool update=true, bool translate_to_centroid=true)
 
void set_output_file (const std::string &offFile)
 
void set_input_offset_file (const std::string &offFile)
 
double get_volume () const
 
void compute_inertia_tensor (double density, Geom::Tensor &) const
 
Geom::Point farthest_point_along (const Geom::Vector &) const
 
bool basefacet_from_normal (const Geom::Vector &normal, unsigned int &basefacetIndex) const
 
Geom::Point basefacet_center (const unsigned int basefacetIndex) const
 
double area_of_facet_crossed_by_vector (const Geom::Point &, const Geom::Vector &, unsigned int &, Geom::Vector &) const
 
Geom::Point initial_centroid () const
 
PolyhedronCoreget_polyhedron_core ()
 
const PolyhedronCoreget_polyhedron_core () const
 
const std::map< std::string, std::vector< int > > & get_facet_map () const
 
void draw_gl () const
 
void draw_gl_edge () const
 
void scale (double ratio)
 
unsigned int get_number_of_vertex () const
 
unsigned int get_number_of_facet () const
 
Interference locate (const Geom::Point &) const
 
Interference locate (const Geom::Point &, double radius) const
 
bool overlap (const Sphere &, double margin, std::vector< std::string > &facet) const
 
double compute_distance (const Geom::Point &)
 
bool collide_inside (const Geom::Point &p1, double radius, Collision::Data &info) const
 
bool collide_outside (const Geom::Point &p1, double radius, Collision::Data &info) const
 
std::ostream & to_povray (std::ostream &out, const Core::Color &) const
 
- Public Member Functions inherited from GranOO3::Shape::Volume
 Volume (const Geom::Frame &frame)
 
virtual ~Volume ()
 
bool is_surface () const
 
bool is_volume () const
 
const Boxget_bounding_box () const
 
const Sphereget_bounding_sphere () const
 
Boxget_bounding_box ()
 
Sphereget_bounding_sphere ()
 
void update_bounding_shape ()
 
bool is_bounding_shape () const
 
template<Interference T>
bool overlap (const Sphere &, Geom::Vector &normal, double &penetration) const
 
Interference locate (const Sphere &) const
 
bool collide_inside (const Geom::Point &, Collision::Data &) const
 
bool collide_outside (const Geom::Point &, Collision::Data &) const
 
virtual bool collide (const Volume &, Collision::Data &) const =0
 
virtual bool collide (const Sphere &, Collision::Data &) const =0
 
virtual bool collide (const Box &, Collision::Data &) const =0
 
virtual bool collide (const Cylinder &, Collision::Data &) const =0
 
virtual bool collide (const Cone &, Collision::Data &) const =0
 
virtual bool collide (const ConeTruncated &, Collision::Data &) const =0
 
virtual bool collide (const Polyhedron &, Collision::Data &) const =0
 
const std::set< std::string > & get_face_ID () const
 
template<>
bool overlap (const Sphere &s, Geom::Vector &normal, double &penetration) const
 
template<>
bool overlap (const Sphere &s, Geom::Vector &normal, double &penetration) const
 
template<>
bool overlap (const Sphere &s, Geom::Vector &normal, double &penetration) const
 
- Public Member Functions inherited from GranOO3::Shape::Base
 Base (const Geom::Frame &frame)
 
virtual ~Base ()
 
void unscale (double)
 
virtual void add_glob (const std::string &)=0
 
const Geom::Framelocal_frame () const
 
const Geom::Pointget_center () const
 
const Geom::Quaternionget_quaternion () const
 
const Geom::Vectorget_position () const
 
void translate (Geom::Vector &)
 
void rotate (const Geom::Vector &axis, const double angleRadian)
 

Static Public Member Functions

static std::string class_ID ()
 
static std::string desc ()
 
- Static Public Member Functions inherited from GranOO3::Shape::Volume
static std::string class_ID ()
 
- Static Public Member Functions inherited from GranOO3::Shape::Base
static Baseglob (const std::string &id)
 
static const Geom::Frameframe_buffer ()
 
static std::string class_ID ()
 
static Basenew_object (const TiXmlElement *el)
 
- Static Public Member Functions inherited from GranOO3::Core::ObjectFactoryInterface< Base, Polyhedron >
static Basebuild ()
 
static bool record (const std::string &id, std::string file_name="", std::string desc="")
 
- Static Public Member Functions inherited from GranOO3::Core::ObjectFactory< BaseClass >
static void record (std::function< BaseClass *()>, const std::string &, const std::string file="", const std::string desc="")
 
static BaseClass * new_object (const std::string &)
 
static std::vector< std::string > get_ID ()
 
static std::map< const std::string, std::function< BaseClass *()> > & get_map ()
 

Private Member Functions

Polyhedronoperator= (const Polyhedron &)
 
template<class Archive >
void save (Archive &ar, const unsigned int version) const
 
template<class Archive >
void load (Archive &ar, const unsigned int version)
 
 BOOST_SERIALIZATION_SPLIT_MEMBER ()
 

Private Attributes

PolyhedronCore _polyhedron_core
 
std::map< std::string, std::vector< int > > _map_facet
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Member Functions inherited from GranOO3::Shape::Volume
template<typename T , typename ... Args>
void set_face_ID (const T &, Args... args)
 
template<typename T >
void set_face_ID (const T &)
 
void copy_face_ID (const std::set< std::string > &)
 
void add_face_ID (const std::string &)
 
- Protected Member Functions inherited from GranOO3::Core::ObjectFactoryInterface< Base, Polyhedron >
 ObjectFactoryInterface ()
 
virtual ~ObjectFactoryInterface ()
 
- Protected Member Functions inherited from GranOO3::Core::ObjectFactory< BaseClass >
 ObjectFactory ()
 
virtual ~ObjectFactory ()
 
- Protected Attributes inherited from GranOO3::Shape::Base
const Geom::Frame_frame
 

Constructor & Destructor Documentation

◆ Polyhedron() [1/5]

GranOO3::Shape::Polyhedron::Polyhedron ( )

◆ Polyhedron() [2/5]

GranOO3::Shape::Polyhedron::Polyhedron ( std::string  fileName,
const Geom::Frame frame 
)

◆ Polyhedron() [3/5]

GranOO3::Shape::Polyhedron::Polyhedron ( const Polyhedron polyhedron,
const Geom::Frame frame 
)

◆ Polyhedron() [4/5]

GranOO3::Shape::Polyhedron::Polyhedron ( const Geom::Frame frame)

◆ Polyhedron() [5/5]

GranOO3::Shape::Polyhedron::Polyhedron ( const Polyhedron s)

◆ ~Polyhedron()

virtual GranOO3::Shape::Polyhedron::~Polyhedron ( )
virtual

Member Function Documentation

◆ aabb()

AABB GranOO3::Shape::Polyhedron::aabb ( ) const
virtual

◆ area_of_facet_crossed_by_vector()

double GranOO3::Shape::Polyhedron::area_of_facet_crossed_by_vector ( const Geom::Point ,
const Geom::Vector ,
unsigned int &  ,
Geom::Vector  
) const

◆ basefacet_center()

Geom::Point GranOO3::Shape::Polyhedron::basefacet_center ( const unsigned int  basefacetIndex) const

◆ basefacet_from_normal()

bool GranOO3::Shape::Polyhedron::basefacet_from_normal ( const Geom::Vector normal,
unsigned int &  basefacetIndex 
) const

◆ BOOST_SERIALIZATION_SPLIT_MEMBER()

GranOO3::Shape::Polyhedron::BOOST_SERIALIZATION_SPLIT_MEMBER ( )
private

◆ class_ID()

static std::string GranOO3::Shape::Polyhedron::class_ID ( )
inlinestatic

◆ collide_inside()

bool GranOO3::Shape::Polyhedron::collide_inside ( const Geom::Point p1,
double  radius,
Collision::Data info 
) const
virtual

◆ collide_outside()

bool GranOO3::Shape::Polyhedron::collide_outside ( const Geom::Point p1,
double  radius,
Collision::Data info 
) const
virtual

◆ compute_distance()

double GranOO3::Shape::Polyhedron::compute_distance ( const Geom::Point )

◆ compute_inertia_tensor()

void GranOO3::Shape::Polyhedron::compute_inertia_tensor ( double  density,
Geom::Tensor  
) const
virtual

◆ desc()

static std::string GranOO3::Shape::Polyhedron::desc ( )
static

◆ draw_gl()

void GranOO3::Shape::Polyhedron::draw_gl ( ) const
virtual

Implements GranOO3::Shape::Base.

◆ draw_gl_edge()

void GranOO3::Shape::Polyhedron::draw_gl_edge ( ) const
virtual

Reimplemented from GranOO3::Shape::Base.

◆ farthest_point_along()

Geom::Point GranOO3::Shape::Polyhedron::farthest_point_along ( const Geom::Vector ) const
virtual

◆ get_facet_map()

const std::map<std::string, std::vector<int> >& GranOO3::Shape::Polyhedron::get_facet_map ( ) const
inline

◆ get_greatest_dimension()

double GranOO3::Shape::Polyhedron::get_greatest_dimension ( ) const
virtual

◆ get_number_of_facet()

unsigned int GranOO3::Shape::Polyhedron::get_number_of_facet ( ) const

◆ get_number_of_vertex()

unsigned int GranOO3::Shape::Polyhedron::get_number_of_vertex ( ) const

◆ get_polyhedron_core() [1/2]

PolyhedronCore & GranOO3::Shape::Polyhedron::get_polyhedron_core ( )
inline

◆ get_polyhedron_core() [2/2]

const PolyhedronCore & GranOO3::Shape::Polyhedron::get_polyhedron_core ( ) const
inline

◆ get_volume()

double GranOO3::Shape::Polyhedron::get_volume ( ) const
virtual

◆ info()

std::string GranOO3::Shape::Polyhedron::info ( ) const
virtual

◆ initial_centroid()

Geom::Point GranOO3::Shape::Polyhedron::initial_centroid ( ) const

◆ load()

template<class Archive >
void GranOO3::Shape::Polyhedron::load ( Archive &  ar,
const unsigned int  version 
)
inlineprivate

◆ locate() [1/2]

Interference GranOO3::Shape::Polyhedron::locate ( const Geom::Point ) const
virtual

◆ locate() [2/2]

Interference GranOO3::Shape::Polyhedron::locate ( const Geom::Point ,
double  radius 
) const
virtual

◆ make_equal_to()

void GranOO3::Shape::Polyhedron::make_equal_to ( const Polyhedron )

◆ operator=()

Polyhedron& GranOO3::Shape::Polyhedron::operator= ( const Polyhedron )
private

◆ overlap()

bool GranOO3::Shape::Polyhedron::overlap ( const Sphere ,
double  margin,
std::vector< std::string > &  facet 
) const

◆ read_ascii()

virtual std::istream& GranOO3::Shape::Polyhedron::read_ascii ( std::istream &  in)
virtual

◆ read_xml_element()

void GranOO3::Shape::Polyhedron::read_xml_element ( const TiXmlElement *  element)
virtual

Reimplemented from GranOO3::Shape::Base.

◆ save()

template<class Archive >
void GranOO3::Shape::Polyhedron::save ( Archive &  ar,
const unsigned int  version 
) const
inlineprivate

◆ scale()

void GranOO3::Shape::Polyhedron::scale ( double  ratio)
virtual

Implements GranOO3::Shape::Base.

◆ set_input_file() [1/2]

void GranOO3::Shape::Polyhedron::set_input_file ( const std::string &  offFile,
bool  update = true,
bool  translate_to_centroid = true 
)

◆ set_input_file() [2/2]

void GranOO3::Shape::Polyhedron::set_input_file ( std::stringstream &  stringStream,
bool  update = true,
bool  translate_to_centroid = true 
)

◆ set_input_offset_file()

void GranOO3::Shape::Polyhedron::set_input_offset_file ( const std::string &  offFile)

◆ set_output_file()

void GranOO3::Shape::Polyhedron::set_output_file ( const std::string &  offFile)

◆ to_povray()

std::ostream& GranOO3::Shape::Polyhedron::to_povray ( std::ostream &  out,
const Core::Color  
) const
virtual

Reimplemented from GranOO3::Shape::Base.

◆ to_vtk() [1/2]

void GranOO3::Shape::Polyhedron::to_vtk ( const unsigned int  shift,
unsigned int *  conn,
unsigned int *  cell_type,
double *  point 
) const

◆ to_vtk() [2/2]

virtual void GranOO3::Shape::Polyhedron::to_vtk ( vtkUnstructuredGrid *  data)
virtual

Reimplemented from GranOO3::Shape::Base.

◆ update_bounding_box()

void GranOO3::Shape::Polyhedron::update_bounding_box ( )
virtual

◆ update_bounding_sphere()

void GranOO3::Shape::Polyhedron::update_bounding_sphere ( )
virtual

◆ vtk_conn_number()

unsigned int GranOO3::Shape::Polyhedron::vtk_conn_number ( ) const

◆ write_ascii()

virtual std::ostream& GranOO3::Shape::Polyhedron::write_ascii ( std::ostream &  out) const
virtual

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Member Data Documentation

◆ _map_facet

std::map<std::string, std::vector<int> > GranOO3::Shape::Polyhedron::_map_facet
private

◆ _polyhedron_core

PolyhedronCore GranOO3::Shape::Polyhedron::_polyhedron_core
private

The documentation for this class was generated from the following file: