/******************************************************************************
** Copyright (C) 2001, University of Alabama in Huntsville. All rights 
** reserved.
**
** File   : ConGraTDoc.h
**
** Author : Satish Hota & Edwin Chan (with help from MFC)
**
** Description:
**    This file provides interface for CConGraTDoc class.
**
** History:
** 09-Nov-01 Satish Hota & Edwin Chan
**     File Created
** 24-Nov-01 Satish Hota
**     Added GetSize method
** 25-Nov-01 Satish Hota
**     Added Draw method and also added a temporary m_pTempList vector to hold
**     temporary drawable objects for testing.
** 26-Nov-01 Edwin Chan
**     Added new method ObjectAt
** 28-Nov-01 Satish Hota
**     Made the CDrawable class CDrawableElement and created a CDrawable
**     super-class.  Hence, replaced usage of CDrawable with CDrawableElement.
** 30-Nov-01 Satish Hota
**     Added KnowledgeBase member, from and to location members.  Added new
**     methods to get the from and to locations.  Modified the interface of 
**     the Draw and the ObjectAt methods.
** 01-Dec-01 Saranyu Tantipongsakul, Satish Hota
**     Added the CGIFParser include file.
******************************************************************************/


#if !defined(AFX_CONGRATDOC_H__5DE64684_36FB_45FD_AFFE_790844664ABB__INCLUDED_)
#define AFX_CONGRATDOC_H__5DE64684_36FB_45FD_AFFE_790844664ABB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "DrawableCGFactory.h"
#include "CGEngine/CKnowledgeBase.h"
#include "DrawableRH.h"
#include "DrawableTH.h"
#include "DrawableSOA.h"
#include "DrawableCOI.h"
#include <vector>
#include "DrawableElement.h"
#include "DrawableRectangle.h"
#include "DrawableRoundedRectangle.h"
#include "DrawableLine.h"
#include "MFCDevConHelper.h"
#include "CGIFParser/CGIFParser.h"

class CConGraTView;
void TempDriver(ACCGFactory* pFactory, CKnowledgeBase** ppKB);

class CConGraTDoc : public CDocument
{
protected: // create from serialization only
	CConGraTDoc();
	DECLARE_DYNCREATE(CConGraTDoc)

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CConGraTDoc)
	public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
	virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual void GetToLocation(int *pnToX, int *pnToY);
	virtual void GetFromLocation(int *pnFromX, int *pnFromY);
    long Draw(CDC* pDC, CConGraTView* pView, ViewType eViewType);
	CSize GetSize();
	virtual ~CConGraTDoc();
	CDrawableElement* ObjectAt(const CPoint& point, ViewType eViewType);
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

public:
    std::vector<CDrawableElement*> m_pTempObjList;

// Generated message map functions
protected:
	int m_nFromX;
    int m_nFromY;
    int m_nToX;
    int m_nToY;
    CKnowledgeBase *m_pKnowledgeBase;
	//{{AFX_MSG(CConGraTDoc)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CONGRATDOC_H__5DE64684_36FB_45FD_AFFE_790844664ABB__INCLUDED_)
