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

Abstract class representing one aggregate particle. More...

#include <aggregate.hpp>

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

Public Member Functions

 Aggregate ()
 Default constructor. More...
 
 Aggregate (const Vector3 &pos)
 Constructor from position. More...
 
 Aggregate (const Quaternion &ori)
 Constructor from orientation. More...
 
 Aggregate (const Vector3 &pos, const Quaternion &ori)
 Constructor from position and orientation. More...
 
bool operator== (const Aggregate &other) const
 Equality operator. More...
 
bool operator!= (const Aggregate &other) const
 Inequality operator. More...
 
virtual bool containsPoint (const Vector3 &p) const =0
 Ckecks, whether given point is contained by receiver. More...
 
virtual bool containsSphere (const Sphere &s) const =0
 Ckecks, whether given sphere is contained by receiver. More...
 
virtual double computeDistanceFrom (const Aggregate &aggreg) const =0
 Computes distance of receiver from given Aggregate. More...
 
virtual double computeMaxCoord (int axis) const =0
 Computes maximum coordinate along given axis. More...
 
virtual double computeMinCoord (int axis) const =0
 Computes minimum coordinate along given axis. 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...
 
virtual double computeVolume () const =0
 Computes volume of receiver.
 
virtual void fromSize (double s)=0
 Adjust receiver dimensions accodring to given size. More...
 
virtual double getSize () const =0
 Returns size of receiver (what sieve opening it would normally pass)
 
virtual double getMaxSize () const =0
 Returns maximum size of receiver.
 
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...
 
virtual const string & getClassName ()=0
 Returns string representation of class name.
 

Static Public Member Functions

static AggregateLoad (istream &is)
 Create and return a new aggregate from given istream. More...
 

Protected Attributes

int number
 Number.
 
Vector3 pos
 Position.
 
Quaternion ori
 Orientation.
 

Friends

ostream & operator<< (ostream &os, const Aggregate &o)
 Aggregate to ostream shift operator.
 
double get_x (const Aggregate &a)
 Auxiliary function to get x coordinate from Aggregate reference (used by Octree)
 
double get_y (const Aggregate &a)
 Auxiliary function to get y coordinate from Aggregate reference (used by Octree)
 
double get_z (const Aggregate &a)
 Auxiliary function to get z coordinate from Aggregate reference (used by Octree)
 
double get_size (const Aggregate &a)
 Auxiliary function to get (max) size from Aggregate reference (used by Octree)
 
double get_x (const Aggregate *a)
 Auxiliary function to get x coordinate from Aggregate pointer (used by Octree)
 
double get_y (const Aggregate *a)
 Auxiliary function to get y coordinate from Aggregate pointer (used by Octree)
 
double get_z (const Aggregate *a)
 Auxiliary function to get z coordinate from Aggregate pointer (used by Octree)
 
double get_size (const Aggregate *a)
 Auxiliary function to get (max) size from Aggregate pointer (used by Octree)
 

Detailed Description

Abstract class representing one aggregate particle.

Containing information about its shape, position and orientation

Constructor & Destructor Documentation

aggregpacking::Aggregate::Aggregate ( )
inline

Default constructor.

Sets number to -1, pos to (0,0,0) and ori to ((1,0,0),0)

aggregpacking::Aggregate::Aggregate ( const Vector3 pos)
inline

Constructor from position.

Number is set to -1 and ori to ((1,0,0),0)

Parameters
posposition
aggregpacking::Aggregate::Aggregate ( const Quaternion ori)
inline

Constructor from orientation.

Number is set to -1 and pos to (0,0,0)

Parameters
oriorientation
aggregpacking::Aggregate::Aggregate ( const Vector3 pos,
const Quaternion ori 
)
inline

Constructor from position and orientation.

Number is set to -1

Parameters
posposition
oriorientation

Member Function Documentation

virtual double aggregpacking::Aggregate::computeDistanceFrom ( const Aggregate aggreg) const
pure 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

Implemented in aggregpacking::Ellipsoid, and aggregpacking::Sphere.

virtual double aggregpacking::Aggregate::computeMaxCoord ( int  axis) const
pure virtual

Computes maximum coordinate along given axis.

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

Implemented in aggregpacking::Ellipsoid, and aggregpacking::Sphere.

virtual double aggregpacking::Aggregate::computeMinCoord ( int  axis) const
pure virtual

Computes minimum coordinate along given axis.

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

Implemented in aggregpacking::Ellipsoid, and aggregpacking::Sphere.

virtual bool aggregpacking::Aggregate::containsPoint ( const Vector3 p) const
pure virtual

Ckecks, whether given point is contained by receiver.

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

Implemented in aggregpacking::Ellipsoid, and aggregpacking::Sphere.

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

Ckecks, whether given sphere is contained by receiver.

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

Implemented in aggregpacking::Ellipsoid, and aggregpacking::Sphere.

virtual void aggregpacking::Aggregate::fromSize ( double  s)
pure virtual

Adjust receiver dimensions accodring to given size.

Parameters
sgiven size

Implemented in aggregpacking::Ellipsoid, and aggregpacking::Sphere.

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

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)
static

Create and return a new aggregate from given istream.

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

Inequality operator.

Intended for Python

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

Equality operator.

Intended for Python

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

Setter for number.

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

Setter for orientation.

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

Setter for position.

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

Setter for position (from individual components)

Parameters
xx coordinate
yy coordinate
zz coordinate

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