Representation of spherical aggregate. More...
#include <aggregate.hpp>
Public Member Functions | |
Sphere () | |
Default constructor. | |
Sphere (const Vector3 &p) | |
Constructor from position. More... | |
Sphere (double r) | |
Constructor from radius. More... | |
Sphere (const Vector3 &p, double r) | |
Constructor from position and radius. More... | |
double | getRadius () const |
Getter for radius. | |
void | setRadius (double r) |
Setter for radius. More... | |
virtual bool | containsPoint (const Vector3 &p) const |
Ckecks, whether given point is contained by receiver. More... | |
virtual bool | containsSphere (const Sphere &s) const |
Ckecks, whether given sphere is contained by receiver. More... | |
virtual double | computeDistanceFrom (const Aggregate &aggreg) const |
Computes distance of receiver from given Aggregate. More... | |
virtual double | computeVolume () const |
Computes volume of receiver. | |
virtual void | fromSize (double s) |
Adjust receiver dimensions accodring to given size. More... | |
virtual double | computeMaxCoord (int axis) const |
Computes maximum coordinate along given axis. More... | |
virtual double | computeMinCoord (int axis) const |
Computes minimum coordinate along given axis. More... | |
virtual double | getSize () const |
Returns size of receiver (what sieve opening it would normally pass) | |
virtual double | getMaxSize () const |
Returns maximum size of receiver. | |
virtual const string & | getClassName () |
Returns string representation of Sphere class name. | |
bool | operator== (const Aggregate &other) const |
Equality operator. More... | |
bool | operator!= (const Aggregate &other) const |
Inequality operator. More... | |
bool | isInsideCube (double s) const |
Determines if receiver is entirely inside cube. The cube is in positive octant and has one corner in origin. More... | |
int | getNumber () |
Getter for number. | |
void | setNumber (int n) |
Setter for number. More... | |
const Vector3 & | getPos () const |
Getter for position (by reference) | |
Vector3 | getPos () |
Getter for position (by value) | |
void | setPos (const Vector3 &p) |
Setter for position. More... | |
void | setPos (double x, double y, double z) |
Setter for position (from individual components) More... | |
const Quaternion & | getOri () const |
Getter for orientation (by reference) | |
Quaternion | getOri () |
Getter for orientation (by value) | |
void | setOri (const Quaternion &q) |
Setter for orientation. More... | |
Static Public Member Functions | |
static Aggregate * | Load (istream &is) |
Create and return a new aggregate from given istream. More... | |
Static Public Attributes | |
static const string | className = "Sphere" |
String representation of Sphere class name. | |
Protected Attributes | |
int | number |
Number. | |
Vector3 | pos |
Position. | |
Quaternion | ori |
Orientation. | |
Private Attributes | |
double | radius |
radius | |
Friends | |
ostream & | operator<< (ostream &os, const Sphere &o) |
Sphere to ostream shift operator. | |
istream & | operator>> (istream &is, Sphere &o) |
Sphere from istream shift operator. | |
Representation of spherical aggregate.
Spherical particles are defined as a set of 3D space points :
|
inline |
Constructor from position.
p | position |
|
inline |
Constructor from radius.
r | radius |
|
inline |
Constructor from position and radius.
p | position |
r | radius |
|
virtual |
Computes distance of receiver from given Aggregate.
Positive when the aggregates are separate, negative whan they overlap
aggreg | Aggregate object to compute distance from |
Implements aggregpacking::Aggregate.
|
inlinevirtual |
Computes maximum coordinate along given axis.
axis | 0=x, 1=y, 2=z |
Implements aggregpacking::Aggregate.
|
inlinevirtual |
Computes minimum coordinate along given axis.
axis | 0=x, 1=y, 2=z |
Implements aggregpacking::Aggregate.
|
virtual |
Ckecks, whether given point is contained by receiver.
p | point coordinates |
Implements aggregpacking::Aggregate.
|
virtual |
Ckecks, whether given sphere is contained by receiver.
s | given sphere object |
Implements aggregpacking::Aggregate.
|
virtual |
Adjust receiver dimensions accodring to given size.
s | given size |
Implements aggregpacking::Aggregate.
|
inherited |
Determines if receiver is entirely inside cube. The cube is in positive octant and has one corner in origin.
s | cube size |
|
staticinherited |
Create and return a new aggregate from given istream.
is | input stream |
|
inlineinherited |
Inequality operator.
Intended for Python
other | instance to compare with |
|
inlineinherited |
Equality operator.
Intended for Python
other | instance to compare with |
|
inlineinherited |
Setter for number.
n | new number |
|
inlineinherited |
Setter for orientation.
q | new orientation |
|
inlineinherited |
Setter for position.
p | new position |
|
inlineinherited |
Setter for position (from individual components)
x | x coordinate |
y | y coordinate |
z | z coordinate |
|
inline |
Setter for radius.
r | new radius |