Integration of OCCT 6.5.0 from SVN
[occt.git] / samples / mfc / standard / 08_HLR / src / Properties / ColorNewColorCubeColorMapDialog.cpp
1 // ColorNewColorCubeColorMapDialog.cpp : implementation file
2 //
3
4 #include "stdafx.h"
5
6 #include "ColorNewColorCubeColorMapDialog.h"
7
8 #include <HLRApp.h>
9 #include "Aspect_ColorCubeColorMap.hxx"
10
11 #ifdef _DEBUG
12 //#define new DEBUG_NEW
13 #undef THIS_FILE
14 static char THIS_FILE[] = __FILE__;
15 #endif
16
17 /////////////////////////////////////////////////////////////////////////////
18 // CColorNewColorCubeColorMapDialog dialog
19
20
21 CColorNewColorCubeColorMapDialog::CColorNewColorCubeColorMapDialog(CWnd* pParent /*=NULL*/)
22         : CDialog(CColorNewColorCubeColorMapDialog::IDD, pParent)
23 {
24         //{{AFX_DATA_INIT(CColorNewColorCubeColorMapDialog)
25         m_base_pixel = 0;
26         m_redmax     = 7;
27         m_redmult    = 1;
28         m_greenmax   = 7;
29         m_greenmult  = 8;
30         m_bluemax    = 3;
31         m_bluemult   = 64;
32         //}}AFX_DATA_INIT
33 }
34
35 void CColorNewColorCubeColorMapDialog::DoDataExchange(CDataExchange* pDX)
36 {
37         CDialog::DoDataExchange(pDX);
38         //{{AFX_DATA_MAP(CColorNewColorCubeColorMapDialog)
39         DDX_Text(pDX, IDC_NewColorCube_EDIT_base_pixel, m_base_pixel);
40         DDX_Text(pDX, IDC_NewColorCube_EDIT_redmax, m_redmax);
41         DDX_Text(pDX, IDC_NewColorCube_EDIT_redmult, m_redmult);
42         DDX_Text(pDX, IDC_NewColorCube_EDIT_greenmax, m_greenmax);
43         DDX_Text(pDX, IDC_NewColorCube_EDIT_grennmult, m_greenmult);
44         DDX_Text(pDX, IDC_NewColorCube_EDIT_bluemax, m_bluemax);
45         DDX_Text(pDX, IDC_NewColorCube_EDIT_bluemult, m_bluemult);
46         //}}AFX_DATA_MAP
47 }
48
49
50 BEGIN_MESSAGE_MAP(CColorNewColorCubeColorMapDialog, CDialog)
51         //{{AFX_MSG_MAP(CColorNewColorCubeColorMapDialog)
52         //}}AFX_MSG_MAP
53 END_MESSAGE_MAP()
54
55 /////////////////////////////////////////////////////////////////////////////
56 // CColorNewColorCubeColorMapDialog message handlers
57
58 void CColorNewColorCubeColorMapDialog::OnOK() 
59 {
60     UpdateData(true);
61     myColorMap = 
62         new Aspect_ColorCubeColorMap(m_base_pixel,
63                                          m_redmax    ,
64                                          m_redmult   ,
65                                          m_greenmax  ,
66                                          m_greenmult ,
67                                          m_bluemax   ,
68                                          m_bluemult  );
69         CDialog::OnOK();
70 }