// EasyOCDoc.cpp : implementation of the CEasyOCDoc class
//

#include "stdafx.h"
#include "EasyOC.h"

#include "EasyOCDoc.h"

//#ifdef _DEBUG
//#define new DEBUG_NEW
//#endif


// CEasyOCDoc

IMPLEMENT_DYNCREATE(CEasyOCDoc, CDocument)

BEGIN_MESSAGE_MAP(CEasyOCDoc, CDocument)
END_MESSAGE_MAP()


// CEasyOCDoc construction/destruction

CEasyOCDoc::CEasyOCDoc()
{
	// TODO: add one-time construction code here
   Handle(Graphic3d_WNTGraphicDevice) hGD = ((CEasyOCApp*)AfxGetApp())->m_GraphicDevice;
   TCollection_ExtendedString strName("2D Viewer");
   TCollection_AsciiString strDomain("My Domain");

   m_3dViewer = new V3d_Viewer(hGD, strName.ToExtString(), 
      strDomain.ToCString());
   m_3dViewer->SetDefaultLights();
   m_3dViewer->SetLightOn();
   //m_3dViewer->SetCircularGridValues(0,0,10,8,0);
   //m_3dViewer->SetRectangularGridValues(0,0,10,10,0);

   m_AISContext = new AIS_InteractiveContext(m_3dViewer);
   m_AISContext->SetDisplayMode(AIS_Shaded,Standard_False);
}

CEasyOCDoc::~CEasyOCDoc()
{
}

BOOL CEasyOCDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;
}




// CEasyOCDoc serialization

void CEasyOCDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}


// CEasyOCDoc diagnostics

#ifdef _DEBUG
void CEasyOCDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CEasyOCDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG


// CEasyOCDoc commands
