EMAN2
Public Member Functions | Private Attributes | List of all members
EMAN::ScreenPoint Class Reference

#include <vecmath.h>

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 139 of file vecmath.h.

Constructor & Destructor Documentation

◆ ScreenPoint() [1/3]

EMAN::ScreenPoint::ScreenPoint ( )
inline

Definition at line 141 of file vecmath.h.

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

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

◆ ScreenPoint() [2/3]

EMAN::ScreenPoint::ScreenPoint ( const ScreenPoint p)
inline

Definition at line 142 of file vecmath.h.

142: x(p[0]), y(p[1]) {}

◆ ScreenPoint() [3/3]

EMAN::ScreenPoint::ScreenPoint ( int  _x,
int  _y 
)
inline

Definition at line 143 of file vecmath.h.

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

Member Function Documentation

◆ operator!=()

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

Definition at line 184 of file vecmath.h.

184 {
185 return x != p.x || y != p.y;
186 }

References x, and y.

◆ operator*=()

ScreenPoint & EMAN::ScreenPoint::operator*= ( int  s)
inline

Definition at line 163 of file vecmath.h.

163 {
164 x *= s; y *= s;
165 return *this;
166 }

References x, and y.

◆ operator+()

ScreenPoint EMAN::ScreenPoint::operator+ ( const ScreenVector v) const
inline

Definition at line 168 of file vecmath.h.

168 {
169 return ScreenPoint( x + v[0], y + v[1] );
170 }

References ScreenPoint(), x, and y.

◆ operator+=()

ScreenPoint & EMAN::ScreenPoint::operator+= ( const ScreenVector v)
inline

Definition at line 153 of file vecmath.h.

153 {
154 x += v[0]; y += v[1];
155 return *this;
156 }

References x, and y.

◆ operator-() [1/2]

ScreenVector EMAN::ScreenPoint::operator- ( const ScreenPoint p) const
inline

Definition at line 172 of file vecmath.h.

172 {
173 return ScreenVector( x - p.x, y - p.y );
174 }

References x, and y.

◆ operator-() [2/2]

ScreenPoint EMAN::ScreenPoint::operator- ( const ScreenVector v) const
inline

Definition at line 176 of file vecmath.h.

176 {
177 return ScreenPoint( x - v[0], y - v[1] );
178 }

References ScreenPoint(), x, and y.

◆ operator-=()

ScreenPoint & EMAN::ScreenPoint::operator-= ( const ScreenVector v)
inline

Definition at line 158 of file vecmath.h.

158 {
159 x -= v[0]; y -= v[1];
160 return *this;
161 }

References x, and y.

◆ operator=()

ScreenPoint & EMAN::ScreenPoint::operator= ( const ScreenPoint a)
inline

Definition at line 145 of file vecmath.h.

145 {
146 x = a[0]; y = a[1];
147 return *this;
148 }

References x, and y.

◆ operator==()

bool EMAN::ScreenPoint::operator== ( const ScreenPoint p) const
inline

Definition at line 180 of file vecmath.h.

180 {
181 return x == p.x && y == p.y;
182 }

References x, and y.

◆ operator[]() [1/2]

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

Definition at line 151 of file vecmath.h.

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

References x.

◆ operator[]() [2/2]

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

Definition at line 150 of file vecmath.h.

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

References x.

◆ print()

void EMAN::ScreenPoint::print ( ) const
inline

Definition at line 188 of file vecmath.h.

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

References x, and y.

Member Data Documentation

◆ x

int EMAN::ScreenPoint::x
private

◆ y

int EMAN::ScreenPoint::y
private

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