1 // HLRView.cpp : implementation of the CHLRView2D class
8 #include "resource2d\RectangularGrid.h"
9 #include "resource2d\CircularGrid.h"
14 //#define new DEBUG_NEW
16 static char THIS_FILE[] = __FILE__;
19 // the key for multi selection :
20 #define MULTISELECTIONKEY MK_SHIFT
22 // the key for shortcut ( use to activate dynamic rotation, panning )
23 #define CASCADESHORTCUTKEY MK_CONTROL
25 // define in witch case you want to display the popup
26 #define POPUPONBUTTONDOWN
28 /////////////////////////////////////////////////////////////////////////////
31 IMPLEMENT_DYNCREATE(CHLRView2D, OCC_2dView)
33 BEGIN_MESSAGE_MAP(CHLRView2D, OCC_2dView)
34 //{{AFX_MSG_MAP(CHLRView2D)
35 // NOTE - the ClassWizard will add and remove mapping macros here.
36 // DO NOT EDIT what you see in these blocks of generated code!
40 /////////////////////////////////////////////////////////////////////////////
41 // CHLRView2D construction/destruction
43 CHLRView2D::CHLRView2D()
47 CHLRView2D::~CHLRView2D()
51 CHLRDoc* CHLRView2D::GetDocument() // non-debug version is inline
53 //ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(OCC_2dDoc)));
54 return (CHLRDoc*)m_pDocument;
58 void CHLRView2D::OnInitialUpdate()
60 Handle(WNT_Window) aWNTWindow;
61 aWNTWindow = new WNT_Window(GetSafeHwnd(),Quantity_NOC_GRAY);
62 myV2dView = GetDocument()->GetViewer2D()->CreateView();
63 myV2dView->SetWindow(aWNTWindow);
65 // initialyse the grids dialogs
66 TheRectangularGridDialog.Create(CRectangularGrid::IDD, NULL);
67 TheCircularGridDialog.Create(CCircularGrid::IDD, NULL);
68 TheRectangularGridDialog.SetViewer (GetDocument()->GetViewer2D());
69 TheCircularGridDialog.SetViewer (GetDocument()->GetViewer2D());
71 Standard_Integer w=100 , h=100 ; /* Debug Matrox */
72 aWNTWindow->Size (w,h) ; /* Keeps me unsatisfied (rlb)..... */
73 /* Resize is not supposed to be done on */
75 /* I suspect another problem elsewhere */
76 ::PostMessage ( GetSafeHwnd () , WM_SIZE , SIZE_RESTORED , w + h*65536 ) ;
79 //-----------------------------------------------------------------------------------------
81 //-----------------------------------------------------------------------------------------
82 void CHLRView2D::DragEvent2D(const Standard_Integer x ,
83 const Standard_Integer y ,
84 const Standard_Integer TheState )
89 //-----------------------------------------------------------------------------------------
91 //-----------------------------------------------------------------------------------------
92 void CHLRView2D::InputEvent2D(const Standard_Integer x ,
93 const Standard_Integer y )
97 //-----------------------------------------------------------------------------------------
99 //-----------------------------------------------------------------------------------------
100 void CHLRView2D::MoveEvent2D(const Standard_Integer x ,
101 const Standard_Integer y )
105 //-----------------------------------------------------------------------------------------
107 //-----------------------------------------------------------------------------------------
108 void CHLRView2D::MultiMoveEvent2D(const Standard_Integer x ,
109 const Standard_Integer y )
113 //-----------------------------------------------------------------------------------------
115 //-----------------------------------------------------------------------------------------
116 void CHLRView2D::MultiDragEvent2D(const Standard_Integer x ,
117 const Standard_Integer y ,
118 const Standard_Integer TheState)
123 //-----------------------------------------------------------------------------------------
125 //-----------------------------------------------------------------------------------------
126 void CHLRView2D::MultiInputEvent2D(const Standard_Integer x ,
127 const Standard_Integer y )
133 void CHLRView2D::AssertValid() const
135 OCC_2dView::AssertValid();
138 void CHLRView2D::Dump(CDumpContext& dc) const
140 OCC_2dView::Dump(dc);