Gazebo Sim

API Reference

7.9.0
MouseDrag.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef GZ_GUI_MOUSEDRAG_HH
19 #define GZ_GUI_MOUSEDRAG_HH
20 
21 #include <memory>
22 
23 #include <gz/sim/gui/GuiSystem.hh>
24 
25 namespace gz
26 {
27 namespace sim
28 {
29  class MouseDragPrivate;
30 
39  {
40  Q_OBJECT
41 
43  Q_PROPERTY(
44  double rotStiffness
45  READ RotStiffness
46  WRITE SetRotStiffness
47  NOTIFY RotStiffnessChanged
48  )
49 
50 
51  Q_PROPERTY(
52  double posStiffness
53  READ PosStiffness
54  WRITE SetPosStiffness
55  NOTIFY PosStiffnessChanged
56  )
57 
59  public: MouseDrag();
60 
62  public: ~MouseDrag() override;
63 
64  // Documentation inherited
65  public: void LoadConfig(const tinyxml2::XMLElement *_pluginElem) override;
66 
67  // Documentation inherited
68  protected: bool eventFilter(QObject *_obj, QEvent *_event) override;
69 
70  // Documentation inherited
71  public: void Update(const UpdateInfo &_info,
72  EntityComponentManager &_ecm) override;
73 
76  public slots: void OnSwitchCOM(const bool _checked);
77 
80  public: Q_INVOKABLE double RotStiffness() const;
81 
83  signals: void RotStiffnessChanged();
84 
87  public: Q_INVOKABLE void SetRotStiffness(double _rotStiffness);
88 
91  public: Q_INVOKABLE double PosStiffness() const;
92 
94  signals: void PosStiffnessChanged();
95 
98  public: Q_INVOKABLE void SetPosStiffness(double _posStiffness);
99 
102  private: std::unique_ptr<MouseDragPrivate> dataPtr;
103  };
104 }
105 }
106 
107 #endif