MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HGridCell Class Reference

Contains the hGrid-information for a certain particle: x,y,z and level of the particle containing this. More...

#include <HGridCell.h>

Public Member Functions

 HGridCell ()
 
bool equals (int x, int y, int z, unsigned int level) const
 Checks if the given (x,y,z,level) is the same as the ones in this cell. More...
 
bool equals (int x, int y, unsigned int level) const
 Checks if the given (x,y,z,level) is the same as the ones in this cell, 2D version. More...
 
bool operator== (const HGridCell &other) const
 Checks if the given cell is the same as the given cell. More...
 
int getHGridX () const
 
void setHGridX (int HGridX)
 
int getHGridY () const
 
void setHGridY (int HGridY)
 
int getHGridZ () const
 
void setHGridZ (int HGridZ)
 
unsigned int getHGridLevel () const
 
void setHGridLevel (unsigned int HGridLevel)
 

Private Attributes

int hGridX_
 Cell position in the grid. More...
 
int hGridY_
 
int hGridZ_
 
unsigned int hGridLevel_
 HGrid-level of the particle containing this cell. More...
 

Detailed Description

Contains the hGrid-information for a certain particle: x,y,z and level of the particle containing this.

Note, that each particle contains a HGridCell. All methods are inline for speed reasons: they are called VERY often, so we do need performance here.

Definition at line 32 of file HGridCell.h.

Constructor & Destructor Documentation

HGridCell::HGridCell ( )
inline

Definition at line 35 of file HGridCell.h.

35  : hGridX_(0), hGridY_(0), hGridZ_(0), hGridLevel_(0)
36  {}
int hGridZ_
Definition: HGridCell.h:99
int hGridY_
Definition: HGridCell.h:99
int hGridX_
Cell position in the grid.
Definition: HGridCell.h:99
unsigned int hGridLevel_
HGrid-level of the particle containing this cell.
Definition: HGridCell.h:101

Member Function Documentation

bool HGridCell::equals ( int  x,
int  y,
int  z,
unsigned int  level 
) const
inline

Checks if the given (x,y,z,level) is the same as the ones in this cell.

Definition at line 39 of file HGridCell.h.

References hGridLevel_, hGridX_, hGridY_, and hGridZ_.

Referenced by Mercury3D::computeWallForces(), Mercury2D::hGridFindContactsWithTargetCell(), Mercury3D::hGridFindContactsWithTargetCell(), Mercury2D::hGridFindParticleContacts(), Mercury3D::hGridFindParticleContacts(), Mercury2D::hGridFindParticlesWithTargetCell(), Mercury3D::hGridFindParticlesWithTargetCell(), Mercury3D::hGridHasContactsInTargetCell(), and operator==().

40  {
41  return (x == hGridX_ && y == hGridY_ && z == hGridZ_ && level == hGridLevel_);
42  }
int hGridZ_
Definition: HGridCell.h:99
int hGridY_
Definition: HGridCell.h:99
int hGridX_
Cell position in the grid.
Definition: HGridCell.h:99
unsigned int hGridLevel_
HGrid-level of the particle containing this cell.
Definition: HGridCell.h:101
bool HGridCell::equals ( int  x,
int  y,
unsigned int  level 
) const
inline

Checks if the given (x,y,z,level) is the same as the ones in this cell, 2D version.

Definition at line 45 of file HGridCell.h.

References hGridLevel_, hGridX_, and hGridY_.

46  {
47  return (x == hGridX_ && y == hGridY_ && level == hGridLevel_);
48  }
int hGridY_
Definition: HGridCell.h:99
int hGridX_
Cell position in the grid.
Definition: HGridCell.h:99
unsigned int hGridLevel_
HGrid-level of the particle containing this cell.
Definition: HGridCell.h:101
unsigned int HGridCell::getHGridLevel ( ) const
inline

Definition at line 86 of file HGridCell.h.

References hGridLevel_.

Referenced by HGrid::computeHashBucketIndex(), BaseParticle::getHGridLevel(), and BaseParticle::printHGrid().

87  {
88  return hGridLevel_;
89  }
unsigned int hGridLevel_
HGrid-level of the particle containing this cell.
Definition: HGridCell.h:101
int HGridCell::getHGridX ( ) const
inline

