NimbRo ROS Soccer Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
basicsmallview.h
1 #ifndef BASICSMALLVIEW_H
2 #define BASICSMALLVIEW_H
3 
4 // Base class for PosVelEffView, RateAngleView, PositionView
5 // Author: Dmytro Pavlichenko <dm.mark999@gmail.com>
6 
7 #include <QWidget>
8 #include <vector>
9 
10 class BasicSmallView : public QWidget
11 {
12  Q_OBJECT
13 
14 public:
15 
16  enum Type // Defines intervals of possible values for spins/sliders
17  {
18  REGULAR, // [-PI, +PI]
19  EXTENSION, // [0, 1]
20  LEG, // [-PI/2, +PI/2]
21  MINUS_ONE_PLUS_ONE
22  };
23 
24  enum Alignment // Order of widgets
25  {
26  NO_PAIR,
27  LEFT,
28  RIGHT
29  };
30 
31  BasicSmallView(Alignment alignment, Type type, std::string jointName, bool shiftMirrored, QWidget *parent = 0);
32  ~BasicSmallView();
33 
34  std::string getJointName();
35  void setEnabled(bool enabled);
36  bool withinRange(double value);
37 
38  virtual bool eventFilter(QObject *object, QEvent *event);
39 
40 protected:
41  bool isShiftPressed();
42  void setUpLayout(std::vector<QWidget*> widgets, Alignment alignment);
43  std::string determineInverseJoint(std::string joint);
44 
45 protected:
46  std::string jointName;
47  std::string m_inverse_joint_name; // If jointName is "left_***", inverse name is "right_***" and wisa wersa
48  bool onShiftMirrored; // If true, mirrors the value for pair widget when 'shift' is pressed
49 
50  double min;
51  double max;
52 
53 private:
54  std::vector<QWidget*> widgets;
55 };
56 
57 #endif
const std::string jointName[NUM_JOINTS]
List of names of the joints that are required by the gait motion module (indexed by the JointID enum)...
Definition: gait_common.h:57