0031521: Samples - update MFC ImportExport sample to use AIS_ViewController
[occt.git] / samples / mfc / standard / 01_Geometry / src / GeometryView2D.cpp
1 // NSGViewBibliotheque.cpp : implementation of the CGeometryView2D class
2 //
3
4 #include "stdafx.h"
5 #include "GeometryApp.h"
6 #include "GeometryDoc.h"
7 #include "GeometryView2D.h"
8 #include ".\Resource2d\RectangularGrid.h"
9 #include ".\Resource2d\CircularGrid.h"
10
11 /////////////////////////////////////////////////////////////////////////////
12 // CNSGView
13
14 IMPLEMENT_DYNCREATE(CGeometryView2D, OCC_2dView)
15 BEGIN_MESSAGE_MAP(CGeometryView2D, OCC_2dView)
16   //{{AFX_MSG_MAP(CGeometryView2D)
17   //}}AFX_MSG_MAP
18 END_MESSAGE_MAP()
19
20 /////////////////////////////////////////////////////////////////////////////
21 // CNSGView construction/destruction
22
23 CGeometryView2D::CGeometryView2D()
24 {
25 }
26
27 CGeometryView2D::~CGeometryView2D()
28 {
29 }
30
31 const Handle(AIS_InteractiveContext)& CGeometryView2D::GetAISContext() const
32 {
33   return ((CGeometryDoc*)m_pDocument)->GetISessionContext();
34 }
35
36 /////////////////////////////////////////////////////////////////////////////
37 // CGeometryView2D diagnostics
38
39 #ifdef _DEBUG
40 void CGeometryView2D::AssertValid() const
41 {
42   CView::AssertValid();
43 }
44
45 void CGeometryView2D::Dump(CDumpContext& dc) const
46 {
47   CView::Dump(dc);
48 }
49
50 CGeometryDoc* CGeometryView2D::GetDocument() // non-debug version is inline
51 {
52   ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CGeometryDoc)));
53   return (CGeometryDoc*)m_pDocument;
54 }
55 #endif //_DEBUG
56
57 /////////////////////////////////////////////////////////////////////////////
58 // CNSGView message handlers
59
60 //=================================================================
61 void CGeometryView2D::OnInitialUpdate()
62 {
63   OCC_2dView::OnInitialUpdate();
64   myView->SetBackgroundColor (Quantity_NOC_BLACK);
65 }