~j-rivero/+junk/ignition-gazebo

« back to all changes in this revision

Viewing changes to include/ignition/gazebo/gui/GuiSystem.hh

  • Committer: Jose Luis Rivero
  • Date: 2022-02-15 17:35:59 UTC
  • Revision ID: jrivero@osrfoundation.org-20220215173559-qyu3wjmqnrby30k7
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2018 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
#ifndef IGNITION_GAZEBO_GUI_GUISYSTEM_HH_
 
18
#define IGNITION_GAZEBO_GUI_GUISYSTEM_HH_
 
19
 
 
20
#include <QtCore>
 
21
 
 
22
#include <ignition/gazebo/config.hh>
 
23
#include <ignition/gazebo/EntityComponentManager.hh>
 
24
#include <ignition/gazebo/gui/Export.hh>
 
25
#include <ignition/gui/Plugin.hh>
 
26
 
 
27
#include <sdf/Element.hh>
 
28
 
 
29
namespace ignition
 
30
{
 
31
namespace gazebo
 
32
{
 
33
  // Inline bracket to help doxygen filtering.
 
34
  inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
 
35
  /// \brief Base class for a GUI System.
 
36
  ///
 
37
  /// A System operates on Entities that have certain Components. A System
 
38
  /// will only operate on an Entity if it has all of the required
 
39
  /// Components.
 
40
  ///
 
41
  /// GUI systems are different from `ignition::gazebo::System`s because they
 
42
  /// don't run in the same process as the physics. Instead, they run in a
 
43
  /// separate process that is stepped by updates coming through the network
 
44
  class IGNITION_GAZEBO_GUI_VISIBLE GuiSystem : public ignition::gui::Plugin
 
45
  {
 
46
    Q_OBJECT
 
47
 
 
48
    /// \brief Update callback called every time the system is stepped.
 
49
    /// This is called at an Ignition transport thread, so any interaction
 
50
    /// with Qt should be done through signals and slots.
 
51
    /// \param[in] _info Current simulation information, such as time.
 
52
    /// \param[in] _ecm Mutable reference to the ECM, so the system can read
 
53
    /// and write entities and their components.
 
54
    public: virtual void Update(const UpdateInfo &_info,
 
55
                                EntityComponentManager &_ecm)
 
56
    {
 
57
      // This will avoid many doxygen warnings
 
58
      (void)_info;
 
59
      (void)_ecm;
 
60
    }
 
61
  };
 
62
}
 
63
}
 
64
}
 
65
#endif