8 setObjectName(
"FollowPosesWidget");
12 QHBoxLayout *file =
new QHBoxLayout;
13 QPushButton *file_explorer =
new QPushButton;
14 file_explorer->setText(
"...");
15 file_explorer->setMaximumSize(30, 30);
16 file_ =
new QLineEdit;
17 file->addWidget(
file_);
18 file->addWidget(file_explorer);
19 connect(file_explorer, SIGNAL(released()),
this, SLOT(
browseFiles()));
28 QHBoxLayout *number_of_layers_layout =
new QHBoxLayout;
29 number_of_layers_layout->addWidget(
new QLabel(
"Number of layers:"));
37 QHBoxLayout *height_between_layers_layout =
new QHBoxLayout;
38 height_between_layers_layout->addWidget(
new QLabel(
"Height between layers:"));
44 QVBoxLayout *duplicate_layer_layout =
new QVBoxLayout;
46 duplicate_layer_layout->addLayout(number_of_layers_layout);
47 duplicate_layer_layout->addLayout(height_between_layers_layout);
74 QFileInfo file(
file_->text());
75 if (!
file_->text().isEmpty() && file.dir().exists())
76 file_dir = file.dir().path();
80 file_dir = QString::fromStdString(path);
85 browser.setOption(QFileDialog::DontUseNativeDialog,
true);
86 QString file_path = browser.getOpenFileName(
this,
"Choose YAML file", file_dir,
87 "YAML files (*.yaml *.YAML *.yml *.YML)");
89 file_->setText(file_path);
100 bool tmp_bool(
false);
102 float tmp_float(0.01);
104 if (config.
mapGetString(objectName() +
"file", &tmp_str))
105 file_->setText(tmp_str);
107 if (config.
mapGetBool(objectName() +
"duplicate_layer", &tmp_bool))
112 if (config.
mapGetInt(objectName() +
"number_of_layers", &tmp_int))
115 if (config.
mapGetFloat(objectName() +
"height_between_layers", &tmp_float))
120 if (config.
mapGetBool(objectName() +
"invert_one_of_two_layers", &tmp_bool))
139 if (
file_->text().isEmpty())
140 return "File name is not specified.";
142 goal.file =
file_->text().toStdString();
152 size_t last_index = full_path.find_last_of(
"/");
153 std::string file_name = full_path.substr(last_index + 1, full_path.size());
155 last_index = file_name.find_last_of(
"\\");
156 file_name = file_name.substr(last_index + 1, file_name.size());
158 last_index = file_name.find_last_of(
".");
159 if (last_index == std::string::npos)
162 return file_name.substr(last_index + 1, file_name.size());
bool mapGetFloat(const QString &key, float *value_out) const
bool mapGetString(const QString &key, QString *value_out) const
void mapSetValue(const QString &key, QVariant value)
bool mapGetBool(const QString &key, bool *value_out) const
bool mapGetInt(const QString &key, int *value_out) const
ROSLIB_DECL std::string getPath(const std::string &package_name)