#include <math.h>

// generalized plotting class
// NO ERROR CHECKING.

#ifndef _H_PLOTTER

class Plotter {
	private:
		// minimum and maximum coordinates for plotting
		double MinSourceX, MinSourceY;
		double MaxSourceX, MaxSourceY;

		double MinDestX, MinDestY;
		double MaxDestX, MaxDestY;
		
		double * target;

		double getSteps(double min, double max, double iterations);

		double convert(double min, double max, double current,
				double destmin, double destmax);

	public:
		// the first 4 functions do what you'd expect.
		//	getStepsX calculates the value you'll have to add
		//		to your counter for each iteration if you start
		//		at min X, want to do "iterations" iterations 
		//		and end up at max X when done.
		//	getStepsY does the same, but with the Y coordinate
		//		this time.
		// they can also be used to get the step size for preventing
		// duplicate rendering.
		//
		// getPlotPosition returns the position in the array that
		// corresponds to the given x/y coordinates. It is used in
		// speeding up the correlation dimension plotter.
		//
		// the last one computes the box counting dimension. To be
		// pedantic, it should be in another class.
		
		void setSourceBoundaries (double minX, double minY, 
				double maxX, double maxY);
		void setTargetBoundaries (double minX, double minY,
				double maxX, double maxY);
		void setTargetArray(double * t_array);

		int getPlotPosition(double x, double y);
		double getPixelArea();

		bool plot(double x, double y, double value);
		
		double getStepsX(double iterations);
		double getStepsY(double iterations);

		double computeBDimension(double value);

};

#endif _H_PLOTTER

