gap_and_valley.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef GAP_AND_VALLEY_H
00024 #define GAP_AND_VALLEY_H
00025
00026 #include <vector>
00027
00028 extern int getIndex( int circularIdx, int max );
00029 extern int sign( double num );
00030 extern int getSectorsBetween( int iS1, int iS2, int iSMax );
00031 extern int getSectorsBetweenDirected( int iS1, int iS2, int iSMax, int iDirection );
00032
00033 class Gap
00034 {
00035 public :
00036 int m_iSector;
00037 double m_dist;
00038 int m_iDir;
00039 bool m_bExplored;
00040 bool m_bContaminated;
00041
00042 Gap();
00043 Gap( int iSector, double dist, int iDir );
00044 Gap( Gap* copyFromGap );
00045 ~Gap();
00046
00047 void Update( int iNewSector, double newDist );
00048 void Update( int iNewSector, double newDist, int iNewDir );
00049
00050 };
00051
00052
00053
00054 class Valley
00055 {
00056 public :
00057 Gap* m_pRisingDisc;
00058 Gap* m_pOtherDisc;
00059 int m_iRisingToOther;
00060
00061 Valley();
00062 Valley( Gap* risingGap, Gap* otherGap, int risingToOther );
00063 virtual ~Valley() {}
00064
00065 void overwrite( Gap* risingGap, Gap* otherGap, int risingToOther );
00066
00067 int getValleyWidth( std::vector<double> fullLP );
00068
00069 bool isSectorInValley( int iSector, int iSMax );
00070 };
00071
00072
00073
00074 #endif