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 #ifndef MOVEIT_MOVEIT_SETUP_ASSISTANT_WIDGETS_VIRTUAL_JOINTS_WIDGET_
38 #define MOVEIT_MOVEIT_SETUP_ASSISTANT_WIDGETS_VIRTUAL_JOINTS_WIDGET_
39 
40 // Qt
41 #include <QWidget>
42 #include <QVBoxLayout>
43 #include <QHBoxLayout>
44 #include <QLabel>
45 #include <QPushButton>
46 #include <QTableWidget>
47 #include <QStackedLayout>
48 #include <QString>
49 #include <QComboBox>
50 
51 // SA
52 #ifndef Q_MOC_RUN
54 #endif
55 
56 #include "header_widget.h"
57 #include "setup_screen_widget.h" // a base class for screens in the setup assistant
58 
59 namespace moveit_setup_assistant
60 {
62 {
63  Q_OBJECT
64 
65 public:
66  // ******************************************************************************************
67  // Public Functions
68  // ******************************************************************************************
69 
70  VirtualJointsWidget(QWidget* parent, moveit_setup_assistant::MoveItConfigDataPtr config_data);
71 
73  virtual void focusGiven();
74 
75  // ******************************************************************************************
76  // Qt Components
77  // ******************************************************************************************
78  QTableWidget* data_table_;
79  QPushButton* btn_edit_;
80  QPushButton* btn_delete_;
81  QPushButton* btn_save_;
82  QPushButton* btn_cancel_;
83  QStackedLayout* stacked_layout_;
84  QLineEdit* vjoint_name_field_;
85  QLineEdit* parent_name_field_;
86  QComboBox* child_link_field_;
87  QComboBox* joint_type_field_;
90 
91 private Q_SLOTS:
92 
93  // ******************************************************************************************
94  // Slot Event Functions
95  // ******************************************************************************************
96 
98  void showNewScreen();
99 
101  void editSelected();
102 
104  void editDoubleClicked(int row, int column);
105 
107  void previewClicked(int row, int column);
108 
110  void deleteSelected();
111 
113  void doneEditing();
114 
116  void cancelEditing();
117 
118 Q_SIGNALS:
119 
120  // ******************************************************************************************
121  // Emitted Signals
122  // ******************************************************************************************
123 
125  void referenceFrameChanged();
126 
127 private:
128  // ******************************************************************************************
129  // Variables
130  // ******************************************************************************************
131 
133  moveit_setup_assistant::MoveItConfigDataPtr config_data_;
134 
136  std::string current_edit_vjoint_;
137 
138  // ******************************************************************************************
139  // Private Functions
140  // ******************************************************************************************
141 
148  srdf::Model::VirtualJoint* findVJointByName(const std::string& name);
149 
155  QWidget* createContentsWidget();
156 
162  QWidget* createEditWidget();
163 
168  void loadDataTable();
169 
174  void loadJointTypesComboBox();
175 
180  void loadChildLinksComboBox();
181 
187  void edit(const std::string& name);
188 };
189 
190 } // namespace
191 
192 #endif
VirtualJointsWidget(QWidget *parent, moveit_setup_assistant::MoveItConfigDataPtr config_data)
moveit_setup_assistant::MoveItConfigDataPtr config_data_
Contains all the configuration data for the setup assistant.
void referenceFrameChanged()
Event sent when this widget updated the root joint, which changes the frame of reference for the mode...
void deleteSelected()
Delete currently editing ite.
srdf::Model::VirtualJoint * findVJointByName(const std::string &name)
void previewClicked(int row, int column)
Preview whatever element is selected.
virtual void focusGiven()
Received when this widget is chosen from the navigation menu.
void editDoubleClicked(int row, int column)
Edit the double clicked element.
void editSelected()
Edit whatever element is selected.
std::string current_edit_vjoint_
Orignal name of vjoint currently being edited. This is used to find the element in the vector...


moveit_setup_assistant
Author(s): Dave Coleman
autogenerated on Sun Oct 18 2020 13:19:28