36 #include <QFileDialog> 58 config_widget_(new QWidget()),
64 p.setColor(QPalette::Background, Qt::white);
67 QPalette p2(
ui_.status->palette());
68 p2.setColor(QPalette::Text, Qt::red);
69 ui_.status->setPalette(p2);
71 QObject::connect(
ui_.browse, SIGNAL(clicked()),
this, SLOT(
SelectFile()));
73 QObject::connect(
ui_.x_offset_spin_box, SIGNAL(valueChanged(
double)),
this, SLOT(
SetXOffset(
double)));
74 QObject::connect(
ui_.y_offset_spin_box, SIGNAL(valueChanged(
double)),
this, SLOT(
SetYOffset(
double)));
87 if (message ==
ui_.status->text().toStdString())
91 QPalette p(
ui_.status->palette());
92 p.setColor(QPalette::Text, Qt::red);
93 ui_.status->setPalette(p);
94 ui_.status->setText(message.c_str());
99 if (message ==
ui_.status->text().toStdString())
103 QPalette p(
ui_.status->palette());
104 p.setColor(QPalette::Text, Qt::green);
105 ui_.status->setPalette(p);
106 ui_.status->setText(message.c_str());
111 if (message ==
ui_.status->text().toStdString())
115 QPalette p(
ui_.status->palette());
116 p.setColor(QPalette::Text, Qt::darkYellow);
117 ui_.status->setPalette(p);
118 ui_.status->setText(message.c_str());
123 ROS_INFO(
"Accept multires image configuration.");
145 QPalette p(
ui_.status->palette());
146 p.setColor(QPalette::Text, Qt::green);
147 ui_.status->setPalette(p);
148 ui_.status->setText(
"OK");
168 dialog.setFileMode(QFileDialog::ExistingFile);
169 dialog.setNameFilter(tr(
"Geo Files (*.geo)"));
173 if (dialog.result() == QDialog::Accepted && dialog.selectedFiles().count() == 1)
175 ui_.path->setText(dialog.selectedFiles().first());
255 for (
int r = 0; r < layer->
RowCount(); r++)
272 if (path.has_root_path())
274 if (path.root_path() != base.root_path())
285 if (base.has_root_path())
287 ROS_WARN(
"Cannot uncomplete a path relative path from a rooted base.");
292 typedef boost::filesystem::path::const_iterator path_iterator;
293 path_iterator path_it = path.begin();
294 path_iterator base_it = base.begin();
295 while (path_it != path.end() && base_it != base.end())
297 if (*path_it != *base_it)
302 boost::filesystem::path
result;
303 for (; base_it != base.end(); ++base_it)
307 for (; path_it != path.end(); ++path_it)
320 std::string path_string;
321 node[
"path"] >> path_string;
323 boost::filesystem::path image_path(path_string);
324 if (image_path.is_complete() ==
false)
326 boost::filesystem::path base_path(path);
328 (path / image_path.relative_path()).normalize().string();
331 ui_.path->setText(path_string.c_str());
336 if (node[
"offset_x"])
339 ui_.x_offset_spin_box->setValue(offset_x_);
341 if (node[
"offset_y"])
344 ui_.y_offset_spin_box->setValue(offset_y_);
350 boost::filesystem::path abs_path(
ui_.path->text().toStdString());
351 boost::filesystem::path base_path(path);
354 emitter << YAML::Key <<
"path" << YAML::Value << rel_path.string();
355 emitter << YAML::Key <<
"offset_x" << YAML::Value <<
offset_x_;
356 emitter << YAML::Key <<
"offset_y" << YAML::Value <<
offset_y_;
void GetCenterPoint(double x, double y)
void SaveConfig(YAML::Emitter &emitter, const std::string &path)
QWidget * GetConfigWidget(QWidget *parent)
swri_transform_util::Transform inverse_transform_
swri_transform_util::GeoReference & GeoReference()
void PrintError(const std::string &message)
std::string target_frame_
void SetYOffset(double latitude_offset)
static tf::Quaternion createIdentityQuaternion()
void LoadConfig(const YAML::Node &node, const std::string &path)
std::string source_frame_
void PrintWarning(const std::string &message)
MultiresView * tile_view_
multires_image::TileSet * tile_set_
swri_transform_util::Transform transform_
boost::filesystem::path MakePathRelative(boost::filesystem::path path, boost::filesystem::path base)
void AcceptConfiguration()
void SetView(double x, double y, double radius, double scale)
void PrintInfo(const std::string &message)
TileSetLayer * GetLayer(int layer)
Tile * GetTile(int column, int row)
swri_transform_util::TransformManagerPtr tf_manager_
virtual ~MultiresImagePlugin()
void Draw(double x, double y, double scale)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
void Transform(const swri_transform_util::Transform &transform)
void SetXOffset(double long_offset)
bool Initialize(QGLWidget *canvas)