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

IntPoint defines an integer-coordinate point in a 1D/2D/3D space. More...

#include <geometry.h>

List of all members.

Public Member Functions

 IntPoint ()
 Construct a point at the origin location.
 IntPoint (int xx)
 Construct a 1D point.
 IntPoint (int xx, int yy)
 Construct a 2D point.
 IntPoint (int xx, int yy, int zz)
 Construct a 3D point.
int get_ndim () const
 Get the dimension of the point, 1D/2D/3D.
int operator[] (int i) const
 Get the ith direction's coordinate.
int & operator[] (int i)
 Get the ith direction's coordinate.

Private Attributes

int data [3]
int ndim

Detailed Description

IntPoint defines an integer-coordinate point in a 1D/2D/3D space.

Definition at line 196 of file geometry.h.


Constructor & Destructor Documentation

EMAN::IntPoint::IntPoint ( ) [inline]

Construct a point at the origin location.

Definition at line 200 of file geometry.h.

References data, and ndim.

                {
                        data[0] = 0;
                        data[1] = 0;
                        data[2] = 0;
                        ndim = 0;
                }
EMAN::IntPoint::IntPoint ( int  xx) [inline, explicit]

Construct a 1D point.

Parameters:
xxThe x coordinate value.

Definition at line 211 of file geometry.h.

References data, and ndim.

                {
                        data[0] = xx;
                        data[1] = 0;
                        data[2] = 0;
                        ndim = 1;
                }
EMAN::IntPoint::IntPoint ( int  xx,
int  yy 
) [inline]

Construct a 2D point.

Parameters:
xxThe x coordinate value.
yyThe y coordinate value.

Definition at line 223 of file geometry.h.

References data, and ndim.

                {
                        data[0] = xx;
                        data[1] = yy;
                        data[2] = 0;
                        ndim = 2;
                }
EMAN::IntPoint::IntPoint ( int  xx,
int  yy,
int  zz 
) [inline]

Construct a 3D point.

Parameters:
xxThe x coordinate value.
yyThe y coordinate value.
zzThe z coordinate value.

Definition at line 236 of file geometry.h.

References data, and ndim.

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

Member Function Documentation

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

Get the dimension of the point, 1D/2D/3D.

Returns:
The dimension of the point.

Definition at line 247 of file geometry.h.

References ndim.

                {
                        return ndim;
                }
int& EMAN::IntPoint::operator[] ( int  i) [inline]

Get the ith direction's coordinate.

Used as a lvalue.

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

Definition at line 265 of file geometry.h.

References data.

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

Get the ith direction's coordinate.

Used as a rvalue.

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

Definition at line 256 of file geometry.h.

References data.

                {
                        return data[i];
                }

Member Data Documentation

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

Definition at line 271 of file geometry.h.

Referenced by IntPoint(), and operator[]().

int EMAN::IntPoint::ndim [private]

Definition at line 272 of file geometry.h.

Referenced by get_ndim(), and IntPoint().


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