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.

00201                 {
00202                         data[0] = 0;
00203                         data[1] = 0;
00204                         data[2] = 0;
00205                         ndim = 0;
00206                 }

EMAN::IntPoint::IntPoint ( int  xx  )  [inline, explicit]

Construct a 1D point.

Parameters:
xx The x coordinate value.

Definition at line 211 of file geometry.h.

References data, and ndim.

00212                 {
00213                         data[0] = xx;
00214                         data[1] = 0;
00215                         data[2] = 0;
00216                         ndim = 1;
00217                 }

EMAN::IntPoint::IntPoint ( int  xx,
int  yy 
) [inline]

Construct a 2D point.

Parameters:
xx The x coordinate value.
yy The y coordinate value.

Definition at line 223 of file geometry.h.

References data, and ndim.

00224                 {
00225                         data[0] = xx;
00226                         data[1] = yy;
00227                         data[2] = 0;
00228                         ndim = 2;
00229                 }

EMAN::IntPoint::IntPoint ( int  xx,
int  yy,
int  zz 
) [inline]

Construct a 3D point.

Parameters:
xx The x coordinate value.
yy The y coordinate value.
zz The z coordinate value.

Definition at line 236 of file geometry.h.

References data, and ndim.

00237                 {
00238                         data[0] = xx;
00239                         data[1] = yy;
00240                         data[2] = zz;
00241                         ndim = 3;
00242                 }


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.

00248                 {
00249                         return ndim;
00250                 }

int& EMAN::IntPoint::operator[] ( int  i  )  [inline]

Get the ith direction's coordinate.

Used as a lvalue.

Parameters:
i The 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.

00266                 {
00267                         return data[i];
00268                 }

int EMAN::IntPoint::operator[] ( int  i  )  const [inline]

Get the ith direction's coordinate.

Used as a rvalue.

Parameters:
i The 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.

00257                 {
00258                         return data[i];
00259                 }


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:
Generated on Tue Jun 11 12:43:13 2013 for EMAN2 by  doxygen 1.4.7