Initial commit.

master
Filip Orság 9 years ago
commit 19c47100c2

@ -0,0 +1,13 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file customgraphicsview.cpp
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#include "customgraphicsview.h"
void CustomGraphicsView::mousePressEvent(QMouseEvent *event) {
emit colorPickerPosition(event->x(), event->y());
}

@ -0,0 +1,28 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file customgraphicsview.h
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef CUSTOMGRAPHICSVIEW_H
#define CUSTOMGRAPHICSVIEW_H
#include <QGraphicsView>
#include <QMouseEvent>
class CustomGraphicsView : public QGraphicsView
{
Q_OBJECT
public:
void mousePressEvent(QMouseEvent *event);
signals:
void colorPickerPosition(int, int);
public slots:
};
#endif // CUSTOMGRAPHICSVIEW_H

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

@ -0,0 +1,87 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file layercomposer.cpp
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#include "layercomposer.h"
#include <QtGui>
LayerComposer::LayerComposer(QWidget *parent) : QMainWindow(parent) {
}
QImage LayerComposer::composeLayers (std::vector<QString> importedLayers,
std::vector<QString> analysingLayers,
std::vector<int> importedIndexes,
std::vector<int> analysingIndexes,
QString &bgRootDir,
QString &overLayRootDir) {
QString bgImgFileName;
for (unsigned int i = 0; i < importedIndexes.size(); i++) {
bgImgFileName = importedLayers[importedIndexes[i]];
}
bgImgFileName = bgRootDir + bgImgFileName;
// final image
// size is taken from the background bitmap
QImage bgImage(bgImgFileName);
QImage resultImage = QImage(bgImage.width(), bgImage.height(), QImage::Format_ARGB32_Premultiplied);
QPainter painter(&resultImage);
// draw background
painter.setCompositionMode(QPainter::CompositionMode_Source);
painter.fillRect(resultImage.rect(), Qt::transparent);
painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
painter.drawImage(0, 0, bgImage);
// ----------------------
QString overlayFileName;
QString srcAddr = overLayRootDir;
for (unsigned int i = 0; i < analysingIndexes.size(); i++) {
overlayFileName = srcAddr + analysingLayers[analysingIndexes[i]];
// mask black colour
QPixmap mypixmap(overlayFileName);
mypixmap.setMask(mypixmap.createMaskFromColor(Qt::black));
// draw given image
painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
painter.drawPixmap(0, 0, mypixmap);
}
painter.end();
return resultImage;
}
QImage LayerComposer::maskSelectedLayer(QString &bgImageFileName, QString &bgRootDir, QRgb maskColor, int rThrsh, int gThrsh, int bThrsh ) {
QImage image(bgRootDir + bgImageFileName);
OpenCVprocessor * cvProcessor = new OpenCVprocessor();
image = cvProcessor->normalizeImage(&image, qRed(maskColor), qGreen(maskColor), qBlue(maskColor), rThrsh, gThrsh, bThrsh);
QPixmap maskPixmap = QPixmap::fromImage(image);
QPixmap myPixmap(bgRootDir + bgImageFileName);
QImage resultImage = QImage(myPixmap.width(), myPixmap.height(), QImage::Format_ARGB32_Premultiplied);
QPainter painter(&resultImage);
// draw background - black
painter.setCompositionMode(QPainter::CompositionMode_Source);
painter.fillRect(resultImage.rect(), Qt::black);
// draw background masked from OpenCV
myPixmap.setMask(maskPixmap.createMaskFromColor(Qt::black));
painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
painter.drawPixmap(0, 0, myPixmap);
painter.end();
return resultImage;
}

@ -0,0 +1,40 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file layercomposer.h
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef LAYERCOMPOSER_H
#define LAYERCOMPOSER_H
#include <QMainWindow>
#include <QPainter>
#include "opencvprocessor.h"
// singleton
#include "project.h"
class LayerComposer : public QMainWindow
{
Q_OBJECT
public:
explicit LayerComposer(QWidget *parent = 0);
QImage composeLayers (std::vector<QString> importedLayers,
std::vector<QString> analysingLayersLayers,
std::vector<int> importedIndexes,
std::vector<int> analysingIndexes,
QString &bgRootDir,
QString &overLayRootDir);
QImage maskSelectedLayer(QString &bgImageFileName, QString &bgRootDir, QRgb maskColor, int rThrsh, int gThrsh, int bThrsh);
QImage composeHistograms (QImage * bgImage);
signals:
public slots:
};
#endif // LAYERCOMPOSER_H

@ -0,0 +1,42 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file layerrecord.cpp
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#include "layerrecord.h"
LayerRecord::LayerRecord(QObject *parent) : QObject(parent) {
}
LayerRecord::LayerRecord(bool b, QString s1, QString s2) {
this->checkBox = b;
this->name = s1;
this->opacity = s2;
}
void LayerRecord::setCheckBox (bool b) {
this->checkBox = b;
}
bool LayerRecord::getCheckBox (void) {
return this->checkBox;
}
void LayerRecord::setName (QString s) {
this->name = s;
}
QString LayerRecord::getName (void) {
return this->name;
}
void LayerRecord::setOpacity (QString s) {
this->opacity = s;
}
QString LayerRecord::getOpacity (void) {
return this->opacity;
}

@ -0,0 +1,43 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file layerrecord.h
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef LAYERRECORD_H
#define LAYERRECORD_H
#include <QObject>
#include <QCheckBox>
class LayerRecord : public QObject
{
Q_OBJECT
public:
explicit LayerRecord(QObject *parent = 0);
explicit LayerRecord(bool b, QString s1, QString s2);
void setCheckBox (bool b);
bool getCheckBox (void);
void setName (QString s);
QString getName (void);
void setOpacity (QString s);
QString getOpacity (void);
signals:
public slots:
private:
bool checkBox;
QString name;
QString opacity;
};
#endif // LAYERRECORD_H

