0027772: Foundation Classes - define Standard_Boolean using C++ type "bool" instead...
[occt.git] / samples / mfc / standard / Common / ColoredMeshDlg.cpp
CommitLineData
7fd59977 1// ColoredMeshDlg.cpp : implementation file
2//
3
4#include "stdafx.h"
5#include "ColoredMeshDlg.h"
6
7#ifdef _DEBUG
8#define new DEBUG_NEW
9#undef THIS_FILE
10static char THIS_FILE[] = __FILE__;
11#endif
12
13/////////////////////////////////////////////////////////////////////////////
14// CColoredMeshDlg dialog
15
16
17CColoredMeshDlg::CColoredMeshDlg(CWnd* pParent /*=NULL*/)
18 : CDialog(CColoredMeshDlg::IDD, pParent)
19{
20 //{{AFX_DATA_INIT(CColoredMeshDlg)
21 // NOTE: the ClassWizard will add member initialization here
22 //}}AFX_DATA_INIT
23}
24
25
26void CColoredMeshDlg::DoDataExchange(CDataExchange* pDX)
27{
28 CDialog::DoDataExchange(pDX);
29 //{{AFX_DATA_MAP(CColoredMeshDlg)
30 DDX_Check(pDX, IDC_RADIO1, m_Rad1OnOff);
31 DDX_Check(pDX, IDC_RADIO2, m_Rad2OnOff);
32 DDX_Check(pDX, IDC_RADIO3, m_Rad3OnOff);
33 DDX_Check(pDX, IDC_CHECK_X1, m_CheckX1OnOff);
34 DDX_Check(pDX, IDC_CHECK_XBlue, m_CheckXBlueOnOff);
35 DDX_Check(pDX, IDC_CHECK_XGreen, m_CheckXGreenOnOff);
36 DDX_Check(pDX, IDC_CHECK_XRed, m_CheckXRedOnOff);
37 DDX_Check(pDX, IDC_CHECK_Y1, m_CheckY1OnOff);
38 DDX_Check(pDX, IDC_CHECK_YBlue, m_CheckYBlueOnOff);
39 DDX_Check(pDX, IDC_CHECK_YGreen, m_CheckYGreenOnOff);
40 DDX_Check(pDX, IDC_CHECK_YRed, m_CheckYRedOnOff);
41 DDX_Check(pDX, IDC_CHECK_Z1, m_CheckZ1OnOff);
42 DDX_Check(pDX, IDC_CHECK_ZBlue, m_CheckZBlueOnOff);
43 DDX_Check(pDX, IDC_CHECK_ZGreen, m_CheckZGreenOnOff);
44 DDX_Check(pDX, IDC_CHECK_ZRed, m_CheckZRedOnOff);
45
46 //}}AFX_DATA_MAP
47}
48
49
50BEGIN_MESSAGE_MAP(CColoredMeshDlg, CDialog)
51 //{{AFX_MSG_MAP(CColoredMeshDlg)
52 ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
53 ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
54 ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
55 ON_BN_CLICKED(IDC_CHECK_X1, OnCheckX1)
56 ON_BN_CLICKED(IDC_CHECK_XBlue, OnCHECKXBlue)
57 ON_BN_CLICKED(IDC_CHECK_XGreen, OnCHECKXGreen)
58 ON_BN_CLICKED(IDC_CHECK_XRed, OnCHECKXRed)
59 ON_BN_CLICKED(IDC_CHECK_Y1, OnCheckY1)
60 ON_BN_CLICKED(IDC_CHECK_YBlue, OnCHECKYBlue)
61 ON_BN_CLICKED(IDC_CHECK_YGreen, OnCHECKYGreen)
62 ON_BN_CLICKED(IDC_CHECK_YRed, OnCHECKYRed)
63 ON_BN_CLICKED(IDC_CHECK_Z1, OnCheckZ1)
64 ON_BN_CLICKED(IDC_CHECK_ZBlue, OnCHECKZBlue)
65 ON_BN_CLICKED(IDC_CHECK_ZGreen, OnCHECKZGreen)
66 ON_BN_CLICKED(IDC_CHECK_ZRed, OnCHECKZRed)
67 //}}AFX_MSG_MAP
68END_MESSAGE_MAP()
69
70/////////////////////////////////////////////////////////////////////////////
71// CColoredMeshDlg message handlers
72void CColoredMeshDlg::OnCancel()
73{
74 OK = Standard_False;
75 CDialog::OnCancel();
76}
77
78void CColoredMeshDlg::OnOK()
79{
80 OK = Standard_True;
81 CDialog::OnOK();
82}
83
84BOOL CColoredMeshDlg::OnInitDialog()
85{
86 CDialog::OnInitDialog();
87 UpdateData (TRUE);
88 m_Rad3OnOff = Standard_True;
89 m_CheckXRedOnOff = Standard_True;
90 m_CheckXGreenOnOff = Standard_False;
91 m_CheckXBlueOnOff = Standard_False;
92 m_CheckYRedOnOff = Standard_False;
93 m_CheckYGreenOnOff = Standard_True;
94 m_CheckYBlueOnOff = Standard_False;
95 m_CheckZRedOnOff = Standard_False;
96 m_CheckZGreenOnOff = Standard_False;
97 m_CheckZBlueOnOff = Standard_True;
98
99 Colorization = 2;
100
101 UpdateData (FALSE);
102
103 // TODO: Add extra initialization here
104
105 return TRUE; // return TRUE unless you set the focus to a control
106 // EXCEPTION: OCX Property Pages should return FALSE
107}
108
109void CColoredMeshDlg::OnRadio1()
110{
111 Colorization = 0;
112}
113
114void CColoredMeshDlg::OnRadio2()
115{
116 Colorization = 1;
117}
118
119void CColoredMeshDlg::OnRadio3()
120{
121 Colorization = 2;
122
123}
124
125void CColoredMeshDlg::OnCheckX1()
126{
dde68833 127 X1OnOff = m_CheckX1OnOff != 0;
7fd59977 128}
129
130void CColoredMeshDlg::OnCHECKXBlue()
131{
132 UpdateData (TRUE);
133 m_CheckXRedOnOff = Standard_False;
134 m_CheckXGreenOnOff = Standard_False;
135 m_CheckXBlueOnOff = Standard_True;
136 UpdateData (FALSE);
137}
138
139void CColoredMeshDlg::OnCHECKXGreen()
140{
141 UpdateData (TRUE);
142 m_CheckXRedOnOff = Standard_False;
143 m_CheckXGreenOnOff = Standard_True;
144 m_CheckXBlueOnOff = Standard_False;
145 UpdateData (FALSE);
146}
147
148void CColoredMeshDlg::OnCHECKXRed()
149{
150 UpdateData (TRUE);
151 m_CheckXRedOnOff = Standard_True;
152 m_CheckXGreenOnOff = Standard_False;
153 m_CheckXBlueOnOff = Standard_False;
154 UpdateData (FALSE);
155}
156
157void CColoredMeshDlg::OnCheckY1()
158{
dde68833 159 Y1OnOff = m_CheckY1OnOff != 0;
7fd59977 160}
161
162void CColoredMeshDlg::OnCHECKYBlue()
163{
164 UpdateData (TRUE);
165 m_CheckYRedOnOff = Standard_False;
166 m_CheckYGreenOnOff = Standard_False;
167 m_CheckYBlueOnOff = Standard_True;
168 UpdateData (FALSE);
169}
170
171void CColoredMeshDlg::OnCHECKYGreen()
172{
173 UpdateData (TRUE);
174 m_CheckYRedOnOff = Standard_False;
175 m_CheckYGreenOnOff = Standard_True;
176 m_CheckYBlueOnOff = Standard_False;
177 UpdateData (FALSE);
178}
179
180void CColoredMeshDlg::OnCHECKYRed()
181{
182 UpdateData (TRUE);
183 m_CheckYRedOnOff = Standard_True;
184 m_CheckYGreenOnOff = Standard_False;
185 m_CheckYBlueOnOff = Standard_False;
186 UpdateData (FALSE);
187}
188
189void CColoredMeshDlg::OnCheckZ1()
190{
dde68833 191 Z1OnOff = m_CheckZ1OnOff != 0;
7fd59977 192}
193
194void CColoredMeshDlg::OnCHECKZBlue()
195{
196 UpdateData (TRUE);
197 m_CheckZRedOnOff = Standard_False;
198 m_CheckZGreenOnOff = Standard_False;
199 m_CheckZBlueOnOff = Standard_True;
200 UpdateData (FALSE);
201}
202
203void CColoredMeshDlg::OnCHECKZGreen()
204{
205 UpdateData (TRUE);
206 m_CheckZRedOnOff = Standard_False;
207 m_CheckZGreenOnOff = Standard_True;
208 m_CheckZBlueOnOff = Standard_False;
209 UpdateData (FALSE);
210}
211
212void CColoredMeshDlg::OnCHECKZRed()
213{
214 UpdateData (TRUE);
215 m_CheckZRedOnOff = Standard_True;
216 m_CheckZGreenOnOff = Standard_False;
217 m_CheckZBlueOnOff = Standard_False;
218 UpdateData (FALSE);
219}