EMAN::ScreenVector Class Reference

#include <vecmath.h>

List of all members.

Public Member Functions

 ScreenVector ()
 ScreenVector (const ScreenVector &v)
 ScreenVector (int _x, int _y)
ScreenVectoroperator= (const ScreenVector &a)
const int & operator[] (int n) const
int & operator[] (int n)
ScreenVectoroperator+= (const ScreenVector &a)
ScreenVectoroperator-= (const ScreenVector &a)
ScreenVectoroperator *= (int s)
ScreenVector operator- () const
ScreenVector operator+ () const
ScreenVector operator+ (const ScreenVector &v) const
ScreenVector operator- (const ScreenVector &v) const
ScreenVector operator * (const double s) const
int operator * (const ScreenVector &v) const
double length () const
int lengthSquared () const
bool operator== (const ScreenVector &v) const
bool operator!= (const ScreenVector &v) const
void print () const

Private Attributes

int x
int y


Detailed Description

Definition at line 55 of file vecmath.h.


Constructor & Destructor Documentation

EMAN::ScreenVector::ScreenVector (  )  [inline]

Definition at line 57 of file vecmath.h.

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

00057 : x(0), y(0) {}

EMAN::ScreenVector::ScreenVector ( const ScreenVector v  )  [inline]

Definition at line 58 of file vecmath.h.

00058 : x(v[0]), y(v[1]) {}

EMAN::ScreenVector::ScreenVector ( int  _x,
int  _y 
) [inline]

Definition at line 59 of file vecmath.h.

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


Member Function Documentation

double EMAN::ScreenVector::length (  )  const [inline]

Definition at line 109 of file vecmath.h.

References sqrt(), x, and y.

00109                                   {
00110                 return (double) sqrt( (double) (x * x + y * y) );
00111             }

int EMAN::ScreenVector::lengthSquared (  )  const [inline]

Definition at line 113 of file vecmath.h.

References x, and y.

00113                                       {
00114                 return x * x + y * y;
00115             }

int EMAN::ScreenVector::operator * ( const ScreenVector v  )  const [inline]

Definition at line 105 of file vecmath.h.

References v, x, and y.

00105                                                          {
00106                 return x * v.x + y * v.y;
00107             }

ScreenVector EMAN::ScreenVector::operator * ( const double  s  )  const [inline]

Definition at line 100 of file vecmath.h.

References ScreenVector(), x, and y.

00100                                                            {
00101                 return ScreenVector( (int)(x * s), (int)(y * s) );
00102             }

ScreenVector& EMAN::ScreenVector::operator *= ( int  s  )  [inline]

Definition at line 79 of file vecmath.h.

References x, and y.

00079                                             {
00080                 x *= s; y *= s;
00081                 return *this;
00082             }

bool EMAN::ScreenVector::operator!= ( const ScreenVector v  )  const [inline]

Definition at line 121 of file vecmath.h.

References v, x, and y.

00121                                                            {
00122                 return x != v.x || y != v.y;
00123             }

ScreenVector EMAN::ScreenVector::operator+ ( const ScreenVector v  )  const [inline]

Definition at line 92 of file vecmath.h.

References ScreenVector(), v, x, and y.

00092                                                                   {
00093                 return ScreenVector( x + v.x, y + v.y );
00094             }

ScreenVector EMAN::ScreenVector::operator+ (  )  const [inline]

Definition at line 88 of file vecmath.h.

00088                                            {
00089                 return *this;
00090             }

ScreenVector& EMAN::ScreenVector::operator+= ( const ScreenVector a  )  [inline]

Definition at line 69 of file vecmath.h.

References x, and y.

00069                                                             {
00070                 x += a[0]; y += a[1];
00071                 return *this;
00072             }

ScreenVector EMAN::ScreenVector::operator- ( const ScreenVector v  )  const [inline]

Definition at line 96 of file vecmath.h.

References ScreenVector(), v, x, and y.

00096                                                                   {
00097                 return ScreenVector( x - v.x, y - v.y );
00098             }

ScreenVector EMAN::ScreenVector::operator- (  )  const [inline]

Definition at line 84 of file vecmath.h.

References ScreenVector(), x, and y.

00084                                            {
00085                 return ScreenVector(-x, -y);
00086             }

ScreenVector& EMAN::ScreenVector::operator-= ( const ScreenVector a  )  [inline]

Definition at line 74 of file vecmath.h.

References x, and y.

00074                                                             {
00075                 x -= a[0]; y -= a[1];
00076                 return *this;
00077             }

ScreenVector& EMAN::ScreenVector::operator= ( const ScreenVector a  )  [inline]

Definition at line 61 of file vecmath.h.

References x, and y.

00061                                                            {
00062                 x = a[0]; y = a[1];
00063                 return *this;
00064             }

bool EMAN::ScreenVector::operator== ( const ScreenVector v  )  const [inline]

Definition at line 117 of file vecmath.h.

References v, x, and y.

00117                                                            {
00118                 return x == v.x && y == v.y;
00119             }

int& EMAN::ScreenVector::operator[] ( int  n  )  [inline]

Definition at line 67 of file vecmath.h.

References x.

00067 { return (&x)[n]; }

const int& EMAN::ScreenVector::operator[] ( int  n  )  const [inline]

Definition at line 66 of file vecmath.h.

References x.

00066 { return (&x)[n]; }

void EMAN::ScreenVector::print (  )  const [inline]

Definition at line 125 of file vecmath.h.

References x, and y.

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


Member Data Documentation

int EMAN::ScreenVector::x [private]

Definition at line 130 of file vecmath.h.

Referenced by length(), lengthSquared(), operator *(), operator *=(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator==(), operator[](), and print().

int EMAN::ScreenVector::y [private]

Definition at line 130 of file vecmath.h.

Referenced by length(), lengthSquared(), operator *(), operator *=(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator==(), and print().


The documentation for this class was generated from the following file:
Generated on Tue Jun 11 12:45:36 2013 for EMAN2 by  doxygen 1.4.7