DPoint3 Class Reference

DPoint3 Class Reference

#include <dpoint3.h>

Class 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;
+ Inheritance diagram for DPoint3:

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
 
DPoint3operator= (const Point3 &a)
 
DPoint3operator-= (const DPoint3 &)
 
DPoint3operator+= (const DPoint3 &)
 
DPoint3operator*= (double)
 
DPoint3operator/= (double)
 
DPoint3 operator- (const DPoint3 &) const
 
DPoint3 operator+ (const DPoint3 &) const
 
double operator* (const DPoint3 &) const
 
DPoint3 operator^ (const DPoint3 &) const
 

Public Attributes

double x
 
double y
 
double 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

DPoint3 ( )
inline
Remarks
Constructor. No initialization is performed.
35 {}
DPoint3 ( double  X,
double  Y,
double  Z 
)
inline
Remarks
Constructor. x, y, and z are initialized to the values specified.
38 { x = X; y = Y; z = Z; }
double y
Definition: dpoint3.h:31
double z
Definition: dpoint3.h:31
double x
Definition: dpoint3.h:31
DPoint3 ( const DPoint3 a)
inline
Remarks
Constructor. x, y, and z are initialized to the DPoint3 specified.
41 { x = a.x; y = a.y; z = a.z; }
double y
Definition: dpoint3.h:31
double z
Definition: dpoint3.h:31
double x
Definition: dpoint3.h:31
DPoint3 ( const Point3 a)
inline
42 { x = a.x; y = a.y; z = a.z; }
float y
Definition: point3.h:54
double y
Definition: dpoint3.h:31
double z
Definition: dpoint3.h:31
double x
Definition: dpoint3.h:31
float z
Definition: point3.h:54
float x
Definition: point3.h:54
DPoint3 ( double  af[3])
inline
Remarks
Constructor. x, y, and z are initialized to. af[0], af[1], and af[2] respectively.
Operators:
47 { x = af[0]; y = af[1]; z = af[2]; }
double y
Definition: dpoint3.h:31
double z
Definition: dpoint3.h:31
double x
Definition: dpoint3.h:31

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.
52 { return (&x)[i]; }
double x
Definition: dpoint3.h:31
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.
55 { return (&x)[i]; }
double x
Definition: dpoint3.h:31
operator double * ( )
inline
Remarks
Conversion function. Returns the address of the DPoint3.x
59 { return(&x); }
double x
Definition: dpoint3.h:31
DPoint3 operator- ( ) const
inline
Remarks
Unary - operator. Negates both x, y and z.
63 { return(DPoint3(-x,-y,-z)); }
double y
Definition: dpoint3.h:31
double z
Definition: dpoint3.h:31
DPoint3()
Definition: dpoint3.h:35
double x
Definition: dpoint3.h:31
DPoint3 operator+ ( ) const
inline
Remarks
Unary +. Returns the point unaltered.
65 { return *this; }
DPoint3& operator= ( const Point3 a)
inline
68 { x = a.x; y = a.y; z = a.z; return *this; }
float y
Definition: point3.h:54
double y
Definition: dpoint3.h:31
double z
Definition: dpoint3.h:31
double x
Definition: dpoint3.h:31
float z
Definition: point3.h:54
float x
Definition: point3.h:54
DPoint3 & operator-= ( const DPoint3 a)
inline
Remarks
Subtracts a DPoint3 from this DPoint3.
120  {
121  x -= a.x; y -= a.y; z -= a.z;
122  return *this;
123  }
double y
Definition: dpoint3.h:31
double z
Definition: dpoint3.h:31
double x
Definition: dpoint3.h:31
DPoint3 & operator+= ( const DPoint3 a)
inline
Remarks
Adds a DPoint3 to this DPoint3.
125  {
126  x += a.x; y += a.y; z += a.z;
127  return *this;
128  }
double y
Definition: dpoint3.h:31
double z
Definition: dpoint3.h:31
double x
Definition: dpoint3.h:31
DPoint3 & operator*= ( double  f)
inline
Remarks
Each element of this DPoint3 is multiplied by the specified double.
130  {
131  x *= f; y *= f; z *= f;
132  return *this;
133  }
double y
Definition: dpoint3.h:31
double z
Definition: dpoint3.h:31
double x
Definition: dpoint3.h:31
DPoint3 & operator/= ( double  f)
inline
Remarks
Each element of this DPoint3 is divided by the specified double.
135  {
136  x /= f; y /= f; z /= f;
137  return *this;
138  }
double y
Definition: dpoint3.h:31
double z
Definition: dpoint3.h:31
double x
Definition: dpoint3.h:31
DPoint3 operator- ( const DPoint3 b) const
inline
Remarks
Subtracts a DPoint3 from a DPoint3.
140  {
141  return(DPoint3(x-b.x,y-b.y,z-b.z));
142  }
double y
Definition: dpoint3.h:31
double z
Definition: dpoint3.h:31
DPoint3()
Definition: dpoint3.h:35
double x
Definition: dpoint3.h:31
DPoint3 operator+ ( const DPoint3 b) const
inline
Remarks
Adds a DPoint3 to a DPoint3.
144  {
145  return(DPoint3(x+b.x,y+b.y,z+b.z));
146  }
double y
Definition: dpoint3.h:31
double z
Definition: dpoint3.h:31
DPoint3()
Definition: dpoint3.h:35
double x
Definition: dpoint3.h:31
double operator* ( const DPoint3 b) const
inline
Remarks
Computes the dot product of this DPoint3 and the specified DPoint3.
148  {
149  return(x*b.x+y*b.y+z*b.z);
150  }
double y
Definition: dpoint3.h:31
double z
Definition: dpoint3.h:31
double x
Definition: dpoint3.h:31
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