/*Carlo C. Maley 7/16/94

This is a file for objects to plot data either in real time or from a file.

It includes:
	Histograms 
	
*/

#pragma once

#define BORDER 20  /*Spacing border around the plots.*/

/*The histogram has a setup method that takes the following arguments:
		A title (char *)
		Lable for the X axis (char *)
		Lable for the Y axis (char *)
		The number of bars to be plotted in the histogram (unsigned int)
		The maximum Y value allowed (int)
		The minimum Y value allowed (int)
		The x location of the upper left corner of the window (int)
		The y location of the upper left corner of the window (int)
		The width of the window (int)
		The height of the window (int).
		
*/

#if __cplusplus
class cHistogram  
#else
class cHistogram : indirect
#endif
{
	int wdscale;  /*The number of x axis values in one bar.*/
	int htscale;  /*scaling for the y axis - a divisor.*/
	unsigned int num_bars; /*The length of the array of data.*/
	int max_data; /*The maximum number allowed for a data value
									  (height of the bar on the graph).*/
	int min_data; /*The minimum number allowed for a data value
									  (height of the bar on the graph).*/	
	Point orig;  /*The origin point for the histogram.*/							 
	WindowPtr DrawingWindow;  /*the window for drawing.*/
	
	public:
		/*cHistogram(void);*/
		void setup(char *title, char *xaxis, char *yaxis, 
						int numbars, int max, int min, int x, int y, int wscale, int hscale);
					   /*This sets up the window for the histogram.*/
		void display_data(int *data); /*Displays the data on the graph.*/
		void add(int datum); /*Increments the appropriate bar.*/
		void remove(int datum); /*Decrements the appropriate bar.*/
		
};
