OpenFPM_data  0.1.0
Project that contain the implementation and interfaces for basic structure like vectors, grids, graph ... .
 All Data Structures Namespaces Functions Variables Typedefs Friends
Sphere< dim, T > Class Template Reference

This class implement the Sphere concept in an N-dimensional space. More...

Detailed Description

template<unsigned int dim, typename T>
class Sphere< dim, T >

This class implement the Sphere concept in an N-dimensional space.

This class implement the sphere shape in an N-dimensional space

Template Parameters
Ttype of the space
dimdimensionality

Definition at line 23 of file Sphere.hpp.

#include <Sphere.hpp>

Public Types

typedef boost::fusion::vector
< T[3], T > 
type
 boost fusion that store the point
 

Public Member Functions

center (unsigned int i)
 Get the component i of the center. More...
 
template<unsigned int k>
 Sphere (boost::fusion::vector< T[k]> &c, T radius)
 Sphere constructor. More...
 
radius ()
 Get the radius of the sphere. More...
 
template<typename Distance >
isInside (Point< dim, T > p)
 Check if a point is inside. More...
 
template<typename Distance >
bool isInside (float *pnt)
 Is the point inside the sphere. More...
 

Data Fields

type data
 Structure that store the data.
 

Static Public Attributes

static const unsigned int x = 0
 property id of the center position of the sphere
 
static const unsigned int r = 1
 property id of the radius of the sphere
 

Constructor & Destructor Documentation

template<unsigned int dim, typename T>
template<unsigned int k>
Sphere< dim, T >::Sphere ( boost::fusion::vector< T[k]> &  c,
radius 
)
inline

Sphere constructor.

Sphere constructor

Template Parameters
kdimensionality of the center point (and the sphere)
Parameters
ccenter point
radius

Definition at line 58 of file Sphere.hpp.

Member Function Documentation

template<unsigned int dim, typename T>
T Sphere< dim, T >::center ( unsigned int  i)
inline

Get the component i of the center.

Parameters
icoordinate
Returns
the coordinate i of the center

Definition at line 44 of file Sphere.hpp.

template<unsigned int dim, typename T>
template<typename Distance >
T Sphere< dim, T >::isInside ( Point< dim, T >  p)
inline

Check if a point is inside.

Template Parameters
distancedistance functor used to calculate the distance two points
Parameters
pPoint to check if it is inside
Returns
true if the point is inside

Definition at line 87 of file Sphere.hpp.

template<unsigned int dim, typename T>
template<typename Distance >
bool Sphere< dim, T >::isInside ( float *  pnt)
inline

Is the point inside the sphere.

Parameters
pntcheck if the point is inside
Returns
true if it is inside

Definition at line 118 of file Sphere.hpp.

template<unsigned int dim, typename T>
T Sphere< dim, T >::radius ( )
inline

Get the radius of the sphere.

Returns
the radius of the sphere

Definition at line 74 of file Sphere.hpp.


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