00001 #ifndef __polyClass_H 00002 #define __polyClass_H 00003 00004 00005 #define _USE_MATH_DEFINES 00006 using namespace std; 00007 00008 enum crossingType { non_object=-3,intersect, coincident, parallel,no_intersection }; 00009 00010 struct pointLocation 00011 { 00012 int x; 00013 int y; 00014 00015 pointLocation(){} 00016 pointLocation(int xx, int yy) { x= xx; y = yy;} 00017 const pointLocation & operator = (pointLocation b) 00018 { 00019 x = b.x; y = b.y; return *this; 00020 } 00021 pointLocation & operator + (pointLocation b) 00022 { x += b.x; y+=b.y; return *this;} 00023 00024 00025 }; 00026 00027 00028 class polyClass { 00029 00030 public: 00031 polyClass(); 00032 polyClass(vector<pointLocation> pts); 00033 ~polyClass(); 00034 00035 int get_upper_area_delta(); 00036 int get_lower_area_delta(); 00037 int linesIntersect(); 00038 float getArea(); 00039 void orderVertices(); 00040 00041 private: 00042 pointLocation* _polyStruct; 00043 int _polygonSideCount; 00044 int tmp; 00045 00046 }; 00047 00048 #endif 00049