MeshKit
1.0
|
00001 /* 00002 * Point2D.hpp 00003 * 00004 * An immutable point with two double coordinates. 00005 * 00006 * The coordinates are named x and y. 00007 */ 00008 #ifndef MESHKIT_UTILS_POINT2D_HPP 00009 #define MESHKIT_UTILS_POINT2D_HPP 00010 00011 // C++ 00012 #include <ostream> 00013 00014 class Point2D 00015 { 00016 private: 00017 00018 double x, y; 00019 00020 public: 00021 00027 Point2D(); 00028 00037 Point2D(double xVal, double yVal); 00038 00042 double getX() const; 00043 00047 double getY() const; 00048 }; 00049 00050 bool operator==(const Point2D & onePnt, const Point2D & otherPnt); 00051 bool operator!=(const Point2D & onePnt, const Point2D & otherPnt); 00052 std::ostream& operator<<(std::ostream& outStream, const Point2D & point); 00053 00054 #endif