TBTK
LDOSPanel.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_LDOS_PANEL
24 #define COM_DAFER45_TBTK_LDOS_PANEL
25 
26 #include "TBTK/Index.h"
27 #include "TBTK/ImagePanel.h"
28 #include "TBTK/IndexPanel.h"
29 #include "TBTK/Property/LDOS.h"
30 
31 #include <wx/wx.h>
32 #include <wx/sizer.h>
33 
34 namespace TBTK{
35 
36 class LDOSPanel : public wxPanel{
37 public:
39  LDOSPanel(wxWindow *parent);
40 
42  ~LDOSPanel();
43 
45  void setLDOS(const Property::LDOS &ldos);
46 
48  void onPaintEvent(wxPaintEvent &event);
49 
51  void onSizeEvent(wxSizeEvent &event);
52 
54  void onChange(wxCommandEvent &event);
55 protected:
56  DECLARE_EVENT_TABLE();
57 private:
59  Property::LDOS *ldos;
60 
62  ImagePanel *resultPanel;
63 
64  class ControlPanel : public wxPanel{
65  public:
67  ControlPanel(wxWindow *parent);
68 
70  ~ControlPanel();
71 
73  double getGaussianSmoothing() const;
74 
76  double getMin() const;
77 
79  double getMax() const;
80 
82  const Index& getIndex() const;
83 
85  void onGaussianSmoothingChanged(wxCommandEvent &event);
86 
88  void onMinChanged(wxCommandEvent &event);
89 
91  void onMaxChanged(wxCommandEvent &event);
92 
93 /* enum class ID {
94  GaussianSmoothing,
95  Min,
96  Max,
97  Index
98  };*/
99  protected:
100  DECLARE_EVENT_TABLE();
101  private:
103  wxStaticText gaussianSmoothingLabel;
104 
106  wxTextCtrl gaussianSmoothingTextBox;
107 
109  double gaussianSmoothing;
110 
112  wxStaticText minLabel;
113 
115  wxTextCtrl minTextBox;
116 
118  double min;
119 
121  wxStaticText maxLabel;
122 
124  wxTextCtrl maxTextBox;
125 
127  double max;
128 
130  IndexPanel indexPanel;
131  };
132 
134  ControlPanel controlPanel;
135 
136  static const wxWindowID GAUSSIAN_SMOOTHING_ID;
137  static const wxWindowID MIN_ID;
138  static const wxWindowID MAX_ID;
139 
141  void updatePlot();
142 };
143 
144 inline double LDOSPanel::ControlPanel::getGaussianSmoothing() const{
145  return gaussianSmoothing;
146 }
147 
148 inline double LDOSPanel::ControlPanel::getMin() const{
149  return min;
150 }
151 
152 inline double LDOSPanel::ControlPanel::getMax() const{
153  return max;
154 }
155 
156 inline const Index& LDOSPanel::ControlPanel::getIndex() const{
157  return indexPanel.getIndex();
158 }
159 
160 }; //End namespace TBTK
161 
162 #endif
Panel for displaying an Index.
Property container for local density of states (LDOS).
Definition: LDOS.h:33
Flexible physical index.
void onChange(wxCommandEvent &event)
Property container for local density of states (LDOS).
Definition: ImagePanel.h:33
void setLDOS(const Property::LDOS &ldos)
void onSizeEvent(wxSizeEvent &event)
void onPaintEvent(wxPaintEvent &event)
LDOSPanel(wxWindow *parent)
Flexible physical index.
Definition: Index.h:70
Definition: ModelFactory.h:35
Definition: IndexPanel.h:33
Definition: LDOSPanel.h:36
Panel for displaying images.