35 #ifdef AGGREGPACKING_BOOST_PYTHON
36 #include <boost/python.hpp>
37 namespace bp = boost::python;
40 #ifdef AGGREGPACKING_SERIALIZATION
52 namespace aggregpacking {
151 virtual void fromSize(
double s) = 0;
154 virtual double getSize()
const = 0;
184 void setPos(
double x,
double y,
double z) {
201 #ifdef AGGREGPACKING_SERIALIZATION
305 #ifdef AGGREGPACKING_SERIALIZATION
454 virtual double getSize()
const;
514 #ifdef AGGREGPACKING_SERIALIZATION
531 #ifdef AGGREGPACKING_BOOST_PYTHON
Representation of spherical aggregate.
Definition: aggregate.hpp:251
3 component vector of real numbers.
virtual double computeVolume() const
Computes volume of receiver.
Definition: aggregate.hpp:290
Vector3 pos
Position.
Definition: aggregate.hpp:69
Ellipsoid()
Default constructor.
Definition: aggregate.hpp:353
int getNumber()
Getter for number.
Definition: aggregate.hpp:161
Quaternion - for rotation representation.
friend double get_z(const Aggregate *a)
Auxiliary function to get z coordinate from Aggregate pointer (used by Octree)
Definition: aggregate.hpp:234
virtual double computeMinCoord(int axis) const =0
Computes minimum coordinate along given axis.
3x3 matrix of real numbers
virtual void fromSize(double s)
Adjust receiver dimensions accodring to given size. Sets b=0.5*s, a=b*(1+0.5*random), c=b*(1-0.5*random)
Definition: aggregate.cpp:196
double getC()
Getter for 3rd semiaxis.
Definition: aggregate.hpp:387
friend double get_size(const Aggregate *a)
Auxiliary function to get (max) size from Aggregate pointer (used by Octree)
Definition: aggregate.hpp:237
virtual bool containsSphere(const Sphere &s) const =0
Ckecks, whether given sphere is contained by receiver.
Ellipsoid(const Vector3 &p)
Constructor from position.
Definition: aggregate.hpp:358
friend double get_z(const Aggregate &a)
Auxiliary function to get z coordinate from Aggregate reference (used by Octree)
Definition: aggregate.hpp:222
void setOri(const Quaternion &q)
Setter for orientation.
Definition: aggregate.hpp:199
virtual void fromSize(double s)=0
Adjust receiver dimensions accodring to given size.
Representation of ellipsoidal aggregate.
Definition: aggregate.hpp:335
bool operator!=(const Aggregate &other) const
Inequality operator.
Definition: aggregate.hpp:108
void setA(double a)
Setter for 1st semiaxis.
Definition: aggregate.hpp:392
static Vector3 computeFarthestPointFrom(const Vector3 &p, const Matrix3 &bT, const Vector3 &pos)
Computes farthest point of Ellipsoid to given point. Returns point on its surface. The computation is based on Monte-Carlo random sampling.
Definition: aggregate.cpp:332
void setB(double b)
Setter for 2nd semiaxis.
Definition: aggregate.hpp:397
double getRandomAxesRatio()
Getter for randomAxesRatio.
Definition: aggregate.hpp:405
void setNumber(int n)
Setter for number.
Definition: aggregate.hpp:166
virtual bool containsSphere(const Sphere &s) const
Ckecks, whether given sphere is contained by receiver.
Definition: aggregate.cpp:96
friend istream & operator>>(istream &is, Sphere &o)
Sphere from istream shift operator.
Definition: aggregate.cpp:126
Matrix3 computeMatrixA() const
Computes matrix .
Definition: aggregate.cpp:442
double c
3rd semiaxis lengths
Definition: aggregate.hpp:344
virtual double getSize() const
Returns size of receiver (what sieve opening it would normally pass)
Definition: aggregate.hpp:298
static double randomAxesRatio
Random axes ratio. Given semiaxis b, a=b*(1+randomAxesRatio*R), c=b*(1-randomAxesRatio*R), R is a random number in range (0,1)
Definition: aggregate.hpp:349
void computeProjectionOnCoordAxis(double &s0, double &w, int axis) const
Computes parameters of its projction onto coordinate axis (such that the projection is s0+-w) ...
Definition: aggregate.cpp:364
virtual double computeMaxCoord(int axis) const =0
Computes maximum coordinate along given axis.
Sphere(double r)
Constructor from radius.
Definition: aggregate.hpp:268
const Vector3 & getPos() const
Getter for position (by reference)
Definition: aggregate.hpp:169
Abstract class representing one aggregate particle.
Definition: aggregate.hpp:63
Matrix3 computeMatrixSigmaInversed() const
Computes matrix , a diagonal matrix with , where is th smiaxis length.
Definition: aggregate.cpp:404
static const string className
String representation of Sphere class name.
Definition: aggregate.hpp:303
virtual double getMaxSize() const =0
Returns maximum size of receiver.
virtual double computeMinCoord(int axis) const
Computes minimum coordinate along given axis.
Definition: aggregate.cpp:388
friend ostream & operator<<(ostream &os, const Sphere &o)
Sphere to ostream shift operator.
Definition: aggregate.cpp:120
Sphere()
Default constructor.
Definition: aggregate.hpp:258
virtual double computeMaxCoord(int axis) const
Computes maximum coordinate along given axis.
Definition: aggregate.hpp:294
Matrix3 computeMatrixBTInversed() const
Computes matrix .
Definition: aggregate.cpp:437
double getRadius() const
Getter for radius.
Definition: aggregate.hpp:277
Quaternion ori
Orientation.
Definition: aggregate.hpp:72
Ellipsoid(double a, double b, double c)
Constructor from semiaxes.
Definition: aggregate.hpp:365
virtual double computeDistanceFrom(const Aggregate &aggreg) const
Computes distance of receiver from given Aggregate.
Definition: aggregate.cpp:107
friend double get_x(const Aggregate *a)
Auxiliary function to get x coordinate from Aggregate pointer (used by Octree)
Definition: aggregate.hpp:228
friend double get_size(const Aggregate &a)
Auxiliary function to get (max) size from Aggregate reference (used by Octree)
Definition: aggregate.hpp:225
double b
2nd semiaxis lengths
Definition: aggregate.hpp:341
virtual double getMaxSize() const
Returns maximum size of receiver.
Definition: aggregate.hpp:456
File containing basic math declarations.
friend ostream & operator<<(ostream &os, const Ellipsoid &o)
Ellipsoid to ostream shift operator.
Definition: aggregate.cpp:451
Quaternion getOri()
Getter for orientation (by value)
Definition: aggregate.hpp:194
Aggregate(const Vector3 &pos, const Quaternion &ori)
Constructor from position and orientation.
Definition: aggregate.hpp:96
Aggregate(const Quaternion &ori)
Constructor from orientation.
Definition: aggregate.hpp:89
double a
1st semiaxis lengths
Definition: aggregate.hpp:338
virtual const string & getClassName()
Returns string representation of Sphere class name.
Definition: aggregate.hpp:307
static bool containsPoint(const Vector3 &p, const Matrix3 &bT, const Vector3 &pos)
Auxiliary structure to test if point lies inside given Ellipsoid.
Definition: aggregate.cpp:158
Vector3 getPos()
Getter for position (by value)
Definition: aggregate.hpp:172
Ellipsoid(const Vector3 &p, double a, double b, double c)
Constructor from position and semiaxes.
Definition: aggregate.hpp:373
virtual void fromSize(double s)
Adjust receiver dimensions accodring to given size.
Definition: aggregate.cpp:102
virtual bool containsSphere(const Sphere &s) const
Ckecks, whether given sphere is contained by receiver.
Definition: aggregate.cpp:169
virtual double computeVolume() const =0
Computes volume of receiver.
Aggregate(const Vector3 &pos)
Constructor from position.
Definition: aggregate.hpp:83
double computeEstimatedDistanceFrom(const Ellipsoid &e) const
Computes estimated distance between receiver and given Ellipsoid. Mainly used as a quick check if two...
Definition: aggregate.cpp:239
Matrix3 computeMatrixSigmaSquare() const
Computes matrix .
Definition: aggregate.cpp:413
bool isInsideCube(double s) const
Determines if receiver is entirely inside cube. The cube is in positive octant and has one corner in ...
Definition: aggregate.cpp:42
virtual double getSize() const =0
Returns size of receiver (what sieve opening it would normally pass)
virtual const string & getClassName()
Returns string representation of Ellipsoid class name.
Definition: aggregate.hpp:516
Matrix3 computeMatrixBT() const
Computes matrix .
Definition: aggregate.cpp:427
friend double get_y(const Aggregate *a)
Auxiliary function to get y coordinate from Aggregate pointer (used by Octree)
Definition: aggregate.hpp:231
bool operator==(const Aggregate &other) const
Equality operator.
Definition: aggregate.hpp:102
virtual bool containsPoint(const Vector3 &p) const
Ckecks, whether given point is contained by receiver.
Definition: aggregate.cpp:91
double getB()
Getter for 2nd semiaxis.
Definition: aggregate.hpp:384
Matrix3 computeMatrixB() const
Computes matrix .
Definition: aggregate.cpp:422
friend istream & operator>>(istream &is, Ellipsoid &o)
Ellipsoid from istream shift operator.
Definition: aggregate.cpp:457
friend ostream & operator<<(ostream &os, const Aggregate &o)
Aggregate to ostream shift operator.
Definition: aggregate.cpp:68
Sphere(const Vector3 &p)
Constructor from position.
Definition: aggregate.hpp:263
static const string className
String representation of Ellipsoid class name.
Definition: aggregate.hpp:512
virtual double computeDistanceFrom(const Aggregate &aggreg) const =0
Computes distance of receiver from given Aggregate.
virtual double computeMinCoord(int axis) const
Computes minimum coordinate along given axis.
Definition: aggregate.hpp:296
void setRadius(double r)
Setter for radius.
Definition: aggregate.hpp:282
virtual double computeMaxCoord(int axis) const
Computes maximum coordinate along given axis.
Definition: aggregate.cpp:381
virtual double getSize() const
Returns size of receiver (what sieve opening it would normally pass), i.e. the middle value from a...
Definition: aggregate.cpp:356
Sphere(const Vector3 &p, double r)
Constructor from position and radius.
Definition: aggregate.hpp:274
static Vector3 computeNearestPointFrom(const Vector3 &p, const Matrix3 &bT, const Vector3 &pos)
Computes nearest point of Ellipsoid to given point. Returns given point if it lies inside the Ellipso...
Definition: aggregate.cpp:275
double radius
radius
Definition: aggregate.hpp:254
int number
Number.
Definition: aggregate.hpp:66
static double computeRelativeDistanceFrom(const Vector3 &p, const Matrix3 &bT, const Vector3 &pos)
Computes relative distance between gvien point and given Ellipsoid. Relative distance means in direct...
Definition: aggregate.cpp:147
virtual bool containsPoint(const Vector3 &p) const =0
Ckecks, whether given point is contained by receiver.
virtual const string & getClassName()=0
Returns string representation of class name.
void setRandomAxesRatio(double v)
Setter for randomAxesRatio.
Definition: aggregate.hpp:408
void setPos(const Vector3 &p)
Setter for position.
Definition: aggregate.hpp:177
friend double get_x(const Aggregate &a)
Auxiliary function to get x coordinate from Aggregate reference (used by Octree)
Definition: aggregate.hpp:216
virtual double computeDistanceFrom(const Aggregate &aggreg) const
Computes distance of receiver from given Aggregate.
Definition: aggregate.cpp:207
Matrix3 computeMatrixBInversed() const
Computes matrix .
Definition: aggregate.cpp:432
void setC(double c)
Setter for 3rd semiaxis.
Definition: aggregate.hpp:402
Aggregate()
Default constructor.
Definition: aggregate.hpp:77
const Quaternion & getOri() const
Getter for orientation (by reference)
Definition: aggregate.hpp:191
double getA()
Getter for 1st semiaxis.
Definition: aggregate.hpp:381
virtual double getMaxSize() const
Returns maximum size of receiver.
Definition: aggregate.hpp:300
const double PI
PI.
Definition: math.hpp:51
static Aggregate * Load(istream &is)
Create and return a new aggregate from given istream.
Definition: aggregate.cpp:51
void setPos(double x, double y, double z)
Setter for position (from individual components)
Definition: aggregate.hpp:184
Matrix3 computeMatrixSigma() const
Computes matrix , a diagonal matrix with , where is th smiaxis length.
Definition: aggregate.cpp:395
virtual double computeVolume() const
Computes volume of receiver.
Definition: aggregate.hpp:435
friend double get_y(const Aggregate &a)
Auxiliary function to get y coordinate from Aggregate reference (used by Octree)
Definition: aggregate.hpp:219