![]() |
GranOO
3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
|
a class that represents a body More...
#include <Body.hpp>
Public Member Functions | |
Body (Shape::Volume &shape, const Geom::Point &p, const Geom::Quaternion &q, double mass, const Geom::Tensor &inertia) | |
constructor More... | |
Body (Shape::Volume &shape, const Geom::Point &p) | |
constructor More... | |
Body (Shape::Volume &shape) | |
constructor More... | |
virtual | ~Body ()=0 |
destructor More... | |
void | set_inertia_tensor (const Geom::Tensor &inertia) |
set the inertia tensor value More... | |
void | set_density (double density) |
set the density value More... | |
Geom::Vector | compute_torque_at (const Geom::Point &A) const |
double | get_kinetic_energy () const |
double | get_mass () const |
get the current mass value of the body More... | |
void | apply_force_at (const Geom::Vector &, const Geom::Point &) |
const Shape::Volume & | to_volume_shape () const |
cast the current object to Shape::Volume More... | |
Shape::Volume & | to_volume_shape () |
cast the current object to Shape::Volume More... | |
double | get_volume () const |
get the current volume of the body More... | |
double | get_bounding_radius () const |
get the current bounding radius of the body More... | |
AABB | aabb () const |
get the aabb tree the body More... | |
bool | collide (const Body &other, Collision::Data &col) |
collision detection with another body More... | |
bool | collide (const Body &other) |
collision detection with another body More... | |
void | make_equal_to (const Body &other) |
for equalizing two bodies More... | |
std::string | info () const |
Display some useful info in the terminal More... | |
virtual std::ostream & | write_ascii (std::ostream &out) const |
dump the current state of the bodyt in a ascii file (standard *.lgdd format) More... | |
virtual std::istream & | read_ascii (std::istream &in) |
update the current state of the body from an ascii file format *.lgdd More... | |
virtual std::ostream & | export_to_povray (std::ostream &out) const |
exporting to povray format More... | |
![]() | |
Node (const Geom::Vector &position) | |
Node (const Geom::Point &position) | |
Node () | |
virtual | ~Node () |
void | clear_force () |
void | clear_torque () |
const Geom::Frame & | local_frame () const |
void | incremental_move (const Geom::Vector &vec) |
void | incremental_unmove (const Geom::Vector &vec) |
void | update_position_from_displacement () |
void | update_displacement_from_position () |
void | set_displacement (const Geom::Vector &) |
void | clear_displacement () |
void | set_displacement_x (const double &) |
void | set_displacement_y (const double &) |
void | set_displacement_z (const double &) |
void | set_position (const Geom::Vector &) |
void | set_position_x (const double &) |
void | set_position_y (const double &) |
void | set_position_z (const double &) |
void | set_center (const Geom::Point &) |
void | update_initial_parameter_to_current_parameter () |
void | update_from_fem () |
void | update_from_dem () |
void | add_interaction (Node &) |
void | erase_interaction (Node &) |
bool | interact_with (const Node &) const |
bool | interact_with (const Ground &) const |
bool | interact_with (const FEM::Surface &) const |
void | apply_force (const Geom::Vector &) |
void | apply_torque (const Geom::Vector &) |
void | set_quaternion_velocity_from_angular_velocity (const Geom::Vector &angularVelocity) |
void | set_quaternion_acceleration_from_angular_acceleration (const Geom::Vector &angularAcceleration, const Geom::Vector &angularVelocity) |
void | update_angular_velocity () |
virtual void | clear_kinematic () |
Geom::Vector | get_linear_velocity_at (const Geom::Point &) const |
void | make_equal_to (const Node &) |
virtual void | draw () |
![]() | |
virtual | ~Base () |
size_t | numID () const |
size_t | uID () const |
void | set_numID (size_t val) |
void | clear_numID () |
Physic::Material & | get_mat () const |
void | set_mat (Physic::Material *) |
Base & | item () |
const Base & | item () const |
bool | is_same (const Base &) const |
template<class T > | |
T & | cast_to () |
template<class T > | |
const T & | cast_to () const |
template<class T > | |
bool | is () const |
virtual bool | is (size_t) const |
virtual const std::string & | get_ID () const |
virtual Base & | clone () |
template<class T > | |
T & | clone_to () |
Signal< Base & > & | deleted_signal () |
![]() | |
Null () | |
virtual | ~Null () |
![]() | |
Drawable () | |
virtual | ~Drawable () |
virtual void | draw_edge () |
virtual void | init_default_color () |
virtual std::ostream & | get_info (std::ostream &os) const |
virtual const Color & | default_color () const |
Color & | get_color () |
const Color & | get_color () const |
virtual void | set_color (const Color &) |
virtual void | set_alpha (float alpha) |
void | apply_color () const |
void | apply_edge_color () const |
void | apply_default_color () |
void | apply_selected_color () |
void | set_line_width (float) |
float | get_line_width () const |
float & | get_line_width () |
void | apply_line_width () const |
bool | is_visible () const |
void | set_visible (bool) |
void | paint () |
void | paint_edge () |
unsigned int | get_item_glkey () const |
![]() | |
Register () | |
virtual | ~Register () |
void | erase_from_all_setof () |
bool | belong_to_setof (const std::string &setOfId) const |
bool | belong_to_setof (const SetOf< Base > &set) const |
std::list< SetOf< Base > * > & | get_setof_list () |
unsigned long long int | get_numeric_ID () const |
![]() | |
PropClass () | |
virtual | ~PropClass () |
T & | new_object () |
T & | get () |
const T & | get () const |
bool | prop_exist () const |
void | add_prop (Core::Prop< Node > *) |
void | remove_prop (Core::Prop< Node > *) |
std::string | info () const |
![]() | |
Register () | |
virtual | ~Register () |
void | erase_from_all_setof () |
bool | belong_to_setof (const std::string &setOfId) const |
bool | belong_to_setof (const SetOf< Node > &set) const |
std::list< SetOf< Node > * > & | get_setof_list () |
unsigned long long int | get_numeric_ID () const |
![]() | |
PropClass () | |
virtual | ~PropClass () |
T & | new_object () |
T & | get () |
const T & | get () const |
bool | prop_exist () const |
void | add_prop (Core::Prop< Body > *) |
void | remove_prop (Core::Prop< Body > *) |
std::string | info () const |
![]() | |
Register () | |
virtual | ~Register () |
void | erase_from_all_setof () |
bool | belong_to_setof (const std::string &setOfId) const |
bool | belong_to_setof (const SetOf< Body > &set) const |
std::list< SetOf< Body > * > & | get_setof_list () |
unsigned long long int | get_numeric_ID () const |
Protected Attributes | |
double | _density |
the density value of the body More... | |
double | _mass |
the mass value of the body More... | |
Geom::Tensor | _inertia_tensor |
the inertia tensor of the body More... | |
Geom::Tensor | _inverse_inertia_tensor |
the inverse of the inertia tensor of the body More... | |
![]() | |
std::vector< Core::Prop< Node > * > | _prop |
![]() | |
std::vector< Core::Prop< Body > * > | _prop |
Private Member Functions | |
void | update_inverse_inertia_tensor () |
update the current value of Body::_inverse_inertia_tensor from the Body::_inertia_tensor value More... | |
Body (const Body &)=delete | |
Body & | operator= (const Body &)=delete |
template<class Archive > | |
void | save (Archive &, const unsigned int) const |
complete serializing of the element in the *.gdd format More... | |
template<class Archive > | |
void | load (Archive &, const unsigned int) |
complete serializing of the element in the *.gdd format More... | |
BOOST_SERIALIZATION_SPLIT_MEMBER () | |
Private Attributes | |
Shape::Volume & | _volume_shape |
Friends | |
class | boost::serialization::access |
Additional Inherited Members | |
![]() | |
static Base & | get_by_numID (size_t) |
static void | clear_all_numID () |
static unsigned int | get_sub_class_number () |
![]() | |
static Drawable & | get_drawable_item_by_glkey (int) |
static void | set_draw_precision (unsigned int p) |
static void | increase_draw_precision () |
static void | decrease_draw_precision () |
static unsigned int | get_draw_precision () |
![]() | |
static Null | null = Null() |
![]() | |
Base () | |
![]() | |
static unsigned int | affect_class_rank_ID () |
a class that represents a body
a template class that model a body with a given shape
A Physic::Body class that models a rigid body able to move (translate and rotate) in a 3D space. Note that this class is pure virtual because the Physic::Body does not know its own shape.
shape | the real shape of the BodyT |
This template class BodyT<shape>
derives from two classes :
shape
class that represents a volume shape such as Shape::Cone, Shape::Cylinder, Shape::Sphere, Shape::Polyhedron, etc.In such way an BodyT<T>
object is both an element and a volume shape. So, you can either ask an BodyT<T>
for getting its mass and its lengths.
|
inline |
constructor
[in] | shape | : the shape to clone |
[in] | p | : initial position of the body |
[in] | q | : initial orientation of the body |
[in] | mass | : the mass of the body |
[in] | inertia | : the inertia tensor of the body |
Construct a new body with the given parameters.
|
inline |
constructor
[in] | shape | : the shape to clone |
[in] | p | : initial position of the body |
[in] | q | : initial orientation of the body |
Construct a new body with the given parameters.
|
inline |
constructor
[in] | shape | : the shape to clone |
Construct a new body with the given parameters.
|
inlinepure virtual |
destructor
Note that the destructor is pure virtual.
|
privatedelete |
|
inline |
|
inline |
|
private |
|
inline |
collision detection with another body
[in] | other | : the other body for collision detection |
true
if the two bodies are colliding false
otherwiseThis method is able to manage collision detection between two bodies. The updated information about collision (normal, penetration value, etc...) are written into the main
static attribute of the GranOO3::Collision::Data class.
|
inline |
collision detection with another body
[in] | other | : the other body for collision detection |
[out] | col | : the collision data information |
true
if the two bodies are colliding false
otherwiseThis method is able to manage collision detection between two bodies. The updated information about collision (normal, penetration value, etc...) are written into the col
parameter.
|
inline |
|
virtual |
exporting to povray format
[in] | os | : the stream to write |
This method is used in the granoo-viewer
for exporting a 3D scene to the povray program
Reimplemented from GranOO3::Physic::Node.
|
inline |
get the current bounding radius of the body
Useful method for generic collision detection
|
inline |
|
virtual |
|
inline |
get the current volume of the body
|
virtual |
Display some useful info in the terminal
Reimplemented from GranOO3::Physic::Node.
Reimplemented in GranOO3::Physic::BodyT< shape >, GranOO3::DEM::ElementT< Shape::Sphere >, and GranOO3::DEM::ElementT< GranOO3::Shape::Polyhedron >.
|
private |
void GranOO3::Physic::Body::make_equal_to | ( | const Body & | other | ) |
for equalizing two bodies
[in] | other | : the other body which will be used as a model for equalizing |
This method can be used for equalizing the current body (this
) to another one (other
). When you equalize two bodies, they have the same position, velocity, mass, etc. This method can be used used for cloning.
|
virtual |
update the current state of the body from an ascii file format *.lgdd
[in] | is | : the stream where the data are read |
Reimplemented from GranOO3::Physic::Node.
Reimplemented in GranOO3::DEM::ElementT< shape >, GranOO3::DEM::ElementT< Shape::Sphere >, GranOO3::DEM::ElementT< GranOO3::Shape::Polyhedron >, GranOO3::DEM::Element, GranOO3::DEM::ToolT< shape >, GranOO3::DEM::Tool, and GranOO3::DEM::DiscreteElement.
|
private |
|
inline |
set the density value
[in] | density | : the new value of density |
Set a new density value. When setting a new density value, the Body::_density Body::_inertia_tensor and Body::_inverse_inertia_tensor are automatically updated.
|
inline |
set the inertia tensor value
[in] | inertia | : the inertia tensor of the body |
Set a new Body::_inertia_tensor value
|
inline |
cast the current object to Shape::Volume
|
inline |
cast the current object to Shape::Volume
|
inlineprivate |
update the current value of Body::_inverse_inertia_tensor from the Body::_inertia_tensor value
|
virtual |
dump the current state of the bodyt in a ascii file (standard *.lgdd format)
[in] | os | : the stream where the data will be written |
Reimplemented from GranOO3::Physic::Node.
Reimplemented in GranOO3::DEM::ToolT< shape >, GranOO3::DEM::Tool, GranOO3::DEM::DiscreteElement, GranOO3::DEM::ElementT< shape >, GranOO3::DEM::ElementT< Shape::Sphere >, GranOO3::DEM::ElementT< GranOO3::Shape::Polyhedron >, and GranOO3::DEM::Element.
|
friend |
|
protected |
the density value of the body
|
protected |
the inertia tensor of the body
|
protected |
the inverse of the inertia tensor of the body
This attribute allows to avoid on-the-fly computation of the inverse of the inertia tensor because it is intensively required by the time scheme. So, we use this attribute as a cache for avoiding multiple useless calculation because modifying massic parameters of bodies is a rare event.
|
protected |
the mass value of the body
|
private |