@ -0,0 +1,183 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file static_singleton.hpp
* \date 6.8.2009
* \author Potěšil Josef xpotes03
* \brief Soubor obsahuje šablonu třídy cStaticSingleton.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef _STATIC_SINGLETON_HPP_
#define _STATIC_SINGLETON_HPP_
#include <stdexcept>
#include <boost/noncopyable.hpp>
#include <boost/thread/mutex.hpp>
////////////////////////////////////////////////////////////////////////////////
/**
* \brief Předdefinovaná třída podporující model větvení do vláken pro
* spolupráci s šablonou cStaticSingleton pro použití ve vícevláknových
* aplikacích. Využívá zámky z knihovny Boost::Threads.
*/
////////////////////////////////////////////////////////////////////////////////
struct MultiThreading
{
typedef boost::mutex mutex;
typedef boost::mutex::scoped_lock scoped_lock;
};
////////////////////////////////////////////////////////////////////////////////
/**
* \brief Předdefinovaná třída pro spolupráci s šablonou cStaticSingleton pro
* použití v jednovláknových aplikacích.
*/
////////////////////////////////////////////////////////////////////////////////
class SingleThreading
{
struct empty {};
struct scoped_guard
{
scoped_guard(empty& ) {}
};
public:
typedef empty mutex;
typedef scoped_guard scoped_lock;
};
////////////////////////////////////////////////////////////////////////////////
/**
* \brief Šablonová třída obsahující jednoduchou implementaci návrhového vzoru
* Singleton, která umožňuje vytvořit jedináčka z jakékoli třídy, která
* má bezparametrový konstruktor.
*/
////////////////////////////////////////////////////////////////////////////////
template<class Host, class ThreadingModel = SingleThreading>
class cStaticSingleton
{
public:
static Host* Instance();
static Host& GetInstance();
private:
cStaticSingleton();
cStaticSingleton(const cStaticSingleton& s);
cStaticSingleton& operator=(const cStaticSingleton& s);
~cStaticSingleton();
static Host& Create();
static Host& Access();
typedef Host& (*access_function)();
static Host* _instance;
static bool _destroyed;
static access_function _access;
static typename ThreadingModel::mutex _mutex;
};
////////////////////////////////////////////////////////////////////////////////
/**
* \brief Funkce pro přístup k jediné instanci třídy.
* \return Ukazatele na instanci.
*/
////////////////////////////////////////////////////////////////////////////////
template<class Host, class ThreadingModel>
inline Host* cStaticSingleton<Host, ThreadingModel>::Instance()
{
return &(GetInstance());
}
////////////////////////////////////////////////////////////////////////////////
/**
* \brief Funkce pro přístup k jediné instanci třídy.
* \return Referenci instanci.
*/
////////////////////////////////////////////////////////////////////////////////
template<class Host, class ThreadingModel>
inline Host& cStaticSingleton<Host, ThreadingModel>::GetInstance()
{
return _access();
}
////////////////////////////////////////////////////////////////////////////////
/**
* \brief Konstruktor.
*/
////////////////////////////////////////////////////////////////////////////////
template<class Host, class ThreadingModel>
cStaticSingleton<Host, ThreadingModel>::cStaticSingleton()
{
}
////////////////////////////////////////////////////////////////////////////////
/**
* \brief Destruktor.
*/
////////////////////////////////////////////////////////////////////////////////
template<class Host, class ThreadingModel>
cStaticSingleton<Host, ThreadingModel>::~cStaticSingleton()
{
_instance = 0;
_destroyed = true;
_access = &cStaticSingleton<Host, ThreadingModel>::Create;
}
////////////////////////////////////////////////////////////////////////////////
/**
* \brief Interní funkce třídy vytvářející samotnou instanci objektu.
* Pro korektní práci ve vícevláknovém prostředí je potřeba
* odkomentovat/upravit testující a uzamykací část
*/
////////////////////////////////////////////////////////////////////////////////
template<class Host, class ThreadingModel>
Host& cStaticSingleton<Host, ThreadingModel>::Create()
{
typename ThreadingModel::scoped_lock scoped_lock(_mutex);
if (!_instance)
{
if (!_destroyed)
{ // Vytvoř jedinou instanci a změň ukazatele _access, kterým byla
// tato metoda zavolána, aby se již nezavolala a místo toho
// se volala funkce zpřístupňující samotnou instanci
static Host staticInstance;
_instance = &staticInstance;
_access = &cStaticSingleton<Host, ThreadingModel>::Access;
}
else
{ // Došlo k přístupu k již zničenému jedináčkovi
throw std::runtime_error("Access to dead reference of an object.");
}
}
return *_instance;
}
////////////////////////////////////////////////////////////////////////////////
/**
* \brief Funkce zpřístupňující instanci hostující třídy.
*/
////////////////////////////////////////////////////////////////////////////////
template<class Host, class ThreadingModel>
Host& cStaticSingleton<Host, ThreadingModel>::Access()
{
return *_instance;
}
////////////////////////////////////////////////////////////////////////////////
// Jedináčkova data
////////////////////////////////////////////////////////////////////////////////
template<class Host, class TM>
Host* cStaticSingleton<Host, TM>::_instance = 0;
template<class H, class TM>
bool cStaticSingleton<H, TM>::_destroyed = false;
template<class H, class TM> typename cStaticSingleton<H, TM>::access_function
cStaticSingleton<H, TM>::_access = &cStaticSingleton<H, TM>::Create;
template<class H, class ThreadingModel> typename ThreadingModel::mutex
cStaticSingleton<H, ThreadingModel>::_mutex;
#endif // _STATIC_SINGLETON_HPP_

@ -0,0 +1,26 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file main.cpp
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#include <QApplication>
#include <iostream>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setOrganizationName("FIT BUT in Brno");
a.setApplicationName("microAnalyzer");
MainWindow microAnalyzer;
microAnalyzer.setWindowTitle("microAnalyzer :: imalcik at FIT BUT in Brno");
microAnalyzer.showMaximized();
return a.exec();
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,155 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file mainwindow.h
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QMessageBox>
#include <QString>
#include <QDir>
#include <QFileDialog>
#include <QLabel>
#include <QScrollArea>
#include <QGraphicsView>
#include <QGraphicsScene>
// openCV
#include "opencv/cv.h"
#include "opencvprocessor.h"
#include "tableformat.h"
// singleton
#include "project.h"
class QLabel;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
static const QString APPL_NAME;
static const int TABLE_BITMAPS = 0;
static const int TABLE_LAYERS = 1;
static const int DEF_SLIDER_VALUE = 20;
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
// File menu
void on_actionNew_Project_triggered();
void on_actionOpen_Project_triggered();
void on_actionSave_Project_triggered();
void on_actionOpen_Image_triggered();
void on_actionClose_Project_Image_triggered();
void on_actionExit_triggered();
void on_actionSave_Project_As_triggered();
// Tools menu
void on_actionZoom_in_25_triggered();
void on_actionZoom_out_25_triggered();
void on_actionFit_in_Window_triggered();
void on_actionOriginal_Size_triggered();
// Tools menu > analyza
void on_actionAnalyze_edges_triggered();
void on_actionHough_triggered();
void on_actionThreshold_triggered();
void on_actionAnalyze_Colors_triggered();
void on_rSlider_valueChanged(int value);
void on_gSlider_valueChanged(int value);
void on_bSlider_valueChanged(int value);
// Help menu
void on_actionHelp_triggered();
void on_actionAbout_microAnalyzer_triggered();
// Layers buttons
void on_pushButton_2_clicked(); // add ANALYSING
void on_pushButton_clicked(); // show only ANALYSING
void on_pushButton_3_clicked(); // delete ANALYSING
void on_pushButton_4_clicked(); // delete IMPORTED
// Additional slots
void on_imageDial_actionTriggered(int action);
void openProject_slot();
void reloadImagesList();
void reloadLayersList();
void graphicsClicked(int xPos, int yPos);
void on_bitmapTableView_activated(QModelIndex index);
// Wizard - singleton instance
void invertOpenedDialog_slot();
void on_actionHistogram_triggered();
private:
Ui::MainWindow *ui;
void menuChangeAvailability(bool setting, bool sliders = false);
void imageResizer(double resizeCoeff);
void onOpenNew_dialReset();
bool importImage(QString &imageFileName, bool addToVector);
void saveProjectToDest(QString projectFileName_withPath, bool removeSubDirs);
QString saveAnalysingImageToDir(QString origFN, QString dstDir, QString ext, QString addition, int number);
bool deleteDialog(QString layerType);
void actualizeGraphicsView(QImage * toShow);
void actualizeFrameColor();
// tableView indexes (imported / analysing)
std::vector<int> getImportedIndexes ();
std::vector<int> getAnalysingIndexes ();
std::vector<int> getSelectedIndexes (QModelIndexList indexes);
void makeColorAnalyzeStep();
void makeCvFunction(int number, int param);
int getIntDialog();
void closeThisProject();
void initStageAndValues();
void resetSlidersValues();
void closeEvent(QCloseEvent *event);
bool saveAskDialog();
void openProject(QString projectFileName);
TableFormat * reloadTableList(int tableSpec);
std::vector<int> importedIndexes;
std::vector<int> analysingIndexes;
QImage visibleImage;
QRgb actualColor;
QGraphicsView * imageView;
int lastDialValue;
bool openedNewProjDialog;
TableFormat *bitmapLayersTBL;
TableFormat *vectorLayersTBL;
bool histogramBtn;
};
#endif // MAINWINDOW_H

