AggregPacking
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Private Attributes | Friends | List of all members
aggregpacking::Sphere Class Reference

Representation of spherical aggregate. More...

#include <aggregate.hpp>

Inheritance diagram for aggregpacking::Sphere:
aggregpacking::Aggregate

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 Vector3getPos () 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 QuaterniongetOri () 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 AggregateLoad (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.
 

Detailed Description

Representation of spherical aggregate.

Spherical particles are defined as a set of 3D space points $\mathbf{x}$:

\[\{ \mathbf{x}\ |\ ||\mathbf{x}-\mathbf{position}|| \le radius \}\]

Constructor & Destructor Documentation

aggregpacking::Sphere::Sphere ( const Vector3 p)
inline

Constructor from position.

Parameters
pposition
aggregpacking::Sphere::Sphere ( double  r)
inline

Constructor from radius.

Parameters
rradius
aggregpacking::Sphere::Sphere ( const Vector3 p,
double  r 
)
inline

Constructor from position and radius.

Parameters
pposition
rradius

Member Function Documentation

double aggregpacking::Sphere::computeDistanceFrom ( const Aggregate aggreg) const
virtual

Computes distance of receiver from given Aggregate.

Positive when the aggregates are separate, negative whan they overlap

Parameters
aggregAggregate object to compute distance from
Returns
distance between receiver and given Aggregate

Implements aggregpacking::Aggregate.

virtual double aggregpacking::Sphere::computeMaxCoord ( int  axis) const
inlinevirtual

Computes maximum coordinate along given axis.

Parameters
axis0=x, 1=y, 2=z

Implements aggregpacking::Aggregate.

virtual double aggregpacking::Sphere::computeMinCoord ( int  axis) const
inlinevirtual

Computes minimum coordinate along given axis.

Parameters
axis0=x, 1=y, 2=z

Implements aggregpacking::Aggregate.

bool aggregpacking::Sphere::containsPoint ( const Vector3 p) const
virtual

Ckecks, whether given point is contained by receiver.

Parameters
ppoint coordinates
Returns
true if receiver contains given point, false otherwise

Implements aggregpacking::Aggregate.

bool aggregpacking::Sphere::containsSphere ( const Sphere s) const
virtual

Ckecks, whether given sphere is contained by receiver.

Parameters
sgiven sphere object
Returns
true if receiver contains entirely given sphere, false otherwise

Implements aggregpacking::Aggregate.

void aggregpacking::Sphere::fromSize ( double  s)
virtual

Adjust receiver dimensions accodring to given size.

Parameters
sgiven size

Implements aggregpacking::Aggregate.

bool aggregpacking::Aggregate::isInsideCube ( double  s) const
inherited

Determines if receiver is entirely inside cube. The cube is in positive octant and has one corner in origin.

Parameters
scube size
Returns
true if receiver is entirely contained by a cube with given size, false otherwise
Aggregate * aggregpacking::Aggregate::Load ( istream &  is)
staticinherited

Create and return a new aggregate from given istream.

Parameters
isinput stream
bool aggregpacking::Aggregate::operator!= ( const Aggregate other) const
inlineinherited

Inequality operator.

Intended for Python

Parameters
otherinstance to compare with
bool aggregpacking::Aggregate::operator== ( const Aggregate other) const
inlineinherited

Equality operator.

Intended for Python

Parameters
otherinstance to compare with
void aggregpacking::Aggregate::setNumber ( int  n)
inlineinherited

Setter for number.

Parameters
nnew number
void aggregpacking::Aggregate::setOri ( const Quaternion q)
inlineinherited

Setter for orientation.

Parameters
qnew orientation
void aggregpacking::Aggregate::setPos ( const Vector3 p)
inlineinherited

Setter for position.

Parameters
pnew position
void aggregpacking::Aggregate::setPos ( double  x,
double  y,
double  z 
)
inlineinherited

Setter for position (from individual components)

Parameters
xx coordinate
yy coordinate
zz coordinate
void aggregpacking::Sphere::setRadius ( double  r)
inline

Setter for radius.

Parameters
rnew radius

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