Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

XYPoint.h

Go to the documentation of this file.
00001 // XYPoint.h: interface for the CXYPoint class.
00002 //
00004 
00005 #if !defined(AFX_XYPOINT_H__5B9481D9_A353_40FB_9B60_5D5AF6C84477__INCLUDED_)
00006 #define AFX_XYPOINT_H__5B9481D9_A353_40FB_9B60_5D5AF6C84477__INCLUDED_
00007 
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011 
00012 class CXYPoint  
00013 {
00014 public:
00015         CXYPoint(double x=0.0, double y=0.0);
00016         virtual ~CXYPoint();
00017         double GetX() {return m_dX;}
00018         double GetY() {return m_dY;}
00019         void SetX(double x) {m_dX = x;}
00020         void SetY(double y) {m_dY = y;}
00021         // allows sorting on X
00022         class CXComparator
00023         {
00024         public:
00025                 CXComparator() {return;}
00026                 virtual ~CXComparator() {return;}
00027                 bool operator()(CXYPoint *p1, CXYPoint *p2)
00028                 {
00029                         return p1->GetX() < p2->GetX();
00030                 }
00031         };
00032         // allows sorting on Y
00033         class CYComparator
00034         {
00035         public:
00036                 CYComparator() {return;}
00037                 virtual ~CYComparator() {return;}
00038                 bool operator()(CXYPoint *p1, CXYPoint *p2)
00039                 {
00040                         return p1->GetY() < p2->GetY();
00041                 }
00042         };
00043 private:
00044         double m_dX;
00045         double m_dY;
00046 };
00047 
00048 #endif // !defined(AFX_XYPOINT_H__5B9481D9_A353_40FB_9B60_5D5AF6C84477__INCLUDED_)

Generated on Mon Nov 3 09:38:20 2003 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002