| 1 | // OCC_3dView.h: interface for the OCC_3dView class. |
| 2 | // |
| 3 | ////////////////////////////////////////////////////////////////////// |
| 4 | |
| 5 | #if !defined(AFX_OCC_3DVIEW_H__1F4065AE_39C4_11D7_8611_0060B0EE281E__INCLUDED_) |
| 6 | #define AFX_OCC_3DVIEW_H__1F4065AE_39C4_11D7_8611_0060B0EE281E__INCLUDED_ |
| 7 | |
| 8 | #if _MSC_VER > 1000 |
| 9 | #pragma once |
| 10 | #endif // _MSC_VER > 1000 |
| 11 | |
| 12 | #include "OCC_BaseView.h" |
| 13 | #include "OCC_3dDoc.h" |
| 14 | #include "OCC_StereoConfigDlg.h" |
| 15 | #include <Standard_Macro.hxx> |
| 16 | |
| 17 | enum CurAction3d { |
| 18 | CurAction3d_Nothing, |
| 19 | CurAction3d_DynamicZooming, |
| 20 | CurAction3d_WindowZooming, |
| 21 | CurAction3d_DynamicPanning, |
| 22 | CurAction3d_GlobalPanning, |
| 23 | CurAction3d_DynamicRotation |
| 24 | }; |
| 25 | |
| 26 | class AFX_EXT_CLASS OCC_3dView : public OCC_BaseView |
| 27 | { |
| 28 | DECLARE_DYNCREATE(OCC_3dView) |
| 29 | public: |
| 30 | OCC_3dView(); |
| 31 | virtual ~OCC_3dView(); |
| 32 | |
| 33 | OCC_3dDoc* GetDocument(); |
| 34 | void FitAll() { if ( !myView.IsNull() ) myView->FitAll(); myView->ZFitAll(); }; |
| 35 | void Redraw() { if ( !myView.IsNull() ) myView->Redraw(); }; |
| 36 | |
| 37 | void SetZoom ( const Standard_Real& Coef ) { myView->SetZoom ( Coef ); }; |
| 38 | |
| 39 | Handle(V3d_View)& GetView() { return myView; } |
| 40 | // Overrides |
| 41 | // ClassWizard generated virtual function overrides |
| 42 | //{{AFX_VIRTUAL(OCC_3dView) |
| 43 | public: |
| 44 | virtual void OnDraw(CDC* pDC); // overridden to draw this view |
| 45 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); |
| 46 | virtual void OnInitialUpdate(); |
| 47 | //}}AFX_VIRTUAL |
| 48 | |
| 49 | // Generated message map functions |
| 50 | protected: |
| 51 | //{{AFX_MSG(OCC_3dView) |
| 52 | afx_msg void OnBUTTONAxo(); |
| 53 | afx_msg void OnBUTTONBack(); |
| 54 | afx_msg void OnBUTTONBottom(); |
| 55 | afx_msg void OnBUTTONFront(); |
| 56 | afx_msg void OnBUTTONHlrOff(); |
| 57 | afx_msg void OnBUTTONHlrOn(); |
| 58 | afx_msg void OnBUTTONLeft(); |
| 59 | afx_msg void OnBUTTONPan(); |
| 60 | afx_msg void OnBUTTONPanGlo(); |
| 61 | afx_msg void OnBUTTONReset(); |
| 62 | afx_msg void OnBUTTONRight(); |
| 63 | afx_msg void OnBUTTONRot(); |
| 64 | afx_msg void OnBUTTONTop(); |
| 65 | afx_msg void OnBUTTONZoomAll(); |
| 66 | afx_msg void OnFileExportImage(); |
| 67 | afx_msg void OnSize(UINT nType, int cx, int cy); |
| 68 | afx_msg void OnBUTTONZoomProg(); |
| 69 | afx_msg void OnBUTTONZoomWin(); |
| 70 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); |
| 71 | afx_msg void OnLButtonUp(UINT nFlags, CPoint point); |
| 72 | afx_msg void OnMButtonDown(UINT nFlags, CPoint point); |
| 73 | afx_msg void OnMButtonUp(UINT nFlags, CPoint point); |
| 74 | afx_msg void OnMouseMove(UINT nFlags, CPoint point); |
| 75 | afx_msg void OnRButtonDown(UINT nFlags, CPoint point); |
| 76 | afx_msg void OnRButtonUp(UINT nFlags, CPoint point); |
| 77 | afx_msg void OnUpdateBUTTONHlrOff(CCmdUI* pCmdUI); |
| 78 | afx_msg void OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI); |
| 79 | afx_msg void OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI); |
| 80 | afx_msg void OnUpdateBUTTONPan(CCmdUI* pCmdUI); |
| 81 | afx_msg void OnUpdateBUTTONZoomProg(CCmdUI* pCmdUI); |
| 82 | afx_msg void OnUpdateBUTTONZoomWin(CCmdUI* pCmdUI); |
| 83 | afx_msg void OnUpdateBUTTONRot(CCmdUI* pCmdUI); |
| 84 | afx_msg void OnModifyChangeBackground(); |
| 85 | afx_msg void OnStereoConfigButton(); |
| 86 | afx_msg void OnUpdateStereoConfigButton (CCmdUI* theCmdUI); |
| 87 | //}}AFX_MSG |
| 88 | DECLARE_MESSAGE_MAP() |
| 89 | |
| 90 | #ifdef _DEBUG |
| 91 | virtual void AssertValid() const; |
| 92 | virtual void Dump(CDumpContext& dc) const; |
| 93 | #endif |
| 94 | |
| 95 | protected: |
| 96 | |
| 97 | Handle(V3d_View) myView; |
| 98 | CurAction3d myCurrentMode; |
| 99 | Standard_Integer myWidth; |
| 100 | Standard_Integer myHeight; |
| 101 | Standard_Boolean myHlrModeIsOn; |
| 102 | |
| 103 | private: |
| 104 | |
| 105 | //! Persistent non blocking stereo configuration dialog |
| 106 | OCC_StereoConfigDlg* m_pStereoDlg; |
| 107 | }; |
| 108 | |
| 109 | #ifndef _DEBUG // debug version in OCC_3dView.cpp |
| 110 | inline OCC_3dDoc* OCC_3dView::GetDocument() |
| 111 | { return (OCC_3dDoc*)m_pDocument; } |
| 112 | #endif |
| 113 | |
| 114 | #endif // !defined(AFX_OCC_3DVIEW_H__1F4065AE_39C4_11D7_8611_0060B0EE281E__INCLUDED_) |