Go to the documentation of this file.
31 #include <QListWidget>
33 #include <QPushButton>
34 #include <QVBoxLayout>
35 #include <QHBoxLayout>
36 #include <QInputDialog>
53 QPushButton* remove_button =
new QPushButton(
"Remove");
54 QPushButton* rename_button =
new QPushButton(
"Rename");
55 QPushButton* zero_button =
new QPushButton(
"Zero");
56 zero_button->setToolTip(
"Jump to 0,0,0 with the current view controller. Shortcut: Z");
58 QHBoxLayout* top_layout =
new QHBoxLayout;
59 top_layout->addWidget(
new QLabel(
"Type:"));
61 top_layout->addStretch();
62 top_layout->addWidget(zero_button);
63 top_layout->setContentsMargins(2, 6, 2, 2);
65 QHBoxLayout* button_layout =
new QHBoxLayout;
67 button_layout->addWidget(remove_button);
68 button_layout->addWidget(rename_button);
69 button_layout->setContentsMargins(2, 0, 2, 2);
71 QVBoxLayout* main_layout =
new QVBoxLayout;
72 main_layout->setContentsMargins(0, 0, 0, 0);
73 main_layout->addLayout(top_layout);
75 main_layout->addLayout(button_layout);
76 setLayout(main_layout);
106 for (
int i = 0; i < ids.size(); i++)
108 const QString&
id = ids[i];
152 for (
int i = 0; i < views_to_delete.size(); i++)
159 delete views_to_delete[i];
167 if (views_to_rename.size() == 1)
179 QString old_name = view->
getName();
181 QInputDialog::getText(
this,
"Rename View",
"New Name?", QLineEdit::Normal, old_name);
183 if (new_name.isEmpty() || new_name == old_name)
virtual void setName(const QString &name)
Set the name.
PropertyTreeModel * getPropertyModel()
void copyCurrentToList()
Make a copy of the current ViewController and add it to the end of the list of saved views.
Property * getProp(const QModelIndex &index) const
return the Property at the given index, or the root property if the index is invalid.
QComboBox * camera_type_selector_
A single element of a property tree, with a name, value, description, and possibly children.
PluginlibFactory< ViewController > * getFactory() const
ViewManager * getViewManager() const override
Return a pointer to the ViewManager.
virtual void expand()
Expand (show the children of) this Property.
void currentChanged()
Emitted just after the current view controller changes.
void setCurrentViewFromIndex(const QModelIndex &index)
QPushButton * save_button_
ViewController * getCurrent() const
Return the current ViewController in use for the main RenderWindow.
void save(Config config) const override
Save configuration data, specifically the PropertyTreeWidget view settings.
void setViewManager(ViewManager *view_man)
Set the ViewManager which this panel should display and edit.
void onTypeSelectorChanged(int selected_index)
virtual QString getName() const
Return the name of this Property as a QString.
virtual void load(const Config &config)
Override to load configuration data. This version loads the name of the panel.
void load(const Config &config) override
Load configuration data, specifically the PropertyTreeWidget view settings.
virtual void save(Config config) const
Override to save configuration data. This version saves the name and class ID of the panel.
void setCurrentFrom(ViewController *view_to_copy)
Make a copy of view_to_copy and install that as the new current ViewController.
PropertyTreeWidget * properties_view_
void setCurrentViewControllerType(const QString &new_class_id)
Create a new view controller of the given type and set it up to mimic and replace the previous curren...
static QString formatClassId(const QString &class_id)
void onInitialize() override
Overridden from Panel. Just calls setViewManager() with vis_manager_->getViewManager().
virtual QString getClassId() const
Return the class identifier which was used to create this instance. This version just returns whateve...
ViewsPanel(QWidget *parent=nullptr)
Configuration data storage class.
VisualizationManager * vis_manager_
rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Dec 13 2024 03:31:03