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

mlib::Point3i Class Reference
[MLIB]

A 3D point class with integer components. More...

#include <point3i.H>

List of all members.

Descriptive interface

typedef int value_type
static int dim ()

Public Member Functions

Constructors
 Point3i ()
 Default constructor. Creates a point at the origin.
 Point3i (int x, int y, int z)
 Constructor that creates a point with the components given in the arguments.
 Point3i (int *v)
 Constructor that creates a point with the values from a 3-element array.
Element Access Functions
const int * data () const
 Returns the components as a 3-element array of integers.
int operator[] (int index) const
int & operator[] (int index)
Overloaded Arithmetic Operators
Point3i operator+ (Cpoint3i &p) const
Point3i operator- () const
void operator+= (Cpoint3i &p)
void operator-= (Cpoint3i &p)
Point Property Queries
double length () const
int length_sqrd () const
Two Point Operations
int dist_sqrd (Cpoint3i &p) const
 Computes the distance squared between two points.
double dist (Cpoint3i &p) const
 Computes the distance between two points.
Overloaded Comparison Operators
int operator== (Cpoint3i &p) const
 Are the two points exactly equal?
int operator!= (Cpoint3i &p) const
 Are the two points not equal?

Protected Attributes

int _x
int _y
int _z

Friends

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

Related Functions

(Note that these are not member functions.)

typedef const Point3i Cpoint3i
 Shortcut for const Point3i.


Detailed Description

A 3D point class with integer components.

Definition at line 27 of file point3i.H.


Member Typedef Documentation

typedef int mlib::Point3i::value_type
 

Definition at line 58 of file point3i.H.


Constructor & Destructor Documentation

mlib::Point3i::Point3i  )  [inline]
 

Default constructor. Creates a point at the origin.

Definition at line 40 of file point3i.H.

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

mlib::Point3i::Point3i int  x,
int  y,
int  z
[inline]
 

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

Definition at line 44 of file point3i.H.

mlib::Point3i::Point3i int *  v  )  [inline]
 

Constructor that creates a point with the values from a 3-element array.

Definition at line 48 of file point3i.H.


Member Function Documentation

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

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

Definition at line 67 of file point3i.H.

References _x.

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

Definition at line 59 of file point3i.H.

double mlib::Point3i::dist Cpoint3i p  )  const [inline]
 

Computes the distance between two points.

Definition at line 110 of file point3i.H.

References dist_sqrd().

int mlib::Point3i::dist_sqrd Cpoint3i p  )  const [inline]
 

Computes the distance squared between two points.

Definition at line 104 of file point3i.H.

References _x, _y, and _z.

Referenced by dist().

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

Definition at line 93 of file point3i.H.

References _x, _y, and _z.

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

Definition at line 95 of file point3i.H.

References _x, _y, and _z.

int mlib::Point3i::operator!= Cpoint3i p  )  const [inline]
 

Are the two points not equal?

Definition at line 123 of file point3i.H.

References _x, _y, and _z.

Point3i mlib::Point3i::operator+ Cpoint3i p  )  const [inline]
 

Definition at line 77 of file point3i.H.

References _x, _y, _z, and Point3i().

void mlib::Point3i::operator+= Cpoint3i p  )  [inline]
 

Definition at line 83 of file point3i.H.

References _x, _y, and _z.

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

Definition at line 81 of file point3i.H.

References _x, _y, _z, and Point3i().

void mlib::Point3i::operator-= Cpoint3i p  )  [inline]
 

Definition at line 85 of file point3i.H.

References _x, _y, and _z.

int mlib::Point3i::operator== Cpoint3i p  )  const [inline]
 

Are the two points exactly equal?

Definition at line 119 of file point3i.H.

References _x, _y, and _z.

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

Definition at line 70 of file point3i.H.

References _x.

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

Definition at line 69 of file point3i.H.

References _x.


Friends And Related Function Documentation

typedef const Point3i Cpoint3i [related]
 

Shortcut for const Point3i.

Definition at line 16 of file point3i.H.

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

Stream insertion operator for the Point3i class.

Definition at line 132 of file point3i.H.


Member Data Documentation

int mlib::Point3i::_x [protected]
 

Definition at line 32 of file point3i.H.

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

int mlib::Point3i::_y [protected]
 

Definition at line 32 of file point3i.H.

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

int mlib::Point3i::_z [protected]
 

Definition at line 32 of file point3i.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