SpherePackingScenarioGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
algorithms::regularpacking::RegularPacking Class Reference

#include <RegularPacking.h>

Inheritance diagram for algorithms::regularpacking::RegularPacking:
Inheritance graph
[legend]
Collaboration diagram for algorithms::regularpacking::RegularPacking:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void addSphere (double x, double y, double z, double r)
void generate ()
double getLength () const
double getPositionX (unsigned int k) const
double getPositionY (unsigned int k) const
double getPositionZ (unsigned int k) const
double getRadius () const
void insertRowOfSpheres (double x, double y, double z, double r)
void insertRowOfSpheres (double x, double y, double z, double r, double rmax)
void insertRowOfSpheres (double x, double y, double z, double r, double rmax, BoundingBox &box)
void insertSphereLayer (double x, double y, double z, double r)
void insertSphereLayer (double x, double y, double z, double r, double rmax)
void insertSphereLayer (double x, double y, double z, double r, double rmax, BoundingBox &box)
void mixGenerate (double radius2, double density, double density2)
void mixGenerate (std::vector< std::pair< double, double > > &configuration)
void mixGenerate (BoundingBox &box, std::vector< SphereLayer > &configuration)
 RegularPacking (double length, double radius, double distance)
 RegularPacking (double length, double radius)
 RegularPacking (BoundingBox &box, std::vector< SphereLayer > &configuration)
 RegularPacking (double length, double radius, double radius2, double density, double density2, double distance)
 RegularPacking (double length, std::vector< std::pair< double, double > > &configuration)
 RegularPacking ()
virtual ~RegularPacking ()

Private Attributes

double _a
double _m

Detailed Description

Class RegularPacking implements the method to generate spheres with Hexagonal close-packed


Constructor & Destructor Documentation

algorithms::regularpacking::RegularPacking::RegularPacking ( double  length,
double  radius,
double  distance 
)

Constructor

Parameters:
lengththe length of one edge in domain,domain is a cubic
radiusthe radius of sphere
distancethe minimal distance between sphere and edge of domain due to the resolution
algorithms::regularpacking::RegularPacking::RegularPacking ( double  length,
double  radius 
)

Constructor without distance

Parameters:
lengththe length of one edge in domain,domain is a cubic
radiusthe radius of sphere
algorithms::regularpacking::RegularPacking::RegularPacking ( double  length,
double  radius,
double  radius2,
double  density,
double  density2,
double  distance 
)
algorithms::regularpacking::RegularPacking::RegularPacking ( double  length,
std::vector< std::pair< double, double > > &  configuration 
)

Constructor

Destructor


Member Function Documentation

void algorithms::regularpacking::RegularPacking::addSphere ( double  x,
double  y,
double  z,
double  r 
)

Insert one sphere into the domain

Parameters:
xthe position of the new sphere in x axle
ythe position of the new sphere in y axle
zthe position of the new sphere in z axle

Filled spheres with whole domain by A-B-A-B-algorithem

1.Determine the center of first sphere inserted for instance like (2r, r, r).

2.The A Plane: row by row, the centers of first row will look like (2r, r, r), (4r, r, r), (6r, r, r), (8r, r, r),

3.The next row will be (r, r + ��3r, r), (3r, r + ��3r, r), (5r, r + ��3r, r), (7r, r + ��3r, r),

4.The B Plane in the same way, which is also inserted row by row: (r, ��3/3r, r+(2��6)/3 r), (3r, ��3/3r, r+(2��6)/3 r), (5r, ��3/3r, r+(2��6)/3 r), (7r, ��3/3r, r+(2��6)/3 r)

5.The next row of B Plane will be (2r, (2��3)/3r, r+(2��6)/3 r), (4r, (2��3)/3r, r+(2��6)/3 r), (6r, (2��3)/3r, r+(2��6)/3 r), (8r, (2��3)/3r, r+(2��6)/3 r),

6.Filling the box with the A-B-A-B-A-

Implements algorithms::AbstractSpherePacking.

Gets the length of domain

Returns:
the length of domain

Gets the position x axle for certain sphere

Parameters:
kthe number of certain sphere
Returns:
the position of x axle

Gets the position y axle for certain sphere

Parameters:
kthe number of certain sphere
Returns:
the position of y axle

Gets the position z axle for certain sphere

Parameters:
kthe number of certain sphere
Returns:
the position of z axle

Gets the radius of sphere

Returns:
the radius of sphere

Reimplemented from algorithms::AbstractSpherePacking.

void algorithms::regularpacking::RegularPacking::insertRowOfSpheres ( double  x,
double  y,
double  z,
double  r 
)

Insert one row of spheres into the domain

Parameters:
xthe position of the initial sphere in x axle
ythe position of the initial sphere in y axle
zthe position of the initial sphere in z axle
void algorithms::regularpacking::RegularPacking::insertRowOfSpheres ( double  x,
double  y,
double  z,
double  r,
double  rmax 
)
void algorithms::regularpacking::RegularPacking::insertRowOfSpheres ( double  x,
double  y,
double  z,
double  r,
double  rmax,
BoundingBox box 
)
void algorithms::regularpacking::RegularPacking::insertSphereLayer ( double  x,
double  y,
double  z,
double  r 
)

Insert one layer of spheres into the domain

Parameters:
xthe position of the initial sphere in x axle
ythe position of the initial sphere in y axle
zthe position of the initial sphere in z axle
void algorithms::regularpacking::RegularPacking::insertSphereLayer ( double  x,
double  y,
double  z,
double  r,
double  rmax 
)
void algorithms::regularpacking::RegularPacking::insertSphereLayer ( double  x,
double  y,
double  z,
double  r,
double  rmax,
BoundingBox box 
)
void algorithms::regularpacking::RegularPacking::mixGenerate ( double  radius2,
double  density,
double  density2 
)
void algorithms::regularpacking::RegularPacking::mixGenerate ( std::vector< std::pair< double, double > > &  configuration)
void algorithms::regularpacking::RegularPacking::mixGenerate ( BoundingBox box,
std::vector< SphereLayer > &  configuration 
)

Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines