TBTK
Need a break? Support the development by playing Polarity Puzzles
DOSPanel.h
1 /* Copyright 2017 Kristofer Björnson
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
17 
24 #ifndef COM_DAFER45_TBTK_DOS_PANEL
25 #define COM_DAFER45_TBTK_DOS_PANEL
26 
27 #include "TBTK/ImagePanel.h"
28 #include "TBTK/Property/DOS.h"
29 
30 #include <wx/wx.h>
31 #include <wx/sizer.h>
32 
33 namespace TBTK{
34 
35 class DOSPanel : public wxPanel{
36 public:
38  DOSPanel(wxWindow *parent);
39 
41  ~DOSPanel();
42 
44  void setDOS(const Property::DOS &dos);
45 
47  void onPaintEvent(wxPaintEvent &event);
48 
50  void onSizeEvent(wxSizeEvent &event);
51 
53  void onChangeEvent(wxCommandEvent &event);
54 
56 // void redraw();
57 protected:
58  DECLARE_EVENT_TABLE();
59 private:
61  Property::DOS *dos;
62 
64  ImagePanel *resultPanel;
65 
66  class ControlPanel : public wxPanel{
67  public:
69  ControlPanel(wxWindow *parent);
70 
72  ~ControlPanel();
73 
75  double getGaussianSmoothing() const;
76 
78  double getMin() const;
79 
81  double getMax() const;
82 
84  void onGaussianSmoothingChanged(wxCommandEvent &event);
85 
87  void onMinChanged(wxCommandEvent &event);
88 
90  void onMaxChanged(wxCommandEvent &event);
91 
92 /* enum ID {
93  GaussianSmoothing,
94  Min,
95  Max
96  };*/
97  protected:
98  DECLARE_EVENT_TABLE();
99  private:
101  wxStaticText gaussianSmoothingLabel;
102 
104  wxTextCtrl gaussianSmoothingTextBox;
105 
107  double gaussianSmoothing;
108 
110  wxStaticText minLabel;
111 
113  wxTextCtrl minTextBox;
114 
116  double min;
117 
119  wxStaticText maxLabel;
120 
122  wxTextCtrl maxTextBox;
123 
125  double max;
126  };
127 
129  ControlPanel controlPanel;
130 
131  static const wxWindowID GAUSSIAN_SMOOTHING_ID;
132  static const wxWindowID MIN_ID;
133  static const wxWindowID MAX_ID;
134 
136  void updatePlot();
137 };
138 
139 inline double DOSPanel::ControlPanel::getGaussianSmoothing() const{
140  return gaussianSmoothing;
141 }
142 
143 inline double DOSPanel::ControlPanel::getMin() const{
144  return min;
145 }
146 
147 inline double DOSPanel::ControlPanel::getMax() const{
148  return max;
149 }
150 
151 }; //End namespace TBTK
152 
153 #endif
154 
DataType max(const Array< DataType > &array)
Definition: ArrayAlgorithms.h:841
DataType min(const Array< DataType > &array)
Definition: ArrayAlgorithms.h:851
Definition: Boolean.h:32
Property container for density of states (DOS).