Browse Source

created seperate ui file for progam gui

Johannes Ruehle 12 years ago
parent
commit
88757469b1
7 changed files with 699 additions and 715 deletions
  1. 45 428
      ImageLabeler.cpp
  2. 37 266
      ImageLabeler.h
  3. 6 4
      ImageLabeler.pro
  4. 1 1
      Makefile
  5. 15 8
      Makefile.Debug
  6. 15 8
      Makefile.Release
  7. 580 0
      ui/ImageLabeler.ui

+ 45 - 428
ImageLabeler.cpp

@@ -12,6 +12,8 @@
 #include "ImageLabeler.h"
 #include "functions.h"
 
+#include "ui_ImageLabeler.h"
+
 #include <QApplication>
 #include <QFrame>
 #include <QMenuBar>
@@ -50,10 +52,11 @@
  *	A constructor is responsible for allocating memory for all the
  *	GUI objects, arranging and connecting them in the right order.
  */
-ImageLabeler::ImageLabeler(QWidget *aParent, QString aSettingsPath) :
-	QMainWindow(aParent)
+ImageLabeler::ImageLabeler(QWidget *aParent, QString aSettingsPath)
+    : QMainWindow( aParent)
 {
-	setFocusPolicy(Qt::StrongFocus);
+
+    this->setupUi( this );
 
 	/*
 	 * Variables
@@ -71,135 +74,11 @@ ImageLabeler::ImageLabeler(QWidget *aParent, QString aSettingsPath) :
 	interrupt_search_ = 0;
 	unsaved_data_ = 0;
 
-	/*
-	 * menu bar part begins
-	 */
-
-	menu_bar_ = new QMenuBar(this);
-	setMenuBar(menu_bar_);
-
-	menu_file_ = new QMenu(menu_bar_);
-	menu_file_->setTitle(tr("&File"));
-
-	menu_save_ = new QMenu(menu_bar_);
-	menu_save_->setTitle(tr("&Save"));
-	menu_load_ = new QMenu(menu_bar_);
-	menu_load_->setTitle(tr("&Load"));
-
-	menu_pascal_ = new QMenu(menu_bar_);
-	menu_pascal_->setTitle(tr("&Pascal"));
-	menu_view_ = new QMenu(menu_bar_);
-	menu_view_->setTitle(tr("&View"));
-	menu_edit_ = new QMenu(menu_bar_);
-	menu_edit_->setTitle(tr("&Edit"));
-	menu_help_ = new QMenu(menu_bar_);
-	menu_help_->setTitle(tr("&Help"));
-
-	/* menu file */
-	action_open_image_ = new QAction(this);
-	action_open_image_->setText(tr("&Load image"));
-	action_open_images_ = new QAction(this);
-	action_open_images_->setText(tr("&Load images (recursively)"));
-	action_open_labeled_image_ = new QAction(this);
-	action_open_labeled_image_->setText(tr("&Load labeled image"));
-	action_load_legend_ = new QAction(this);
-	action_load_legend_->setText(tr("&Load legend"));
-	action_save_all_ = new QAction(this);
-	action_save_all_->setText(tr("&Save all info"));
-	action_save_all_->setEnabled(false);
-	action_save_segmented_ = new QAction(this);
-	action_save_segmented_->setText(tr("Save segmented &picture"));
-	action_save_segmented_->setEnabled(false);
-	action_save_legend_ = new QAction(this);
-	action_save_legend_->setText(tr("Save &legend"));
-	action_save_legend_->setEnabled(false);
-	action_quit_ = new QAction(this);
-	action_quit_->setText(tr("&Quit"));
-	/* menu pascal */
-	action_load_pascal_file_ = new QAction(this);
-	action_load_pascal_file_->setText(tr("&Load pascal file"));
-	action_load_pascal_poly_ = new QAction(this);
-	action_load_pascal_poly_->setText(tr("&Load poly info"));
-	/* menu view */
-	action_view_normal_ = new QAction(this);
-	action_view_normal_->setText(tr("&Normal"));
-	action_view_normal_->setEnabled(false);
-	action_view_segmented_ = new QAction(this);
-	action_view_segmented_->setText(tr("&Segmented"));
-	action_view_segmented_->setEnabled(false);
-	/* menu edit */
-	action_undo_ = new QAction(this);
-	action_undo_->setText(tr("&Undo"));
-	action_undo_->setEnabled(false);
-	action_redo_ = new QAction(this);
-	action_redo_->setText(tr("&Redo"));
-	action_redo_->setEnabled(false);
-	action_bound_box_tool_ = new QAction(this);
-	action_bound_box_tool_->setText(tr("Bounding box tool"));
-	action_bound_box_tool_->setEnabled(false);
-	action_polygon_tool_ = new QAction(this);
-	action_polygon_tool_->setText(tr("&Polygon tool"));
-	action_polygon_tool_->setEnabled(false);
-	action_tagging_tool_ = new QAction(this);
-	action_tagging_tool_->setText(tr("&Tagging tool"));
-	action_tagging_tool_->setEnabled(false);
-	action_add_description_ = new QAction(this);
-	action_add_description_->setText(tr("&Add image description"));
-	action_add_description_->setEnabled(false);
-	action_options_ = new QAction(this);
-	action_options_->setText(tr("&Options"));
-	/* menu help */
-	action_help_content_ = new QAction(this);
-	action_help_content_->setText(tr("&Help content"));
-	action_help_content_->setEnabled(false);
-	action_about_ = new QAction(this);
-	action_about_->setText(tr("&About"));
-	action_about_->setEnabled(false);
-	/* ------------------ */
-
-	menu_load_->addAction(action_open_image_);
-	menu_load_->addAction(action_open_images_);
-	menu_load_->addAction(action_open_labeled_image_);
-	menu_load_->addAction(action_load_legend_);
-	menu_save_->addAction(action_save_segmented_);
-	menu_save_->addAction(action_save_legend_);
-	menu_save_->addAction(action_save_all_);
-	menu_file_->addAction(menu_load_->menuAction());
-	menu_file_->addAction(menu_save_->menuAction());
-	menu_file_->addAction(menu_pascal_->menuAction());
-	//menu_file_->addSeparator();
-
-	menu_file_->addSeparator();
-	menu_file_->addAction(action_quit_);
-
-	menu_pascal_->addAction(action_load_pascal_file_);
-	menu_pascal_->addAction(action_load_pascal_poly_);
-
-	menu_view_->addAction(action_view_normal_);
-	menu_view_->addAction(action_view_segmented_);
-
-	menu_edit_->addAction(action_undo_);
-	menu_edit_->addAction(action_redo_);
-	menu_edit_->addSeparator();
-	menu_edit_->addAction(action_bound_box_tool_);
-	menu_edit_->addAction(action_polygon_tool_);
-	menu_edit_->addAction(action_tagging_tool_);
-	menu_edit_->addSeparator();
-	menu_edit_->addAction(action_add_description_);
-	menu_edit_->addAction(action_options_);
-
-	menu_help_->addAction(action_help_content_);
-	menu_help_->addAction(action_about_);
-
-	menu_bar_->addAction(menu_file_->menuAction());
-	menu_bar_->addAction(menu_view_->menuAction());
-	menu_bar_->addAction(menu_edit_->menuAction());
-	menu_bar_->addAction(menu_help_->menuAction());
 
 	/*
 	 * popup menu part begins
 	 */
-	popup_area_list_ = new QMenu;
+    popup_area_list_ = new QMenu(this);
 
 	action_delete_area_ = new QAction(this);
 	action_delete_area_->setText(tr("&Delete area"));
@@ -209,7 +88,7 @@ ImageLabeler::ImageLabeler(QWidget *aParent, QString aSettingsPath) :
 	popup_area_list_->addAction(action_delete_area_);
 	popup_area_list_->addAction(action_edit_area_);
 
-	popup_label_list_ = new QMenu;
+    popup_label_list_ = new QMenu(this);
 
 	action_set_color_ = new QAction(this);
 	action_set_color_->setText(tr("Set &color"));
@@ -222,7 +101,7 @@ ImageLabeler::ImageLabeler(QWidget *aParent, QString aSettingsPath) :
 	popup_label_list_->addAction(action_toggle_priority_);
 	popup_label_list_->addAction(action_delete_label_);
 
-	popup_images_list_ = new QMenu;
+    popup_images_list_ = new QMenu(this);
 
 	action_remove_image_ = new QAction(this);
 	action_remove_image_->setText(tr("&remove image"));
@@ -232,31 +111,12 @@ ImageLabeler::ImageLabeler(QWidget *aParent, QString aSettingsPath) :
 	/*
 	 * widgets part begins
 	 */
-	central_widget_ = new QWidget(this);
-	setCentralWidget(central_widget_);
-
-	frame_toolbox_ = new QFrame(central_widget_);
-	frame_toolbox_->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
-	frame_toolbox_->setLineWidth(0);
-	frame_toolbox_->setMidLineWidth(0);
-	frame_center_ = new QFrame(central_widget_);
-	frame_image_ = new QScrollArea(frame_center_);
-	frame_image_->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
-	frame_image_->setLineWidth(0);
-	frame_image_->setMidLineWidth(0);
-	frame_image_->setWidgetResizable(false);
-	frame_image_->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
-	frame_image_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
-	frame_labelbox_ = new QFrame(central_widget_);
-	frame_labelbox_->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
-	frame_labelbox_->setLineWidth(0);
-	frame_labelbox_->setMidLineWidth(0);
 
 	/* just dummy */
 	image_ = new QPixmap(500, 500);
 	image_->fill(QColor(Qt::white));
 
-	image_holder_ = new ImageHolder;
+    image_holder_ = new ImageHolder( frame_image_ );
 	image_holder_->setPixmap(*image_);
 	image_holder_->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
 	image_holder_->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
@@ -267,163 +127,8 @@ ImageLabeler::ImageLabeler(QWidget *aParent, QString aSettingsPath) :
 
 	frame_image_->setWidget(image_holder_);
 
-	list_label_ = new QListWidget(central_widget_);
-	list_label_->setContextMenuPolicy(Qt::CustomContextMenu);
-	list_areas_ = new QListWidget(central_widget_);
-	list_areas_->setContextMenuPolicy(Qt::CustomContextMenu);
-	list_images_widget_ = new QListWidget(central_widget_);
-	list_images_widget_->setContextMenuPolicy(Qt::CustomContextMenu);
-
-	label_toolbox_ = new QLabel(tr("Tool box"), frame_toolbox_);
-	label_list_label_ = new QLabel(tr("Object labels:"), central_widget_);
-	label_list_areas_ = new QLabel(tr("Selected areas:"), central_widget_);
-	label_list_images_ = new QLabel(tr("Loaded images:"), central_widget_);
-
-	/* buttons */
-	button_bound_box_tool_ = new QPushButton(frame_toolbox_);
-	button_bound_box_tool_->setText(tr("bbox"));
-	button_bound_box_tool_->setEnabled(false);
-	button_bound_box_tool_->setCheckable(true);
-	button_polygon_tool_ = new QPushButton(frame_toolbox_);
-	button_polygon_tool_->setText(tr("poly tool"));
-	button_polygon_tool_->setEnabled(false);
-	button_polygon_tool_->setCheckable(true);
-	button_tagging_tool_ = new QPushButton(frame_toolbox_);
-	button_tagging_tool_->setText(tr("tagging"));
-	button_tagging_tool_->setEnabled(false);
-	button_clear_selection_tool_ = new QPushButton(frame_toolbox_);
-	button_clear_selection_tool_->setText(tr("clear selection"));
-	button_clear_selection_tool_->setEnabled(false);
-	button_generate_colors_ = new QPushButton(frame_toolbox_);
-	button_generate_colors_->setText(tr("generate label colors"));
-	button_generate_colors_->setEnabled(false);
-	button_delete_all_labels_ = new QPushButton(frame_toolbox_);
-	button_delete_all_labels_->setText(tr("delete all labels"));
-	button_delete_all_labels_->setEnabled(false);
-
-	group_tools_ = new QButtonGroup;
-	group_tools_->addButton(button_bound_box_tool_);
-	group_tools_->addButton(button_polygon_tool_);
-
-	button_confirm_selection_ = new QPushButton(central_widget_);
-	button_confirm_selection_->setText(tr("Confirm selection"));
-	button_confirm_selection_->setEnabled(false);
-
-	button_add_label_ = new QPushButton(frame_labelbox_);
-	button_add_label_->setText(tr("Add label"));
-	button_add_label_->setEnabled(false);
-	button_remove_label_ = new QPushButton(frame_labelbox_);
-	button_remove_label_->setText(tr("Remove label"));
-	button_remove_label_->setEnabled(false);
-
-	button_delete_area_ = new QPushButton(frame_labelbox_);
-	button_delete_area_->setText(tr("Delete area"));
-	button_delete_area_->setEnabled(false);
-	button_change_area_ = new QPushButton(frame_labelbox_);
-	button_change_area_->setText(tr("Change area"));
-	button_change_area_->setEnabled(false);
-	button_change_area_text_ = new QPushButton(frame_labelbox_);
-	button_change_area_text_->setText(tr("Change area text"));
-	button_change_area_text_->setEnabled(false);
-
-	button_add_image_ = new QPushButton(frame_toolbox_);
-	button_add_image_->setText(tr("Add"));
-	button_remove_image_ = new QPushButton(frame_toolbox_);
-	button_remove_image_->setText(tr("Remove"));
-	button_remove_image_->setEnabled(false);
-
-	button_prev_image_ = new QPushButton(central_widget_);
-	button_prev_image_->setText("←");
-	button_prev_image_->setAutoRepeat(true);
-	
-	button_next_image_ = new QPushButton(central_widget_);
-	button_next_image_->setText("→");
-	button_next_image_->setAutoRepeat(true);
-	
-	/*
-	 * layouts part begins
-	 */
-	layout_main_ = new QHBoxLayout(central_widget_);
-	layout_left_ = new QVBoxLayout();
-	layout_toolbox_ = new QVBoxLayout();
-	layout_imagelist_buttons_ = new QHBoxLayout();
-	layout_center_ = new QVBoxLayout();
-	layout_frame_image_ = new QVBoxLayout();
-	layout_image_widget_ = new QGridLayout();
-	layout_center_buttons_ = new QHBoxLayout();
-	layout_right_ = new QVBoxLayout();
-	layout_labelbox_ = new QVBoxLayout();
-	layout_labelbox_buttons_ = new QHBoxLayout();
-	layout_areabox_buttons_ = new QVBoxLayout();
-
-	layout_main_->addLayout(layout_left_);
-	layout_main_->addLayout(layout_center_);
-	layout_main_->addLayout(layout_right_);
-
-	/* making the center part stretchable */
-	layout_main_->setStretch(1, 1);
-
-	/* left part */
-	layout_left_->addWidget(frame_toolbox_);
-	frame_toolbox_->setLayout(layout_toolbox_);
-
-	layout_toolbox_->addWidget(label_toolbox_);
-	layout_toolbox_->addWidget(button_bound_box_tool_);
-	layout_toolbox_->addWidget(button_polygon_tool_);
-	layout_toolbox_->addSpacing(10);
-	layout_toolbox_->addWidget(button_tagging_tool_);
-	layout_toolbox_->addSpacing(10);
-	layout_toolbox_->addWidget(button_clear_selection_tool_);
-	layout_toolbox_->addWidget(button_delete_all_labels_);
-	layout_toolbox_->addSpacing(10);
-	layout_toolbox_->addWidget(button_generate_colors_);
-	/* stretch is for making toolbox as small as it can be */
-	layout_toolbox_->addSpacing(10);
-	layout_left_->addWidget(label_list_images_);
-
-	layout_left_->addLayout(layout_imagelist_buttons_);
-	layout_imagelist_buttons_->addWidget(button_add_image_);
-	layout_imagelist_buttons_->addWidget(button_remove_image_);
-
-	layout_left_->addWidget(list_images_widget_);
-	list_images_widget_->setFixedWidth(200);
-	layout_left_->addStretch(1);
-	layout_left_->addWidget(button_confirm_selection_);
-
-
-	/* central part */
-	layout_center_->addWidget(frame_center_);
-	frame_center_->setLayout(layout_frame_image_);
-
-	layout_frame_image_->setContentsMargins(0, 0, 0, 0);
-	layout_frame_image_->addWidget(frame_image_);
-
-	layout_frame_image_->addLayout(layout_center_buttons_);
-	layout_center_buttons_->addWidget(button_prev_image_);
-	layout_center_buttons_->addWidget(button_next_image_);
-
-	/* right part */
-	layout_right_->addWidget(frame_labelbox_);
-	frame_labelbox_->setFixedWidth(200);
-	frame_labelbox_->setLayout(layout_labelbox_);
-
-	layout_labelbox_->addWidget(label_list_label_);
-
-	layout_labelbox_->addLayout(layout_labelbox_buttons_);
-	layout_labelbox_buttons_->addWidget(button_add_label_);
-	layout_labelbox_buttons_->addWidget(button_remove_label_);
-
-	layout_labelbox_->addWidget(list_label_);
-	layout_labelbox_->addWidget(label_list_areas_);
-
-	layout_labelbox_->addLayout(layout_areabox_buttons_);
-	layout_areabox_buttons_->addWidget(button_delete_area_);
-	layout_areabox_buttons_->addWidget(button_change_area_);
-	layout_areabox_buttons_->addWidget(button_change_area_text_);
-	layout_areabox_buttons_->setSpacing(0);
-
-	layout_labelbox_->addWidget(list_areas_);
 
+{
 	connect(
 		action_quit_,
 		SIGNAL(triggered()),
@@ -725,6 +430,8 @@ ImageLabeler::ImageLabeler(QWidget *aParent, QString aSettingsPath) :
 		SLOT(onAreaEdit())
 		);
 
+    }
+
 	QString settingsPath = aSettingsPath;
 	if (settingsPath.isEmpty())
 		settingsPath = QString("ImageLabeler.ini");
@@ -752,105 +459,20 @@ ImageLabeler::ImageLabeler(QWidget *aParent, QString aSettingsPath) :
  */
 ImageLabeler::~ImageLabeler()
 {
-	delete action_quit_;
-	delete action_open_labeled_image_;
-	delete action_open_image_;
-	delete action_open_images_;
-	delete action_load_legend_;
-	delete action_load_pascal_file_;
-	delete action_load_pascal_poly_;
-	delete action_save_legend_;
-	delete action_save_segmented_;
-	delete action_save_all_;
-	delete action_view_normal_;
-	delete action_view_segmented_;
-	delete action_undo_;
-	delete action_redo_;
-	delete action_bound_box_tool_;
-	delete action_polygon_tool_;
-	delete action_tagging_tool_;
-	delete action_add_description_;
-	delete action_options_;
-	delete action_about_;
-	delete action_help_content_;
-
-	delete menu_load_;
-	delete menu_save_;
-	delete menu_pascal_;
-	delete menu_file_;
-	delete menu_view_;
-	delete menu_edit_;
-	delete menu_help_;
-
-	delete menu_bar_;
-
-	delete action_delete_area_;
-	delete action_edit_area_;
-
-	delete popup_area_list_;
-
-	delete action_toggle_priority_;
-	delete action_set_color_;
-	delete action_delete_label_;
-
-	delete popup_label_list_;
-
-	delete action_remove_image_;
-
-	delete popup_images_list_;
+
+    if( list_images_ != NULL)
+    {
+        delete list_images_;
+        list_images_ = NULL;
+    }
 
 	delete image_;
-	delete image_holder_;
-
-	delete button_add_label_;
-	delete button_remove_label_;
-	delete button_bound_box_tool_;
-	delete button_delete_area_;
-	delete button_change_area_;
-	delete button_change_area_text_;
-	delete button_polygon_tool_;
-	delete button_tagging_tool_;
-	delete button_clear_selection_tool_;
-	delete button_generate_colors_;
-	delete button_delete_all_labels_;
-	delete button_next_image_;
-	delete button_prev_image_;
-
-	delete button_confirm_selection_;
-
-	delete label_list_label_;
-	delete label_list_areas_;
-	delete label_toolbox_;
-	delete label_list_images_;
-	delete list_areas_;
-	delete list_label_;
-	delete list_images_widget_;
-
-	delete layout_imagelist_buttons_;
-	delete layout_toolbox_;
-	delete layout_right_;
-	delete layout_center_buttons_;
-	delete layout_frame_image_;
-	delete layout_center_;
-	delete layout_labelbox_buttons_;
-	delete layout_areabox_buttons_;
-	delete layout_labelbox_;
-	delete layout_left_;
-	delete layout_main_;
-
-	delete frame_labelbox_;
-	delete frame_toolbox_;
-	delete frame_image_;
-	delete frame_center_;
-
-	delete central_widget_;
 
 	if (pure_data_) {
 		delete[] *pure_data_;
 		delete pure_data_;
 	}
 
-	delete list_images_;
 	delete settings_;
 }
 
@@ -1619,7 +1241,6 @@ ImageLabeler::nextImage(int iImageStep)
 
 	if (!askForUnsavedData()) {
 		return;
-		/* NOTREACHED */
 	}
 
 	list_bounding_box_.clear();
@@ -1639,14 +1260,12 @@ ImageLabeler::nextImage(int iImageStep)
 	if (!selectImage(image_ID_)) {
 		showWarning(tr("Next image is not available"));
 		return;
-		/* NOTREACHED */
 	}
 
 	list_images_widget_->setCurrentRow(image_ID_);
 
 	if (current_image_.isEmpty()) {
 		return;
-		/* NOTREACHED */
 	}
 
 	QString winTitle;
@@ -1672,12 +1291,10 @@ ImageLabeler::prevImage(int iImageStep)
 {
 	if (!list_images_widget_->count()) {
 		return;
-		/* NOTREACHED */
 	}
 
 	if (!askForUnsavedData()) {
 		return;
-		/* NOTREACHED */
 	}
 
 	list_bounding_box_.clear();
@@ -1700,7 +1317,7 @@ ImageLabeler::prevImage(int iImageStep)
 	if (!selectImage(image_ID_)) {
 		showWarning(tr("Next image is not available"));
 		return;
-		/* NOTREACHED */
+/* NOTREACHED */
 	}
 
 	QString winTitle;
@@ -3113,10 +2730,12 @@ ImageLabeler::addBBoxFromData(
 )
 {
 	BoundingBox *bbox = new BoundingBox;
-	*bbox = BBoxFromData(aBBoxData);
-	if (!bbox->rect.isValid() || !ID) {
+    if (!this->BBoxFromData(aBBoxData, *bbox) )
+        return;
+
+    if (!bbox->rect.isValid() || !ID)
+    {
 		return;
-		/* NOTREACHED */
 	}
 
 	bbox->label_ID_ = *ID;
@@ -3130,14 +2749,10 @@ ImageLabeler::addBBoxFromData(
  *
  * format is x;y;w;h where w - width and h - height
  */
-BoundingBox
-ImageLabeler::BBoxFromData(
-	QString *aBBoxData
-)
+bool ImageLabeler::BBoxFromData(const QString *aBBoxData, BoundingBox &p_BBox)
 {
-	BoundingBox bbox;
-	QString buffer;
-	bbox.rect.setRect(-1, -1, -1, -1);
+    QString buffer;
+    p_BBox.rect.setRect(-1, -1, -1, -1);
 	int startPos = 0;
 	bool ok = 1;
 
@@ -3155,35 +2770,37 @@ ImageLabeler::BBoxFromData(
 			break;
 		}
 
-		if (-1 == bbox.rect.x()) {
-			bbox.rect.setX(bboxData);
-			bbox.rect.setWidth(-1);
+        if (-1 == p_BBox.rect.x()) {
+            p_BBox.rect.setX(bboxData);
+            p_BBox.rect.setWidth(-1);
 		}
-		else if (-1 == bbox.rect.y()) {
-			bbox.rect.setY(bboxData);
-			bbox.rect.setHeight(-1);
+        else if (-1 == p_BBox.rect.y()) {
+            p_BBox.rect.setY(bboxData);
+            p_BBox.rect.setHeight(-1);
 		}
-		else if (-1 == bbox.rect.width()) {
-			bbox.rect.setWidth(bboxData);
+        else if (-1 == p_BBox.rect.width()) {
+            p_BBox.rect.setWidth(bboxData);
 		}
-		else if (-1 == bbox.rect.height()) {
-			bbox.rect.setHeight(bboxData);
+        else if (-1 == p_BBox.rect.height()) {
+            p_BBox.rect.setHeight(bboxData);
 		}
 
 		startPos = i + 1;
 	}
 
-	if (!bbox.rect.isValid()) {
+    if (!p_BBox.rect.isValid()) {
 		qDebug() <<
 			"BBoxFromData: "
 			"bbox format is corrupted";
-		bbox.rect.setRect(-1, -1, -1, -1);
+        p_BBox.rect.setRect(-1, -1, -1, -1);
+        return false;
 	}
 	else if (!ok) {
-		bbox.rect.setRect(-1, -1, -1, -1);
+        p_BBox.rect.setRect(-1, -1, -1, -1);
+        return false;
 	}
 
-	return bbox;
+    return true;
 }
 
 //! A protected member getting a BoundaryBox from text of the list_areas_ item
@@ -3243,7 +2860,7 @@ ImageLabeler::BBoxFromListItemText(
 		/* NOTREACHED */
 	}
 	QString pointsData = aString->mid(pointsPos, pointsLen);
-	bbox = BBoxFromData(&pointsData);
+    BBoxFromData(&pointsData, bbox);
 	bbox.label_ID_ = labelID;
 
 

+ 37 - 266
ImageLabeler.h

@@ -15,6 +15,8 @@
 #include <QMainWindow>
 #include <QDir>
 
+#include "ui_ImageLabeler.h"
+
 /* forward declarations */
 class QMenuBar;
 class QMenu;
@@ -54,7 +56,7 @@ struct Image {
 /*
  * \\see ImageHolder
  */
-class ImageLabeler : public QMainWindow
+class ImageLabeler : public QMainWindow, public Ui::ImageLabelerGui
 {
 	Q_OBJECT
 protected:
@@ -94,9 +96,7 @@ protected:
 		QString *aString,
 		int *oldID
 		);
-	BoundingBox BBoxFromData(
-		QString *aBBoxData
-		);
+    bool BBoxFromData(const QString *aBBoxData, BoundingBox &p_BBox);
 	BoundingBox	BBoxFromListItemText(
 		QString *aString,
 		int *oldID
@@ -195,282 +195,53 @@ public slots:
 	void readSettings();
 
 private:
-	/*
-	 *  menu
-	 */
-
-	//! main menu bar contains all other menus
-	QMenuBar *menu_bar_;
-
-	//! \brief contains all actions connected with file loading and saving.
-	//! also contains menu_pascal_
-	QMenu *menu_file_;
-
-	//! \brief contains all actions connected with file saving.
-	QMenu *menu_save_;
-
-	//! \brief contains all actions connected with file saving.
-	QMenu *menu_load_;
-
-	//! contains actions for loading PASCAL xml file and PASCAL polygon
-	QMenu *menu_pascal_;
-
-	//! \brief contains action_view_normal_ and action_view_segmented_
-	//! \see action_view_normal_ \see action_view_segmented_
-	QMenu *menu_view_;
-
-	/*! \brief contains tools, undo, redo, description adding and options
-	 * \see action_undo_
-	 * \see action_redo_
-	 * \see action_bound_box_tool_
-	 * \see action_polygon_tool_
-	 * \see action_tagging_tool_
-	 * \see action_add_description_
-	 * \see action_options_
-	 */
-	QMenu *menu_edit_;
-
-	//! empty yet
-	QMenu *menu_help_;
-
-	/* menu file */
-	//! \see loadImages()
-	QAction *action_open_images_;
-
-	//! \see loadImage()
-	QAction *action_open_image_;
-
-	//! \see loadInfo()
-	QAction *action_open_labeled_image_;
-
-	//! \see loadLegendFromFile()
-	QAction *action_load_legend_;
-
-	//! \see saveAllInfo()
-	QAction *action_save_all_;
-
-	//! \see saveSegmentedPicture()
-	QAction *action_save_segmented_;
-
-	//! \see saveLegend()
-	QAction *action_save_legend_;
-
-	//! closes the application
-	QAction *action_quit_;
-
-	/* menu pascal */
-	//! \see loadPascalFile();
-	QAction *action_load_pascal_file_;
-
-	//! \see loadPascalPolys();
-	QAction *action_load_pascal_poly_;
-
-	/* menu view */
-	//! loads an image from current_image_ \see viewNormal()
-	QAction *action_view_normal_;
-
-	//! loads an image from segmented_image_ \see viewSegmented()
-	QAction *action_view_segmented_;
-
-	/* menu edit */
-	//! \see ImageHolder::undo()
-	QAction *action_undo_;
-
-	//! \see ImageHolder::redo()
-	QAction *action_redo_;
-
-	//! \see setBoundingBoxTool(bool aButtonPressed)
-	QAction *action_bound_box_tool_;
-
-	//! \see setPolygonTool(bool aButtonPressed)
-	QAction *action_polygon_tool_;
-
-	//! \see setTags()
-	QAction *action_tagging_tool_;
-
-	/*! \see setDataFromForm(QString aData)
-	 *  \see image_description_
-	 */
-	QAction *action_add_description_;
-
-	//! \see OptionsForm
-	QAction *action_options_;
-
-	//! empty yet
-	QAction *action_about_;
-
-	//! empty yet
-	QAction *action_help_content_;
-
-
-	/* popup menu */
-	//! \brief popup menu for area_list_
-	//! \see list_areas_
-	QMenu *popup_area_list_;
-
-	//! \see deleteArea()
-	QAction *action_delete_area_;
-
-	//! \see editArea()
-	QAction *action_edit_area_;
-
-	//! \brief popup menu for list_label_
-	//! \see list_label_
-	QMenu *popup_label_list_;
-
-	//! \see toggleLabelPriority()
-	QAction *action_toggle_priority_;
-
-	//! \see setLabelColor(int anID, QColor aColor)
-	QAction *action_set_color_;
-
-	//! \see removeLabel()
-	QAction *action_delete_label_;
-
-	//! \brief popup menu for list_images_
-	//! \see list_images
-	QMenu *popup_images_list_;
-
-	//! \see removeImage()
-	QAction *action_remove_image_;
-
-	/* layouts */
-	QHBoxLayout *layout_main_;
-	QVBoxLayout *layout_left_;
-	QVBoxLayout *layout_toolbox_;
-	QHBoxLayout *layout_imagelist_buttons_;
-	QVBoxLayout *layout_center_;
-	QVBoxLayout *layout_frame_image_;
-	QGridLayout *layout_image_widget_;
-	QHBoxLayout *layout_center_buttons_;
-	QVBoxLayout *layout_right_;
-	QVBoxLayout *layout_labelbox_;
-	QHBoxLayout *layout_labelbox_buttons_;
-	QVBoxLayout *layout_areabox_buttons_;
-
-	/* widgets */
-	//!	parent for all widgets
-	QWidget *central_widget_;
-
-	//! \brief container(parent) of the image_holder_
-	//! \see iamge_holder_
-	QScrollArea *frame_image_;
-
-	//! frame containing all the widgets in the center
-	QFrame *frame_center_;
-
-	//! frame containing all the left part
-	QFrame *frame_toolbox_;
-
-	//! frame containing all the right part
-	QFrame *frame_labelbox_;
-
-	//! \brief object containing current loaded image
-	//! \see image_holder_
-	QPixmap *image_;
-
-	//! widget containing the image_(inherited from QLabel)
-	ImageHolder *image_holder_;
-
-	//! just an information label
-	QLabel *label_toolbox_;
-
-	//! just an information label
-	QLabel *label_list_label_;
-
-	//! just an information label
-	QLabel *label_list_areas_;
-
-	//! just an information label
-	QLabel *label_list_images_;
-
-	//! list widget containing labels
-	QListWidget *list_label_;
-
-	//! list widget containing selected areas data
-	QListWidget *list_areas_;
-
-	//! \brief list widget containing loaded images names
-	//! \see list_images_
-	QListWidget *list_images_widget_;
-
-	//! \brief widget for editing tags and image description
-	//! \see tags_
-	//! \see image_description_
-	LineEditForm line_edit_form_;
-
-	//! widget containing possible options
-	OptionsForm options_form_;
-
-	//! \brief button switching to the bounding box tool
-	//! \see BoundingBox
-	//! \see setBoundingBoxTool(bool aButtonPressed)
-	QPushButton *button_bound_box_tool_;
-
-	//! \brief button switching to the bounding box tool
-	//! \see Polygon
-	//! \see setPolygonTool(bool aButtonPressed)
-	QPushButton *button_polygon_tool_;
-
-	//! \brief button calling LineEditForm to edit tags
-	//! \see tags_
-	//! \see LineEditForm
-	QPushButton *button_tagging_tool_;
 
-	//! \brief button clearing all selection
-	//! \see clearAllTool()
-	QPushButton *button_clear_selection_tool_;
+    /* popup menu */
+    //! \brief popup menu for area_list_
+    //! \see list_areas_
+    QMenu *popup_area_list_;
 
-	//! \brief button deleting all labels(except BACKGROUND)
-	//! \see clearLabelList()
-	QPushButton *button_delete_all_labels_;
+    //! \see deleteArea()
+    QAction *action_delete_area_;
 
-	//! \brief button generating colors for all labels(except BACKGROUND)
-	//! \see generateColors()
-	QPushButton *button_generate_colors_;
+    //! \see editArea()
+    QAction *action_edit_area_;
 
-	//! \brief button adding new label
-	//! \see addLabel()
-	QPushButton *button_add_label_;
+    //! \brief popup menu for list_label_
+    //! \see list_label_
+    QMenu *popup_label_list_;
 
-	//! \brief button removing current label
-	//! \see removeLabel()
-	QPushButton *button_remove_label_;
+    //! \see toggleLabelPriority()
+    QAction *action_toggle_priority_;
 
-	//! \brief button deleting current area
-	//! \see deleteArea()
-	QPushButton *button_delete_area_;
+    //! \see setLabelColor(int anID, QColor aColor)
+    QAction *action_set_color_;
 
-	//! \brief button allowing area text changing
-	//! \see editArea()
-	QPushButton *button_change_area_text_;
+    //! \see removeLabel()
+    QAction *action_delete_label_;
 
-	//! \brief button allowing area modifying
-	//! \see focusOnArea()
-	QPushButton *button_change_area_;
+    //! \brief popup menu for list_images_
+    //! \see list_images
+    QMenu *popup_images_list_;
 
-	//! \brief button removing current image
-	//! \see loadImage()
-	QPushButton *button_add_image_;
+    //! \see removeImage()
+    QAction *action_remove_image_;
 
-	//! \brief button removing current image
-	//! \see removeImage()
-	QPushButton *button_remove_image_;
+    //! \brief object containing current loaded image
+    //! \see image_holder_
+    QPixmap *image_;
 
-	//! \brief button switching to the next image
-	//! \see nextImage()
-	QPushButton *button_prev_image_;
+    //! widget containing the image_(inherited from QLabel)
+    ImageHolder *image_holder_;
 
-	//! \brief button switching to the previous image
-	//! \see prevImage()
-	QPushButton *button_next_image_;
+    //! \brief widget for editing tags and image description
+    //! \see tags_
+    //! \see image_description_
+    LineEditForm line_edit_form_;
 
-	//! \brief button confirming current selection(selected area)
-	//! \see configrmSelection()
-	QPushButton *button_confirm_selection_;
+    //! widget containing possible options
+    OptionsForm options_form_;
 
-	//! abstract group manages tool buttons state
-	QButtonGroup *group_tools_;
 
 	/* variables */
 	//! keeps current keyboard modifier(like ctrl, shift, alt etc)

+ 6 - 4
ImageLabeler.pro

@@ -1,8 +1,7 @@
 TEMPLATE = app
 TARGET = ImageLabeler
-QT += core \
-    gui \
-    xml
+QT += core gui xml
+
 HEADERS += LineEditForm.h \
     OptionsForm.h \
     functions.h \
@@ -14,5 +13,8 @@ SOURCES += LineEditForm.cpp \
     ImageHolder.cpp \
     ImageLabeler.cpp \
     main.cpp
-FORMS += 
+
+FORMS += \ 
+    ui/ImageLabeler.ui
+
 RESOURCES += 

+ 1 - 1
Makefile

@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: ImageLabeler
-# Generated by qmake (2.01a) (Qt 4.7.4) on: Mi. Mai 9 13:25:25 2012
+# Generated by qmake (2.01a) (Qt 4.7.4) on: Fr. Dez 14 13:16:18 2012
 # Project:  ImageLabeler.pro
 # Template: app
 # Command: /usr/bin/qmake CONFIG+=debug_and_release -o Makefile ImageLabeler.pro

+ 15 - 8
Makefile.Debug

@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: ImageLabeler
-# Generated by qmake (2.01a) (Qt 4.7.4) on: Mi. Mai 9 13:25:25 2012
+# Generated by qmake (2.01a) (Qt 4.7.4) on: Fr. Dez 14 13:16:18 2012
 # Project:  ImageLabeler.pro
 # Template: app
 #############################################################################
@@ -9,10 +9,10 @@
 
 CC            = gcc
 CXX           = g++
-DEFINES       = -DQT_WEBKIT_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
+DEFINES       = -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
 CFLAGS        = -m64 -pipe -g -Wall -W -D_REENTRANT $(DEFINES)
 CXXFLAGS      = -m64 -pipe -g -Wall -W -D_REENTRANT $(DEFINES)
-INCPATH       = -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include/QtWebKit -I/usr/include -Idebug
+INCPATH       = -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include -Idebug -I.
 LINK          = g++
 LFLAGS        = -m64
 LIBS          = $(SUBLIBS)  -L/usr/lib64 -lQtXml -L/usr/lib64 -lQtGui -L/usr/X11R6/lib64 -lQtCore -lpthread 
@@ -111,7 +111,7 @@ first: all
 
 all: Makefile.Debug $(TARGET)
 
-$(TARGET):  $(OBJECTS)  
+$(TARGET): ui_ImageLabeler.h $(OBJECTS)  
 	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
 
 qmake:  FORCE
@@ -119,7 +119,7 @@ qmake:  FORCE
 
 dist: 
 	@$(CHK_DIR_EXISTS) debug/ImageLabeler1.0.0 || $(MKDIR) debug/ImageLabeler1.0.0 
-	$(COPY_FILE) --parents $(SOURCES) $(DIST) debug/ImageLabeler1.0.0/ && $(COPY_FILE) --parents LineEditForm.h OptionsForm.h functions.h ImageHolder.h ImageLabeler.h debug/ImageLabeler1.0.0/ && $(COPY_FILE) --parents LineEditForm.cpp OptionsForm.cpp functions.cpp ImageHolder.cpp ImageLabeler.cpp main.cpp debug/ImageLabeler1.0.0/ && (cd `dirname debug/ImageLabeler1.0.0` && $(TAR) ImageLabeler1.0.0.tar ImageLabeler1.0.0 && $(COMPRESS) ImageLabeler1.0.0.tar) && $(MOVE) `dirname debug/ImageLabeler1.0.0`/ImageLabeler1.0.0.tar.gz . && $(DEL_FILE) -r debug/ImageLabeler1.0.0
+	$(COPY_FILE) --parents $(SOURCES) $(DIST) debug/ImageLabeler1.0.0/ && $(COPY_FILE) --parents LineEditForm.h OptionsForm.h functions.h ImageHolder.h ImageLabeler.h debug/ImageLabeler1.0.0/ && $(COPY_FILE) --parents LineEditForm.cpp OptionsForm.cpp functions.cpp ImageHolder.cpp ImageLabeler.cpp main.cpp debug/ImageLabeler1.0.0/ && $(COPY_FILE) --parents ui/ImageLabeler.ui debug/ImageLabeler1.0.0/ && (cd `dirname debug/ImageLabeler1.0.0` && $(TAR) ImageLabeler1.0.0.tar ImageLabeler1.0.0 && $(COMPRESS) ImageLabeler1.0.0.tar) && $(MOVE) `dirname debug/ImageLabeler1.0.0`/ImageLabeler1.0.0.tar.gz . && $(DEL_FILE) -r debug/ImageLabeler1.0.0
 
 
 clean:compiler_clean 
@@ -155,6 +155,7 @@ debug/moc_ImageHolder.cpp: ImageHolder.h
 debug/moc_ImageLabeler.cpp: ImageHolder.h \
 		LineEditForm.h \
 		OptionsForm.h \
+		ui_ImageLabeler.h \
 		ImageLabeler.h
 	/usr/bin/moc $(DEFINES) $(INCPATH) ImageLabeler.h -o debug/moc_ImageLabeler.cpp
 
@@ -165,15 +166,19 @@ compiler_image_collection_clean:
 	-$(DEL_FILE) qmake_image_collection.cpp
 compiler_moc_source_make_all:
 compiler_moc_source_clean:
-compiler_uic_make_all:
+compiler_uic_make_all: ui_ImageLabeler.h
 compiler_uic_clean:
+	-$(DEL_FILE) ui_ImageLabeler.h
+ui_ImageLabeler.h: ui/ImageLabeler.ui
+	/usr/bin/uic ui/ImageLabeler.ui -o ui_ImageLabeler.h
+
 compiler_yacc_decl_make_all:
 compiler_yacc_decl_clean:
 compiler_yacc_impl_make_all:
 compiler_yacc_impl_clean:
 compiler_lex_make_all:
 compiler_lex_clean:
-compiler_clean: compiler_moc_header_clean 
+compiler_clean: compiler_moc_header_clean compiler_uic_clean 
 
 ####### Compile
 
@@ -194,13 +199,15 @@ debug/ImageLabeler.o: ImageLabeler.cpp ImageLabeler.h \
 		ImageHolder.h \
 		LineEditForm.h \
 		OptionsForm.h \
+		ui_ImageLabeler.h \
 		functions.h
 	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/ImageLabeler.o ImageLabeler.cpp
 
 debug/main.o: main.cpp ImageLabeler.h \
 		ImageHolder.h \
 		LineEditForm.h \
-		OptionsForm.h
+		OptionsForm.h \
+		ui_ImageLabeler.h
 	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/main.o main.cpp
 
 debug/moc_LineEditForm.o: debug/moc_LineEditForm.cpp 

+ 15 - 8
Makefile.Release

@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: ImageLabeler
-# Generated by qmake (2.01a) (Qt 4.7.4) on: Mi. Mai 9 13:25:25 2012
+# Generated by qmake (2.01a) (Qt 4.7.4) on: Fr. Dez 14 13:16:18 2012
 # Project:  ImageLabeler.pro
 # Template: app
 #############################################################################
@@ -9,10 +9,10 @@
 
 CC            = gcc
 CXX           = g++
-DEFINES       = -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
+DEFINES       = -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
 CFLAGS        = -m64 -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
 CXXFLAGS      = -m64 -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
-INCPATH       = -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include/QtWebKit -I/usr/include -Irelease
+INCPATH       = -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include -Irelease -I.
 LINK          = g++
 LFLAGS        = -m64 -Wl,-O1
 LIBS          = $(SUBLIBS)  -L/usr/lib64 -lQtXml -L/usr/lib64 -lQtGui -L/usr/X11R6/lib64 -lQtCore -lpthread 
@@ -111,7 +111,7 @@ first: all
 
 all: Makefile.Release $(TARGET)
 
-$(TARGET):  $(OBJECTS)  
+$(TARGET): ui_ImageLabeler.h $(OBJECTS)  
 	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
 
 qmake:  FORCE
@@ -119,7 +119,7 @@ qmake:  FORCE
 
 dist: 
 	@$(CHK_DIR_EXISTS) release/ImageLabeler1.0.0 || $(MKDIR) release/ImageLabeler1.0.0 
-	$(COPY_FILE) --parents $(SOURCES) $(DIST) release/ImageLabeler1.0.0/ && $(COPY_FILE) --parents LineEditForm.h OptionsForm.h functions.h ImageHolder.h ImageLabeler.h release/ImageLabeler1.0.0/ && $(COPY_FILE) --parents LineEditForm.cpp OptionsForm.cpp functions.cpp ImageHolder.cpp ImageLabeler.cpp main.cpp release/ImageLabeler1.0.0/ && (cd `dirname release/ImageLabeler1.0.0` && $(TAR) ImageLabeler1.0.0.tar ImageLabeler1.0.0 && $(COMPRESS) ImageLabeler1.0.0.tar) && $(MOVE) `dirname release/ImageLabeler1.0.0`/ImageLabeler1.0.0.tar.gz . && $(DEL_FILE) -r release/ImageLabeler1.0.0
+	$(COPY_FILE) --parents $(SOURCES) $(DIST) release/ImageLabeler1.0.0/ && $(COPY_FILE) --parents LineEditForm.h OptionsForm.h functions.h ImageHolder.h ImageLabeler.h release/ImageLabeler1.0.0/ && $(COPY_FILE) --parents LineEditForm.cpp OptionsForm.cpp functions.cpp ImageHolder.cpp ImageLabeler.cpp main.cpp release/ImageLabeler1.0.0/ && $(COPY_FILE) --parents ui/ImageLabeler.ui release/ImageLabeler1.0.0/ && (cd `dirname release/ImageLabeler1.0.0` && $(TAR) ImageLabeler1.0.0.tar ImageLabeler1.0.0 && $(COMPRESS) ImageLabeler1.0.0.tar) && $(MOVE) `dirname release/ImageLabeler1.0.0`/ImageLabeler1.0.0.tar.gz . && $(DEL_FILE) -r release/ImageLabeler1.0.0
 
 
 clean:compiler_clean 
@@ -155,6 +155,7 @@ release/moc_ImageHolder.cpp: ImageHolder.h
 release/moc_ImageLabeler.cpp: ImageHolder.h \
 		LineEditForm.h \
 		OptionsForm.h \
+		ui_ImageLabeler.h \
 		ImageLabeler.h
 	/usr/bin/moc $(DEFINES) $(INCPATH) ImageLabeler.h -o release/moc_ImageLabeler.cpp
 
@@ -165,15 +166,19 @@ compiler_image_collection_clean:
 	-$(DEL_FILE) qmake_image_collection.cpp
 compiler_moc_source_make_all:
 compiler_moc_source_clean:
-compiler_uic_make_all:
+compiler_uic_make_all: ui_ImageLabeler.h
 compiler_uic_clean:
+	-$(DEL_FILE) ui_ImageLabeler.h
+ui_ImageLabeler.h: ui/ImageLabeler.ui
+	/usr/bin/uic ui/ImageLabeler.ui -o ui_ImageLabeler.h
+
 compiler_yacc_decl_make_all:
 compiler_yacc_decl_clean:
 compiler_yacc_impl_make_all:
 compiler_yacc_impl_clean:
 compiler_lex_make_all:
 compiler_lex_clean:
-compiler_clean: compiler_moc_header_clean 
+compiler_clean: compiler_moc_header_clean compiler_uic_clean 
 
 ####### Compile
 
@@ -194,13 +199,15 @@ release/ImageLabeler.o: ImageLabeler.cpp ImageLabeler.h \
 		ImageHolder.h \
 		LineEditForm.h \
 		OptionsForm.h \
+		ui_ImageLabeler.h \
 		functions.h
 	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/ImageLabeler.o ImageLabeler.cpp
 
 release/main.o: main.cpp ImageLabeler.h \
 		ImageHolder.h \
 		LineEditForm.h \
-		OptionsForm.h
+		OptionsForm.h \
+		ui_ImageLabeler.h
 	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/main.o main.cpp
 
 release/moc_LineEditForm.o: release/moc_LineEditForm.cpp 

+ 580 - 0
ui/ImageLabeler.ui

@@ -0,0 +1,580 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ImageLabelerGui</class>
+ <widget class="QMainWindow" name="ImageLabelerGui">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>593</height>
+   </rect>
+  </property>
+  <property name="focusPolicy">
+   <enum>Qt::StrongFocus</enum>
+  </property>
+  <property name="windowTitle">
+   <string>ImageLabeler</string>
+  </property>
+  <widget class="QWidget" name="central_widget_">
+   <layout class="QHBoxLayout" name="layout_main_" stretch="1,1,1">
+    <item>
+     <layout class="QVBoxLayout" name="layout_left_" stretch="0,0,0,0,0,0">
+      <item>
+       <widget class="QFrame" name="frame_toolbox_">
+        <property name="frameShape">
+         <enum>QFrame::StyledPanel</enum>
+        </property>
+        <property name="frameShadow">
+         <enum>QFrame::Raised</enum>
+        </property>
+        <layout class="QVBoxLayout" name="layout_toolbox_">
+         <item>
+          <widget class="QLabel" name="label_toolbox_">
+           <property name="text">
+            <string>Tool Box</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="button_bound_box_tool_">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>bbox</string>
+           </property>
+           <property name="checkable">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="button_polygon_tool_">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>poly tool</string>
+           </property>
+           <property name="checkable">
+            <bool>true</bool>
+           </property>
+           <property name="checked">
+            <bool>false</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="verticalSpacer">
+           <property name="orientation">
+            <enum>Qt::Vertical</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Fixed</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>20</width>
+             <height>10</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QPushButton" name="button_tagging_tool_">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>tagging</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="verticalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Vertical</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Fixed</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>20</width>
+             <height>10</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QPushButton" name="button_clear_selection_tool_">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>clear selection</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="button_delete_all_labels_">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>delete all labels</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="verticalSpacer_3">
+           <property name="orientation">
+            <enum>Qt::Vertical</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Fixed</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>20</width>
+             <height>10</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QPushButton" name="button_generate_colors_">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>generate label colors</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+      <item>
+       <widget class="QLabel" name="label_list_images_">
+        <property name="text">
+         <string>Loaded Images:</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="layout_imagelist_buttons_">
+        <item>
+         <widget class="QPushButton" name="button_add_image_">
+          <property name="text">
+           <string>Add</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="button_remove_image_">
+          <property name="enabled">
+           <bool>false</bool>
+          </property>
+          <property name="text">
+           <string>Remove</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <widget class="QListWidget" name="list_images_widget_">
+        <property name="maximumSize">
+         <size>
+          <width>200</width>
+          <height>16777215</height>
+         </size>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeType">
+         <enum>QSizePolicy::Minimum</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>1</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QPushButton" name="button_confirm_selection_">
+        <property name="enabled">
+         <bool>false</bool>
+        </property>
+        <property name="text">
+         <string>Confirm selection</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </item>
+    <item>
+     <layout class="QVBoxLayout" name="layout_center_">
+      <item>
+       <widget class="QFrame" name="frame_center_">
+        <property name="frameShape">
+         <enum>QFrame::StyledPanel</enum>
+        </property>
+        <property name="frameShadow">
+         <enum>QFrame::Raised</enum>
+        </property>
+        <layout class="QVBoxLayout" name="layout_frame_image_">
+         <property name="margin">
+          <number>0</number>
+         </property>
+         <item>
+          <widget class="QScrollArea" name="frame_image_">
+           <property name="lineWidth">
+            <number>0</number>
+           </property>
+           <property name="widgetResizable">
+            <bool>false</bool>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignCenter</set>
+           </property>
+           <widget class="QWidget" name="scrollAreaWidgetContents">
+            <property name="geometry">
+             <rect>
+              <x>0</x>
+              <y>0</y>
+              <width>250</width>
+              <height>501</height>
+             </rect>
+            </property>
+           </widget>
+          </widget>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="layout_center_buttons_">
+           <item>
+            <widget class="QPushButton" name="button_prev_image_">
+             <property name="text">
+              <string>←</string>
+             </property>
+             <property name="autoRepeat">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QPushButton" name="button_next_image_">
+             <property name="text">
+              <string>→</string>
+             </property>
+             <property name="autoRepeat">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </widget>
+      </item>
+     </layout>
+    </item>
+    <item>
+     <layout class="QVBoxLayout" name="layout_right_">
+      <item>
+       <widget class="QFrame" name="frame_labelbox_">
+        <property name="maximumSize">
+         <size>
+          <width>200</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="frameShape">
+         <enum>QFrame::StyledPanel</enum>
+        </property>
+        <property name="frameShadow">
+         <enum>QFrame::Raised</enum>
+        </property>
+        <layout class="QVBoxLayout" name="layout_labelbox_">
+         <item>
+          <widget class="QLabel" name="label_list_label_">
+           <property name="text">
+            <string>Object labels:</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="layout_labelbox_buttons_">
+           <item>
+            <widget class="QPushButton" name="button_add_label_">
+             <property name="enabled">
+              <bool>false</bool>
+             </property>
+             <property name="text">
+              <string>Add label</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QPushButton" name="button_remove_label_">
+             <property name="enabled">
+              <bool>false</bool>
+             </property>
+             <property name="text">
+              <string>Remove label</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <widget class="QListWidget" name="list_label_"/>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_list_areas_">
+           <property name="text">
+            <string>Selected areas:</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="layout_areabox_buttons_">
+           <property name="spacing">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="QPushButton" name="button_delete_area_">
+             <property name="enabled">
+              <bool>false</bool>
+             </property>
+             <property name="text">
+              <string>Delete area</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QPushButton" name="button_change_area_">
+             <property name="enabled">
+              <bool>false</bool>
+             </property>
+             <property name="text">
+              <string>Change area</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QPushButton" name="button_change_area_text_">
+             <property name="enabled">
+              <bool>false</bool>
+             </property>
+             <property name="text">
+              <string>Change area text</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <widget class="QListWidget" name="list_areas_"/>
+         </item>
+        </layout>
+       </widget>
+      </item>
+     </layout>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QMenuBar" name="menu_bar_">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>800</width>
+     <height>29</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menu_file_">
+    <property name="title">
+     <string>&amp;File</string>
+    </property>
+    <widget class="QMenu" name="menu_load_">
+     <property name="title">
+      <string>&amp;Load</string>
+     </property>
+     <addaction name="action_open_image_"/>
+     <addaction name="action_open_images_"/>
+     <addaction name="action_open_labeled_image_"/>
+     <addaction name="action_load_legend_"/>
+    </widget>
+    <widget class="QMenu" name="menu_save_">
+     <property name="title">
+      <string>&amp;Save</string>
+     </property>
+     <addaction name="action_save_segmented_"/>
+     <addaction name="action_save_legend_"/>
+     <addaction name="action_save_all_"/>
+    </widget>
+    <widget class="QMenu" name="menu_pascal_">
+     <property name="title">
+      <string>&amp;Pascal</string>
+     </property>
+     <addaction name="action_load_pascal_file_"/>
+     <addaction name="action_load_pascal_poly_"/>
+    </widget>
+    <addaction name="menu_load_"/>
+    <addaction name="menu_save_"/>
+    <addaction name="menu_pascal_"/>
+    <addaction name="separator"/>
+    <addaction name="action_quit_"/>
+   </widget>
+   <widget class="QMenu" name="menu_view_">
+    <property name="title">
+     <string>&amp;View</string>
+    </property>
+    <addaction name="action_view_normal_"/>
+    <addaction name="action_view_segmented_"/>
+   </widget>
+   <widget class="QMenu" name="menu_edit_">
+    <property name="title">
+     <string>&amp;Edit</string>
+    </property>
+    <addaction name="action_undo_"/>
+    <addaction name="action_redo_"/>
+    <addaction name="separator"/>
+    <addaction name="action_bound_box_tool_"/>
+    <addaction name="action_polygon_tool_"/>
+    <addaction name="action_tagging_tool_"/>
+    <addaction name="separator"/>
+    <addaction name="action_add_description_"/>
+    <addaction name="action_options_"/>
+   </widget>
+   <widget class="QMenu" name="menu_help_">
+    <property name="title">
+     <string>&amp;Help</string>
+    </property>
+    <addaction name="action_help_content_"/>
+    <addaction name="action_about_"/>
+   </widget>
+   <addaction name="menu_file_"/>
+   <addaction name="menu_view_"/>
+   <addaction name="menu_edit_"/>
+   <addaction name="menu_help_"/>
+  </widget>
+  <action name="action_quit_">
+   <property name="text">
+    <string>&amp;Quit</string>
+   </property>
+  </action>
+  <action name="action_view_normal_">
+   <property name="text">
+    <string>&amp;Normal</string>
+   </property>
+  </action>
+  <action name="action_view_segmented_">
+   <property name="text">
+    <string>&amp;Segmented</string>
+   </property>
+  </action>
+  <action name="action_open_image_">
+   <property name="text">
+    <string>Load image</string>
+   </property>
+  </action>
+  <action name="action_open_images_">
+   <property name="text">
+    <string>Load images (recursively)</string>
+   </property>
+  </action>
+  <action name="action_open_labeled_image_">
+   <property name="text">
+    <string>Load labeled image</string>
+   </property>
+  </action>
+  <action name="action_load_legend_">
+   <property name="text">
+    <string>Load legend</string>
+   </property>
+  </action>
+  <action name="action_save_segmented_">
+   <property name="text">
+    <string>Save segmented &amp;picture</string>
+   </property>
+  </action>
+  <action name="action_save_legend_">
+   <property name="text">
+    <string>Save &amp;legend</string>
+   </property>
+  </action>
+  <action name="action_save_all_">
+   <property name="text">
+    <string>&amp;Save all info</string>
+   </property>
+  </action>
+  <action name="action_load_pascal_file_">
+   <property name="text">
+    <string>&amp;Load pascal file</string>
+   </property>
+  </action>
+  <action name="action_load_pascal_poly_">
+   <property name="text">
+    <string>&amp;Load poly info</string>
+   </property>
+  </action>
+  <action name="action_help_content_">
+   <property name="text">
+    <string>&amp;Help content</string>
+   </property>
+  </action>
+  <action name="action_about_">
+   <property name="text">
+    <string>&amp;About</string>
+   </property>
+  </action>
+  <action name="action_undo_">
+   <property name="text">
+    <string>&amp;Undo</string>
+   </property>
+  </action>
+  <action name="action_redo_">
+   <property name="text">
+    <string>&amp;Redo</string>
+   </property>
+  </action>
+  <action name="action_bound_box_tool_">
+   <property name="text">
+    <string>Bounding box tool</string>
+   </property>
+  </action>
+  <action name="action_polygon_tool_">
+   <property name="text">
+    <string>&amp;Polygon tool</string>
+   </property>
+  </action>
+  <action name="action_tagging_tool_">
+   <property name="text">
+    <string>&amp;Tagging tool</string>
+   </property>
+  </action>
+  <action name="action_add_description_">
+   <property name="text">
+    <string>&amp;Add Image Description</string>
+   </property>
+  </action>
+  <action name="action_options_">
+   <property name="text">
+    <string>&amp;Options</string>
+   </property>
+  </action>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>