// file: $USFS/class/polygon/v1.0/polygon.h
//

// make sure the definitions are made only once
//
#ifndef __ISIP_POLYGON
#define __ISIP_POLYGON

// isip include files
//
#ifndef __ISIP_INTEGRAL
#include <integral.h>
#endif

// Polygon: a class that reads segmentation data on usfs database
// as polygons and determines if a given point is inside a polygon or not
//
class Polygon {

  //---------------------------------------------------------------------------
  //
  // protected data
  //
  //---------------------------------------------------------------------------
protected:

  // general information of the polygon
  //
  char_1* transcription_d;  // transcription for this polygon
  int_4 num_vertices_d;     // number of vertices of the polygon
  int_4* vertices_d;        // pointer to coordinates for vertices	

  // debugging parameters
  //
  int_4 debug_level_d;      // amount of debug information
  
  //---------------------------------------------------------------------------
  //
  // public methods
  //
  //---------------------------------------------------------------------------
public:

  // required methods
  //
  char_1* name_cc();
  volatile void error_handler_cc(char_1* method_name, char_1* message);
  
  // destructors/constructors
  //
  ~Polygon();
  Polygon();                                // default
  Polygon(Polygon& polygon);                // copy
  
  // methods to set/get the transcription for the polygon
  //
  logical_1 set_trans_cc(char_1* transcription);
  char_1* get_trans_cc();
    
  // load polygon data from the data file
  //
  logical_1 load_cc(int_4 coordinate);
     
  // method to determine if a given point is inside the polygon or not
  //
  logical_1 is_inside_cc(int_4 x_val, int_4 y_val);

  // useful debugging methods
  //
  logical_1 set_debug_cc(int_4 debug_level);
  logical_1 debug_cc(FILE* fp, char_1* message);
  logical_1 display_cc(FILE* fp);
  
  //---------------------------------------------------------------------------
  //
  // private methods
  //
  //---------------------------------------------------------------------------
private:

  // no members here
  //
};

// end of file
//
#endif
