OpenStructure
Public Member Functions
Size Class Reference

#include <size.hh>

Public Member Functions

 Size ()
 
 Size (const Size &s)
 
 Size (unsigned int w)
 
 Size (unsigned int w, unsigned int h)
 
 Size (unsigned int w, unsigned int h, unsigned int d)
 
 Size (const Point &p1, const Point &p2)
 
Point GetHalf () const
 
unsigned int GetWidth () const
 
unsigned int GetHeight () const
 
unsigned int GetDepth () const
 
unsigned int GetSlab () const
 
unsigned int GetVol () const
 
unsigned int GetVolume () const
 
unsigned int GetDim () const
 
Sizeoperator= (const Size &s)
 
unsigned int operator[] (unsigned int index) const
 
unsigned int & operator[] (unsigned int index)
 
bool operator== (const Size &s) const
 
bool operator!= (const Size &s) const
 
Sizeoperator+= (const Size &s)
 
Sizeoperator-= (const Size &s)
 

Detailed Description

class encapsulating 1D to 3D size

Definition at line 39 of file size.hh.

Constructor & Destructor Documentation

◆ Size() [1/6]

Size ( )

◆ Size() [2/6]

Size ( const Size s)

◆ Size() [3/6]

Size ( unsigned int  w)
explicit

1D constructor

◆ Size() [4/6]

Size ( unsigned int  w,
unsigned int  h 
)
explicit

2D constructor

◆ Size() [5/6]

Size ( unsigned int  w,
unsigned int  h,
unsigned int  d 
)
explicit

3D constructor

◆ Size() [6/6]

Size ( const Point p1,
const Point p2 
)

initialize from two points

Member Function Documentation

◆ GetDepth()

unsigned int GetDepth ( ) const

get depth component (convenience to index 2)

◆ GetDim()

unsigned int GetDim ( ) const

return dimensionality (1-3)

◆ GetHalf()

Point GetHalf ( ) const

return the point at half the size

for even dimension, its N/2-1, for odd dimension its (N-1)/2

◆ GetHeight()

unsigned int GetHeight ( ) const

get height component (convenience to index 1)

◆ GetSlab()

unsigned int GetSlab ( ) const

get area (width * height)

◆ GetVol()

unsigned int GetVol ( ) const

get volume (depcrecated, use GetVolume() instead)

◆ GetVolume()

unsigned int GetVolume ( ) const

get volume

◆ GetWidth()

unsigned int GetWidth ( ) const

get width component (convenience to index 0)

◆ operator!=()

bool operator!= ( const Size s) const

◆ operator+=()

Size& operator+= ( const Size s)

◆ operator-=()

Size& operator-= ( const Size s)

◆ operator=()

Size& operator= ( const Size s)

◆ operator==()

bool operator== ( const Size s) const

◆ operator[]() [1/2]

unsigned int& operator[] ( unsigned int  index)

◆ operator[]() [2/2]

unsigned int operator[] ( unsigned int  index) const

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