@ -0,0 +1,870 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>724</width>
<height>704</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralWidget"/>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>724</width>
<height>25</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>File</string>
</property>
<addaction name="actionNew_Project"/>
<addaction name="actionOpen_Project"/>
<addaction name="actionSave_Project"/>
<addaction name="actionSave_Project_As"/>
<addaction name="separator"/>
<addaction name="actionOpen_Image"/>
<addaction name="separator"/>
<addaction name="actionClose_Project_Image"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menuTools">
<property name="title">
<string>Tools</string>
</property>
<addaction name="actionZoom_in_25"/>
<addaction name="actionZoom_out_25"/>
<addaction name="actionFit_in_Window"/>
<addaction name="actionOriginal_Size"/>
<addaction name="separator"/>
<addaction name="actionHistogram"/>
<addaction name="actionThreshold"/>
<addaction name="separator"/>
<addaction name="actionAnalyze_edges"/>
<addaction name="actionAnalyze_Colors"/>
</widget>
<widget class="QMenu" name="menuHelp">
<property name="title">
<string>Help</string>
</property>
<addaction name="actionHelp"/>
<addaction name="separator"/>
<addaction name="actionAbout_microAnalyzer"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuTools"/>
<addaction name="menuHelp"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<widget class="QDockWidget" name="dockWidget">
<property name="minimumSize">
<size>
<width>250</width>
<height>625</height>
</size>
</property>
<property name="floating">
<bool>false</bool>
</property>
<property name="features">
<set>QDockWidget::NoDockWidgetFeatures</set>
</property>
<property name="windowTitle">
<string> Tools</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="QWidget" name="dockWidgetContents">
<property name="font">
<font>
<family>Arial</family>
</font>
</property>
<widget class="QDial" name="imageDial">
<property name="geometry">
<rect>
<x>26</x>
<y>19</y>
<width>201</width>
<height>151</height>
</rect>
</property>
<property name="minimum">
<number>-999</number>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="sliderPosition">
<number>0</number>
</property>
<property name="tracking">
<bool>true</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="wrapping">
<bool>true</bool>
</property>
<property name="notchTarget">
<double>10.000000000000000</double>
</property>
<property name="notchesVisible">
<bool>true</bool>
</property>
</widget>
<widget class="Line" name="line">
<property name="geometry">
<rect>
<x>10</x>
<y>170</y>
<width>220</width>
<height>20</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QLabel" name="bitmapLayers_label">
<property name="geometry">
<rect>
<x>10</x>
<y>187</y>
<width>191</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Sans</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Background layers (dbl click)</string>
</property>
</widget>
<widget class="QLabel" name="vectLayers_label">
<property name="geometry">
<rect>
<x>14</x>
<y>299</y>
<width>111</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Sans</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Analysing layers</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>92</x>
<y>0</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Sans</family>
<pointsize>10</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Fine zoom</string>
</property>
</widget>
<widget class="QTableView" name="bitmapTableView">
<property name="geometry">
<rect>
<x>10</x>
<y>209</y>
<width>221</width>
<height>71</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="gridStyle">
<enum>Qt::DashLine</enum>
</property>
<property name="sortingEnabled">
<bool>false</bool>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>true</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>140</number>
</attribute>
<attribute name="horizontalHeaderHighlightSections">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderMinimumSectionSize">
<number>25</number>
</attribute>
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>19</number>
</attribute>
<attribute name="verticalHeaderHighlightSections">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderMinimumSectionSize">
<number>15</number>
</attribute>
</widget>
<widget class="Line" name="separator_layers">
<property name="geometry">
<rect>
<x>10</x>
<y>279</y>
<width>220</width>
<height>20</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QTableView" name="vectorTableView">
<property name="geometry">
<rect>
<x>10</x>
<y>320</y>
<width>221</width>
<height>161</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="gridStyle">
<enum>Qt::DashLine</enum>
</property>
<property name="sortingEnabled">
<bool>false</bool>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>true</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>140</number>
</attribute>
<attribute name="horizontalHeaderHighlightSections">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderMinimumSectionSize">
<number>25</number>
</attribute>
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>19</number>
</attribute>
<attribute name="verticalHeaderHighlightSections">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderMinimumSectionSize">
<number>15</number>
</attribute>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>165</x>
<y>295</y>
<width>31</width>
<height>21</height>
</rect>
</property>
<property name="toolTip">
<string>Show only selected Analysing layers (blue)</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>images/icons/btn_analyzeLayers.png</normaloff>images/icons/btn_analyzeLayers.png</iconset>
</property>
</widget>
<widget class="QPushButton" name="pushButton_2">
<property name="geometry">
<rect>
<x>200</x>
<y>295</y>
<width>31</width>
<height>21</height>
</rect>
</property>
<property name="toolTip">
<string>Add selected Analysing layers (blue) to selected Imported layers (red)</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>images/icons/btn_addLayers.png</normaloff>images/icons/btn_addLayers.png</iconset>
</property>
</widget>
<widget class="QFrame" name="frame">
<property name="geometry">
<rect>
<x>150</x>
<y>499</y>
<width>81</width>
<height>21</height>
</rect>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>13</x>
<y>501</y>
<width>131</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Sans</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Mask colour:</string>
</property>
</widget>
<widget class="Line" name="separator_layers_2">
<property name="geometry">
<rect>
<x>10</x>
<y>480</y>
<width>220</width>
<height>20</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QPushButton" name="pushButton_3">
<property name="geometry">
<rect>
<x>130</x>
<y>295</y>
<width>31</width>
<height>21</height>
</rect>
</property>
<property name="toolTip">
<string>Delete selected ANALYSING layers (blue ones)</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>images/icons/delete.png</normaloff>images/icons/delete.png</iconset>
</property>
</widget>
<widget class="QPushButton" name="pushButton_4">
<property name="geometry">
<rect>
<x>200</x>
<y>184</y>
<width>31</width>
<height>21</height>
</rect>
</property>
<property name="toolTip">
<string>Delete selected IMPORTED layers (blue ones)</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>images/icons/delete.png</normaloff>images/icons/delete.png</iconset>
</property>
</widget>
<widget class="QSlider" name="rSlider">
<property name="geometry">
<rect>
<x>70</x>
<y>529</y>
<width>160</width>
<height>19</height>
</rect>
</property>
<property name="minimum">
<number>-5</number>
</property>
<property name="maximum">
<number>45</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
<property name="value">
<number>5</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QSlider" name="gSlider">
<property name="geometry">
<rect>
<x>70</x>
<y>553</y>
<width>160</width>
<height>19</height>
</rect>
</property>
<property name="minimum">
<number>-5</number>
</property>
<property name="maximum">
<number>45</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
<property name="value">
<number>5</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QSlider" name="bSlider">
<property name="geometry">
<rect>
<x>70</x>
<y>578</y>
<width>160</width>
<height>19</height>
</rect>
</property>
<property name="minimum">
<number>-5</number>
</property>
<property name="maximum">
<number>45</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
<property name="value">
<number>5</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QLabel" name="rLabel">
<property name="geometry">
<rect>
<x>13</x>
<y>530</y>
<width>46</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Sans</family>
<pointsize>10</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Red</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="gLabel">
<property name="geometry">
<rect>
<x>13</x>
<y>553</y>
<width>46</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Sans</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Green</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="bLabel">
<property name="geometry">
<rect>
<x>13</x>
<y>577</y>
<width>46</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Sans</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Blue</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</widget>
</widget>
<widget class="QToolBar" name="mainToolBar">
<property name="minimumSize">
<size>
<width>0</width>
<height>32</height>
</size>
</property>
<property name="movable">
<bool>false</bool>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="actionNew_Project"/>
<addaction name="actionOpen_Project"/>
<addaction name="actionSave_Project"/>
<addaction name="actionSave_Project_As"/>
<addaction name="separator"/>
<addaction name="actionOpen_Image"/>
<addaction name="separator"/>
<addaction name="actionClose_Project_Image"/>
<addaction name="separator"/>
<addaction name="actionZoom_in_25"/>
<addaction name="actionZoom_out_25"/>
<addaction name="actionFit_in_Window"/>
<addaction name="actionOriginal_Size"/>
<addaction name="separator"/>
<addaction name="actionHistogram"/>
<addaction name="actionThreshold"/>
<addaction name="separator"/>
<addaction name="actionAnalyze_edges"/>
<addaction name="actionAnalyze_Colors"/>
<addaction name="separator"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
</widget>
<action name="actionNew_Project">
<property name="checkable">
<bool>false</bool>
</property>
<property name="icon">
<iconset>
<normaloff>images/icons/newProject.png</normaloff>images/icons/newProject.png</iconset>
</property>
<property name="text">
<string>New Project</string>
</property>
<property name="shortcut">
<string>Ctrl+N</string>
</property>
</action>
<action name="actionOpen_Project">
<property name="icon">
<iconset>
<normaloff>images/icons/openProject.png</normaloff>images/icons/openProject.png</iconset>
</property>
<property name="text">
<string>Open Project</string>
</property>
<property name="shortcut">
<string>Ctrl+O</string>
</property>
</action>
<action name="actionSave_Project">
<property name="icon">
<iconset>
<normaloff>images/icons/save.png</normaloff>images/icons/save.png</iconset>
</property>
<property name="text">
<string>Save Project</string>
</property>
<property name="shortcut">
<string>Ctrl+S</string>
</property>
</action>
<action name="actionOpen_Image">
<property name="icon">
<iconset>
<normaloff>images/icons/openImage.png</normaloff>images/icons/openImage.png</iconset>
</property>
<property name="text">
<string>Import Image</string>
</property>
<property name="shortcut">
<string>Ctrl+I</string>
</property>
</action>
<action name="actionExit">
<property name="icon">
<iconset>
<normaloff>images/icons/exit.png</normaloff>images/icons/exit.png</iconset>
</property>
<property name="text">
<string>Exit</string>
</property>
<property name="shortcut">
<string>Ctrl+Q</string>
</property>
</action>
<action name="actionZoom_in_25">
<property name="icon">
<iconset>
<normaloff>images/icons/zoom-in.png</normaloff>images/icons/zoom-in.png</iconset>
</property>
<property name="text">
<string>Zoom in (+ 20 %)</string>
</property>
<property name="shortcut">
<string>Ctrl++</string>
</property>
</action>
<action name="actionZoom_out_25">
<property name="icon">
<iconset>
<normaloff>images/icons/zoom-out.png</normaloff>images/icons/zoom-out.png</iconset>
</property>
<property name="text">
<string>Zoom out (- 20 %)</string>
</property>
<property name="shortcut">
<string>Ctrl+-</string>
</property>
</action>
<action name="actionFit_in_Window">
<property name="icon">
<iconset>
<normaloff>images/icons/zoom-fit.png</normaloff>images/icons/zoom-fit.png</iconset>
</property>
<property name="text">
<string>Fit in Window</string>
</property>
<property name="shortcut">
<string>Ctrl+Enter</string>
</property>
</action>
<action name="actionOriginal_Size">
<property name="icon">
<iconset>
<normaloff>images/icons/zoom-orig.png</normaloff>images/icons/zoom-orig.png</iconset>
</property>
<property name="text">
<string>Original Size</string>
</property>
<property name="shortcut">
<string>Ctrl+0</string>
</property>
</action>
<action name="actionHelp">
<property name="icon">
<iconset>
<normaloff>images/icons/help.png</normaloff>images/icons/help.png</iconset>
</property>
<property name="text">
<string>Help</string>
</property>
<property name="shortcut">
<string>F1</string>
</property>
</action>
<action name="actionAbout_microAnalyzer">
<property name="text">
<string>About microAnalyzer</string>
</property>
</action>
<action name="actionAnalyze_edges">
<property name="text">
<string>Analyze Edges</string>
</property>
</action>
<action name="actionThreshold">
<property name="text">
<string>Threshold</string>
</property>
</action>
<action name="actionSave_Project_As">
<property name="icon">
<iconset>
<normaloff>images/icons/save-as.png</normaloff>images/icons/save-as.png</iconset>
</property>
<property name="text">
<string>Save Project As</string>
</property>
<property name="shortcut">
<string>Ctrl+Shift+S</string>
</property>
</action>
<action name="actionShow_project">
<property name="text">
<string>show project</string>
</property>
</action>
<action name="actionClose_Project_Image">
<property name="icon">
<iconset>
<normaloff>images/icons/close.png</normaloff>images/icons/close.png</iconset>
</property>
<property name="text">
<string>Close Project / Image</string>
</property>
<property name="shortcut">
<string>Ctrl+W</string>
</property>
</action>
<action name="actionHough">
<property name="text">
<string>Hough</string>
</property>
</action>
<action name="actionAnalyze_Colors">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Analyze Colour</string>
</property>
</action>
<action name="actionHistogram">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Histogram</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>

