SpherePackingScenarioGenerator
|
#include <RegularPacking.h>
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 |
Class RegularPacking implements the method to generate spheres with Hexagonal close-packed
algorithms::regularpacking::RegularPacking::RegularPacking | ( | double | length, |
double | radius, | ||
double | distance | ||
) |
Constructor
length | the length of one edge in domain,domain is a cubic |
radius | the radius of sphere |
distance | the minimal distance between sphere and edge of domain due to the resolution |
algorithms::regularpacking::RegularPacking::RegularPacking | ( | double | length, |
double | radius | ||
) |
Constructor without distance
length | the length of one edge in domain,domain is a cubic |
radius | the radius of sphere |
algorithms::regularpacking::RegularPacking::RegularPacking | ( | BoundingBox & | box, |
std::vector< SphereLayer > & | configuration | ||
) |
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
void algorithms::regularpacking::RegularPacking::addSphere | ( | double | x, |
double | y, | ||
double | z, | ||
double | r | ||
) |
Insert one sphere into the domain
x | the position of the new sphere in x axle |
y | the position of the new sphere in y axle |
z | the position of the new sphere in z axle |
void algorithms::regularpacking::RegularPacking::generate | ( | ) | [virtual] |
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.
double algorithms::regularpacking::RegularPacking::getLength | ( | ) | const |
Gets the length of domain
double algorithms::regularpacking::RegularPacking::getPositionX | ( | unsigned int | k | ) | const |
Gets the position x axle for certain sphere
k | the number of certain sphere |
double algorithms::regularpacking::RegularPacking::getPositionY | ( | unsigned int | k | ) | const |
Gets the position y axle for certain sphere
k | the number of certain sphere |
double algorithms::regularpacking::RegularPacking::getPositionZ | ( | unsigned int | k | ) | const |
Gets the position z axle for certain sphere
k | the number of certain sphere |
double algorithms::regularpacking::RegularPacking::getRadius | ( | ) | const |
Gets 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
x | the position of the initial sphere in x axle |
y | the position of the initial sphere in y axle |
z | the 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
x | the position of the initial sphere in x axle |
y | the position of the initial sphere in y axle |
z | the 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 | ||
) |
double algorithms::regularpacking::RegularPacking::_a [private] |
double algorithms::regularpacking::RegularPacking::_m [private] |