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

mlib::Point2i Class Reference
[MLIB]

A 2D point 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
 Point2i ()
 Default Constructor. Creates a point at the origin.
 Point2i (int xx, int yy)
 Constructor that creates a point with the components specified in the arguments.
Element Access Functions
const int * data () const
 Returns the components as a 2-element array of integers.
int operator[] (int index) const
int & operator[] (int index)
Overloaded Arithmetic Operators
Point2i operator+ (Cpoint2i &p) const
Point2i operator+ (Cvec2i &v) const
Vec2i operator- (Cpoint2i &p) const
Point2i operator- (Cvec2i &v) const
Point2i operator- () const
void operator+= (Cpoint2i &p)
void operator+= (Cvec2i &v)
void operator-= (Cpoint2i &p)
void operator-= (Cvec2i &v)
Point Property Queries
double length () const
int length_sqrd () const
Two Point Operations
int dist_sqrd (Cpoint2i &p) const
 Computes the distance squared between two points.
double dist (Cpoint2i &p) const
 Computes the distance between two points.
Overloaded Comparison Operators
int operator== (Cpoint2i &p) const
 Are the two points exactly equal?
int operator!= (Cpoint2i &p) const
 Are the two points not equal?

Protected Attributes

int _x
int _y

Friends

Overloaded Stream Operators
ostream & operator<< (ostream &os, const Point2i &p)
 Stream insertion operator for Point2i class.

Related Functions

(Note that these are not member functions.)

typedef const Point2i Cpoint2i
 Shortcut for const Point2i.


Detailed Description

A 2D point class with integer components.

Definition at line 145 of file point2i.H.


Member Typedef Documentation

typedef int mlib::Point2i::value_type
 

Definition at line 172 of file point2i.H.


Constructor & Destructor Documentation

mlib::Point2i::Point2i  )  [inline]
 

Default Constructor. Creates a point at the origin.

Definition at line 158 of file point2i.H.

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

mlib::Point2i::Point2i int  xx,
int  yy
[inline]
 

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

Definition at line 162 of file point2i.H.


Member Function Documentation

const int* mlib::Point2i::data  )  const [inline]
 

Returns the components as a 2-element array of integers.

Definition at line 181 of file point2i.H.

References _x.

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

Definition at line 173 of file point2i.H.

double mlib::Point2i::dist Cpoint2i p  )  const [inline]
 

Computes the distance between two points.

Definition at line 219 of file point2i.H.

References dist_sqrd().

Referenced by IDRefImage::search().

int mlib::Point2i::dist_sqrd Cpoint2i p  )  const [inline]
 

Computes the distance squared between two points.

Definition at line 216 of file point2i.H.

References _x, and _y.

Referenced by dist().

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

Definition at line 207 of file point2i.H.

References _x, and _y.

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

Definition at line 208 of file point2i.H.

References _x, and _y.

int mlib::Point2i::operator!= Cpoint2i p  )  const [inline]
 

Are the two points not equal?

Definition at line 230 of file point2i.H.

References _x, and _y.

Point2i mlib::Point2i::operator+ Cvec2i &  v  )  const [inline]
 

Definition at line 192 of file point2i.H.

References _x, _y, and Point2i().

Point2i mlib::Point2i::operator+ Cpoint2i p  )  const [inline]
 

Definition at line 191 of file point2i.H.

References _x, _y, and Point2i().

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

Definition at line 198 of file point2i.H.

References _x, and _y.

void mlib::Point2i::operator+= Cpoint2i p  )  [inline]
 

Definition at line 197 of file point2i.H.

References _x, and _y.

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

Definition at line 195 of file point2i.H.

References _x, _y, and Point2i().

Point2i mlib::Point2i::operator- Cvec2i &  v  )  const [inline]
 

Definition at line 194 of file point2i.H.

References _x, _y, and Point2i().

Vec2i mlib::Point2i::operator- Cpoint2i p  )  const [inline]
 

Definition at line 193 of file point2i.H.

References _x, and _y.

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

Definition at line 200 of file point2i.H.

References _x, and _y.

void mlib::Point2i::operator-= Cpoint2i p  )  [inline]
 

Definition at line 199 of file point2i.H.

References _x, and _y.

int mlib::Point2i::operator== Cpoint2i p  )  const [inline]
 

Are the two points exactly equal?

Definition at line 228 of file point2i.H.

References _x, and _y.

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

Definition at line 184 of file point2i.H.

References _x.

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

Definition at line 183 of file point2i.H.

References _x.


Friends And Related Function Documentation

typedef const Point2i Cpoint2i [related]
 

Shortcut for const Point2i.

Definition at line 134 of file point2i.H.

ostream& operator<< ostream &  os,
const Point2i p
[friend]
 

Stream insertion operator for Point2i class.

Definition at line 238 of file point2i.H.


Member Data Documentation

int mlib::Point2i::_x [protected]
 

Definition at line 150 of file point2i.H.

Referenced by data(), dist_sqrd(), length(), length_sqrd(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator==(), and operator[]().

int mlib::Point2i::_y [protected]
 

Definition at line 150 of file point2i.H.

Referenced by dist_sqrd(), length(), length_sqrd(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), and operator==().


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