<Source Index | <PPA-L top page

plotarea.h


//////////////////////////////////////////////////
//
//  This file is to be used for point process analysis
//
//      Copyright  October 2001 by TAKENAKA, A.

#if !defined (___PLOT_AREA_H)
#define ___PLOT_AREA_H

#include <string>
#include <vector>
#include <utility>

#include "r_x_array.h"
#include "pointlist.h"

//////////////////////////////
//
//  Plot area class calculates values of L function
//  for loaded point data.
//
//  When one set of data is given, L functions for the given
//  spatial point pattern is calculated.
//
//  When two sets of data are given, L functions for bivariate
//  point spatial pattern is calculated..
//
//  To use this class, call loadPoints() and calc_L(), and then
//  call r_X_Array to get the results.

class PlotArea
{
  public:

    PlotArea(void);

    bool loadPoints(const char* file1, const char* file2 = NULL);
    bool calc_L(double r_unit, double r_upto);
    const r_X_Array& getResults(void);

  protected:  //  protected methods.

    void   initArray(void);
    int    r_to_index(double r);

    void   calc_K(void);
    void   calc_crossK(void);

    double get_s(double x);  //  Ohser's edge correction
    void   fromKtoL(void);   //  From K function to L function.

  protected:  //  data members.

    PointList Points1;
    PointList Points2;

    double Density1;
    double Density2;

    double R_Upto;
    double R_Unit;
    int    MaxR_Index;

    XY     AreaSize;
    double Area;
    double Perimeter;

    r_X_Array ResultsArray;

};

#endif