TBTK
DOSPanel.h
Go to the documentation of this file.
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 
23 #ifndef COM_DAFER45_TBTK_DOS_PANEL
24 #define COM_DAFER45_TBTK_DOS_PANEL
25 
26 #include "TBTK/ImagePanel.h"
27 #include "TBTK/Property/DOS.h"
28 
29 #include <wx/wx.h>
30 #include <wx/sizer.h>
31 
32 namespace TBTK{
33 
34 class DOSPanel : public wxPanel{
35 public:
37  DOSPanel(wxWindow *parent);
38 
40  ~DOSPanel();
41 
43  void setDOS(const Property::DOS &dos);
44 
46  void onPaintEvent(wxPaintEvent &event);
47 
49  void onSizeEvent(wxSizeEvent &event);
50 
52  void onChangeEvent(wxCommandEvent &event);
53 
55 // void redraw();
56 protected:
58 private:
60  Property::DOS *dos;
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  void onGaussianSmoothingChanged(wxCommandEvent &event);
84 
86  void onMinChanged(wxCommandEvent &event);
87 
89  void onMaxChanged(wxCommandEvent &event);
90 
91 /* enum ID {
92  GaussianSmoothing,
93  Min,
94  Max
95  };*/
96  protected:
98  private:
100  wxStaticText gaussianSmoothingLabel;
101 
103  wxTextCtrl gaussianSmoothingTextBox;
104 
106  double gaussianSmoothing;
107 
109  wxStaticText minLabel;
110 
112  wxTextCtrl minTextBox;
113 
115  double min;
116 
118  wxStaticText maxLabel;
119 
121  wxTextCtrl maxTextBox;
122 
124  double max;
125  };
126 
128  ControlPanel controlPanel;
129 
130  static const wxWindowID GAUSSIAN_SMOOTHING_ID;
131  static const wxWindowID MIN_ID;
132  static const wxWindowID MAX_ID;
133 
135  void updatePlot();
136 };
137 
138 inline double DOSPanel::ControlPanel::getGaussianSmoothing() const{
139  return gaussianSmoothing;
140 }
141 
142 inline double DOSPanel::ControlPanel::getMin() const{
143  return min;
144 }
145 
146 inline double DOSPanel::ControlPanel::getMax() const{
147  return max;
148 }
149 
150 }; //End namespace TBTK
151 
152 #endif
DOSPanel(wxWindow *parent)
void setDOS(const Property::DOS &dos)
Definition: ImagePanel.h:33
void onPaintEvent(wxPaintEvent &event)
Definition: DOSPanel.h:34
void onSizeEvent(wxSizeEvent &event)
Definition: ModelFactory.h:35
Property container for density of states (DOS).
Property container for density of states (DOS).
Definition: DOS.h:32
void onChangeEvent(wxCommandEvent &event)
Panel for displaying images.