mesh_conv::MC_sphere_geometry Class Reference

Model for a geometric sphere. More...

#include <MC_sphere_geometry.hpp>

Inheritance diagram for mesh_conv::MC_sphere_geometry:
Inheritance graph
[legend]
Collaboration diagram for mesh_conv::MC_sphere_geometry:
Collaboration graph
[legend]

List of all members.

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_v3dcenter ()
 get the center of the sphere
const MC_v3dcenter () 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

Detailed Description

Model for a geometric sphere.

Definition at line 10 of file MC_sphere_geometry.hpp.


Constructor & Destructor Documentation

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     {}


Member Function Documentation

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 (  ) 
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     }

Here is the call graph for this function:

Here is the caller graph for this function:

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 (  ) 

Member Data Documentation

the center of the sphere

Definition at line 56 of file MC_sphere_geometry.hpp.

Referenced by center(), and is_collide().

the radius of the sphere

Definition at line 58 of file MC_sphere_geometry.hpp.

Referenced by is_collide(), and radius().


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

Generated on Sun Apr 18 20:24:48 2010 by  doxygen 1.6.1