0023791: Remove obsolete functionality - animation mode and degeneration presentation...
[occt.git] / samples / mfc / standard / 04_Viewer3d / src / Viewer3dView.h
1 // Viewer3dView.h : interface of the CViewer3dView class
2 //
3 /////////////////////////////////////////////////////////////////////////////
4
5 #if !defined(AFX_VIEWERVIEW_H__4EF39FBC_4EBB_11D1_8D67_0800369C8A03__INCLUDED_)
6 #define AFX_VIEWERVIEW_H__4EF39FBC_4EBB_11D1_8D67_0800369C8A03__INCLUDED_
7
8 #include <Viewer3dDoc.h>
9
10 #include <V3d_DirectionalLight.hxx>
11 #include <V3d_PositionalLight.hxx>
12 #include <V3d_AmbientLight.hxx>
13 #include <V3d_SpotLight.hxx>
14
15 #if _MSC_VER >= 1000
16 #pragma once
17 #endif // _MSC_VER >= 1000
18 enum View3D_CurrentAction { 
19   CurAction3d_Nothing,
20   CurAction3d_DynamicZooming,
21   CurAction3d_WindowZooming,
22   CurAction3d_DynamicPanning,
23   CurAction3d_GlobalPanning,
24   CurAction3d_DynamicRotation,
25   CurAction3d_BeginSpotLight,
26   CurAction3d_TargetSpotLight,
27   CurAction3d_EndSpotLight,
28   CurAction3d_BeginPositionalLight,
29   CurAction3d_BeginDirectionalLight,
30   CurAction3d_EndDirectionalLight
31 };
32
33 class CViewer3dView : public CView
34 {
35 protected: // create from serialization only
36         CViewer3dView();
37         DECLARE_DYNCREATE(CViewer3dView)
38
39 public:
40         CViewer3dDoc* GetDocument();
41         void Redraw() {   myView->Redraw(); };
42         void InitButtons();
43         void Reset();
44         void GetViewCenter(V3d_Coordinate& Xc, V3d_Coordinate& Yc);
45         void CViewer3dView::SetViewCenter(V3d_Coordinate Xc, V3d_Coordinate Yc);
46         void GetViewEye(V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z);
47         void SetViewEye(const V3d_Coordinate X,const V3d_Coordinate Y,const V3d_Coordinate Z);
48         Quantity_Factor GetViewScale();
49         void SetViewScale(const Quantity_Factor Coef);
50         void FitAll() {   myView->FitAll();  myView->ZFitAll();  };
51
52
53 // Overrides
54         // ClassWizard generated virtual function overrides
55         //{{AFX_VIRTUAL(CViewer3dView)
56         public:
57         virtual void OnDraw(CDC* pDC);  // overridden to draw this view
58         virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
59         virtual void OnInitialUpdate();
60         //}}AFX_VIRTUAL
61
62 // Implementation
63 public:
64         virtual ~CViewer3dView();
65 #ifdef _DEBUG
66         virtual void AssertValid() const;
67         virtual void Dump(CDumpContext& dc) const;
68 #endif
69
70   int scaleX;
71   int scaleY;
72   int scaleZ;
73
74 protected:
75
76 // Generated message map functions
77 protected:
78         //{{AFX_MSG(CViewer3dView)
79         afx_msg void OnBUTTONAxo();
80         afx_msg void OnBUTTONBack();
81         afx_msg void OnBUTTONBottom();
82         afx_msg void OnBUTTONFront();
83         afx_msg void OnBUTTONHlrOff();
84         afx_msg void OnBUTTONHlrOn();
85         afx_msg void OnBUTTONLeft();
86         afx_msg void OnBUTTONPan();
87         afx_msg void OnBUTTONPanGlo();
88         afx_msg void OnBUTTONReset();
89         afx_msg void OnBUTTONRight();
90         afx_msg void OnBUTTONRot();
91         afx_msg void OnBUTTONTop();
92         afx_msg void OnBUTTONZoomAll();
93         afx_msg void OnSize(UINT nType, int cx, int cy);
94         afx_msg void OnBUTTONZoomProg();
95         afx_msg void OnBUTTONZoomWin();
96         afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
97   afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
98         afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
99         afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
100         afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
101         afx_msg void OnMouseMove(UINT nFlags, CPoint point);
102         afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
103         afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
104     afx_msg void OnUpdateBUTTONHlrOff(CCmdUI* pCmdUI);
105         afx_msg void OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI);
106         afx_msg void OnUpdateBUTTONPanGlo(CCmdUI* pCmdUI);
107         afx_msg void OnUpdateBUTTONPan(CCmdUI* pCmdUI);
108         afx_msg void OnUpdateBUTTONZoomProg(CCmdUI* pCmdUI);
109         afx_msg void OnUpdateBUTTONZoomWin(CCmdUI* pCmdUI);
110         afx_msg void OnUpdateBUTTONRot(CCmdUI* pCmdUI);
111         afx_msg void OnModifyChangeBackground();
112         afx_msg void OnDirectionalLight();
113         afx_msg void OnSpotLight();
114         afx_msg void OnPositionalLight();
115         afx_msg void OnAmbientLight();
116         afx_msg void OnZcueing();
117         afx_msg void OnScale();
118         afx_msg void OnZclipping();
119         afx_msg void OnShadingmodel();
120         afx_msg void OnAntialiasingonoff();
121         afx_msg void OnClearLights();
122         afx_msg void OnModelclipping();
123         afx_msg void OnOptionsTrihedronStaticTrihedron();
124         //}}AFX_MSG
125         DECLARE_MESSAGE_MAP()
126 private:
127         enum VisMode { VIS_WIREFRAME, VIS_SHADE, VIS_HLR };
128         VisMode                        myVisMode;
129         
130   Handle_V3d_View                myView;
131   Handle_Graphic3d_GraphicDriver myGraphicDriver;
132   View3D_CurrentAction           myCurrentMode;
133   Standard_Integer               myXmin;
134   Standard_Integer               myYmin;
135   Standard_Integer               myXmax;
136   Standard_Integer               myYmax;
137   Standard_Integer               myWidth;
138   Standard_Integer               myHeight;
139
140   Standard_Integer               NbActiveLights;
141   Standard_Boolean               myHlrModeIsOn;
142   Quantity_Factor                myCurZoom;
143   Handle_V3d_AmbientLight        myCurrent_AmbientLight;
144   Handle_V3d_SpotLight           myCurrent_SpotLight;
145   Handle_V3d_PositionalLight     myCurrent_PositionalLight;
146   Handle_V3d_DirectionalLight    myCurrent_DirectionalLight;
147   Handle_V3d_Plane               myPlane;
148   Handle_AIS_Shape               myShape;
149
150 private:
151         enum LineStyle { Solid, Dot, ShortDash, LongDash, Default };
152         CPen*  m_Pen;
153     virtual void DrawRectangle (const Standard_Integer  MinX  ,
154                                                 const Standard_Integer  MinY  ,
155                                 const Standard_Integer  MaxX  ,
156                                                 const Standard_Integer  MaxY  ,
157                                                     const Standard_Boolean  Draw  ,
158                                 const LineStyle aLineStyle = Default  );
159         UINT myAxisKey;
160         UINT myScaleDirection;
161         void RedrawVisMode();
162
163 };
164
165 #ifndef _DEBUG  // debug version in Viewer3dView.cpp
166 inline CViewer3dDoc* CViewer3dView::GetDocument()
167    { return (CViewer3dDoc*)m_pDocument; }
168 #endif
169
170 /////////////////////////////////////////////////////////////////////////////
171
172 //{{AFX_INSERT_LOCATION}}
173 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
174
175 #endif // !defined(AFX_VIEWERVIEW_H__4EF39FBC_4EBB_11D1_8D67_0800369C8A03__INCLUDED_)