// BemRawDoc.h : interface of the CBemRawDoc class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_BEMRAWDOC_H__B84A67AC_3DE7_11D3_B28A_00C0DFA996CB__INCLUDED_)
#define AFX_BEMRAWDOC_H__B84A67AC_3DE7_11D3_B28A_00C0DFA996CB__INCLUDED_

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

class CNode;
class CElement;
class CIntPoint;
class CIntElem;
class CWell;
class CTimeInt;

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

// Attributes
public:

// Operations
public:
	CObArray Nodes,Elems,TriElems,IntNods,Wells,Area,TimInts;
	LOGFONT lfnt,lfntw;
	int bounl,bounr,bount,bounb;
	CString name;
	float kx,ky,thick,precip,efpo,matter,retd,lamb;
	float gcb[6],tx,ty,txy,tt,tp,rprec,al,at,delt,tim;
	int nel,nwl,ntim;
	CSize m_size;

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

// Implementation
public:
	void OpenParts();
	void SaveCorner();
	void OpenCorner();
	void PlotTime (CDC& dc,int its,int ite);
	CTimeInt* AddTime (float tim);
	CTimeInt* GetTime(int i);
	float gran();
	void TimeInter(CDC& dc);
	void PositionParts(CDC& dc);
	float PolArea();
	CPoint TranCoord (float x,float y);
	void GenParts (CDC& dc);
	void DelCorner (int i);
	int FindCorner (CPoint pt);
	void PlotArea(CDC& dc);
	CIntElem* GetIntElm(int i);
	CIntPoint* GetIntPt(int i);
	CElement* GetElement(int i);
	CNode* GetNode(int i);
	CWell* GetWell(int i);
	CNode* GetArNode(int i);
	void PlotIntPt (CDC* pDC,int sz,BOOL IsNum);
	void PlotNod (CDC* pDC,int sz,BOOL IsNum);
	void PlotWells(CDC *td,int sz);
	void PlotElem (CDC *td,BOOL IsNum);
	void Veloc (double& vx,double& vy,float xb,float yb);
	void InVel (double xp,double yp,double x1,double y1,double x2,double y2,double& hx,double& hy,double& gx,double& gy,double tt);
	CSize GetDocSize();
	CNode* AddCorner (CPoint pt);
	CNode* AddCorner(float x,float y);
	void ScaleNodes(CRect rc);
	virtual ~CBemRawDoc();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CBemRawDoc)
	afx_msg void OnPartSave();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

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

#endif // !defined(AFX_BEMRAWDOC_H__B84A67AC_3DE7_11D3_B28A_00C0DFA996CB__INCLUDED_)