@ -0,0 +1,38 @@
TEMPLATE = app
TARGET = microAnalyzer
DEPENDPATH += .
# OpenCV
LIBS += -lopencv_core -lopencv_imgproc -lboost_system
INCLUDEPATH += .
QT += widgets
QT += xml
# Input
HEADERS += layerrecord.h \
mainwindow.h \
project.h \
projectwizard.h \
./libs/staticsingleton.h \
tableformat.h \
xmlparser.h \
opencvprocessor.h \
layercomposer.h \
customgraphicsview.h
FORMS += mainwindow.ui
SOURCES += layerrecord.cpp \
main.cpp \
mainwindow.cpp \
project.cpp \
projectwizard.cpp \
tableformat.cpp \
xmlparser.cpp \
opencvprocessor.cpp \
layercomposer.cpp \
customgraphicsview.cpp
RC_FILE = microAnalyzer.rc

@ -0,0 +1 @@
IDI_ICON1 ICON DISCARDABLE "images/application.ico"

@ -0,0 +1,164 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file opencvprocessor.cpp
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#include "opencvprocessor.h"
#include "string.h"
#include <string>
#include <iostream>
OpenCVprocessor::OpenCVprocessor(QWidget *parent) :
QMainWindow(parent)
{
}
IplImage * OpenCVprocessor::qImageToCvImage(QImage *qimg) {
IplImage *imgHeader = cvCreateImageHeader( cvSize(qimg->width(), qimg->height()), IPL_DEPTH_8U, 4);
imgHeader->imageData = (char*) qimg->bits();
uchar* newdata = (uchar*) malloc(sizeof(uchar) * qimg->byteCount());
memcpy(newdata, qimg->bits(), qimg->byteCount());
imgHeader->imageData = (char*) newdata;
return imgHeader;
}
QImage OpenCVprocessor::cvImageToQImage(const IplImage *iplImage) {
int height = iplImage->height;
int width = iplImage->width;
if (iplImage->depth == IPL_DEPTH_8U && iplImage->nChannels == 3) {
const uchar *qImageBuffer = (const uchar*)iplImage->imageData;
QImage img(qImageBuffer, width, height, QImage::Format_RGB888);
return img.rgbSwapped();
} else if (iplImage->depth == IPL_DEPTH_8U && iplImage->nChannels == 1){
const uchar *qImageBuffer = (const uchar*)iplImage->imageData;
QImage img(qImageBuffer, width, height, QImage::Format_Indexed8);
QVector<QRgb> colorTable;
for (int i = 0; i < 256; i++){
colorTable.push_back(qRgb(i, i, i));
}
img.setColorTable(colorTable);
return img;
}else{
return QImage();
}
}
QImage OpenCVprocessor::processThreshold_Edges(QImage * input, bool processEdges, int threshValue) {
IplImage * img = NULL;
img = qImageToCvImage(input);
// transform source image to greyscale
IplImage *dst = cvCreateImage( cvSize( img->width, img->height ), IPL_DEPTH_8U, 1 );
cvCvtColor( img, dst, CV_RGB2GRAY );
// make threshold
cvThreshold(dst, dst, threshValue, 255, CV_THRESH_BINARY);
if (processEdges) {
cvCanny( dst, dst, 1.0, 1.0, 3);
}
QImage qEdges = cvImageToQImage(dst);
cvReleaseImage(&dst);
cvReleaseImage(&img);
return qEdges;
}
QImage OpenCVprocessor::normalizeImage(QImage * input, int red, int green, int blue, int rThrs, int gThrs, int bThrs) {
// load image
IplImage * img = NULL;
img = qImageToCvImage(input);
// prepare particular channels
IplImage* imgRed = cvCreateImage(cvGetSize(img), 8, 1);
IplImage* imgGreen = cvCreateImage(cvGetSize(img), 8, 1);
IplImage* imgBlue = cvCreateImage(cvGetSize(img), 8, 1);
// split channels
cvSplit(img, imgBlue, imgGreen, imgRed, NULL);
// change to bitmask!
int lowRed = red-rThrs;
if (lowRed < 0) {
lowRed = 0;
}
if (lowRed > 255) {
lowRed = 255;
}
int highRed = red+rThrs;
if (highRed < 0) {
highRed = 0;
}
if (highRed > 255) {
highRed = 255;
}
int lowGreen = green-gThrs;
if (lowGreen < 0) {
lowGreen = 0;
}
if (lowGreen > 255) {
lowGreen = 255;
}
int highGreen = green+gThrs;
if (highGreen < 0) {
highGreen = 0;
}
if (highGreen > 255) {
highGreen = 255;
}
int lowBlue = blue-bThrs;
if (lowBlue < 0) {
lowBlue = 0;
}
if (lowBlue > 255) {
lowBlue = 255;
}
int highBlue = blue+bThrs;
if (highBlue < 0) {
highBlue = 0;
}
if (highBlue > 255) {
highBlue = 255;
}
// mask each channle
cvInRangeS(imgRed, cvScalar(lowRed), cvScalar(highRed), imgRed);
cvInRangeS(imgGreen, cvScalar(lowGreen), cvScalar(highGreen), imgGreen);
cvInRangeS(imgBlue, cvScalar(lowBlue), cvScalar(highBlue), imgBlue);
cvMul(imgRed, imgGreen, imgRed);
cvMul(imgRed, imgBlue, imgRed);
// transform result to QImage format
QImage qOutput = cvImageToQImage(imgRed);
// release memory
cvReleaseImage(&img);
cvReleaseImage(&imgRed);
cvReleaseImage(&imgGreen);
cvReleaseImage(&imgBlue);
return qOutput;
}