Definition at line 56 of file HGridCell.h.

References hGridX_.

Referenced by HGrid::computeHashBucketIndex(), BaseParticle::getHGridX(), and BaseParticle::printHGrid().

57  {
58  return hGridX_;
59  }
int hGridX_
Cell position in the grid.
Definition: HGridCell.h:99
int HGridCell::getHGridY ( ) const
inline

Definition at line 66 of file HGridCell.h.

References hGridY_.

Referenced by HGrid::computeHashBucketIndex(), BaseParticle::getHGridY(), and BaseParticle::printHGrid().

67  {
68  return hGridY_;
69  }
int hGridY_
Definition: HGridCell.h:99
int HGridCell::getHGridZ ( ) const
inline

Definition at line 76 of file HGridCell.h.

References hGridZ_.

Referenced by HGrid::computeHashBucketIndex(), BaseParticle::getHGridZ(), and BaseParticle::printHGrid().

77  {
78  return hGridZ_;
79  }
int hGridZ_
Definition: HGridCell.h:99
bool HGridCell::operator== ( const HGridCell other) const
inline

Checks if the given cell is the same as the given cell.

Definition at line 51 of file HGridCell.h.

References equals(), hGridLevel_, hGridX_, hGridY_, and hGridZ_.

52  {
53  return equals(other.hGridX_, other.hGridY_, other.hGridZ_, other.hGridLevel_);
54  }
bool equals(int x, int y, int z, unsigned int level) const
Checks if the given (x,y,z,level) is the same as the ones in this cell.
Definition: HGridCell.h:39
int hGridZ_
Definition: HGridCell.h:99
int hGridY_
Definition: HGridCell.h:99
int hGridX_
Cell position in the grid.
Definition: HGridCell.h:99
unsigned int hGridLevel_
HGrid-level of the particle containing this cell.
Definition: HGridCell.h:101
void HGridCell::setHGridLevel ( unsigned int  HGridLevel)
inline

Definition at line 91 of file HGridCell.h.

References hGridLevel_.

Referenced by BaseParticle::BaseParticle(), and BaseParticle::setHGridLevel().

92  {
93  hGridLevel_ = HGridLevel;
94  }
unsigned int hGridLevel_
HGrid-level of the particle containing this cell.
Definition: HGridCell.h:101
void HGridCell::setHGridX ( int  HGridX)
inline

Definition at line 61 of file HGridCell.h.

References hGridX_.

Referenced by BaseParticle::BaseParticle(), and BaseParticle::setHGridX().

62  {
63  hGridX_ = HGridX;
64  }
int hGridX_
Cell position in the grid.
Definition: HGridCell.h:99
void HGridCell::setHGridY ( int  HGridY)
inline

Definition at line 71 of file HGridCell.h.

References hGridY_.

Referenced by BaseParticle::BaseParticle(), and BaseParticle::setHGridY().

72  {
73  hGridY_ = HGridY;
74  }
int hGridY_
Definition: HGridCell.h:99
void HGridCell::setHGridZ ( int  HGridZ)
inline

Definition at line 81 of file HGridCell.h.

References hGridZ_.

Referenced by BaseParticle::BaseParticle(), and BaseParticle::setHGridZ().

82  {
83  hGridZ_ = HGridZ;
84  }
int hGridZ_
Definition: HGridCell.h:99

Member Data Documentation

unsigned int HGridCell::hGridLevel_
private

HGrid-level of the particle containing this cell.

Definition at line 101 of file HGridCell.h.

Referenced by equals(), getHGridLevel(), operator==(), and setHGridLevel().

int HGridCell::hGridX_
private

Cell position in the grid.

Definition at line 99 of file HGridCell.h.

Referenced by equals(), getHGridX(), operator==(), and setHGridX().

int HGridCell::hGridY_
private

Definition at line 99 of file HGridCell.h.

Referenced by equals(), getHGridY(), operator==(), and setHGridY().

int HGridCell::hGridZ_
private

Definition at line 99 of file HGridCell.h.

Referenced by equals(), getHGridZ(), operator==(), and setHGridZ().


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