virtual_joints_widget.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2012, Willow Garage, Inc.
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 Willow Garage 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: Dave Coleman */
36 
37 #pragma once
38 
39 // Qt
40 class QLabel;
41 class QLineEdit;
42 class QPushButton;
43 class QTableWidget;
44 class QStackedWidget;
45 class QComboBox;
46 
47 // SA
48 #ifndef Q_MOC_RUN
50 #endif
51 
52 #include "setup_screen_widget.h" // a base class for screens in the setup assistant
53 
54 namespace moveit_setup_assistant
55 {
57 {
58  Q_OBJECT
59 
60 public:
61  // ******************************************************************************************
62  // Public Functions
63  // ******************************************************************************************
64 
65  VirtualJointsWidget(QWidget* parent, const MoveItConfigDataPtr& config_data);
66 
68  void focusGiven() override;
69 
70  // ******************************************************************************************
71  // Qt Components
72  // ******************************************************************************************
73  QTableWidget* data_table_;
74  QPushButton* btn_edit_;
75  QPushButton* btn_delete_;
76  QPushButton* btn_save_;
77  QPushButton* btn_cancel_;
78  QStackedWidget* stacked_widget_;
79  QLineEdit* vjoint_name_field_;
80  QLineEdit* parent_name_field_;
81  QComboBox* child_link_field_;
82  QComboBox* joint_type_field_;
85 
86 private Q_SLOTS:
87 
88  // ******************************************************************************************
89  // Slot Event Functions
90  // ******************************************************************************************
91 
93  void showNewScreen();
94 
96  void editSelected();
97 
99  void editDoubleClicked(int row, int column);
100 
102  void previewClicked(int row, int column);
103 
105  void deleteSelected();
106 
108  void doneEditing();
109 
111  void cancelEditing();
112 
113 Q_SIGNALS:
114 
115  // ******************************************************************************************
116  // Emitted Signals
117  // ******************************************************************************************
118 
120  void referenceFrameChanged();
121 
122 private:
123  // ******************************************************************************************
124  // Variables
125  // ******************************************************************************************
126 
128  moveit_setup_assistant::MoveItConfigDataPtr config_data_;
129 
131  std::string current_edit_vjoint_;
132 
133  // ******************************************************************************************
134  // Private Functions
135  // ******************************************************************************************
136 
143  srdf::Model::VirtualJoint* findVJointByName(const std::string& name);
144 
150  QWidget* createContentsWidget();
151 
157  QWidget* createEditWidget();
158 
163  void loadDataTable();
164 
169  void loadJointTypesComboBox();
170 
175  void loadChildLinksComboBox();
176 
182  void edit(const std::string& name);
183 };
184 
185 } // namespace moveit_setup_assistant
moveit_setup_assistant::VirtualJointsWidget
Definition: virtual_joints_widget.h:56
moveit_setup_assistant::VirtualJointsWidget::showNewScreen
void showNewScreen()
Show edit screen.
Definition: virtual_joints_widget.cpp:262
moveit_setup_assistant::VirtualJointsWidget::joint_type_field_
QComboBox * joint_type_field_
Definition: virtual_joints_widget.h:82
moveit_setup_assistant::VirtualJointsWidget::btn_edit_
QPushButton * btn_edit_
Definition: virtual_joints_widget.h:74
moveit_setup_assistant::VirtualJointsWidget::config_data_
moveit_setup_assistant::MoveItConfigDataPtr config_data_
Contains all the configuration data for the setup assistant.
Definition: virtual_joints_widget.h:128
moveit_setup_assistant::VirtualJointsWidget::doneEditing
void doneEditing()
Save editing changes.
Definition: virtual_joints_widget.cpp:457
moveit_setup_assistant::VirtualJointsWidget::current_edit_vjoint_
std::string current_edit_vjoint_
Orignal name of vjoint currently being edited. This is used to find the element in the vector.
Definition: virtual_joints_widget.h:131
moveit_setup_assistant::VirtualJointsWidget::deleteSelected
void deleteSelected()
Delete currently editing ite.
Definition: virtual_joints_widget.cpp:414
moveit_setup_assistant::VirtualJointsWidget::loadJointTypesComboBox
void loadJointTypesComboBox()
Definition: virtual_joints_widget.cpp:354
moveit_setup_assistant::VirtualJointsWidget::createContentsWidget
QWidget * createContentsWidget()
Definition: virtual_joints_widget.cpp:125
moveit_setup_assistant::VirtualJointsWidget::child_link_field_
QComboBox * child_link_field_
Definition: virtual_joints_widget.h:81
moveit_config_data.h
moveit_setup_assistant::VirtualJointsWidget::referenceFrameChanged
void referenceFrameChanged()
Event sent when this widget updated the root joint, which changes the frame of reference for the mode...
moveit_setup_assistant::VirtualJointsWidget::cancelEditing
void cancelEditing()
Cancel changes.
Definition: virtual_joints_widget.cpp:565
moveit_setup_assistant::VirtualJointsWidget::parent_name_field_
QLineEdit * parent_name_field_
Definition: virtual_joints_widget.h:80
moveit_setup_assistant::VirtualJointsWidget::findVJointByName
srdf::Model::VirtualJoint * findVJointByName(const std::string &name)
Definition: virtual_joints_widget.cpp:387
moveit_setup_assistant::VirtualJointsWidget::vjoint_list_widget_
QWidget * vjoint_list_widget_
Definition: virtual_joints_widget.h:83
SetupScreenWidget
Definition: setup_screen_widget.h:44
moveit_setup_assistant::VirtualJointsWidget::previewClicked
void previewClicked(int row, int column)
Preview whatever element is selected.
Definition: virtual_joints_widget.cpp:291
moveit_setup_assistant::VirtualJointsWidget::btn_save_
QPushButton * btn_save_
Definition: virtual_joints_widget.h:76
moveit_setup_assistant
Definition: compute_default_collisions.h:46
moveit_setup_assistant::VirtualJointsWidget::focusGiven
void focusGiven() override
Received when this widget is chosen from the navigation menu.
Definition: virtual_joints_widget.cpp:629
moveit_setup_assistant::VirtualJointsWidget::vjoint_edit_widget_
QWidget * vjoint_edit_widget_
Definition: virtual_joints_widget.h:84
srdf::Model::VirtualJoint
moveit_setup_assistant::VirtualJointsWidget::btn_cancel_
QPushButton * btn_cancel_
Definition: virtual_joints_widget.h:77
moveit_setup_assistant::VirtualJointsWidget::editDoubleClicked
void editDoubleClicked(int row, int column)
Edit the double clicked element.
Definition: virtual_joints_widget.cpp:283
setup_screen_widget.h
moveit_setup_assistant::VirtualJointsWidget::edit
void edit(const std::string &name)
Definition: virtual_joints_widget.cpp:314
moveit_setup_assistant::VirtualJointsWidget::loadDataTable
void loadDataTable()
Definition: virtual_joints_widget.cpp:577
moveit_setup_assistant::VirtualJointsWidget::editSelected
void editSelected()
Edit whatever element is selected.
Definition: virtual_joints_widget.cpp:298
moveit_setup_assistant::VirtualJointsWidget::btn_delete_
QPushButton * btn_delete_
Definition: virtual_joints_widget.h:75
moveit_setup_assistant::VirtualJointsWidget::data_table_
QTableWidget * data_table_
Definition: virtual_joints_widget.h:73
moveit_setup_assistant::VirtualJointsWidget::VirtualJointsWidget
VirtualJointsWidget(QWidget *parent, const MoveItConfigDataPtr &config_data)
Definition: virtual_joints_widget.cpp:92
moveit_setup_assistant::VirtualJointsWidget::stacked_widget_
QStackedWidget * stacked_widget_
Definition: virtual_joints_widget.h:78
moveit_setup_assistant::VirtualJointsWidget::createEditWidget
QWidget * createEditWidget()
Definition: virtual_joints_widget.cpp:193
moveit_setup_assistant::VirtualJointsWidget::vjoint_name_field_
QLineEdit * vjoint_name_field_
Definition: virtual_joints_widget.h:79
moveit_setup_assistant::VirtualJointsWidget::loadChildLinksComboBox
void loadChildLinksComboBox()
Definition: virtual_joints_widget.cpp:368


moveit_setup_assistant
Author(s): Dave Coleman
autogenerated on Sat May 3 2025 02:28:05