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

#include <vecmath.h>

List of all members.

Public Member Functions

 ScreenPoint ()
 ScreenPoint (const ScreenPoint &p)
 ScreenPoint (int _x, int _y)
ScreenPointoperator= (const ScreenPoint &a)
const int & operator[] (int n) const
int & operator[] (int n)
ScreenPointoperator+= (const ScreenVector &v)
ScreenPointoperator-= (const ScreenVector &v)
ScreenPointoperator*= (int s)
ScreenPoint operator+ (const ScreenVector &v) const
ScreenVector operator- (const ScreenPoint &p) const
ScreenPoint operator- (const ScreenVector &v) const
bool operator== (const ScreenPoint &p) const
bool operator!= (const ScreenPoint &p) const
void print () const

Private Attributes

int x
int y

Detailed Description

Definition at line 143 of file vecmath.h.


Constructor & Destructor Documentation

EMAN::ScreenPoint::ScreenPoint ( ) [inline]

Definition at line 145 of file vecmath.h.

Referenced by operator+(), and operator-().

: x(0), y(0) {}
EMAN::ScreenPoint::ScreenPoint ( const ScreenPoint p) [inline]

Definition at line 146 of file vecmath.h.

: x(p[0]), y(p[1]) {}
EMAN::ScreenPoint::ScreenPoint ( int  _x,
int  _y 
) [inline]

Definition at line 147 of file vecmath.h.

: x(_x), y(_y) {}

Member Function Documentation

bool EMAN::ScreenPoint::operator!= ( const ScreenPoint p) const [inline]

Definition at line 188 of file vecmath.h.

References x, and y.

                                                          {
                return x != p.x || y != p.y;
            }
ScreenPoint& EMAN::ScreenPoint::operator*= ( int  s) [inline]

Definition at line 167 of file vecmath.h.

References x, and y.

                                           {
                x *= s; y *= s;
                return *this;
            }
ScreenPoint EMAN::ScreenPoint::operator+ ( const ScreenVector v) const [inline]

Definition at line 172 of file vecmath.h.

References ScreenPoint(), x, and y.

                                                               {
                return ScreenPoint( x + v[0], y + v[1] );
            }
ScreenPoint& EMAN::ScreenPoint::operator+= ( const ScreenVector v) [inline]

Definition at line 157 of file vecmath.h.

References x, and y.

                                                           {
                x += v[0]; y += v[1];
                return *this;
            }
ScreenPoint EMAN::ScreenPoint::operator- ( const ScreenVector v) const [inline]

Definition at line 180 of file vecmath.h.

References ScreenPoint(), x, and y.

                                                               {
                return ScreenPoint( x - v[0], y - v[1] );
            }
ScreenVector EMAN::ScreenPoint::operator- ( const ScreenPoint p) const [inline]

Definition at line 176 of file vecmath.h.

References x, and y.

                                                               {
                return ScreenVector( x - p.x, y - p.y );
            }
ScreenPoint& EMAN::ScreenPoint::operator-= ( const ScreenVector v) [inline]

Definition at line 162 of file vecmath.h.

References x, and y.

                                                           {
                x -= v[0]; y -= v[1];
                return *this;
            }
ScreenPoint& EMAN::ScreenPoint::operator= ( const ScreenPoint a) [inline]

Definition at line 149 of file vecmath.h.

References x, and y.

                                                         {
                x = a[0]; y = a[1];
                return *this;
            }
bool EMAN::ScreenPoint::operator== ( const ScreenPoint p) const [inline]

Definition at line 184 of file vecmath.h.

References x, and y.

                                                          {
                return x == p.x && y == p.y;
            }
const int& EMAN::ScreenPoint::operator[] ( int  n) const [inline]

Definition at line 154 of file vecmath.h.

References x.

{ return (&x)[n]; }
int& EMAN::ScreenPoint::operator[] ( int  n) [inline]

Definition at line 155 of file vecmath.h.

References x.

{ return (&x)[n]; }
void EMAN::ScreenPoint::print ( ) const [inline]

Definition at line 192 of file vecmath.h.

References x, and y.

                               {
                std::cout << "(" << x << ", " << y << ")";
            }

Member Data Documentation

int EMAN::ScreenPoint::x [private]
int EMAN::ScreenPoint::y [private]

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