| 
									
										
										
										
											2017-01-02 21:07:43 -05:00
										 |  |  | // Copyright (c) Charles J. Cliffe
 | 
					
						
							|  |  |  | // SPDX-License-Identifier: GPL-2.0+
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-03 20:59:49 -04:00
										 |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "GLPanel.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class MeterPanel : public GLPanel { | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2016-07-06 23:16:25 -04:00
										 |  |  |     MeterPanel(std::string name, float low, float high, float current); | 
					
						
							| 
									
										
										
										
											2016-07-07 22:37:57 -04:00
										 |  |  |     ~MeterPanel(); | 
					
						
							| 
									
										
										
										
											2016-07-06 23:16:25 -04:00
										 |  |  |     void setName(std::string name_in); | 
					
						
							| 
									
										
										
										
											2016-07-07 22:37:57 -04:00
										 |  |  |     std::string getName(); | 
					
						
							| 
									
										
										
										
											2016-07-06 23:16:25 -04:00
										 |  |  |     void setRange(float low, float high); | 
					
						
							| 
									
										
										
										
											2016-07-07 23:47:58 -04:00
										 |  |  |     float getLow(); | 
					
						
							|  |  |  |     float getHigh(); | 
					
						
							| 
									
										
										
										
											2016-07-06 23:16:25 -04:00
										 |  |  |     void setValue(float value); | 
					
						
							|  |  |  |     void setHighlight(float value); | 
					
						
							| 
									
										
										
										
											2016-07-07 22:37:57 -04:00
										 |  |  |     void setHighlightVisible(bool vis); | 
					
						
							| 
									
										
										
										
											2016-07-06 23:16:25 -04:00
										 |  |  |     float getValue(); | 
					
						
							|  |  |  |     bool isMeterHit(CubicVR::vec2 mousePoint); | 
					
						
							|  |  |  |     float getMeterHitValue(CubicVR::vec2 mousePoint, GLPanel &panel); | 
					
						
							| 
									
										
										
										
											2016-07-07 22:37:57 -04:00
										 |  |  |     void setChanged(bool changed); | 
					
						
							|  |  |  |     bool getChanged(); | 
					
						
							| 
									
										
										
										
											2016-07-03 20:59:49 -04:00
										 |  |  |      | 
					
						
							|  |  |  | protected: | 
					
						
							| 
									
										
										
										
											2016-07-06 23:16:25 -04:00
										 |  |  |     void drawPanelContents(); | 
					
						
							|  |  |  |     void setValueLabel(std::string label); | 
					
						
							|  |  |  |     void setPanelLevel(float setValue, GLPanel &panel); | 
					
						
							| 
									
										
										
										
											2016-07-03 20:59:49 -04:00
										 |  |  |      | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     std::string name; | 
					
						
							|  |  |  |     float low, high, current; | 
					
						
							| 
									
										
										
										
											2016-07-07 22:37:57 -04:00
										 |  |  |     bool changed; | 
					
						
							| 
									
										
										
										
											2016-07-03 20:59:49 -04:00
										 |  |  |     GLPanel bgPanel; | 
					
						
							|  |  |  |     GLPanel levelPanel; | 
					
						
							|  |  |  |     GLPanel highlightPanel; | 
					
						
							|  |  |  |     GLTextPanel labelPanel; | 
					
						
							|  |  |  |     GLTextPanel valuePanel; | 
					
						
							|  |  |  | }; |