task_panel.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2017, Bielefeld University
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Bielefeld University nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 /* Author: Robert Haschke
36  Desc: Monitor manipulation tasks and visualize their solutions
37 */
38 
39 #pragma once
40 
41 #include <rviz/panel.h>
43 #include <QModelIndex>
44 class QItemSelection;
45 class QIcon;
46 
47 namespace rviz {
48 class WindowManagerInterface;
49 class Property;
50 class BoolProperty;
51 class EnumProperty;
52 } // namespace rviz
53 
54 namespace moveit_rviz_plugin {
55 
56 class TaskSolutionVisualization;
57 MOVEIT_CLASS_FORWARD(TaskListModel);
58 MOVEIT_CLASS_FORWARD(TaskPanel);
59 
61 class SubPanel : public QWidget
62 {
63  Q_OBJECT
64 public:
65  SubPanel(QWidget* parent = nullptr) : QWidget(parent) {}
66 
67  virtual void save(rviz::Config /*config*/) {} // NOLINT(performance-unnecessary-value-param)
68  virtual void load(const rviz::Config& /*config*/) {}
69 
70 Q_SIGNALS:
71  void configChanged();
72 };
73 
75 class TaskPanelPrivate;
76 class TaskPanel : public rviz::Panel
77 {
78  Q_OBJECT
79  Q_DECLARE_PRIVATE(TaskPanel)
81 
82 public:
83  TaskPanel(QWidget* parent = nullptr);
84  ~TaskPanel() override;
85 
87  void addSubPanel(SubPanel* w, const QString& title, const QIcon& icon);
88 
94  static void request(rviz::WindowManagerInterface* window_manager);
95  static void release();
96 
97  void onInitialize() override;
98  void load(const rviz::Config& config) override;
99  void save(rviz::Config config) const override;
100 
101 protected Q_SLOTS:
102  void showStageDockWidget();
103 };
104 
105 class MetaTaskListModel;
112 class TaskViewPrivate;
113 class TaskView : public SubPanel
114 {
115  Q_OBJECT
116  Q_DECLARE_PRIVATE(TaskView)
118 
119 protected:
120  // configuration settings
121  enum TaskExpand : uint8_t
122  {
123  EXPAND_TOP = 1,
125  EXPAND_NONE
126  };
127 
131 
132 public:
134  {
135  OLD_TASK_KEEP = 1,
137  OLD_TASK_REMOVE
138  };
139 
140  TaskView(TaskPanel* parent, rviz::Property* root);
141  ~TaskView() override;
142 
143  void save(rviz::Config config) override;
144  void load(const rviz::Config& config) override;
145 
146 public Q_SLOTS:
147  void addTask();
148 
149 protected Q_SLOTS:
150  void removeSelectedStages();
151  void onCurrentStageChanged(const QModelIndex& current, const QModelIndex& previous);
152  void onCurrentSolutionChanged(const QModelIndex& current, const QModelIndex& previous);
153  void onSolutionSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
154  void onExecCurrentSolution() const;
155  void onShowTimeChanged();
156  void onOldTaskHandlingChanged();
157 
158 private:
159  Q_PRIVATE_SLOT(d_ptr, void configureInsertedModels(QModelIndex, int, int));
160 
161 Q_SIGNALS:
162  void oldTaskHandlingChanged(int old_task_handling);
163 };
164 
165 class GlobalSettingsWidgetPrivate;
167 {
168  Q_OBJECT
169  Q_DECLARE_PRIVATE(GlobalSettingsWidget)
171 
172 public:
173  GlobalSettingsWidget(TaskPanel* parent, rviz::Property* root);
174  ~GlobalSettingsWidget() override;
175 
176  void save(rviz::Config config) override;
177  void load(const rviz::Config& config) override;
178 };
179 } // namespace moveit_rviz_plugin
panel.h
moveit_rviz_plugin::TaskView::initial_task_expand
rviz::EnumProperty * initial_task_expand
Definition: task_panel.h:128
moveit_rviz_plugin::MOVEIT_CLASS_FORWARD
MOVEIT_CLASS_FORWARD(OcTreeRender)
rviz::Panel
moveit_rviz_plugin::GlobalSettingsWidget
Definition: task_panel.h:166
moveit_rviz_plugin::TaskViewPrivate
Definition: task_panel_p.h:102
moveit_rviz_plugin::TaskView::OLD_TASK_REPLACE
@ OLD_TASK_REPLACE
Definition: task_panel.h:136
rviz::BoolProperty
moveit_rviz_plugin::TaskView::show_time_column
rviz::BoolProperty * show_time_column
Definition: task_panel.h:130
moveit_rviz_plugin::TaskPanel::showStageDockWidget
void showStageDockWidget()
Definition: task_panel.cpp:236
moveit_rviz_plugin::SubPanel
Base class for all sub panels within the Task Panel.
Definition: task_panel.h:61
moveit_rviz_plugin::TaskView::EXPAND_ALL
@ EXPAND_ALL
Definition: task_panel.h:124
rviz::EnumProperty
rviz::Property
moveit_rviz_plugin::TaskPanel::save
void save(rviz::Config config) const override
Definition: task_panel.cpp:220
moveit_rviz_plugin::TaskPanel::load
void load(const rviz::Config &config) override
Definition: task_panel.cpp:228
moveit_rviz_plugin::MetaTaskListModel
Definition: meta_task_list_model.h:90
moveit_rviz_plugin::TaskPanelPrivate
Definition: task_panel_p.h:90
rviz
moveit_rviz_plugin::SubPanel::load
virtual void load(const rviz::Config &)
Definition: task_panel.h:68
moveit_rviz_plugin::TaskView::OldTaskHandling
OldTaskHandling
Definition: task_panel.h:133
moveit_rviz_plugin::SubPanel::save
virtual void save(rviz::Config)
Definition: task_panel.h:67
moveit_rviz_plugin::TaskPanel
Definition: task_panel.h:76
moveit_rviz_plugin::TaskPanel::release
static void release()
Definition: task_panel.cpp:201
moveit_rviz_plugin
moveit_rviz_plugin::TaskView
Definition: task_panel.h:113
uint8_t
uint8_t
moveit_rviz_plugin::GlobalSettingsWidgetPrivate
Definition: task_panel_p.h:128
moveit_rviz_plugin::TaskView::old_task_handling
rviz::EnumProperty * old_task_handling
Definition: task_panel.h:129
moveit_rviz_plugin::SubPanel::SubPanel
SubPanel(QWidget *parent=nullptr)
Definition: task_panel.h:65
class_forward.h
moveit_rviz_plugin::TaskView::TaskExpand
TaskExpand
Definition: task_panel.h:121
moveit_rviz_plugin::TaskPanel::d_ptr
TaskPanelPrivate * d_ptr
Definition: task_panel.h:80
moveit_rviz_plugin::TaskPanel::addSubPanel
void addSubPanel(SubPanel *w, const QString &title, const QIcon &icon)
add a new sub panel widget
Definition: task_panel.cpp:153
moveit_rviz_plugin::SubPanel::configChanged
void configChanged()
moveit_rviz_plugin::TaskPanel::onInitialize
void onInitialize() override
Definition: task_panel.cpp:216
rviz::Config
moveit_rviz_plugin::TaskPanel::request
static void request(rviz::WindowManagerInterface *window_manager)
Definition: task_panel.cpp:188


visualization
Author(s): Robert Haschke
autogenerated on Thu Feb 27 2025 03:39:51