/*********************************************************************************
 JPlotDataBase.h

	Interface for the JPlotDataBase class.

	Copyright @ 1997 by Glenn W. Bach. All rights reserved.

 ********************************************************************************/

#ifndef _H_JPlotDataBase
#define _H_JPlotDataBase

#include <JCollection.h>
#include <J2DDataPoint.h>
#include <J2DVectorPoint.h>

class JPlotDataBase : public JCollection
{
public:

	enum PlotDataType
	{
		kScatterPlot,
		kSurfacePlot,
		kContourPlot,
		kVectorPlot
	};

public:

	JPlotDataBase(const PlotDataType type);

	virtual ~JPlotDataBase();

	PlotDataType	GetType() const;
	virtual void	GetElement(const JIndex index, J2DDataPoint* data) const;
	virtual void	GetElement(const JIndex index, J2DVectorPoint* data) const;

	virtual void		GetXRange(JFloat* xMin, JFloat* xMax) const = 0;
	virtual JBoolean	GetYRange(const JFloat xMin, const JFloat xMax,
								  JFloat* yMin, JFloat* yMax) const = 0;
	virtual JBoolean	GetZRange(const JFloat xMin, const JFloat xMax,
								  const JFloat yMin, const JFloat yMax,
								  JFloat* zMin, JFloat* zMax) const;
	virtual JBoolean	Get4thRange(const JFloat xMin, const JFloat xMax,
									const JFloat yMin, const JFloat yMax,
									const JFloat zMin, const JFloat zMax,
									JFloat* min, JFloat* max) const;

	virtual JBoolean	HasXErrors() const;
	virtual JBoolean	HasYErrors() const;
	virtual JBoolean	HasSymmetricXErrors() const;
	virtual JBoolean	HasSymmetricYErrors() const;

private:

	const PlotDataType	itsType;

public:

	static const JCharacter* kCurveChanged;

	class CurveChanged : public JBroadcaster::Message
	{
	public:

		CurveChanged()
			:
			JBroadcaster::Message(kCurveChanged)
			{ };
	};
};


/*********************************************************************************
 GetType

 ********************************************************************************/

inline JPlotDataBase::PlotDataType 
JPlotDataBase::GetType()
	const
{
	return itsType;
}

#endif
