Gazebo Gazebo

API Reference

6.17.1
CopyPaste.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 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 IGNITION_GAZEBO_GUI_COPYPASTE_HH_
19 #define IGNITION_GAZEBO_GUI_COPYPASTE_HH_
20 
21 #include <memory>
22 
23 #include <gz/msgs.hh>
24 
25 #include "gz/sim/gui/GuiSystem.hh"
26 
27 namespace ignition
28 {
29 namespace gazebo
30 {
31  class CopyPastePrivate;
32 
35  {
36  Q_OBJECT
37 
39  public: CopyPaste();
40 
42  public: ~CopyPaste() override;
43 
44  // Documentation inherited
45  public: void LoadConfig(const tinyxml2::XMLElement *_pluginElem) override;
46 
47  // Documentation inherited
48  public: void Update(const UpdateInfo &_info,
49  EntityComponentManager &_ecm) override;
50 
52  public slots: void OnCopy();
53 
56  public slots: void OnPaste();
57 
58  // Documentation inherited
59  protected: bool eventFilter(QObject *_obj, QEvent *_event) override;
60 
66  private: bool CopyServiceCB(const ignition::msgs::StringMsg &_req,
67  ignition::msgs::Boolean &_resp);
68 
73  private: bool PasteServiceCB(const ignition::msgs::Empty &_req,
74  ignition::msgs::Boolean &_resp);
75 
78  private: std::unique_ptr<CopyPastePrivate> dataPtr;
79  };
80 }
81 }
82 
83 #endif
Base class for a GUI System.
Definition: gz/sim/gui/GuiSystem.hh:44
void OnPaste()
Callback to paste the data that has been copied, if copied data exists.
This library is part of the Gazebo project.
Definition: gz/sim/Actor.hh:33
The EntityComponentManager constructs, deletes, and returns components and entities....
Definition: gz/sim/EntityComponentManager.hh:66
void Update(const UpdateInfo &_info, EntityComponentManager &_ecm) override
Update callback called every time the system is stepped. This is called at an Ignition transport thre...
Information passed to systems on the update callback.
Definition: include/gz/sim/Types.hh:38
void LoadConfig(const tinyxml2::XMLElement *_pluginElem) override
Plugin for copying/pasting entities in the GUI.
Definition: CopyPaste.hh:34
~CopyPaste() override
Destructor.
bool eventFilter(QObject *_obj, QEvent *_event) override
void OnCopy()
Callback to copy the selected entity.