7fd59977 |
1 | // OCCDemoView.h : interface of the COCCDemoView class |
2 | // |
3 | ///////////////////////////////////////////////////////////////////////////// |
4 | |
5 | #if !defined(AFX_OCCDEMOVIEW_H__57A6A230_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_) |
6 | #define AFX_OCCDEMOVIEW_H__57A6A230_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_ |
7 | |
8 | #if _MSC_VER > 1000 |
9 | #pragma once |
10 | #endif // _MSC_VER > 1000 |
11 | |
12 | enum View3D_CurrentAction { |
13 | CurAction3d_Nothing, |
14 | CurAction3d_DynamicZooming, |
15 | CurAction3d_WindowZooming, |
16 | CurAction3d_DynamicPanning, |
17 | CurAction3d_GlobalPanning, |
18 | CurAction3d_DynamicRotation |
19 | }; |
20 | |
21 | class COCCDemoView : public CView |
22 | { |
23 | protected: // create from serialization only |
24 | COCCDemoView(); |
25 | DECLARE_DYNCREATE(COCCDemoView) |
26 | |
27 | // Attributes |
28 | public: |
29 | COCCDemoDoc* GetDocument(); |
9764ccbb |
30 | void FitAll() |
31 | { |
32 | myView->FitAll(); |
33 | myView->ZFitAll(); |
34 | }; |
35 | void GetViewAt (V3d_Coordinate& theX, V3d_Coordinate& theY, V3d_Coordinate& theZ) const; |
36 | void SetViewAt (const V3d_Coordinate theX, const V3d_Coordinate theY, const V3d_Coordinate theZ); |
37 | void GetViewEye (V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z); |
38 | void SetViewEye (const V3d_Coordinate X,const V3d_Coordinate Y,const V3d_Coordinate Z); |
7fd59977 |
39 | Quantity_Factor GetViewScale(); |
40 | void SetViewScale(const Quantity_Factor Coef); |
9764ccbb |
41 | void Translate (const V3d_Coordinate theX, const V3d_Coordinate theY); |
7fd59977 |
42 | |
43 | |
44 | // Operations |
45 | public: |
46 | void InitButtons(); |
47 | void Reset(); |
48 | |
49 | // Overrides |
50 | // ClassWizard generated virtual function overrides |
51 | //{{AFX_VIRTUAL(COCCDemoView) |
52 | public: |
53 | virtual void OnDraw(CDC* pDC); // overridden to draw this view |
54 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); |
55 | virtual void OnInitialUpdate(); |
56 | protected: |
57 | //}}AFX_VIRTUAL |
58 | |
59 | // Implementation |
60 | public: |
61 | virtual ~COCCDemoView(); |
62 | #ifdef _DEBUG |
63 | virtual void AssertValid() const; |
64 | virtual void Dump(CDumpContext& dc) const; |
65 | #endif |
66 | |
67 | protected: |
68 | |
69 | // Generated message map functions |
70 | protected: |
71 | //{{AFX_MSG(COCCDemoView) |
72 | afx_msg void OnBUTTONAxo(); |
73 | afx_msg void OnBUTTONBack(); |
74 | afx_msg void OnBUTTONBottom(); |
75 | afx_msg void OnBUTTONFront(); |
76 | afx_msg void OnBUTTONHlrOn(); |
77 | afx_msg void OnBUTTONLeft(); |
78 | afx_msg void OnBUTTONPan(); |
79 | afx_msg void OnBUTTONPanGlo(); |
80 | afx_msg void OnBUTTONReset(); |
81 | afx_msg void OnBUTTONRight(); |
82 | afx_msg void OnBUTTONRot(); |
83 | afx_msg void OnBUTTONTop(); |
84 | afx_msg void OnBUTTONZoomAll(); |
85 | afx_msg void OnSize(UINT nType, int cx, int cy); |
86 | afx_msg void OnBUTTONZoomProg(); |
87 | afx_msg void OnBUTTONZoomWin(); |
88 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); |
89 | afx_msg void OnLButtonUp(UINT nFlags, CPoint point); |
90 | afx_msg void OnMouseMove(UINT nFlags, CPoint point); |
91 | afx_msg void OnRButtonDown(UINT nFlags, CPoint point); |
92 | afx_msg void OnRButtonUp(UINT nFlags, CPoint point); |
93 | afx_msg void OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI); |
94 | afx_msg void OnUpdateBUTTONPan(CCmdUI* pCmdUI); |
95 | afx_msg void OnUpdateBUTTONZoomProg(CCmdUI* pCmdUI); |
96 | afx_msg void OnUpdateBUTTONZoomWin(CCmdUI* pCmdUI); |
97 | afx_msg void OnUpdateBUTTONRot(CCmdUI* pCmdUI); |
98 | afx_msg void OnBUTTONWire(); |
99 | afx_msg void OnBUTTONShade(); |
100 | afx_msg void OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI); |
101 | afx_msg void OnUpdateBUTTONShade(CCmdUI* pCmdUI); |
102 | afx_msg void OnUpdateBUTTONWire(CCmdUI* pCmdUI); |
103 | //}}AFX_MSG |
104 | DECLARE_MESSAGE_MAP() |
105 | |
106 | private: |
107 | void RedrawVisMode(); |
108 | |
109 | private: |
110 | enum VisMode { VIS_WIREFRAME, VIS_SHADE, VIS_HLR }; |
92efcf78 |
111 | Handle(V3d_View) myView; |
112 | Handle(Graphic3d_GraphicDriver) myGraphicDriver; |
7fd59977 |
113 | View3D_CurrentAction myCurrentMode; |
114 | VisMode myVisMode; |
115 | Standard_Integer myXmin; |
116 | Standard_Integer myYmin; |
117 | Standard_Integer myXmax; |
118 | Standard_Integer myYmax; |
119 | Quantity_Factor myCurZoom; |
120 | |
121 | private: |
122 | enum LineStyle { Solid, Dot, ShortDash, LongDash, Default }; |
123 | CPen* m_Pen; |
124 | virtual void DrawRectangle (const Standard_Integer MinX , |
125 | const Standard_Integer MinY , |
126 | const Standard_Integer MaxX , |
127 | const Standard_Integer MaxY , |
128 | const Standard_Boolean Draw , |
129 | const LineStyle aLineStyle = Default ); |
130 | |
131 | }; |
132 | |
133 | #ifndef _DEBUG // debug version in OCCDemoView.cpp |
134 | inline COCCDemoDoc* COCCDemoView::GetDocument() |
135 | { return (COCCDemoDoc*)m_pDocument; } |
136 | #endif |
137 | |
138 | ///////////////////////////////////////////////////////////////////////////// |
139 | |
140 | //{{AFX_INSERT_LOCATION}} |
141 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. |
142 | |
143 | #endif // !defined(AFX_OCCDEMOVIEW_H__57A6A230_7B4F_11D5_BA4A_0060B0EE18EA__INCLUDED_) |