VAPoR  3.0.0
boxsliderframe.h
Go to the documentation of this file.
1 //************************************************************************
2 // *
3 // Copyright (C) 2011 *
4 // University Corporation for Atmospheric Research *
5 // All Rights Reserved *
6 // *
7 //************************************************************************/
8 //
9 // File: boxsliders.h
10 //
11 // Author: Alan Norton
12 // National Center for Atmospheric Research
13 // PO 3000, Boulder, Colorado
14 //
15 // Date: July 2011
16 //
17 // Description: Defines the BoxSliderFrame class. This provides
18 // a frame that supports sliders and textboxes to control a box
19 //
20 #ifndef BOXSLIDERFRAME_H
21 #define BOXSLIDERFRAME_H
22 #include <QFrame>
23 #include <qwidget.h>
24 #include "boxframe.h"
25 #include <vector>
26 
27 
28 namespace VAPoR {
29 
50 class BoxSliderFrame : public QFrame, public Ui_boxframe {
51  Q_OBJECT
52 
53 public:
54  BoxSliderFrame( QWidget * parent = 0);
56 
59  void setFullDomain(const double exts[6]);
60 
64  void setBoxExtents(const std::vector<double>& minExts, const std::vector<double>& maxExts);
65 
68  void getBoxExtents(double[6]);
69 
72  void setVariableName(std::string vname) {_varname = vname;}
73 
77  void setNumRefinements(int numrefs){
78  _numRefinements = numrefs;
79  }
80 signals:
84  void extentsChanged();
85 
86 #ifndef DOXYGEN_SKIP_THIS
87 protected slots:
88  void boxTextChanged(const QString&);
89  void boxReturnPressed();
90  void xSliderCtrChange();
91  void ySliderCtrChange();
92  void zSliderCtrChange();
93  void xSliderSizeChange();
94  void ySliderSizeChange();
95  void zSliderSizeChange();
96  void nudgeXCenter(int);
97  void nudgeYCenter(int);
98  void nudgeZCenter(int);
99  void nudgeXSize(int);
100  void nudgeYSize(int);
101  void nudgeZSize(int);
102 
103 
104 private:
105  void updateGuiValues(const double mid[3],const double size[3]);
106  void confirmText();
107  void nudgeCenter(std::string varname, int val, int dir);
108  void nudgeSize(int val, int dir);
109  bool _textChangedFlag;
110  bool _silenceSignals;
111  double _boxExtents[6];
112  double _domainExtents[6];
113  int _voxelDims[3];
114  int _numRefinements;
115  int _lastCenterSlider[3];
116  int _lastSizeSlider[3];
117  std::string _varname;
118 #endif //DOXYGEN_SKIP_THIS
119 };
120 };
121 
122 
123 #endif
124 
void getBoxExtents(double[6])
void setVariableName(std::string vname)
A QFrame that contains sliders and text boxes controlling the extents of a box.
void setBoxExtents(const std::vector< double > &minExts, const std::vector< double > &maxExts)
void setFullDomain(const double exts[6])
Definition: DC.h:10
void setNumRefinements(int numrefs)
BoxSliderFrame(QWidget *parent=0)