00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #pragma once
00021
00022 #include <iostream>
00023 #include <fstream>
00024
00025 #include <vector>
00026
00027 using namespace std;
00028
00029 #include "utils.h"
00030
00031
00033 class Point {
00035 friend ostream& operator<<(ostream& output, const Point& p);
00037 friend ofstream& operator<<(ofstream& output, const Point& p);
00039 friend ifstream& operator>>(ifstream& input, Point& p);
00040
00041 public:
00043 double lat;
00045 double lon;
00047 double elev;
00049 double towerHeight;
00051 double vegHeight;
00053 int vegType;
00055 int vegCover;
00057 int landType;
00058
00059 Point();
00060
00064 Point(double _lat, double _lon);
00065
00070 Point(double _lat, double _lon, double _towerHeight);
00071
00075 double distance(Point* p);
00076
00080 double bearing(Point* p);
00081
00086 Point* project(double bearing, double distance);
00087
00088 };
00089
00090
00091
00093 class Region {
00094 public:
00098 virtual vector<Point*> discrete(double resolution) = 0;
00099
00103 virtual bool contains(Point* p) = 0;
00104
00107 virtual void add(Point* p) = 0;
00108 };
00109
00110
00112 class RegionArea : Region {
00114 friend ostream& operator<<(ostream& output, const RegionArea& r);
00115 private:
00116 public:
00118 Point* bottomLeft;
00120 Point* topRight;
00121
00122 RegionArea();
00123
00127 RegionArea(Point* bottomLeft, Point* topRight);
00128
00132 RegionArea(Point* center, double radius);
00133
00134 ~RegionArea();
00135
00139 vector<Point*> discrete(double resolution);
00140
00144 bool contains(Point* p);
00145
00148 void add(Point* p);
00149
00150 };
00151
00152
00154 class RegionLine : Region {
00156 friend ofstream& operator<<(ofstream& output, const RegionLine& r);
00157 private:
00159 vector<Point*> list;
00160 public:
00161 RegionLine();
00162
00165 RegionLine(vector<Point*> list);
00166
00170 RegionLine(Point* p, Point* q);
00171
00174 RegionLine(string filename);
00175
00176 ~RegionLine();
00177
00180 double length();
00181
00185 vector<Point*> discrete(double resolution);
00186
00190 bool contains(Point* p);
00191
00194 void add(Point* p);
00195
00196 };
00197
00198