// Matt Streeter
// 2/27/00
// GRAPH.H
// Header for class TESGraphWindow; window class used to graph fitness
// scores.
// Copyright Matt Streeter, 2000. All rights reserved
#ifndef __GRAPH_H__
#define __GRAPH_H__
#include <owl/owlpch.h>
#include <owl/applicat.h>
#include <owl/framewin.h>
#include <owl/dc.h>
#include <owl/inputdia.h>
#include <math.h>
#include "eswindow.h"
struct GenerationScore
{
int iGeneration;
double dDiversity;
double dMin,dMax,dAverage,dMedian;
GenerationScore *pNext;
};
typedef unsigned char byte;
class TESGraphWindow : public TESWindow {
public:
TESGraphWindow(TWindow *pParent,char *pTitle,GenerationScore **ppScoreList,
TESGraphWindow **ppThis);
~TESGraphWindow();
static TColor mMaxColor;
static TColor mAvgColor;
static TColor mDiversityColor;
static TColor mMinColor;
static TColor mBorderColor;
protected:
GenerationScore **mppScoreList;
byte mbScale;
TESGraphWindow **mppThis;
void Paint(TDC&, bool, TRect&);
void GraphVariable(byte bVar,double dMaxVal,double dMinVal,TColor& Color,
TDC& dc,TRect& rect);
GenerationScore *LastScore();
int GetNumScores();
double GetVar(byte bVar,GenerationScore *pScore);
/*
void CmScaleLinear();
void CmScaleLogarithmic();
void CmScaleSigmoid();
void CeScaleLinear(TCommandEnabler& ce);
void CeScaleLogarithmic(TCommandEnabler& ce);
void CeScaleSigmoid(TCommandEnabler& ce);
*/
void EvSize(UINT SizeType, TSize& Size);
DECLARE_RESPONSE_TABLE(TESGraphWindow);
};
class TESGraphApp : public TApplication {
public:
TESGraphApp() : TApplication() {}
protected:
void InitMainWindow();
};
#endif // __GRAPH_H__