1 // OCCDemoView.h : interface of the COCCDemoView class
3 /////////////////////////////////////////////////////////////////////////////
5 #if !defined(AFX_OCCDEMOVIEW_H__57A6A230_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)
6 #define AFX_OCCDEMOVIEW_H__57A6A230_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_
10 #endif // _MSC_VER > 1000
12 enum View3D_CurrentAction {
14 CurAction3d_DynamicZooming,
15 CurAction3d_WindowZooming,
16 CurAction3d_DynamicPanning,
17 CurAction3d_GlobalPanning,
18 CurAction3d_DynamicRotation
21 class COCCDemoView : public CView
23 protected: // create from serialization only
25 DECLARE_DYNCREATE(COCCDemoView)
29 COCCDemoDoc* GetDocument();
35 void FitAll() { myView->FitAll(); myView->ZFitAll(); };
36 void GetViewCenter(V3d_Coordinate& Xc, V3d_Coordinate& Yc);
37 void SetViewCenter(const V3d_Coordinate Xc, const V3d_Coordinate Yc);
38 void GetViewEye(V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z);
39 void SetViewEye(const V3d_Coordinate X,const V3d_Coordinate Y,const V3d_Coordinate Z);
40 Quantity_Factor GetViewScale();
41 void SetViewScale(const Quantity_Factor Coef);
45 // ClassWizard generated virtual function overrides
46 //{{AFX_VIRTUAL(COCCDemoView)
48 virtual void OnDraw(CDC* pDC); // overridden to draw this view
49 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
50 virtual void OnInitialUpdate();
56 virtual ~COCCDemoView();
58 virtual void AssertValid() const;
59 virtual void Dump(CDumpContext& dc) const;
64 // Generated message map functions
66 //{{AFX_MSG(COCCDemoView)
67 afx_msg void OnBUTTONAxo();
68 afx_msg void OnBUTTONBack();
69 afx_msg void OnBUTTONBottom();
70 afx_msg void OnBUTTONFront();
71 afx_msg void OnBUTTONHlrOn();
72 afx_msg void OnBUTTONLeft();
73 afx_msg void OnBUTTONPan();
74 afx_msg void OnBUTTONPanGlo();
75 afx_msg void OnBUTTONReset();
76 afx_msg void OnBUTTONRight();
77 afx_msg void OnBUTTONRot();
78 afx_msg void OnBUTTONTop();
79 afx_msg void OnBUTTONZoomAll();
80 afx_msg void OnSize(UINT nType, int cx, int cy);
81 afx_msg void OnBUTTONZoomProg();
82 afx_msg void OnBUTTONZoomWin();
83 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
84 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
85 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
86 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
87 afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
88 afx_msg void OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI);
89 afx_msg void OnUpdateBUTTONPan(CCmdUI* pCmdUI);
90 afx_msg void OnUpdateBUTTONZoomProg(CCmdUI* pCmdUI);
91 afx_msg void OnUpdateBUTTONZoomWin(CCmdUI* pCmdUI);
92 afx_msg void OnUpdateBUTTONRot(CCmdUI* pCmdUI);
93 afx_msg void OnBUTTONWire();
94 afx_msg void OnBUTTONShade();
95 afx_msg void OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI);
96 afx_msg void OnUpdateBUTTONShade(CCmdUI* pCmdUI);
97 afx_msg void OnUpdateBUTTONWire(CCmdUI* pCmdUI);
102 void RedrawVisMode();
105 enum VisMode { VIS_WIREFRAME, VIS_SHADE, VIS_HLR };
106 Handle_V3d_View myView;
107 Handle_Graphic3d_GraphicDriver myGraphicDriver;
108 View3D_CurrentAction myCurrentMode;
110 Standard_Integer myXmin;
111 Standard_Integer myYmin;
112 Standard_Integer myXmax;
113 Standard_Integer myYmax;
114 Quantity_Factor myCurZoom;
117 enum LineStyle { Solid, Dot, ShortDash, LongDash, Default };
119 virtual void DrawRectangle (const Standard_Integer MinX ,
120 const Standard_Integer MinY ,
121 const Standard_Integer MaxX ,
122 const Standard_Integer MaxY ,
123 const Standard_Boolean Draw ,
124 const LineStyle aLineStyle = Default );
128 #ifndef _DEBUG // debug version in OCCDemoView.cpp
129 inline COCCDemoDoc* COCCDemoView::GetDocument()
130 { return (COCCDemoDoc*)m_pDocument; }
133 /////////////////////////////////////////////////////////////////////////////
135 //{{AFX_INSERT_LOCATION}}
136 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
138 #endif // !defined(AFX_OCCDEMOVIEW_H__57A6A230_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_)