EMAN2
Public Member Functions | Private Attributes
EMAN::IntSize Class Reference

IntSize is used to describe a 1D, 2D or 3D rectangular size in integers. More...

#include <geometry.h>

List of all members.

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]

Detailed Description

IntSize is used to describe a 1D, 2D or 3D rectangular size in integers.

Definition at line 52 of file geometry.h.


Constructor & Destructor Documentation

EMAN::IntSize::IntSize ( int  xx = 0,
int  yy = 0,
int  zz = 0 
) [inline, explicit]

Construct an IntSize object.

Parameters:
xxThe x direction size. Default is 0.
yyThe y direction size. Default is 0.
zzThe z direction size. Default is 0.

Definition at line 61 of file geometry.h.

References data.

                {
                        data[0] = xx;
                        data[1] = yy;
                        data[2] = zz;
                }

Member Function Documentation

int EMAN::IntSize::get_ndim ( ) const [inline]

Get its dimension, 1D, 2D, or 3D.

Returns:
The dimension.

Definition at line 72 of file geometry.h.

References data.

                {
                        if (data[2] > 1) {
                                return 3;
                        }
                        else if (data[1] > 1) {
                                return 2;
                        }
                        return 1;
                }
int& EMAN::IntSize::operator[] ( int  i) [inline]

Get the ith direction's size.

Used as a lvalue.

Parameters:
iThe ith direction, with 0 is x, 1 is y, 2 is z.
Returns:
The ith direction's size.

Definition at line 96 of file geometry.h.

References data.

                {
                        return data[i];
                }
int EMAN::IntSize::operator[] ( int  i) const [inline]

Get the ith direction's size.

Used as a rvalue.

Parameters:
iThe ith direction, with 0 is x, 1 is y, 2 is z.
Returns:
The ith direction's size.

Definition at line 87 of file geometry.h.

References data.

                {
                        return data[i];
                }

Member Data Documentation

int EMAN::IntSize::data[3] [private]

Definition at line 102 of file geometry.h.

Referenced by get_ndim(), IntSize(), and operator[]().


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