0028316: Coding Rules - Elimilate confusing aliases of Standard_Real type in V3d_View
[occt.git] / samples / mfc / standard / Common / Resource2D / CircularGrid.cpp
CommitLineData
7fd59977 1// CircularGrid.cpp : implementation file
2//
3
4#include "stdafx.h"
5
6#include "CircularGrid.h"
7
8/////////////////////////////////////////////////////////////////////////////
9// CCircularGrid dialog
10
11
12CCircularGrid::CCircularGrid(CWnd* pParent /*=NULL*/)
13 : CDialog(CCircularGrid::IDD, pParent)
14{
15 //{{AFX_DATA_INIT(CCircularGrid)
16 m_RotationAngle = 0.0;
17 m_XOrigin = 0.0;
18 m_YOrigin = 0.0;
19 m_RadiusStep = 0.0;
20 m_DivisionNumber = 0;
21 //}}AFX_DATA_INIT
22}
23
24
25void CCircularGrid::DoDataExchange(CDataExchange* pDX)
26{
27 CDialog::DoDataExchange(pDX);
28 //{{AFX_DATA_MAP(CCircularGrid)
29 DDX_Text(pDX, IDC_CircGrid_RotationAngle, m_RotationAngle);
30 DDX_Text(pDX, IDC_CircGrid_XOrigin, m_XOrigin);
31 DDX_Text(pDX, IDC_CircGrid_Yorigin, m_YOrigin);
32 DDX_Text(pDX, IDC_CirctGrid_RadiusStep, m_RadiusStep);
33 DDX_Text(pDX, IDC_CircGrid_DivNumber, m_DivisionNumber);
34 //}}AFX_DATA_MAP
35}
36
37
38BEGIN_MESSAGE_MAP(CCircularGrid, CDialog)
39 //{{AFX_MSG_MAP(CCircularGrid)
40 ON_EN_UPDATE(IDC_CircGrid_DivNumber, OnUpdateCircGridDivNumber)
41 ON_EN_UPDATE(IDC_CircGrid_RotationAngle, OnUpdateCircGridRotationAngle)
42 ON_EN_UPDATE(IDC_CircGrid_XOrigin, OnUpdateCircGridXOrigin)
43 ON_EN_UPDATE(IDC_CircGrid_Yorigin, OnUpdateCircGridYorigin)
44 ON_EN_UPDATE(IDC_CirctGrid_RadiusStep, OnUpdateCirctGridRadiusStep)
45 //}}AFX_MSG_MAP
46END_MESSAGE_MAP()
47
48/////////////////////////////////////////////////////////////////////////////
49// CCircularGrid message handlers
50
51void CCircularGrid::OnCancel()
52{
53 myViewer->SetCircularGridValues(SavedXOrigin , SavedYOrigin,
54 SavedRadiusStep, SavedDivisionNumber,
55 SavedRotationAngle );
56 CDialog::OnCancel();
57}
58
59void CCircularGrid::UpdateDialogData()
60{
61 UpdateData(TRUE);
62 ASSERT(!myViewer.IsNull());
ee2be2a8 63 Standard_Real XOrigin,YOrigin,RadiusStep;
7fd59977 64 Standard_Integer DivisionNumber;
ee2be2a8 65 Standard_Real RotationAngle;
7fd59977 66
67 XOrigin = m_XOrigin ;
68 YOrigin = m_YOrigin ;
69 RadiusStep = m_RadiusStep ;
70 DivisionNumber = m_DivisionNumber ;
42e4630c 71 RotationAngle = m_RotationAngle*M_PI/180 ;
7fd59977 72 myViewer->SetCircularGridValues(XOrigin, YOrigin, RadiusStep, DivisionNumber, RotationAngle );
73
74}
75
76
77void CCircularGrid::OnUpdateCircGridDivNumber()
78{
79 UpdateDialogData();
80}
81
82void CCircularGrid::OnUpdateCircGridRotationAngle()
83{
84 UpdateDialogData();
85}
86
87void CCircularGrid::OnUpdateCircGridXOrigin()
88{
89 UpdateDialogData();
90}
91
92void CCircularGrid::OnUpdateCircGridYorigin()
93{
94 UpdateDialogData();
95}
96
97void CCircularGrid::OnUpdateCirctGridRadiusStep()
98{
99 UpdateDialogData();
100}
101
102void CCircularGrid::UpdateValues()
103{
ee2be2a8 104 Standard_Real XOrigin,YOrigin,RadiusStep;
7fd59977 105 Standard_Integer DivisionNumber;
ee2be2a8 106 Standard_Real RotationAngle;
7fd59977 107 myViewer->CircularGridValues(XOrigin, YOrigin, RadiusStep, DivisionNumber, RotationAngle );
108 m_XOrigin = SavedXOrigin = XOrigin;
109 m_YOrigin = SavedYOrigin = YOrigin;
110 m_RadiusStep = SavedRadiusStep = RadiusStep;
111 m_DivisionNumber = SavedDivisionNumber = DivisionNumber;
112 m_RotationAngle = SavedRotationAngle = RotationAngle;
113 UpdateData(FALSE);
114}