Public Member Functions | Public Attributes

IPoint3 Class Reference

Search for all occurrences

Detailed 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;

#include <ipoint3.h>

Inheritance diagram for IPoint3:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  IPoint3 ()
  IPoint3 (int X, int Y, int Z)
  IPoint3 (const IPoint3 &a)
  IPoint3 (int ai[3])
int &  operator[] (int i)
const int &  operator[] (int i) const
  operator int * ()
IPoint3  operator- () const
IPoint3  operator+ () const
GEOMEXPORT IPoint3 operator-= (const IPoint3 &)
GEOMEXPORT IPoint3 operator+= (const IPoint3 &)
GEOMEXPORT IPoint3  operator- (const IPoint3 &) const
GEOMEXPORT IPoint3  operator+ (const IPoint3 &) const
GEOMEXPORT int  operator* (const IPoint3 &) const
GEOMEXPORT int  DotProd (const IPoint3 &) const
GEOMEXPORT IPoint3  operator^ (const IPoint3 &) const
GEOMEXPORT 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

Constructor & Destructor Documentation

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

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.
{ return (&x)[i]; }     
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.
{ return (&x)[i]; }  
operator int * ( ) [inline]
Remarks:
Conversion function. Returns the address of the IPoint3.
{ return(&x); }
IPoint3 operator- ( ) const [inline]
Remarks:
Unary - operator. Negates x, y and z.
{ return(IPoint3(-x,-y,-z)); } 
IPoint3 operator+ ( ) const [inline]
Remarks:
Unary +. Returns the point unaltered.
{ return *this; } 
IPoint3 & operator-= ( const IPoint3 a ) [inline]
Remarks:
Subtracts a IPoint3 from this IPoint3.
                                                    {   
    x -= a.x;   y -= a.y;   z -= a.z;
    return *this;
    }
IPoint3 & operator+= ( const IPoint3 a ) [inline]
Remarks:
Adds a IPoint3 to this IPoint3.
                                                    {
    x += a.x;   y += a.y;   z += a.z;
    return *this;
    }
IPoint3 operator- ( const IPoint3 b ) const [inline]
Remarks:
Subtracts a IPoint3 from a IPoint3.
                                                        {
    return(IPoint3(x-b.x,y-b.y,z-b.z));
    }
IPoint3 operator+ ( const IPoint3 b ) const [inline]
Remarks:
Adds a IPoint3 to a IPoint3.
                                                        {
    return(IPoint3(x+b.x,y+b.y,z+b.z));
    }
int operator* ( const IPoint3 b ) const [inline]
Remarks:
Returns the dot product of two IPoint3s.
                                                    {  
    return(x*b.x+y*b.y+z*b.z);  
    }
int DotProd ( const IPoint3 b ) const [inline]
Remarks:
Returns the dot product of two IPoint3s.
                                                   { 
    return(x*b.x+y*b.y+z*b.z);  
    }
GEOMEXPORT IPoint3 operator^ ( const IPoint3 ) const
Remarks:
The cross product of two IPoint3's (vectors).
GEOMEXPORT 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.

{ return (x == p.x && y == p.y && z == p.z); }
int operator!= ( const IPoint3 p ) const [inline]
{ return ( (x != p.x) || (y != p.y) || (z != p.z) ); }

Member Data Documentation

int x
int y
int z

IPoint3 IPoint3 IPoint3 IPoint3 IPoint3 IPoint3 IPoint3 IPoint3 IPoint3 IPoint3
IPoint3 IPoint3 IPoint3 IPoint3 IPoint3 IPoint3 IPoint3 IPoint3 IPoint3 IPoint3