NuTo
Numerics Tool
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | Friends | List of all members
NuTo::Event Class Reference

class for storing events More...

#include <Event.h>

Public Types

enum  EventType { SphereCollision, WallCollision, WallTransfer }
 statistics More...
 
typedef std::vector< Event * > LocalEvents
 

Public Member Functions

 Event (double rTime, CollidableBase *rFirst, CollidableBase *rSecond, int rType)
 constructor, initialized with the two CollidableBase objects involved in this collision More...
 
 Event (const Event &rEvent)=default
 copy constructor More...
 
Eventoperator= (const NuTo::Event &)=default
 
 Event (Event &&rEvent)=default
 
Eventoperator= (Event &&)=default
 
bool operator< (const Event &rOther) const
 important operator for the event list sorting sort priority: time >> collidables More...
 
bool operator== (Event const &rRhs) const
 determines, whether two events are equal More...
 
bool operator!= (Event const &rRhs) const
 determines, whether two events are unequal More...
 
 ~Event ()
 destructor removes itself (this) from the local event lists of both collidables More...
 
double GetTime () const
 getter for mTime More...
 
void AddNewEvents (EventListHandler &rEvents) const
 creates new events for mFirst and mSecond (–> automatically added to local event lists, see constructor) stores them to the global event list More...
 
void EraseOldEvents (EventListHandler &rEvents) const
 removes all events in the local event lists of rEvent More...
 
void PerformCollision () const
 performs the collision of mFirst vs. mSecond More...
 
void AddLocalEvent ()
 adds itself (this) to the local event lists of both collidables More...
 
int GetType () const
 getter for type More...
 

Static Public Attributes

static const double EVENTNULL = -1.
 identifier for null events More...
 

Protected Attributes

CollidableBasemFirst
 first CollidableBase involved More...
 
CollidableBasemSecond
 second CollidableBase involved More...
 

Friends

std::ostream & operator<< (std::ostream &rOutStream, const Event &rEvent)
 

Detailed Description

class for storing events

Member Typedef Documentation

typedef std::vector<Event*> NuTo::Event::LocalEvents

Member Enumeration Documentation

statistics

Enumerator
SphereCollision 
WallCollision 
WallTransfer 

Constructor & Destructor Documentation

NuTo::Event::Event ( double  rTime,
CollidableBase rFirst,
CollidableBase rSecond,
int  rType 
)

constructor, initialized with the two CollidableBase objects involved in this collision

Parameters
rTimeevent time
rFirstfirst CollidableBase involved
rSecondsecond CollidableBase involved
NuTo::Event::Event ( const Event rEvent)
default

copy constructor

NuTo::Event::Event ( Event &&  rEvent)
default
NuTo::Event::~Event ( )

destructor removes itself (this) from the local event lists of both collidables

Member Function Documentation

void NuTo::Event::AddLocalEvent ( )

adds itself (this) to the local event lists of both collidables

void NuTo::Event::AddNewEvents ( EventListHandler rEvents) const

creates new events for mFirst and mSecond (–> automatically added to local event lists, see constructor) stores them to the global event list

Parameters
rEventsglobal event list
void NuTo::Event::EraseOldEvents ( EventListHandler rEvents) const

removes all events in the local event lists of rEvent

Parameters
rEventsglobal event list
double NuTo::Event::GetTime ( ) const

getter for mTime

Returns
time of event
int NuTo::Event::GetType ( ) const

getter for type

bool NuTo::Event::operator!= ( Event const &  rRhs) const

determines, whether two events are unequal

bool NuTo::Event::operator< ( const Event rOther) const

important operator for the event list sorting sort priority: time >> collidables

Event& NuTo::Event::operator= ( const NuTo::Event )
default
Event& NuTo::Event::operator= ( Event &&  )
default
bool NuTo::Event::operator== ( Event const &  rRhs) const

determines, whether two events are equal

void NuTo::Event::PerformCollision ( ) const

performs the collision of mFirst vs. mSecond

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  rOutStream,
const Event rEvent 
)
friend

Member Data Documentation

const double NuTo::Event::EVENTNULL = -1.
static

identifier for null events

CollidableBase* NuTo::Event::mFirst
protected

first CollidableBase involved

CollidableBase* NuTo::Event::mSecond
protected

second CollidableBase involved


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