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);
78 connect(remove_button, SIGNAL(clicked()),
this, SLOT(
onDeleteClicked()));
79 connect(rename_button, SIGNAL(clicked()),
this, SLOT(
renameSelected()));
80 connect(zero_button, SIGNAL(clicked()),
this, SLOT(
onZeroClicked()));
107 for (
int i = 0; i < ids.size(); i++)
109 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)
void setViewManager(ViewManager *view_man)
Set the ViewManager which this panel should display and edit.
ViewController * getCurrent() const
Return the current ViewController in use for the main RenderWindow.
virtual void expand()
Expand (show the children of) this Property.
void onInitialize() override
Overridden from Panel. Just calls setViewManager() with vis_manager_->getViewManager().
VisualizationManager * vis_manager_
void setCurrentFrom(ViewController *view_to_copy)
Make a copy of view_to_copy and install that as the new current ViewController.
void save(Config config) const override
Save configuration data, specifically the PropertyTreeWidget view settings.
A single element of a property tree, with a name, value, description, and possibly children...
virtual void setName(const QString &name)
Set the name.
static QString formatClassId(const QString &class_id)
PluginlibFactory< ViewController > * getFactory() const
virtual void save(Config config) const
Override to save configuration data. This version saves the name and class ID of the panel...
PropertyTreeWidget * properties_view_
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.
QPushButton * save_button_
Property * getProp(const QModelIndex &index) const
return the Property at the given index, or the root property if the index is invalid.
virtual QString getName() const
Return the name of this Property as a QString.
PropertyTreeModel * getPropertyModel()
QComboBox * camera_type_selector_
void setCurrentViewFromIndex(const QModelIndex &index)
void onTypeSelectorChanged(int selected_index)
virtual void load(const Config &config)
Override to load configuration data. This version loads the name of the panel.
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...
ViewManager * getViewManager() const override
Return a pointer to the ViewManager.
void load(const Config &config) override
Load configuration data, specifically the PropertyTreeWidget view settings.