Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

mlib::Vec2i Class Reference
[MLIB]

A 2D vector class with integer components. More...

#include <point2i.H>

List of all members.

Descriptive interface

typedef int value_type
static int dim ()

Public Member Functions

Constructors
 Vec2i ()
 Default Constructor. Creates a zero vector.
 Vec2i (int x, int y)
 Constructor that creates a vector with the components specified in the arguments.
Overloaded Arithmetic Operators
Vec2i operator+ (Cvec2i &v) const
Vec2i operator- (Cvec2i &v) const
int operator * (Cvec2i &v) const
Vec2i operator- () const
void operator+= (Cvec2i &v)
void operator-= (Cvec2i &v)
Element Access Functions
int operator[] (int index) const
int & operator[] (int index)
Vector Property Queries
double length () const
int length_sqrd () const
int is_null () const
 Are the vector's components both equal to zero?
Vector Operations
Vec2i perpend () const
Two Vector Operations
double dist (Cvec2i &v) const
 Computes the distance between two vectors treated as position vectors.
int dist_sqrd (Cvec2i &v) const
 Computes the distance squared between two vectors treated as position vectors.
Overloaded Comparison Operators
int operator== (Cvec2i &v) const
 Are the two vectors exactly equal?
int operator!= (Cvec2i &v) const
 Are the two vectors not equal?

Protected Attributes

int _x
int _y

Friends

Overloaded Stream Operators
ostream & operator<< (ostream &os, Cvec2i &v)
 Stream insertion operator for Vec2i class.

Related Functions

(Note that these are not member functions.)

typedef const Vec2i Cvec2i
 Shortcut for const Vec2i.


Detailed Description

A 2D vector class with integer components.

Definition at line 27 of file point2i.H.


Member Typedef Documentation

typedef int mlib::Vec2i::value_type
 

Definition at line 53 of file point2i.H.


Constructor & Destructor Documentation

mlib::Vec2i::Vec2i  )  [inline]
 

Default Constructor. Creates a zero vector.

Definition at line 40 of file point2i.H.

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

mlib::Vec2i::Vec2i int  x,
int  y
[inline]
 

Constructor that creates a vector with the components specified in the arguments.

Definition at line 44 of file point2i.H.


Member Function Documentation

static int mlib::Vec2i::dim  )  [inline, static]
 

Definition at line 54 of file point2i.H.

double mlib::Vec2i::dist Cvec2i v  )  const [inline]
 

Computes the distance between two vectors treated as position vectors.

Definition at line 102 of file point2i.H.

int mlib::Vec2i::dist_sqrd Cvec2i v  )  const [inline]
 

Computes the distance squared between two vectors treated as position vectors.

Definition at line 105 of file point2i.H.

int mlib::Vec2i::is_null  )  const [inline]
 

Are the vector's components both equal to zero?

Definition at line 86 of file point2i.H.

References _x, and _y.

double mlib::Vec2i::length  )  const [inline]
 

Definition at line 82 of file point2i.H.

References _x, and _y.

int mlib::Vec2i::length_sqrd  )  const [inline]
 

Definition at line 83 of file point2i.H.

References _x, and _y.

int mlib::Vec2i::operator * Cvec2i v  )  const [inline]
 

Definition at line 63 of file point2i.H.

References _x, and _y.

int mlib::Vec2i::operator!= Cvec2i v  )  const [inline]
 

Are the two vectors not equal?

Definition at line 115 of file point2i.H.

References _x, and _y.

Vec2i mlib::Vec2i::operator+ Cvec2i v  )  const [inline]
 

Definition at line 61 of file point2i.H.

References _x, _y, and Vec2i().

void mlib::Vec2i::operator+= Cvec2i v  )  [inline]
 

Definition at line 66 of file point2i.H.

References _x, and _y.

Vec2i mlib::Vec2i::operator-  )  const [inline]
 

Definition at line 64 of file point2i.H.

References _x, _y, and Vec2i().

Vec2i mlib::Vec2i::operator- Cvec2i v  )  const [inline]
 

Definition at line 62 of file point2i.H.

References _x, _y, and Vec2i().

void mlib::Vec2i::operator-= Cvec2i v  )  [inline]
 

Definition at line 67 of file point2i.H.

References _x, and _y.

int mlib::Vec2i::operator== Cvec2i v  )  const [inline]
 

Are the two vectors exactly equal?

Definition at line 113 of file point2i.H.

References _x, and _y.

int& mlib::Vec2i::operator[] int  index  )  [inline]
 

Definition at line 75 of file point2i.H.

References _x.

int mlib::Vec2i::operator[] int  index  )  const [inline]
 

Definition at line 74 of file point2i.H.

References _x.

Vec2i mlib::Vec2i::perpend  )  const [inline]
 

Definition at line 93 of file point2i.H.

References _x, _y, and Vec2i().


Friends And Related Function Documentation

typedef const Vec2i Cvec2i [related]
 

Shortcut for const Vec2i.

Definition at line 16 of file point2i.H.

ostream& operator<< ostream &  os,
Cvec2i v
[friend]
 

Stream insertion operator for Vec2i class.

Definition at line 123 of file point2i.H.


Member Data Documentation

int mlib::Vec2i::_x [protected]
 

Definition at line 32 of file point2i.H.

Referenced by is_null(), length(), length_sqrd(), operator *(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator==(), operator[](), and perpend().

int mlib::Vec2i::_y [protected]
 

Definition at line 32 of file point2i.H.

Referenced by is_null(), length(), length_sqrd(), operator *(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator==(), and perpend().


The documentation for this class was generated from the following file:
Generated on Mon Sep 18 11:48:11 2006 for jot by  doxygen 1.4.4