TBTK
Need a break? Support the development by playing Polarity Puzzles
LDOSPanel.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_LDOS_PANEL
25 #define COM_DAFER45_TBTK_LDOS_PANEL
26 
27 #include "TBTK/Index.h"
28 #include "TBTK/ImagePanel.h"
29 #include "TBTK/IndexPanel.h"
30 #include "TBTK/Property/LDOS.h"
31 
32 #include <wx/wx.h>
33 #include <wx/sizer.h>
34 
35 namespace TBTK{
36 
37 class LDOSPanel : public wxPanel{
38 public:
40  LDOSPanel(wxWindow *parent);
41 
43  ~LDOSPanel();
44 
46  void setLDOS(const Property::LDOS &ldos);
47 
49  void onPaintEvent(wxPaintEvent &event);
50 
52  void onSizeEvent(wxSizeEvent &event);
53 
55  void onChange(wxCommandEvent &event);
56 protected:
57  DECLARE_EVENT_TABLE();
58 private:
60  Property::LDOS *ldos;
61 
63  ImagePanel *resultPanel;
64 
65  class ControlPanel : public wxPanel{
66  public:
68  ControlPanel(wxWindow *parent);
69 
71  ~ControlPanel();
72 
74  double getGaussianSmoothing() const;
75 
77  double getMin() const;
78 
80  double getMax() const;
81 
83  const Index& getIndex() const;
84 
86  void onGaussianSmoothingChanged(wxCommandEvent &event);
87 
89  void onMinChanged(wxCommandEvent &event);
90 
92  void onMaxChanged(wxCommandEvent &event);
93 
94 /* enum class ID {
95  GaussianSmoothing,
96  Min,
97  Max,
98  Index
99  };*/
100  protected:
101  DECLARE_EVENT_TABLE();
102  private:
104  wxStaticText gaussianSmoothingLabel;
105 
107  wxTextCtrl gaussianSmoothingTextBox;
108 
110  double gaussianSmoothing;
111 
113  wxStaticText minLabel;
114 
116  wxTextCtrl minTextBox;
117 
119  double min;
120 
122  wxStaticText maxLabel;
123 
125  wxTextCtrl maxTextBox;
126 
128  double max;
129 
131  IndexPanel indexPanel;
132  };
133 
135  ControlPanel controlPanel;
136 
137  static const wxWindowID GAUSSIAN_SMOOTHING_ID;
138  static const wxWindowID MIN_ID;
139  static const wxWindowID MAX_ID;
140 
142  void updatePlot();
143 };
144 
145 inline double LDOSPanel::ControlPanel::getGaussianSmoothing() const{
146  return gaussianSmoothing;
147 }
148 
149 inline double LDOSPanel::ControlPanel::getMin() const{
150  return min;
151 }
152 
153 inline double LDOSPanel::ControlPanel::getMax() const{
154  return max;
155 }
156 
157 inline const Index& LDOSPanel::ControlPanel::getIndex() const{
158  return indexPanel.getIndex();
159 }
160 
161 }; //End namespace TBTK
162 
163 #endif
164 
Physical index.
DataType max(const Array< DataType > &array)
Definition: ArrayAlgorithms.h:841
Property container for local density of states (LDOS).
DataType min(const Array< DataType > &array)
Definition: ArrayAlgorithms.h:851
Definition: Boolean.h:32