Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef CONCENTRICSEARCH_H
00029 #define CONCENTRICSEARCH_H
00030
00031 #include "Function2Search.h"
00032 #include "Angle.h"
00033 #include "QGpCoreToolsDLLExport.h"
00034
00035 namespace QGpCoreTools {
00036
00037 class AbstractFunction2;
00038
00039 class QGPCORETOOLS_EXPORT ConcentricSearch : public Function2Search
00040 {
00041 public:
00042 ConcentricSearch();
00043 ~ConcentricSearch();
00044
00045 void setGrid(double minR, double maxR, double dR);
00046 void setMaximumRadius(double maxR) {_rMax=maxR;}
00047 void setCenter(double x, double y) {_x=x; _y=y;}
00048 void setNoiseLevel(double nl) {_noiseLevel=nl;}
00049
00050 double maximum(QAtomicInt * terminate=0);
00051 double maxX() const {return _maxX;}
00052 double maxY() const {return _maxY;}
00053 double maxRadius() const;
00054 Angle maxAngle() const {return Angle(_maxX-_x, _maxY-_y);}
00055 Angle maxAngle(double radius) const {return Angle(_maxX-_x, _maxY-_y, radius);}
00056 double r0() const;
00057 double dr() const {return _dr;}
00058 private:
00059 enum Segment {Top, Bottom, Left, Right};
00060 bool scanX(double min, double max, double y);
00061 bool scanY(double min, double max, double x);
00062 void crossRefineX(double x, double y, double dr);
00063 void crossRefineY(double x, double y, double dr);
00064
00065 mutable QMutex _r0Mutex;
00066 double _r0, _dr, _rMax, _noiseLevel;
00067 Segment _segment;
00068 double _x,_y,_pos;
00069 double _precision;
00070 double _v1,_v2,_v3;
00071 double _maxValue,_maxX, _maxY;
00072 };
00073
00074 }
00075
00076 #endif // CONCENTRICSEARCH_H