0031431: Visualization, PrsMgr_PresentableObject - simplify HLR computing interface
[occt.git] / samples / mfc / standard / 04_Viewer3d / src / ShadingModelDlg.cpp
1 // ShadingModelDlg.cpp : implementation file
2 //
3
4 #include "stdafx.h"
5 #include "Viewer3dApp.h"
6 #include "ShadingModelDlg.h"
7
8 #ifdef _DEBUG
9 #define new DEBUG_NEW
10 #undef THIS_FILE
11 static char THIS_FILE[] = __FILE__;
12 #endif
13
14 /////////////////////////////////////////////////////////////////////////////
15 // CShadingModelDlg dialog
16
17
18 CShadingModelDlg::CShadingModelDlg(Handle(V3d_View) Current_V3d_View, CWnd* pParent /*=NULL*/)
19         : CDialog(CShadingModelDlg::IDD, pParent)
20 {
21         //{{AFX_DATA_INIT(CShadingModelDlg)
22         myCurrent_V3d_View=Current_V3d_View;
23         //}}AFX_DATA_INIT
24 }
25
26
27 void CShadingModelDlg::DoDataExchange(CDataExchange* pDX)
28 {
29         CDialog::DoDataExchange(pDX);
30         //{{AFX_DATA_MAP(CShadingModelDlg)
31                 // NOTE: the ClassWizard will add DDX and DDV calls here
32         //}}AFX_DATA_MAP
33 }
34
35
36 BEGIN_MESSAGE_MAP(CShadingModelDlg, CDialog)
37         //{{AFX_MSG_MAP(CShadingModelDlg)
38         ON_BN_CLICKED(IDC_SHADINGMODEL_COLOR,   OnShadingmodelColor)
39         ON_BN_CLICKED(IDC_SHADINGMODEL_FLAT,    OnShadingmodelFlat)
40         ON_BN_CLICKED(IDC_SHADINGMODEL_GOURAUD, OnShadingmodelGouraud)
41         ON_BN_CLICKED(IDC_SHADINGMODEL_PHONG,   OnShadingmodelPhong)
42         //}}AFX_MSG_MAP
43 END_MESSAGE_MAP()
44
45 /////////////////////////////////////////////////////////////////////////////
46 // CShadingModelDlg message handlers
47
48 void CShadingModelDlg::OnShadingmodelColor() 
49 {
50         myCurrent_V3d_View->SetShadingModel(V3d_COLOR);
51         myCurrent_V3d_View->Update();
52 }
53
54 void CShadingModelDlg::OnShadingmodelFlat() 
55 {
56         myCurrent_V3d_View->SetShadingModel(V3d_FLAT);
57         myCurrent_V3d_View->Update();   
58 }
59
60 void CShadingModelDlg::OnShadingmodelGouraud() 
61 {
62         myCurrent_V3d_View->SetShadingModel(V3d_GOURAUD);
63         myCurrent_V3d_View->Update();   
64 }
65
66 void CShadingModelDlg::OnShadingmodelPhong()
67 {
68         myCurrent_V3d_View->SetShadingModel(V3d_PHONG);
69         myCurrent_V3d_View->Update();
70 }