31 #include <QListWidget> 33 #include <QPushButton> 34 #include <QVBoxLayout> 35 #include <QHBoxLayout> 36 #include <QInputDialog> 56 QPushButton* remove_button =
new QPushButton(
"Remove" );
57 QPushButton* rename_button =
new QPushButton(
"Rename" );
58 QPushButton* zero_button =
new QPushButton(
"Zero" );
59 zero_button->setToolTip(
"Jump to 0,0,0 with the current view controller. Shortcut: Z" );
61 QHBoxLayout* top_layout =
new QHBoxLayout;
62 top_layout->addWidget(
new QLabel(
"Type:" ));
64 top_layout->addStretch();
65 top_layout->addWidget( zero_button );
66 top_layout->setContentsMargins( 2, 6, 2, 2 );
68 QHBoxLayout* button_layout =
new QHBoxLayout;
70 button_layout->addWidget( remove_button );
71 button_layout->addWidget( rename_button );
72 button_layout->setContentsMargins( 2, 0, 2, 2 );
74 QVBoxLayout* main_layout =
new QVBoxLayout;
75 main_layout->setContentsMargins( 0,0,0,0 );
76 main_layout->addLayout( top_layout );
78 main_layout->addLayout( button_layout );
79 setLayout( main_layout );
81 connect( remove_button, SIGNAL( clicked() ),
this, SLOT(
onDeleteClicked() ));
82 connect( rename_button, SIGNAL( clicked() ),
this, SLOT(
renameSelected() ));
83 connect( zero_button, SIGNAL( clicked() ),
this, SLOT(
onZeroClicked() ));
108 for(
int i = 0; i < ids.size(); i++ )
110 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();
180 QString new_name = QInputDialog::getText(
this,
"Rename View",
"New Name?", QLineEdit::Normal, old_name );
182 if( new_name.isEmpty() || new_name == old_name )
void setViewManager(ViewManager *view_man)
Set the ViewManager which this panel should display and edit.
virtual void save(Config config) const
Save configuration data, specifically the PropertyTreeWidget view settings.
virtual void expand()
Expand (show the children of) this Property.
ViewController * getCurrent() const
Return the current ViewController in use for the main RenderWindow.
VisualizationManager * vis_manager_
virtual ViewManager * getViewManager() const
Return a pointer to the ViewManager.
void setCurrentFrom(ViewController *view_to_copy)
Make a copy of view_to_copy and install that as the new current ViewController.
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)
PropertyTreeWidget * properties_view_
virtual QString getClassId() const
Return the class identifier which was used to create this instance. This version just returns whateve...
Configuration data storage class.
QPushButton * save_button_
PropertyTreeModel * getPropertyModel()
PluginlibFactory< ViewController > * getFactory() const
QComboBox * camera_type_selector_
ViewsPanel(QWidget *parent=0)
void setCurrentViewFromIndex(const QModelIndex &index)
virtual void save(Config config) const
Override to save configuration data. This version saves the name and class ID of the panel...
Property * getProp(const QModelIndex &index) const
return the Property at the given index, or the root property if the index is invalid.
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...
virtual QString getName() const
Return the name of this Property as a QString.
virtual void load(const Config &config)
Load configuration data, specifically the PropertyTreeWidget view settings.
virtual void onInitialize()
Overridden from Panel. Just calls setViewManager() with vis_manager_->getViewManager().