@ -0,0 +1,44 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file opencvprocessor.h
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef OPENCVPROCESSOR_H
#define OPENCVPROCESSOR_H
#include <QMainWindow>
#include "opencv/cv.h"
#include "opencv/highgui.h"
class OpenCVprocessor : public QMainWindow
{
Q_OBJECT
public:
explicit OpenCVprocessor(QWidget *parent = 0);
IplImage * qImageToCvImage(QImage *qimg);
QImage cvImageToQImage(const IplImage *iplImage);
QImage processThreshold_Edges(QImage * input, bool processEdges, int threshValue);
QImage normalizeImage(QImage * input, int red, int green, int blue, int rThrs, int gThrs, int bThrs);
QImage detectDrawQuads(QImage * input);
std::vector<QImage> makeHistogram(QImage * input);
IplImage* DrawHistogram(CvHistogram *hist, float scaleX=1, float scaleY=1);
signals:
public slots:
private:
IplImage * cvImage;
QImage qtImage;
};
#endif // OPENCVPROCESSOR_H

@ -0,0 +1,456 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file project.cpp
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#include "project.h"
#include "mainwindow.h"
#include "xmlparser.h"
// Konstanty
const QString Project::PROJVERSION = QString("1.0");
const QString Project::PROJSUBDIR_IMAGES = QString("images");
const QString Project::PROJSUBDIR_LAYERS = QString("layers");
const QString Project::PROJ_FILE_EXT = QString(".mapro");
const QString Project::XML_TRUE = QString("1");
const QString Project::XML_FALSE = QString("0");
// --------------------------------------------
/**
* @brief = KONSTRUKTOR
*/
// --------------------------------------------
Project::Project(QObject *parent) : QObject(parent){
valueInit();
}
// --------------------------------------------
/**
* @brief = DESTRUKTOR
*/
// --------------------------------------------
Project::~Project()
{
}
void Project::valueInit() {
setProjectName("");
setProjectFileName("");
setProjectRootDir("");
setProjectRootDir_old("");
setImagesDir(PROJSUBDIR_IMAGES);
setLayersDir(PROJSUBDIR_LAYERS);
setFileImported(false);
std::vector<QString> imgs;
setImages(imgs);
std::vector<QString> lrs;
setLayers(lrs);
}
void Project::setProjectName (QString s) {
this->projectName = s;
}
QString Project::getProjectName (void) {
return this->projectName;
}
void Project::setProjectFileName (QString s) {
this->projectFileName = s;
}
QString Project::getProjectFileName (void) {
return this->projectFileName;
}
void Project::setProjectRootDir (QString s) {
this->projectRootDir = s;
}
QString Project::getProjectRootDir (void) {
return this->projectRootDir;
}
void Project::setProjectRootDir_old (QString s) {
this->projectRootDir_old = s;
}
QString Project::getProjectRootDir_old (void) {
return this->projectRootDir_old;
}
void Project::setImagesDir (QString s) {
this->imagesDir = s;
}
QString Project::getImagesDir (void) {
return this->imagesDir;
}
void Project::setLayersDir (QString s) {
this->layersDir = s;
}
QString Project::getLayersDir (void) {
return this->layersDir;
}
void Project::setFileImported (bool i) {
this->fileImported = i;
}
bool Project::getFileImported (void) {
return this->fileImported;
}
void Project::setImages (std::vector<QString> i) {
if (i != getImages()) {
this->images = i;
emit imagesValueChanged();
}
}
std::vector<QString> Project::getImages (void) {
return this->images;
}
void Project::addToImages (QString s) {
this->images.push_back(s);
emit imagesValueChanged();
}
QString Project::getSelectedImage (unsigned int index) {
if (images.size() > index) {
return this->images[index];
}
else {
return "ERROR";
}
}
void Project::eraseSelectedImage(unsigned int index) {
if (images.size() > index) {
std::vector<QString>::iterator it = images.begin();
it += index;
images.erase(it);
}
}
void Project::emitDeleteImported() {
emit imagesValueChanged();
}
void Project::setLayers (std::vector<QString> i) {
if (i != getLayers()) {
this->layers = i;
emit layersValueChanged();
}
}
std::vector<QString> Project::getLayers (void) {
return this->layers;
}
void Project::addToLayers (QString s) {
this->layers.push_back(s);
emit layersValueChanged();
}
QString Project::getSelectedLayer (unsigned int index) {
if (layers.size() > index) {
return this->layers[index];
}
else {
return "ERROR";
}
}
void Project::eraseSelectedLayer(unsigned int index) {
if (layers.size() > index) {
std::vector<QString>::iterator it = layers.begin();
it += index;
layers.erase(it);
}
}
void Project::emitDeleteAnalysings() {
emit layersValueChanged();
}
int Project::layersCount() {
return this->layers.size();
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
void Project::prepareProject(QString rootDir, QString projectName, QString projectFileName,
bool fileImported, std::vector<QString> images, std::vector<QString> layers) {
setProjectRootDir_old(getProjectRootDir());
setProjectRootDir(rootDir);
setProjectName(projectName);
setProjectFileName(projectFileName);
setFileImported(fileImported);
setImagesDir(Project::PROJSUBDIR_IMAGES);
setLayersDir(Project::PROJSUBDIR_LAYERS);
setImages(images);
setLayers(layers);
}
bool Project::fileCopy(QString fileName, QString destDir, QString destFilename, QString * newFileName) {
// remembering of the filename
QFileInfo fi(fileName);
// get the number for filename (filename_number.ext)
QDir dir(destDir);
int number = dir.count();
number--;
while (1) {
QString numStr = QString::number(number);
QFile destFile(destDir + "/" + destFilename + "_" + numStr + "." + fi.completeSuffix());
if (!destFile.exists()) {
break;
}
else {
number++;
}
}
// copy the file to the project directory with a specified filename
QString numStr = QString::number(number);
QString finalDestFileString = destDir + "/" + destFilename + "_" + numStr + "." + fi.completeSuffix();
QFile sourceFile(fileName);
QFile finalDestFile(finalDestFileString);
QFileInfo finalFi(finalDestFileString);
*newFileName = finalFi.baseName() + "." + finalFi.completeSuffix();
if (sourceFile.exists()) {
if (!sourceFile.copy(finalDestFile.fileName())) {
return false;
}
}
return true;
}
bool Project::removeDir(QString dirName) {
bool result = true;
QDir dir(dirName);
if (dir.exists(dirName)) {
Q_FOREACH(QFileInfo info, dir.entryInfoList(QDir::NoDotAndDotDot | QDir::System | QDir::Hidden | QDir::AllDirs | QDir::Files, QDir::DirsFirst)) {
if (info.isDir()) {
result = this->removeDir(info.absoluteFilePath());
}
else {
result = QFile::remove(info.absoluteFilePath());
}
if (!result) {
return result;
}
}
result = dir.rmdir(dirName);
}
return result;
}
bool Project::saveToFile(bool removeSubDirs) {
if (getProjectRootDir() == getProjectRootDir_old()) {
removeSubDirs = false;
}
QFile mapro(getProjectRootDir() + "/" + getProjectFileName());
if (mapro.exists()) {
if (!mapro.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
return false;
}
}
else {
if (!mapro.open(QIODevice::ReadWrite)) {
return false;
}
}
// make an entry in XML for an imported image
QString importedInt = XML_FALSE;
if (getFileImported()) {
importedInt = XML_TRUE;
}
// prepare directory structure for the project
QString projImages_dir = getProjectRootDir();
projImages_dir.append("/").append(getImagesDir());
QString projLayers_dir = getProjectRootDir();
projLayers_dir.append("/").append(getLayersDir());
if (removeSubDirs) {
if (QDir(projImages_dir).exists()) {
removeDir(projImages_dir);
}
QDir().mkpath(projImages_dir);
if (QDir(projLayers_dir).exists()) {
removeDir(projLayers_dir);
}
QDir().mkpath(projLayers_dir);
}
else {
if (!QDir(projImages_dir).exists()) {
QDir().mkpath(projImages_dir);
}
if (!QDir(projLayers_dir).exists()) {
QDir().mkpath(projLayers_dir);
}
}
// copying of the files and creating an XML entry
// BACKGROUNDs
QString importedImageFilesXML = "";
std::vector<QString> tmpB = getImages();
for (uint i = 0; i < getImages().size(); i++) {
QString scrImage = getImages()[i]; // source file
QFileInfo scrFi(scrImage);
// if the file is already in the right place, do not perform the copying
bool fileFromProjectDir = false;
if (scrImage == (scrFi.baseName() + "." + scrFi.completeSuffix())) {
scrImage = getProjectRootDir_old() + "/" + getImagesDir() + "/" + scrImage;
fileFromProjectDir = true;
}
QString destAddr = getProjectRootDir() + "/" + getImagesDir(); // destination directory
QString newFileName_part = "pict"; // renaming of the file
QString newFileName_whole; // final file name for XML entry
// for SAVE it does not copy files that already exist in the project
bool makeCopy = true;
QFile testExist(scrImage);
if (!removeSubDirs && fileFromProjectDir && testExist.exists()) {
makeCopy = false;
newFileName_whole = getImages()[i];
}
if (makeCopy && !fileCopy(scrImage, destAddr, newFileName_part, &newFileName_whole)) {
removeDir(getProjectRootDir());
return false;
}
if (makeCopy) {
tmpB[i] = newFileName_whole;
}
importedImageFilesXML += "\t\t<image>" + newFileName_whole + "</image>\n";
}
setImages(tmpB);
// copying of the files and creating an XML entry
// LAYERs
QString importedLayerFilesXML = "";
std::vector<QString> tmpL = getLayers();
for (uint i = 0; i < getLayers().size(); i++) {
QString scrImage = getLayers()[i]; // source file
QFileInfo scrFi(scrImage);
bool fileFromProjectDir = false;
if (scrImage == (scrFi.baseName() + "." + scrFi.completeSuffix())) {
scrImage = getProjectRootDir_old() + "/" + getLayersDir() + "/" + scrImage;
fileFromProjectDir = true;
}
QString destAddr = getProjectRootDir() + "/" + getLayersDir(); // destination directory
QString newFileName_part = scrFi.baseName(); // renaming of the file
QString newFileName_whole; // final file name for XML entry
// for SAVE it does not copy files that already exist in the project
bool makeCopy = true;
QFile testExist(scrImage);
if (!removeSubDirs && fileFromProjectDir && testExist.exists()) {
makeCopy = false;
newFileName_whole = getLayers()[i];
}
if (makeCopy && !fileCopy(scrImage, destAddr, newFileName_part, &newFileName_whole)) {
removeDir(getProjectRootDir());
return false;
}
if (makeCopy) {
tmpL[i] = newFileName_whole;
}
importedLayerFilesXML += "\t\t<layer>" + newFileName_whole + "</layer>\n";
}
setLayers(tmpL);
// XML format of the project file
QTextStream ts( &mapro );
ts << "<ma_project>" << endl <<
"\t<version>" + PROJVERSION + "</version>" << endl <<
"\t<name>" + getProjectName() + "</name>" << endl <<
"\t<fileImported>" + importedInt + "</fileImported>" << endl <<
"\t<imagesDir>" + getImagesDir() + "</imagesDir>" << endl <<
"\t<layersDir>" + getLayersDir() + "</layersDir>" << endl <<
"\t<images>" << endl;
if (importedImageFilesXML.length() > 0) {
ts << importedImageFilesXML;
}
ts << "\t</images>" << endl <<
"\t<layers>" << endl;
if (importedLayerFilesXML.length() > 0) {
ts << importedLayerFilesXML;
}
ts << "\t</layers>" << endl <<
"</ma_project>" << endl;
mapro.close();
return true;
}
bool Project::deleteAnalysing(int index) {
// prepare path for removing of a file
QString fileToRemove = getProjectRootDir() + "/";
fileToRemove += getLayersDir() + "/";
fileToRemove += getSelectedLayer(index);
// remove file from LAYERs
eraseSelectedLayer(index);
return QFile::remove(fileToRemove);
}
bool Project::deleteImported(int index) {
// prepare path for removing of a file
QString fileToRemove = getProjectRootDir() + "/";
fileToRemove += getImagesDir() + "/";
fileToRemove += getSelectedImage(index);
// remove file from BACKGROUNDs
eraseSelectedImage(index);
// samotne smazani souboru
return QFile::remove(fileToRemove);
}

@ -0,0 +1,104 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file project.h
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef PROJECT_H
#define PROJECT_H
#include <QObject>
#include <QMainWindow>
#include <QTextStream>
#include <vector>
#include <QMessageBox>
#include <iostream>
// singleton
#include "./libs/staticsingleton.h"
class Project : public QObject
{
Q_OBJECT
public:
static const QString PROJVERSION;
static const QString PROJSUBDIR_IMAGES;
static const QString PROJSUBDIR_LAYERS;
static const QString XML_TRUE;
static const QString XML_FALSE;
static const QString PROJ_FILE_EXT;
void valueInit();
void setProjectName (QString name);
QString getProjectName (void);
void setProjectFileName (QString name);
QString getProjectFileName (void);
void setProjectRootDir (QString s);
QString getProjectRootDir (void);
void setProjectRootDir_old (QString s);
QString getProjectRootDir_old (void);
void setImagesDir (QString s);
QString getImagesDir (void);
void setLayersDir (QString s);
QString getLayersDir (void);
void setFileImported (bool i);
bool getFileImported (void);
void setImages (std::vector<QString> i);
std::vector<QString> getImages (void);
void addToImages (QString s);
QString getSelectedImage (unsigned int index);
void eraseSelectedImage(unsigned int index);
void emitDeleteImported();
void setLayers (std::vector<QString> i);
std::vector<QString> getLayers (void);
void addToLayers (QString s);
QString getSelectedLayer (unsigned int index);
void eraseSelectedLayer(unsigned int index);
void emitDeleteAnalysings();
int layersCount();
void prepareProject(QString rootDir, QString projectName,
QString projectFileName, bool fileImported,
std::vector<QString> images, std::vector<QString> layers);
bool saveToFile(bool removeSubDirs);
bool fileCopy(QString fileName, QString destDir, QString destFilename, QString * newFileName);
bool removeDir(QString dirName);
bool deleteAnalysing(int index);
bool deleteImported(int index);
signals:
void imagesValueChanged();
void layersValueChanged();
public slots:
private:
// constructor, destructor private = singleton
explicit Project(QObject *parent = 0);
~Project();
// friend allows singleton to be created by this object
friend class cStaticSingleton<Project>;
QString projectRootDir;
QString projectRootDir_old;
QString projectFileName;
QString projectName;
bool fileImported;
QString imagesDir;
QString layersDir;
std::vector<QString> images;
std::vector<QString> layers;
};
// singleton instance of the project
typedef cStaticSingleton<Project> cProject;
#endif // PROJECT_H

@ -0,0 +1,148 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file projectwizard.cpp
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#include <QtGui>
#include <QVBoxLayout>
#include <QLineEdit>
#include <QPushButton>
#include "projectwizard.h"
#include "xmlparser.h"
#include "mainwindow.h"
ProjectWizard::ProjectWizard(QWidget *parent) : QWizard(parent) {
addPage(new WelcomePage);
addPage(new ProjectInfoPage);
setWindowTitle(tr("New Project Wizard"));
}
void ProjectWizard::accept() {
QString projectName = field("projectName").toString();
QString projectDir = field("projectDir").toString();
bool checkBox = field("importFileCheck").toBool();
QString imageFileName = field("imageFile").toString();
std::vector<QString> imagesVect;
std::vector<QString> layersVect;
// import of a file
if (checkBox) {
imagesVect.push_back(imageFileName);
}
QString projectFileName = projectName + Project::PROJ_FILE_EXT;
// make the new project file in the project root
cProject::Instance()->prepareProject(projectDir, projectName, projectFileName, checkBox, imagesVect, layersVect);
bool removeSubDirs = true;
cProject::Instance()->saveToFile(removeSubDirs);
QDialog::accept();
QMessageBox::information(this, tr("microAnalyzer :: PROJECT CREATED"), tr("The project \"%1\" was successfully created.").arg(projectName));
}
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
WelcomePage::WelcomePage(QWidget *parent): QWizardPage(parent) {
setTitle(tr("Welcome to New Project Wizard!"));
label = new QLabel(tr("<p>This wizard will create a New Project directory "
"with basic configuration. It is needed to fill only few information.</p>"
"<p>Click <strong>next</strong> to continue, please.</p>"));
label->setWordWrap(true);
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(label);
setLayout(layout);
}
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
ProjectInfoPage::ProjectInfoPage(QWidget *parent): QWizardPage(parent) {
setTitle(tr("Project details<br />"));
// name of the project
projectNameLabel = new QLabel(tr("Project name:"));
projectNameLineEdit = new QLineEdit;
projectNameLabel->setBuddy(projectNameLineEdit);
// root dir of the project
projectDirLabel = new QLabel(tr("Choose &project root directory:"));
projectDirLineEdit = new QLineEdit;
projectDirLabel->setBuddy(projectDirLineEdit);
chooseDirBtn = new QPushButton("Choose dir");
connect(chooseDirBtn, SIGNAL(clicked()), this, SLOT(browseDirs()));
// image import
imageImportLabel = new QLabel(tr("Choose &image file to import:"));
imageImportLineEdit = new QLineEdit;
imageImportLineEdit->setEnabled(false);
imageImportLabel->setBuddy(imageImportLineEdit);
importFileCheckBox = new QCheckBox(tr("Import image file now."));
importImageBtn = new QPushButton("Import image");
importImageBtn->setEnabled(false);
connect(importImageBtn, SIGNAL(clicked()), this, SLOT(openImageFile()));
connect(importFileCheckBox, SIGNAL(toggled(bool)), importImageBtn, SLOT(setEnabled(bool)));
connect(importFileCheckBox, SIGNAL(toggled(bool)), imageImportLineEdit, SLOT(setEnabled(bool)));
registerField("projectName*", projectNameLineEdit);
registerField("projectDir*", projectDirLineEdit);
registerField("importFileCheck", importFileCheckBox);
registerField("imageFile", imageImportLineEdit);
// UI wizard
QGridLayout *layout = new QGridLayout;
layout->addWidget(projectNameLabel, 0, 0);
layout->addWidget(projectNameLineEdit, 0, 1, 1, 3);
QLabel *separatorLabel1 = new QLabel(tr(" "));
layout->addWidget(separatorLabel1, 1, 0);
layout->addWidget(projectDirLabel, 2, 0);
layout->addWidget(projectDirLineEdit, 3, 0, 1, 3);
layout->addWidget(chooseDirBtn, 3, 3);
QLabel *separatorLabel = new QLabel(tr(" "));
layout->addWidget(separatorLabel, 4, 0);
layout->addWidget(importFileCheckBox, 5, 0);
layout->addWidget(imageImportLabel, 6, 0);
layout->addWidget(imageImportLineEdit, 7, 0, 1, 3);
layout->addWidget(importImageBtn, 7, 3);
setLayout(layout);
}
void ProjectInfoPage::browseDirs() {
QString directory = QFileDialog::getExistingDirectory(0 , "Choose project root directory", QDir::currentPath());
if (!directory.isEmpty()) {
projectDirLineEdit->setText(directory);
}
}
/*
* Load image
*/
void ProjectInfoPage::openImageFile() {
QString imageFileName = QFileDialog::getOpenFileName(this, tr("Open Image"), QDir::currentPath(), "*.bmp *.png *.tif *.jpg *.jpeg");
if (!imageFileName.isEmpty()) {
imageImportLineEdit->setText(imageFileName);
}
}
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------

@ -0,0 +1,81 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file projectwizard.h
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef PROJECTWIZARD_H
#define PROJECTWIZARD_H
#include <QWizard>
// singleton
#include "project.h"
class QCheckBox;
class QMessageBox;
class QGroupBox;
class QLabel;
class QLineEdit;
class QRadioButton;
class QPushButton;
class MainWindow;
class ProjectWizard : public QWizard
{
Q_OBJECT
public:
explicit ProjectWizard(QWidget *parent = 0);
void accept();
signals:
public slots:
};
// --------------------------------------------
class WelcomePage : public QWizardPage
{
Q_OBJECT
public:
WelcomePage(QWidget *parent = 0);
private:
QLabel *label;
};
// --------------------------------------------
class ProjectInfoPage : public QWizardPage
{
Q_OBJECT
public:
ProjectInfoPage(QWidget *parent = 0);
private slots:
void openImageFile();
void browseDirs();
private:
QLabel *projectNameLabel;
QLineEdit *projectNameLineEdit;
QLabel *projectDirLabel;
QLineEdit *projectDirLineEdit;
QCheckBox *importFileCheckBox;
QGroupBox *groupBox;
QLabel *imageImportLabel;
QLineEdit *imageImportLineEdit;
QPushButton *importImageBtn;
QPushButton *chooseDirBtn;
};
#endif // PROJECTWIZARD_H

@ -0,0 +1,146 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file tebleformat.cpp
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#include "tableformat.h"
TableFormat::TableFormat(QObject *parent): QAbstractTableModel(parent) {
}
TableFormat::TableFormat(QList<LayerRecord*> pairs, QObject *parent) : QAbstractTableModel(parent) {
listOfPairs = pairs;
}
Qt::ItemFlags TableFormat::flags(const QModelIndex &index) const {
Qt::ItemFlags result = QAbstractTableModel::flags(index);
if (index.column() == 0) {
result = Qt::ItemIsUserCheckable | Qt::ItemIsEditable | Qt::ItemIsEnabled;
return result;
}
if (!index.isValid()) {
return Qt::ItemIsEnabled;
}
return QAbstractTableModel::flags(index);
}
int TableFormat::rowCount(const QModelIndex &parent) const {
Q_UNUSED(parent);
return listOfPairs.size();
}
int TableFormat::columnCount(const QModelIndex &parent) const {
Q_UNUSED(parent);
return 3;
}
QVariant TableFormat::data(const QModelIndex &index, int role) const {
if (!index.isValid()) {
return QVariant();
}
if (index.row() >= listOfPairs.size() || index.row() < 0) {
return QVariant();
}
LayerRecord * currentRow = listOfPairs.at(index.row());
if (role == Qt::CheckStateRole && index.column() == 0) {
return currentRow->getCheckBox();
}
if (role == Qt::DisplayRole) {
if (index.column() == 0) {
// checkBox
}
else if (index.column() == 1) {
return currentRow->getName();
}
else if (index.column() == 2) {
return currentRow->getOpacity();
}
}
return QVariant();
}
QVariant TableFormat::headerData(int section, Qt::Orientation orientation, int role) const {
if (role != Qt::DisplayRole)
return QVariant();
if (orientation == Qt::Horizontal) {
switch (section) {
case 0:
return tr("");
case 1:
return tr("Layer");
case 2:
return tr("%");
default:
return QVariant();
}
}
return QVariant();
}
bool TableFormat::insertRows(int position, int rows, const QModelIndex &index) {
Q_UNUSED(index);
beginInsertRows(QModelIndex(), position, position+rows-1);
for (int row = 0; row < rows; row++) {
QString s1 = " ";
listOfPairs.insert(0, new LayerRecord(true, s1, s1));
}
endInsertRows();
return true;
}
bool TableFormat::removeRows(int position, int rows, const QModelIndex &index) {
Q_UNUSED(index);
beginRemoveRows(QModelIndex(), position, position+rows-1);
for (int row=0; row < rows; ++row) {
listOfPairs.removeAt(position);
}
endRemoveRows();
return true;
}
bool TableFormat::setData(const QModelIndex &index, const QVariant &value, int role) {
if (index.isValid() && role == Qt::EditRole) {
int row = index.row();
LayerRecord * p = listOfPairs.value(row);
if (index.column() == 0) {
}
else if (index.column() == 1) {
p->setName(value.toString());
}
else if (index.column() == 2) {
p->setOpacity(value.toString());
}
else {
return false;
}
listOfPairs.replace(row, p);
emit(dataChanged(index, index));
return true;
}
return false;
}
QList<LayerRecord*> TableFormat::getList() {
return listOfPairs;
}

@ -0,0 +1,41 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file tableformat.h
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef TABLEFORMAT_H
#define TABLEFORMAT_H
#include <QAbstractTableModel>
#include <QList>
#include "layerrecord.h"
class TableFormat : public QAbstractTableModel
{
Q_OBJECT
public:
TableFormat(QObject *parent=0);
TableFormat(QList<LayerRecord*> listofPairs, QObject *parent=0);
Qt::ItemFlags flags(const QModelIndex &index) const;
int rowCount(const QModelIndex &parent) const;
int columnCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole);
bool insertRows(int position, int rows, const QModelIndex &index=QModelIndex());
bool removeRows(int position, int rows, const QModelIndex &index=QModelIndex());
QList<LayerRecord*> getList();
private:
QList<LayerRecord*> listOfPairs;
};
#endif // TABLEFORMAT_H

