Public Member Functions | Public Attributes

DPoint3 Class Reference

Search for all occurrences

Detailed Description

class DPoint3

Description:
This class describes a 3D point using double precision 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:
double x,y,z;

#include <dpoint3.h>

Inheritance diagram for DPoint3:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  DPoint3 ()
  DPoint3 (double X, double Y, double Z)
  DPoint3 (const DPoint3 &a)
  DPoint3 (const Point3 &a)
  DPoint3 (double af[3])
double &  operator[] (int i)
const double &  operator[] (int i) const
  operator double * ()
DPoint3  operator- () const
DPoint3  operator+ () const
GEOMEXPORT DPoint3 operator= (const Point3 &a)
GEOMEXPORT DPoint3 operator-= (const DPoint3 &)
GEOMEXPORT DPoint3 operator+= (const DPoint3 &)
GEOMEXPORT DPoint3 operator*= (double)
GEOMEXPORT DPoint3 operator/= (double)
GEOMEXPORT DPoint3  operator- (const DPoint3 &) const
GEOMEXPORT DPoint3  operator+ (const DPoint3 &) const
GEOMEXPORT double  operator* (const DPoint3 &) const
GEOMEXPORT DPoint3  operator^ (const DPoint3 &) const

Public Attributes

double  x
double  y
double  z

Constructor & Destructor Documentation

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

Member Function Documentation

double& operator[] ( int  i ) [inline]
Remarks:
Allows access to x, y and z using the subscript operator.
Returns:
An index of 0 will return x, 1 will return y, 2 will return z.
{ return (&x)[i]; }
const double& operator[] ( int  i ) const [inline]
Remarks:
Allows access to x, y and z using the subscript operator.
Returns:
An index of 0 will return x, 1 will return y, 2 will return z.
{ return (&x)[i]; }  
operator double * ( ) [inline]
Remarks:
Conversion function. Returns the address of the DPoint3.x
{ return(&x); }
DPoint3 operator- ( ) const [inline]
Remarks:
Unary - operator. Negates both x, y and z.
{ return(DPoint3(-x,-y,-z)); } 
DPoint3 operator+ ( ) const [inline]
Remarks:
Unary +. Returns the point unaltered.
{ return *this; } 
GEOMEXPORT DPoint3& operator= ( const Point3 a ) [inline]
{   x = a.x; y = a.y; z = a.z;  return *this; }
DPoint3 & operator-= ( const DPoint3 a ) [inline]
Remarks:
Subtracts a DPoint3 from this DPoint3.
                                                    {   
    x -= a.x;   y -= a.y;   z -= a.z;
    return *this;
    }
DPoint3 & operator+= ( const DPoint3 a ) [inline]
Remarks:
Adds a DPoint3 to this DPoint3.
                                                    {
    x += a.x;   y += a.y;   z += a.z;
    return *this;
    }
DPoint3 & operator*= ( double  f ) [inline]
Remarks:
Each element of this DPoint3 is multiplied by the specified double.
                                            {
    x *= f;   y *= f;   z *= f;
    return *this;
    }
DPoint3 & operator/= ( double  f ) [inline]
Remarks:
Each element of this DPoint3 is divided by the specified double.
                                            { 
    x /= f; y /= f; z /= f; 
    return *this; 
    }
DPoint3 operator- ( const DPoint3 b ) const [inline]
Remarks:
Subtracts a DPoint3 from a DPoint3.
                                                        {
    return(DPoint3(x-b.x,y-b.y,z-b.z));
    }
DPoint3 operator+ ( const DPoint3 b ) const [inline]
Remarks:
Adds a DPoint3 to a DPoint3.
                                                        {
    return(DPoint3(x+b.x,y+b.y,z+b.z));
    }
double operator* ( const DPoint3 b ) const [inline]
Remarks:
Computes the dot product of this DPoint3 and the specified DPoint3.
                                                       {  
    return(x*b.x+y*b.y+z*b.z);  
    }
GEOMEXPORT DPoint3 operator^ ( const DPoint3 ) const
Remarks:
Computes the cross product of this DPoint3 and the specified DPoint3.

Member Data Documentation

double x
double y
double z

DPoint3 DPoint3 DPoint3 DPoint3 DPoint3 DPoint3 DPoint3 DPoint3 DPoint3 DPoint3
DPoint3 DPoint3 DPoint3 DPoint3 DPoint3 DPoint3 DPoint3 DPoint3 DPoint3 DPoint3