Model for a geometric sphere. More...
#include <MC_sphere_geometry.hpp>


Public Member Functions | |
| MC_sphere_geometry () | |
| empty constructor | |
| MC_sphere_geometry (const MC_v3d &_center, const double &_radius) | |
| direct constructor | |
| MC_sphere_geometry (const MC_sphere_geometry &sphere) | |
| copy constuctor | |
| MC_v3d & | center () |
| get the center of the sphere | |
| const MC_v3d & | center () const |
| get the center of the sphere | |
| double & | radius () |
| get the radius of the sphere | |
| const double & | radius () const |
| get the radius of the sphere | |
| bool | is_collide (const MC_sphere_geometry &sphere) |
| check if the current sphere collide with an other one | |
Private Attributes | |
| MC_v3d | center_internal |
| the center of the sphere | |
| double | radius_internal |
| the radius of the sphere | |
Model for a geometric sphere.
Definition at line 10 of file MC_sphere_geometry.hpp.
| mesh_conv::MC_sphere_geometry::MC_sphere_geometry | ( | ) |
empty constructor
Definition at line 7 of file MC_sphere_geometry.cpp.
00007 :center_internal(MC_v3d(0,0,0)),radius_internal(1){}
| mesh_conv::MC_sphere_geometry::MC_sphere_geometry | ( | const MC_v3d & | _center, | |
| const double & | _radius | |||
| ) |
direct constructor
Definition at line 8 of file MC_sphere_geometry.cpp.
00008 :center_internal(_center),radius_internal(_radius){}
| mesh_conv::MC_sphere_geometry::MC_sphere_geometry | ( | const MC_sphere_geometry & | sphere | ) |
copy constuctor
Definition at line 16 of file MC_sphere_geometry.cpp.
00017 :center_internal(sphere.center_internal),radius_internal(sphere.radius_internal) 00018 {}
| const MC_v3d & mesh_conv::MC_sphere_geometry::center | ( | ) | const |
get the center of the sphere
Definition at line 11 of file MC_sphere_geometry.cpp.
References center_internal.
00011 {return center_internal;}
| MC_v3d & mesh_conv::MC_sphere_geometry::center | ( | ) |
get the center of the sphere
Definition at line 10 of file MC_sphere_geometry.cpp.
References center_internal.
Referenced by mesh_conv::MC_grid_3d_scalar::add_potential(), mesh_conv::MC_sphere_physic::constraint_in_unit_cube(), mesh_conv::MC_sphere_physic::constraint_no_collision_sphere(), mesh_conv::MC_sphere_physic::evolve(), is_collide(), and mesh_conv::implicit::MC_potential_sphere::operator()().
00010 {return center_internal;}

| bool mesh_conv::MC_sphere_geometry::is_collide | ( | const MC_sphere_geometry & | sphere | ) |
check if the current sphere collide with an other one
Definition at line 19 of file MC_sphere_geometry.cpp.
References center(), center_internal, radius(), and radius_internal.
Referenced by mesh_conv::MC_sphere_physic::constraint_no_collision_sphere().
00020 { 00021 00022 double dist_center=(center_internal-sphere.center()).norm(); 00023 double radius_sum=radius_internal+sphere.radius(); 00024 if(dist_center<radius_sum) 00025 return true; 00026 return false; 00027 }


| const double & mesh_conv::MC_sphere_geometry::radius | ( | ) | const |
get the radius of the sphere
Definition at line 14 of file MC_sphere_geometry.cpp.
References radius_internal.
00014 {return radius_internal;}
| double & mesh_conv::MC_sphere_geometry::radius | ( | ) |
get the radius of the sphere
Definition at line 13 of file MC_sphere_geometry.cpp.
References radius_internal.
Referenced by mesh_conv::MC_grid_3d_scalar::add_potential(), mesh_conv::MC_sphere_physic::constraint_in_unit_cube(), mesh_conv::MC_sphere_physic::constraint_no_collision_sphere(), is_collide(), and mesh_conv::implicit::MC_potential_sphere::operator()().
00013 {return radius_internal;}

the center of the sphere
Definition at line 56 of file MC_sphere_geometry.hpp.
Referenced by center(), and is_collide().
double mesh_conv::MC_sphere_geometry::radius_internal [private] |
the radius of the sphere
Definition at line 58 of file MC_sphere_geometry.hpp.
Referenced by is_collide(), and radius().
1.6.1