#include <geometry.h>
Public Member Functions | |
IntSize (int xx=0, int yy=0, int zz=0) | |
Construct an IntSize object. | |
int | get_ndim () const |
Get its dimension, 1D, 2D, or 3D. | |
int | operator[] (int i) const |
Get the ith direction's size. | |
int & | operator[] (int i) |
Get the ith direction's size. | |
Private Attributes | |
int | data [3] |
Definition at line 52 of file geometry.h.
EMAN::IntSize::IntSize | ( | int | xx = 0 , |
|
int | yy = 0 , |
|||
int | zz = 0 | |||
) | [inline, explicit] |
int EMAN::IntSize::get_ndim | ( | ) | const [inline] |
Get its dimension, 1D, 2D, or 3D.
Definition at line 72 of file geometry.h.
References data.
00073 { 00074 if (data[2] > 1) { 00075 return 3; 00076 } 00077 else if (data[1] > 1) { 00078 return 2; 00079 } 00080 return 1; 00081 }
int& EMAN::IntSize::operator[] | ( | int | i | ) | [inline] |
Get the ith direction's size.
Used as a lvalue.
i | The ith direction, with 0 is x, 1 is y, 2 is z. |
Definition at line 96 of file geometry.h.
References data.
00097 { 00098 return data[i]; 00099 }
int EMAN::IntSize::operator[] | ( | int | i | ) | const [inline] |
Get the ith direction's size.
Used as a rvalue.
i | The ith direction, with 0 is x, 1 is y, 2 is z. |
Definition at line 87 of file geometry.h.
References data.
00088 { 00089 return data[i]; 00090 }
int EMAN::IntSize::data[3] [private] |