index page | plotarea.cpp
0001: //////////////////////////////////////////////////
0002: //
0003: //                      ppa-r
0004: //  point process analysis system: pair correlation
0005: //
0006: //      Copyright  October 2001 by TAKENAKA, A.
0007: //           rev.  November 2004
0008: 
0009: #if !defined (___PLOT_AREA_H)
0010: #define ___PLOT_AREA_H
0011: 
0012: #include <string>
0013: #include <vector>
0014: #include <utility>
0015: 
0016: #include "r_x_array.h"
0017: #include "pointlist.h"         // link to pointlist.cpp
0018: 
0019: //////////////////////////////
0020: //
0021: //  Plot area class calculates pair correlation for loaded point data.
0022: //
0023: //  When a set of data is given, correlation within given
0024: //  spatial point pattern is calculated.
0025: //
0026: //  When two sets of data are given, correlation between the 
0027: //  two sets of points is calculated..
0028: //
0029: //  To use this class, call loadPoints() and calc_r(), and then
0030: //  call getResults to get the results.
0031: 
0032: class PlotArea
0033: {
0034:   public:
0035: 
0036:     PlotArea(void);
0037: 
0038:     bool loadPoints(const char* file1, const char* file2 = NULL);
0039:     const r_X_Array& getResults(void);
0040:     bool  calc_cor(double r_unit, double r_upto);
0041: 
0042:   protected:  //  protected methods.
0043: 
0044:     void   initArray(void);
0045: //    int    r_to_index(double r);
0046:     double get_w(double d);  //  Epanechnikov kernel
0047:     double get_s(double x);  //  Ohser's edge correction
0048: 
0049:   protected:  //  data members.
0050: 
0051:     PointList Points1;
0052:     PointList Points2;
0053: 
0054:     double Density1;
0055:     double Density2;
0056:     double MeanDensity;
0057:     double Delta;  //  width of Epanechnikov kernel.
0058: 
0059:     double R_Upto;
0060:     double R_Unit;
0061:     int    MaxR_Index;
0062: 
0063:     XY     AreaSize;
0064:     double Area;
0065:     double Perimeter;
0066: 
0067:     r_X_Array ResultsArray;
0068: };
0069: 
0070: #endif

Back to Top of this Page