Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ipoint.hpp

Go to the documentation of this file.
00001 //************************************************************************************//
00002 // Module       : ipoint.cpp
00003 // Date         : 8/20/03 (DLR)
00004 // Copyright    : 2003-2006 Copyright University Corporation for Atmospheric
00005 //                Research
00006 // Description  : Encapsulates the access methods and data associated with
00007 //                defining an GINT  point 
00008 // Derived From : none.
00009 // Modifications:
00010 //************************************************************************************//
00011 #if !defined(IPOINT_HPP)
00012 #define IPOINT_HPP
00013 
00014 #include "gtypes.h"
00015 #include <iostream.h>
00016 #include <stdlib.h>
00017 #include <math.h>
00018 
00019 class IPoint
00020 {
00021 public:
00022                   IPoint(); 
00023                  ~IPoint();
00024   friend ostream& operator<<(ostream &, IPoint &);
00025 
00026   inline GBOOL    operator==(IPoint &p) 
00027   { return (p.i1==i1 && p.i2==i2 && p.i3==i3); }
00028 
00029   inline GBOOL    operator!=(IPoint &p) // Add 'fuzziness' to equality check
00030   { return !this->operator==(p); }
00031 
00032   inline void  operator=(IPoint &p)
00033   { i1 = p.i1; i2 = p.i2; i3 = p.i3;}
00034 
00035   inline void  operator=(GINT  f)
00036   { i1 = i2 = i3 = f; }
00037 
00038   inline GINT  &operator()(GINT  i)
00039   { if ( i<0 || i>=3 ) { cout << "IPoint::(): access error; bad index:" << i << endl; exit(1); }
00040     return *pix_[i]; }
00041 
00042   inline GINT  &operator[](GINT  i)
00043   { if ( i<0 || i>=3 ) { cout << "IPoint::[]: access error; bad index:" << i << endl; exit(1); }
00044     return *pix_[i]; }
00045 
00046   GINT       i1;
00047   GINT       i2;
00048   GINT       i3;
00049   GINT       *pix_[3];
00050 
00051 };
00052 
00053 #endif

Generated on Wed Dec 21 16:00:48 2005 for Geophysics & Astrophysics Spectral Element Adaptive Refinement (GASpAR) 2D Code by  doxygen 1.4.4