00001
00002
00003
00004
00005
00006
00007
00008 #ifndef BUILDINGARRAYH
00009 #define BUILDINGARRAYH
00010
00011 #include "MathTypes.h"
00012 #include "Projections.h"
00013 #include "Building.h"
00014 #include <stdio.h>
00015
00016 #define BCFVERSION_CURRENT 1.2f
00017 #define BCFVERSION_SUPPORTED 1.1f
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class vtBuildingArray : public Array<vtBuildingPtr>
00035 {
00036 public:
00037 ~vtBuildingArray() { Empty(); }
00038 virtual void DestructItems(int first, int last);
00039
00040 void AddBuilding(vtBuildingPtr bld) { Append(bld); }
00041 void Remove(int index, DPoint2 &thepoint)
00042 {
00043
00044 thepoint = GetAt(index)->GetLocation();
00045 RemoveAt(index, 1);
00046 }
00047 void DeleteSelected();
00048
00049 bool ReadSHP(const char* pathname);
00050 bool ReadBCF(const char* pathname);
00051 bool WriteSHP(const char* pathname);
00052 bool WriteBCF(const char* pathname);
00053 bool ReadBCF_Old(FILE *fp);
00054
00055 int IsBuildingThere(DPoint2 point, double error);
00056
00057 bool FindClosestCorner(DPoint2 point, double error,
00058 int &building, int &corner, double &distance);
00059 bool FindClosestCenter(DPoint2 point, double error,
00060 int &building, double &distance);
00061
00062 bool IsEmpty() { return (GetSize() == 0); }
00063 void GetExtents(DRECT &ext);
00064
00065
00066 int NumSelected();
00067 void DeselectAll();
00068
00069
00070
00071 virtual vtBuilding *NewBuilding() { return new vtBuilding; }
00072
00073
00074 vtProjection m_proj;
00075 protected:
00076 };
00077
00078 #endif