@ -0,0 +1,87 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file xmlparser.cpp
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#include "xmlparser.h"
#include "project.h"
#include "mainwindow.h"
XMLparser::XMLparser(QWidget *parent) :
QMainWindow(parent)
{
}
bool XMLparser::read(QIODevice *device) {
QString errorStr;
int errorLine;
int errorColumn;
if (!domDocument.setContent(device, true, &errorStr, &errorLine, &errorColumn)) {
QMessageBox::information(this, tr("microAnalyzer :: ERROR"),
tr("Project file parse error at line %1, column %2:\n%3")
.arg(errorLine)
.arg(errorColumn)
.arg(errorStr));
return false;
}
QDomElement root = domDocument.documentElement();
if (root.tagName() != "ma_project") {
QMessageBox::critical(window(), tr("microAnalyzer :: ERROR"), tr("The file is not a microAnalyzer project file."));
return false;
} else if (root.hasAttribute("version") && root.attribute("version") != "1.0") {
QMessageBox::critical(window(), tr("microAnalyzer :: ERROR"), tr("The file is not a microAnalyzer project file version 1.0."));
return false;
}
// basic values
QString childName = root.firstChildElement("name").text();
QString childFileImported = root.firstChildElement("fileImported").text();
QString childImagesDir = root.firstChildElement("imagesDir").text();
QString childLayersDir = root.firstChildElement("layersDir").text();
// load information from xml to the project instance
cProject::Instance()->setProjectName(childName);
cProject::Instance()->setFileImported((childFileImported == Project::XML_TRUE) ? true : false);
cProject::Instance()->setImagesDir(childImagesDir);
cProject::Instance()->setLayersDir(childLayersDir);
cProject::Instance()->setProjectFileName(cProject::Instance()->getProjectName() + Project::PROJ_FILE_EXT);
// load imported images for backgrounds
std::vector<QString> imgVect;
if (childFileImported == Project::XML_TRUE) {
QDomElement childImagesRoot = root.firstChildElement("images");
if (!childImagesRoot.isNull()) {
QDomElement childImages = childImagesRoot.firstChildElement("image");
while (!childImages.isNull()) {
imgVect.push_back(childImages.text());
childImages = childImages.nextSiblingElement("image");
}
}
}
cProject::Instance()->setImages(imgVect);
// load imported layers
std::vector<QString> layers;
QDomElement childLayersRoot = root.firstChildElement("layers");
if (!childLayersRoot.isNull()) {
QDomElement childLayers = childLayersRoot.firstChildElement("layer");
while (!childLayers.isNull()) {
layers.push_back(childLayers.text());
childLayers = childLayers.nextSiblingElement("layer");
}
}
cProject::Instance()->setLayers(layers);
return true;
}

@ -0,0 +1,37 @@
////////////////////////////////////////////////////////////////////////////////
/**
* \file xmlparser.h
* \version v1.0
* \author Ing. Dominik Malcik
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef XMLPARSER_H
#define XMLPARSER_H
#include <QMainWindow>
#include <QtXml/QDomDocument>
#include <QMessageBox>
#include <vector>
// singleton
#include "project.h"
class XMLparser : public QMainWindow
{
Q_OBJECT
public:
explicit XMLparser(QWidget *parent = 0);
bool read(QIODevice *file);
signals:
public slots:
private:
QDomDocument domDocument;
};
#endif // XMLPARSER_H
Loading…
Cancel
Save