IPoint3 Class Reference

#include <ipoint3.h>

Class Description

See also
Class Point3.

Description:
This class describes a 3D point using integer x, y and z coordinates. Methods are provided to add and subtract points, multiply and divide by scalars, and element by element multiply and divide two points. All methods are implemented by the system.
Data Members:
int x,y,z;
+ Inheritance diagram for IPoint3:

Public Member Functions

 IPoint3 ()
 
 IPoint3 (int X, int Y, int Z)
 
 IPoint3 (const IPoint3 &a)
 
 IPoint3 (int ai[3])
 
intoperator[] (int i)
 
const intoperator[] (int i) const
 
 operator int * ()
 
IPoint3 operator- () const
 
IPoint3 operator+ () const
 
IPoint3operator-= (const IPoint3 &)
 
IPoint3operator+= (const IPoint3 &)
 
IPoint3 operator- (const IPoint3 &) const
 
IPoint3 operator+ (const IPoint3 &) const
 
int operator* (const IPoint3 &) const
 
int DotProd (const IPoint3 &) const
 
IPoint3 operator^ (const IPoint3 &) const
 
IPoint3 CrossProd (const IPoint3 &) const
 
int operator== (const IPoint3 &p) const
 
int operator!= (const IPoint3 &p) const
 

Public Attributes

int x
 
int y
 
int z
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 

Constructor & Destructor Documentation

IPoint3 ( )
inline
Remarks
Constructor. No initialization is performed.
35 {}
IPoint3 ( int  X,
int  Y,
int  Z 
)
inline
Remarks
Constructor. x, y, and z are initialized to the values specified.
38 { x = X; y = Y; z = Z; }
int y
Definition: ipoint3.h:31
int x
Definition: ipoint3.h:31
int z
Definition: ipoint3.h:31
IPoint3 ( const IPoint3 a)
inline
Remarks
Constructor. x, y, and z are initialized to the IPoint3 specified.
41 { x = a.x; y = a.y; z = a.z; }
int y
Definition: ipoint3.h:31
int x
Definition: ipoint3.h:31
int z
Definition: ipoint3.h:31
IPoint3 ( int  ai[3])
inline
Remarks
Constructor. x, y, and z are initialized to. ai[0], ai[1], and ai[2] respectively.
44 { x = ai[0]; y = ai[1]; z = ai[2]; }
int y
Definition: ipoint3.h:31
int x
Definition: ipoint3.h:31
int z
Definition: ipoint3.h:31

Member Function Documentation

int& operator[] ( int  i)
inline
Remarks
Allows access to x, y and z using the [ ] operator.
Returns
An index of 0 will return x, 1 will return y, 2 will return z.
49 { return (&x)[i]; }
int x
Definition: ipoint3.h:31
const int& operator[] ( int  i) const
inline
Remarks
Allows access to x, y and z using the [ ] operator.
Returns
An index of 0 will return x, 1 will return y, 2 will return z.
52 { return (&x)[i]; }
int x
Definition: ipoint3.h:31
operator int * ( )
inline
Remarks
Conversion function. Returns the address of the IPoint3.
56 { return(&x); }
int x
Definition: ipoint3.h:31
IPoint3 operator- ( ) const
inline
Remarks
Unary - operator. Negates x, y and z.
60 { return(IPoint3(-x,-y,-z)); }
IPoint3()
Definition: ipoint3.h:35
int y
Definition: ipoint3.h:31
int x
Definition: ipoint3.h:31
int z
Definition: ipoint3.h:31
IPoint3 operator+ ( ) const
inline
Remarks
Unary +. Returns the point unaltered.
62 { return *this; }
IPoint3 & operator-= ( const IPoint3 a)
inline
Remarks
Subtracts a IPoint3 from this IPoint3.
113  {
114  x -= a.x; y -= a.y; z -= a.z;
115  return *this;
116  }
int y
Definition: ipoint3.h:31
int x
Definition: ipoint3.h:31
int z
Definition: ipoint3.h:31
IPoint3 & operator+= ( const IPoint3 a)
inline
Remarks
Adds a IPoint3 to this IPoint3.
118  {
119  x += a.x; y += a.y; z += a.z;
120  return *this;
121  }
int y
Definition: ipoint3.h:31
int x
Definition: ipoint3.h:31
int z
Definition: ipoint3.h:31
IPoint3 operator- ( const IPoint3 b) const
inline
Remarks
Subtracts a IPoint3 from a IPoint3.
123  {
124  return(IPoint3(x-b.x,y-b.y,z-b.z));
125  }
IPoint3()
Definition: ipoint3.h:35
int y
Definition: ipoint3.h:31
int x
Definition: ipoint3.h:31
int z
Definition: ipoint3.h:31
IPoint3 operator+ ( const IPoint3 b) const
inline
Remarks
Adds a IPoint3 to a IPoint3.
127  {
128  return(IPoint3(x+b.x,y+b.y,z+b.z));
129  }
IPoint3()
Definition: ipoint3.h:35
int y
Definition: ipoint3.h:31
int x
Definition: ipoint3.h:31
int z
Definition: ipoint3.h:31
int operator* ( const IPoint3 b) const
inline
Remarks
Returns the dot product of two IPoint3s.
131  {
132  return(x*b.x+y*b.y+z*b.z);
133  }
int y
Definition: ipoint3.h:31
int x
Definition: ipoint3.h:31
int z
Definition: ipoint3.h:31
int DotProd ( const IPoint3 b) const
inline
Remarks
Returns the dot product of two IPoint3s.
135  {
136  return(x*b.x+y*b.y+z*b.z);
137  }
int y
Definition: ipoint3.h:31
int x
Definition: ipoint3.h:31
int z
Definition: ipoint3.h:31
IPoint3 operator^ ( const IPoint3 ) const
Remarks
The cross product of two IPoint3's (vectors).
IPoint3 CrossProd ( const IPoint3 ) const
Remarks
Returns the cross product of two IPoint3's (vectors).
Operators:
int operator== ( const IPoint3 p) const
inline
Remarks
Test for equality between two IPoint3's.
Returns
Nonzero if the IPoint3's are equal; otherwise 0.

90 { return (x == p.x && y == p.y && z == p.z); }
int y
Definition: ipoint3.h:31
int x
Definition: ipoint3.h:31
int z
Definition: ipoint3.h:31
int operator!= ( const IPoint3 p) const
inline
91 { return ( (x != p.x) || (y != p.y) || (z != p.z) ); }
int y
Definition: ipoint3.h:31
int x
Definition: ipoint3.h:31
int z
Definition: ipoint3.h:31

Member Data Documentation

int x
int y
int z