1 // Viewer3dView.h : interface of the CViewer3dView class
3 /////////////////////////////////////////////////////////////////////////////
5 #if !defined(AFX_VIEWERVIEW_H__4EF39FBC_4EBB_11D1_8D67_0800369C8A03__INCLUDED_)
6 #define AFX_VIEWERVIEW_H__4EF39FBC_4EBB_11D1_8D67_0800369C8A03__INCLUDED_
8 #include <Viewer3dDoc.h>
10 #include <V3d_DirectionalLight.hxx>
11 #include <V3d_PositionalLight.hxx>
12 #include <V3d_AmbientLight.hxx>
13 #include <V3d_SpotLight.hxx>
17 #endif // _MSC_VER >= 1000
18 enum View3D_CurrentAction {
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
33 class CViewer3dView : public CView
35 protected: // create from serialization only
37 DECLARE_DYNCREATE(CViewer3dView)
40 CViewer3dDoc* GetDocument();
41 void Redraw() { myView->Redraw(); };
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(); };
54 // ClassWizard generated virtual function overrides
55 //{{AFX_VIRTUAL(CViewer3dView)
57 virtual void OnDraw(CDC* pDC); // overridden to draw this view
58 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
59 virtual void OnInitialUpdate();
64 virtual ~CViewer3dView();
66 virtual void AssertValid() const;
67 virtual void Dump(CDumpContext& dc) const;
76 // Generated message map functions
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();
125 DECLARE_MESSAGE_MAP()
127 enum VisMode { VIS_WIREFRAME, VIS_SHADE, VIS_HLR };
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;
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;
151 enum LineStyle { Solid, Dot, ShortDash, LongDash, Default };
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 );
160 UINT myScaleDirection;
161 void RedrawVisMode();
165 #ifndef _DEBUG // debug version in Viewer3dView.cpp
166 inline CViewer3dDoc* CViewer3dView::GetDocument()
167 { return (CViewer3dDoc*)m_pDocument; }
170 /////////////////////////////////////////////////////////////////////////////
172 //{{AFX_INSERT_LOCATION}}
173 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
175 #endif // !defined(AFX_VIEWERVIEW_H__4EF39FBC_4EBB_11D1_8D67_0800369C8A03__INCLUDED_)