Click here to Skip to main content
15,878,871 members
Articles / Desktop Programming / MFC

The Diffraction Grating Calculator

Rate me:
Please Sign up or sign in to vote.
4.40/5 (5 votes)
30 Oct 2010GPL38 min read 41.2K   678   6  
An MFC Windows program related to Concave Diffraction Gratings using VTK libraries.
#pragma once

// CPlotProperties2 dialog

class CPlotProperties2 : public CDialog
{
	DECLARE_DYNAMIC(CPlotProperties2)

public:
	CPlotProperties2(CWnd* pParent = NULL);   // standard constructor
	virtual ~CPlotProperties2();

// Dialog Data
	enum { IDD = IDD_PLOTPROPERTIES2 };

public:
   // Plot properties IN/OUT

   // Axis min/max
   double m_dBottomAxisMin;
   double m_dBottomAxisMax;
   double m_dLeftAxisMin  ;
   double m_dLeftAxisMax  ;
   double m_dTopAxisMin   ;
   double m_dTopAxisMax   ;
   double m_dRightAxisMin ;
   double m_dRightAxisMax ;

   // grids on/off
   bool m_bBottomAxisGrid;
   bool m_bLeftAxisGrid  ;
   bool m_bTopAxisGrid   ;
   bool m_bRightAxisGrid ;

   // Series Properties (defaults)
   int m_nSeriesType; // 0) Line, 1) Points, 2) Surface

   int m_nLineWidth;
   int m_nPenStyle;

   int m_nPointsType;
   int m_nPointsWidth;
   int m_nPointsHeight;

   COLORREF m_SeriesColour;
   COLORREF m_BackgroundColor;

protected:
   // Controls
   CButton m_buttonRadioLine;
   CButton m_buttonRadioPoints;
   CComboBox m_combo_Line_PenStyle;
   CComboBox m_combo_Line_LineWidth;
   CComboBox m_combo_Points_Style;
   CComboBox m_combo_Points_Height;
   CComboBox m_combo_Points_Width;

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
   afx_msg void OnCbnSelchangeComboLinePenstyle();
   afx_msg void OnCbnSelchangeComboLineLinewidth();
   afx_msg void OnCbnSelchangeComboPointsStyle();
   afx_msg void OnCbnSelchangeComboPointsHeight();
   afx_msg void OnCbnSelchangeComboPointsWidth();
protected:
   virtual void OnCancel();
public:
   virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
   virtual void OnOK();
public:
   virtual BOOL OnInitDialog();
   afx_msg void OnBnClickedRadioLineseries();
   afx_msg void OnBnClickedRadioPointseries();
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer (Senior)
Italy Italy
Senior Software Developer in C/C++ and Oracle.
Ex-physicist holding a Ph.D. on x-ray lasers.

Comments and Discussions