/*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 
	
*/

#include <oops.h>
#include "plotting.h"


/* Histograms -------------------------------------------------------------*/
/*cHistogram::cHistogram (void) 
{
	scale = 1;
}
*/
void cHistogram::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.*/
{

	Rect	histPosition; /* = {40, 355, 320, 635};*/
	Rect  testrect;

		//	Now create a Macintosh window. Note that
		//	its position is fixed and that it cannot
		//	be moved.

/*	DrawingWindow = NewWindow(NULL, &drawingWindowPosition,
								"\pHistogram", TRUE, noGrowDocProc,
								(void *)-1L, FALSE, 0L);
*/
	max_data = max;
	min_data = min;
	num_bars = numbars;
	wdscale = wscale;
	htscale = hscale;
	orig.h = x + BORDER;
	orig.v = y - (max / hscale);
	
	SetRect(&histPosition, x, y, x + (numbars * wscale) + (2 * BORDER), 
				y + ((max - min)  / hscale) + (2 * BORDER));

	DrawingWindow = NewWindow(NULL, &histPosition,
								CtoPstr(title), TRUE, noGrowDocProc,
								(void *)-1L, FALSE, 0L);
	
	SetPort(DrawingWindow);
/*	ShowPen();
	PenNormal();

	MoveTo(orig.h, orig.v);
	LineTo(orig.h + (num_bars * wdscale), orig.v);
	MoveTo(orig.h, orig.v + (min_data / htscale));
	LineTo(orig.h, orig.v - (max_data / htscale)); 
*/
	SetRect(&testrect, orig.h, orig.v - (max_data / htscale), 
			  orig.h + (num_bars * wdscale), orig.v + (min_data / htscale));
	FrameRect(&testrect);
}

void cHistogram::display_data(int *data) /*Displays the current data on the graph.*/
{

}
void cHistogram::add(int datum) /*Increments the appropriate bar.*/
{

}

void cHistogram::remove(int datum) /*Decrements the appropriate bar.*/
{

}
