From: Sergey Belash Date: Fri, 7 Mar 2014 12:50:17 +0000 (+0400) Subject: "GUI" stubs for testing of CMake building procedures, preliminary examples of GUI X-Git-Tag: V_0.1~62 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f09c9895be486d30c9aa48da040c3aeb3ccbaa74;p=modules%2Fshaper.git "GUI" stubs for testing of CMake building procedures, preliminary examples of GUI --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bc0930ea..c44ff627d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,3 +6,5 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeCommon" ${CMAKE_MODULE_PATH}) ADD_SUBDIRECTORY (src/ModelAPI) ADD_SUBDIRECTORY (src/Model) +ADD_SUBDIRECTORY (src/XGUI) +ADD_SUBDIRECTORY (src/GeomModule) \ No newline at end of file diff --git a/src/GeomModule/GeomModule.cpp b/src/GeomModule/GeomModule.cpp new file mode 100644 index 000000000..de003fd87 --- /dev/null +++ b/src/GeomModule/GeomModule.cpp @@ -0,0 +1,35 @@ +#include "GeomModule.h" + +#include +#include +#include +#include + +/*!Create and return new instance of XGUI_Module*/ +extern "C" GM_EXPORT XGUI_Module* createModule() +{ + return new GeomModule(); +} + + +GeomModule::GeomModule() +{ + QString aDir = qApp->applicationDirPath(); + QString aXMLFile = aDir + QDir::separator() + "main_menu.xml"; + + QFile aFile(aXMLFile); + if (aFile.open((QIODevice::ReadOnly | QIODevice::Text))) { + QTextStream aTextStream(&aFile); + myMenuXML = aTextStream.readAll(); + } +} + + +GeomModule::~GeomModule() +{ +} + +QString GeomModule::moduleDescription() const +{ + return myMenuXML; +} \ No newline at end of file diff --git a/src/GeomModule/GeomModule.h b/src/GeomModule/GeomModule.h new file mode 100644 index 000000000..8ccd09aa8 --- /dev/null +++ b/src/GeomModule/GeomModule.h @@ -0,0 +1,21 @@ + +#ifndef GeomModule_H +#define GeomModule_H + +#include "GeomModule_Defs.h" + +#include + +class GM_EXPORT GeomModule : public XGUI_Module +{ +public: + GeomModule(); + virtual ~GeomModule(); + + virtual QString moduleDescription() const; + +private: + QString myMenuXML; +}; + +#endif \ No newline at end of file diff --git a/src/GeomModule/GeomModule_Defs.h b/src/GeomModule/GeomModule_Defs.h new file mode 100644 index 000000000..45697e587 --- /dev/null +++ b/src/GeomModule/GeomModule_Defs.h @@ -0,0 +1,16 @@ +#ifndef GeomModule_Defs_H +#define GeomModule_Defs_H + + +#if defined WIN32 +# if defined GM_EXPORTS || defined gm_EXPORTS +# define GM_EXPORT __declspec( dllexport ) +# else +# define GM_EXPORT __declspec( dllimport ) +# endif +#else +# define GM_EXPORT +#endif + + +#endif \ No newline at end of file diff --git a/src/GeomModule/main_menu.xml b/src/GeomModule/main_menu.xml new file mode 100644 index 000000000..5a81a5d7e --- /dev/null +++ b/src/GeomModule/main_menu.xml @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/src/XGUI/CMakeLists.txt b/src/XGUI/CMakeLists.txt new file mode 100644 index 000000000..ee41e8cb9 --- /dev/null +++ b/src/XGUI/CMakeLists.txt @@ -0,0 +1,60 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11) + +INCLUDE(Common) +INCLUDE(FindQt5) + +SET(PROJECT_HEADERS + XGUI_Command.h + XGUI_MainMenu.h + XGUI_MainWindow.h + XGUI_MenuGroupPanel.h + XGUI_Module.h + XGUI_Tools.h + XGUI_Workbench.h + XGUI_Workshop.h +) + +SET(PROJECT_AUTOMOC + ${CMAKE_CURRENT_BINARY_DIR}/XGUI_automoc.cpp +) + +SET(PROJECT_SOURCES + XGUI_Command.cpp + XGUI_Main.cpp + XGUI_MainMenu.cpp + XGUI_MainWindow.cpp + XGUI_MenuGroupPanel.cpp + XGUI_Tools.cpp + XGUI_Workbench.cpp + XGUI_Workshop.cpp +) + +SET(PROJECT_RESOURCES + XGUI_pictures.qrc +) + +SET(TEXT_RESOURCES + XGUI_msg_en.ts +) + +QT5_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES}) +QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES}) + +SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES}) +SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES}) + +ADD_DEFINITIONS(-DWIN32 -D_WINDOWS) + +ADD_EXECUTABLE(XGUI WIN32 + ${PROJECT_SOURCES} + ${PROJECT_HEADERS} + ${PROJECT_COMPILED_RESOURCES} + ${TEXT_RESOURCES} + ${QM_RESOURCES} +) + +# The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore +TARGET_LINK_LIBRARIES(XGUI ${Qt5Widgets_LIBRARIES}) + +INSTALL(TARGETS XGUI DESTINATION bin) +INSTALL(FILES ${QM_RESOURCES} DESTINATION bin) diff --git a/src/XGUI/XGUI_Command.cpp b/src/XGUI/XGUI_Command.cpp new file mode 100644 index 000000000..4c4249c6f --- /dev/null +++ b/src/XGUI/XGUI_Command.cpp @@ -0,0 +1,42 @@ +#include "XGUI_Command.h" + +#include + +XGUI_Command::XGUI_Command(QObject * parent) : + QWidgetAction(parent) +{ +} + +XGUI_Command::XGUI_Command(const QIcon& icon, const QString& text, QObject* parent): + QWidgetAction(parent) +{ + setIcon(icon); + setText(text); +} + + +XGUI_Command::~XGUI_Command() +{ +} + +QWidget* XGUI_Command::createWidget(QWidget* theParent) +{ + if (theParent->inherits("XGUI_MenuGroupPanel")) { + QPushButton* aBtn = new QPushButton(theParent); + aBtn->setIcon(icon()); + aBtn->setText(text()); + QKeySequence aKeys = shortcut(); + QString aToolTip = toolTip(); + if (!aKeys.isEmpty()) + aToolTip = aToolTip + " (" + aKeys.toString() + ")"; + if (!aToolTip.isEmpty()) + aBtn->setToolTip(aToolTip); + + aBtn->addAction(this); + connect(aBtn, SIGNAL(clicked()), this, SLOT(trigger())); + aBtn->setFlat(true); + aBtn->setMinimumSize(MIN_BUTTON_WIDTH, MIN_BUTTON_HEIGHT); + return aBtn; + } + return QWidgetAction::createWidget(theParent); +} \ No newline at end of file diff --git a/src/XGUI/XGUI_Command.h b/src/XGUI/XGUI_Command.h new file mode 100644 index 000000000..8f1caf154 --- /dev/null +++ b/src/XGUI/XGUI_Command.h @@ -0,0 +1,22 @@ +#ifndef XGUI_Command_H +#define XGUI_Command_H + +#include + +#define MIN_BUTTON_HEIGHT 18 +#define MIN_BUTTON_WIDTH 40 + + +class XGUI_Command : public QWidgetAction +{ + Q_OBJECT +public: + XGUI_Command(QObject * parent); + XGUI_Command(const QIcon& icon, const QString& text, QObject* parent); + ~XGUI_Command(); + +protected: + virtual QWidget* createWidget(QWidget* theParent); +}; + +#endif \ No newline at end of file diff --git a/src/XGUI/XGUI_Main.cpp b/src/XGUI/XGUI_Main.cpp new file mode 100644 index 000000000..c709f31b3 --- /dev/null +++ b/src/XGUI/XGUI_Main.cpp @@ -0,0 +1,19 @@ + +#include "XGUI_Workshop.h" +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + // Install translator + QTranslator aTranslator; + aTranslator.load(app.applicationDirPath() + "\\XGUI_msg_en.qm"); + app.installTranslator(&aTranslator); + + XGUI_Workshop aWorkshop; + aWorkshop.startApplication(); + + return app.exec(); +} diff --git a/src/XGUI/XGUI_MainMenu.cpp b/src/XGUI/XGUI_MainMenu.cpp new file mode 100644 index 000000000..0be7579aa --- /dev/null +++ b/src/XGUI/XGUI_MainMenu.cpp @@ -0,0 +1,55 @@ +#include "XGUI_MainMenu.h" +#include "XGUI_Workbench.h" +#include "XGUI_MainWindow.h" + +#include +#include +#include +#include + +XGUI_MainMenu::XGUI_MainMenu(XGUI_MainWindow *parent) : + QObject(parent), myDesktop(parent) +{ + parent->setTabPosition(Qt::TopDockWidgetArea, QTabWidget::North); +} + + +XGUI_MainMenu::~XGUI_MainMenu(void) +{ +} + +int XGUI_MainMenu::addWorkbench(QString theTitle) +{ + QDockWidget* aDoc = new QDockWidget(myDesktop); + aDoc->setFeatures(QDockWidget::DockWidgetVerticalTitleBar); + aDoc->setAllowedAreas(Qt::TopDockWidgetArea); + aDoc->setWindowTitle(theTitle); + aDoc->setMinimumHeight(30); + aDoc->setContentsMargins(0, 0, 0, 0); + + XGUI_Workbench* aPage = new XGUI_Workbench(aDoc); + aDoc->setWidget(aPage); + + myDesktop->addDockWidget(Qt::TopDockWidgetArea, aDoc); + if (myMenuTabs.length() > 1) { + myDesktop->tabifyDockWidget(myMenuTabs.last(), aDoc); + } + + + myMenuTabs.append(aDoc); + return myMenuTabs.length() - 1; +} + + +int XGUI_MainMenu::addGroup(int thePageId) +{ + XGUI_Workbench* aPage = dynamic_cast(myMenuTabs[thePageId]->widget()); + return aPage->addGroup(); +} + +void XGUI_MainMenu::addCommand(int thePageId, int theGroupId, XGUI_Command* theCommand) +{ + XGUI_Workbench* aPage = dynamic_cast(myMenuTabs[thePageId]->widget()); + aPage->addCommand(theGroupId, theCommand); +} + diff --git a/src/XGUI/XGUI_MainMenu.h b/src/XGUI/XGUI_MainMenu.h new file mode 100644 index 000000000..3521be3c0 --- /dev/null +++ b/src/XGUI/XGUI_MainMenu.h @@ -0,0 +1,33 @@ +#ifndef XGUI_MainMenu_H +#define XGUI_MainMenu_H + +#include +#include + +class QTabWidget; +class QLabel; +class QAction; +class XGUI_Command; +class XGUI_MainWindow; +class QDockWidget; + + +class XGUI_MainMenu : public QObject +{ + Q_OBJECT +public: + XGUI_MainMenu(XGUI_MainWindow *parent); + virtual ~XGUI_MainMenu(); + + int addWorkbench(QString theTitle); + + int addGroup(int thePageId); + + void addCommand(int thePageId, int theGroupId, XGUI_Command* theCommand); + +private: + XGUI_MainWindow* myDesktop; + QList myMenuTabs; +}; + +#endif diff --git a/src/XGUI/XGUI_MainWindow.cpp b/src/XGUI/XGUI_MainWindow.cpp new file mode 100644 index 000000000..3c4e99b49 --- /dev/null +++ b/src/XGUI/XGUI_MainWindow.cpp @@ -0,0 +1,155 @@ +#include "XGUI_MainWindow.h" +#include "XGUI_MainMenu.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +XGUI_MainWindow::XGUI_MainWindow(QWidget* parent) : + QMainWindow(parent), myObjectBrowser(0) +{ + //menuBar(); + myMenuBar = new XGUI_MainMenu(this); + + QDockWidget* aDoc = new QDockWidget(this); + aDoc->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); + aDoc->setWindowTitle(tr("OBJECT_BROWSER_TITLE")); + myObjectBrowser = new QTreeWidget(aDoc); + myObjectBrowser->setColumnCount(1); + myObjectBrowser->setHeaderHidden(true); + aDoc->setWidget(myObjectBrowser); + addDockWidget(Qt::LeftDockWidgetArea, aDoc); + aDoc->hide(); + + aDoc = new QDockWidget(this); + aDoc->setFeatures(QDockWidget::AllDockWidgetFeatures | QDockWidget::DockWidgetVerticalTitleBar); + aDoc->setMinimumHeight(20); + aDoc->setWindowTitle("Console"); + QTextEdit* aTextEdt = new QTextEdit(aDoc); + aTextEdt->setText(">>>"); + aTextEdt->setMinimumHeight(20); + aDoc->setWidget(aTextEdt); + addDockWidget(Qt::BottomDockWidgetArea, aDoc); + + QMdiArea* aMdiArea = new QMdiArea(this); + setCentralWidget(aMdiArea); + + aMdiArea->addSubWindow(getSubWindow(), Qt::FramelessWindowHint); + + fillObjectBrowser(); + +} + + +QWidget* XGUI_MainWindow::getSubWindow() +{ + QMdiSubWindow* aSub = new QMdiSubWindow(this); + QLabel* aLbl = new QLabel(aSub); + aLbl->setFrameStyle(QFrame::Sunken); + aLbl->setFrameShape(QFrame::Panel); + aLbl->setPixmap(QPixmap(":pictures/ViewPort.png")); + aLbl->setScaledContents(true); + aSub->setWidget(aLbl); + + QStringList aPictures; + aPictures<<":pictures/occ_view_camera_dump.png"<<":pictures/occ_view_style_switch.png"; + aPictures<<":pictures/occ_view_triedre.png"<<":pictures/occ_view_fitall.png"; + aPictures<<":pictures/occ_view_fitarea.png"<<":pictures/occ_view_zoom.png"; + aPictures<<":pictures/occ_view_pan.png"<<":pictures/occ_view_glpan.png"; + aPictures<<":pictures/occ_view_rotate.png"<<":pictures/occ_view_front.png"; + aPictures<<":pictures/occ_view_back.png"<<":pictures/occ_view_left.png"; + aPictures<<":pictures/occ_view_right.png"<<":pictures/occ_view_top.png"; + aPictures<<":pictures/occ_view_bottom.png"<<":pictures/occ_view_clone.png"; + + QToolBar* aBar = new QToolBar(aSub); + aBar->setGeometry(0,0,500,30); + + QAction* aBtn; + foreach(QString aName, aPictures) { + aBtn = new QAction(aBar); + aBtn->setIcon(QIcon(aName)); + aBar->addAction(aBtn); + } + + aBar = new QToolBar(aSub); + aBar->setGeometry(615,0,100,25); + QStringList aWndIcons; + aWndIcons<<":pictures/wnd_minimize.png"<<":pictures/wnd_maximize.png"<<":pictures/wnd_close.png"; + foreach(QString aName, aWndIcons) { + aBtn = new QAction(aBar); + aBtn->setIcon(QIcon(aName)); + aBar->addAction(aBtn); + } + + return aSub; +} + + +XGUI_MainWindow::~XGUI_MainWindow(void) +{ +} + +//****************************************************** +void XGUI_MainWindow::showObjectBrowser() +{ + myObjectBrowser->parentWidget()->show(); +} + +//****************************************************** +void XGUI_MainWindow::hideObjectBrowser() +{ + myObjectBrowser->parentWidget()->hide(); +} + +//****************************************************** +void XGUI_MainWindow::fillObjectBrowser() +{ + QStringList aNames; + aNames << "Parameters" << "Constructions"; + aNames << "Part 1" << "Part 2" << "Part 3"; + aNames << "Properties"; + + QStringList aIcons; + aIcons << ":pictures/params_folder.png"; + aIcons << ":pictures/constr_folder.png"; + aIcons << ":pictures/part_ico.png"; + aIcons << ":pictures/part_ico.png"; + aIcons << ":pictures/part_ico.png"; + aIcons << ":pictures/properties.png"; + + QList aItems; + foreach(QString aName, aNames) { + QTreeWidgetItem* aItem = new QTreeWidgetItem(myObjectBrowser); + aItem->setText(0, aName); + aItems.append(aItem); + } + for(int i = 0; i < aItems.length(); i++) { + aItems[i]->setIcon(0, QIcon(aIcons[i])); + } + myObjectBrowser->addTopLevelItems(aItems); + + for (int i = 2; i < 5; i++) { + QTreeWidgetItem* aItem = new QTreeWidgetItem(aItems[i]); + aItem->setText(0, "Parameters"); + aItem->setIcon(0, QIcon(":pictures/params_folder.png")); + + aItem = new QTreeWidgetItem(aItems[i]); + aItem->setText(0, "Construction"); + aItem->setIcon(0, QIcon(":pictures/constr_folder.png")); + + aItem = new QTreeWidgetItem(aItems[i]); + aItem->setText(0, "Bodies"); + aItem->setIcon(0, QIcon(":pictures/part_ico.png")); + + aItem = new QTreeWidgetItem(aItems[i]); + aItem->setText(0, "Features"); + aItem->setIcon(0, QIcon(":pictures/features.png")); + } +} diff --git a/src/XGUI/XGUI_MainWindow.h b/src/XGUI/XGUI_MainWindow.h new file mode 100644 index 000000000..dfd5703c8 --- /dev/null +++ b/src/XGUI/XGUI_MainWindow.h @@ -0,0 +1,33 @@ +#ifndef XGUI_MAINWINDOW_H +#define XGUI_MAINWINDOW_H + +#include + +class XGUI_MainMenu; +class QTreeWidget; + +class XGUI_MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + XGUI_MainWindow(QWidget* parent = 0); + virtual ~XGUI_MainWindow(); + + XGUI_MainMenu* menuObject() const { return myMenuBar; } + + QTreeWidget* objectBrowser() const { return myObjectBrowser; } + void showObjectBrowser(); + void hideObjectBrowser(); + +private: + //!! For test purposes only + QWidget* getSubWindow(); + void fillObjectBrowser(); + + + XGUI_MainMenu* myMenuBar; + QTreeWidget* myObjectBrowser; +}; + +#endif \ No newline at end of file diff --git a/src/XGUI/XGUI_MenuGroupPanel.cpp b/src/XGUI/XGUI_MenuGroupPanel.cpp new file mode 100644 index 000000000..b88960f7b --- /dev/null +++ b/src/XGUI/XGUI_MenuGroupPanel.cpp @@ -0,0 +1,61 @@ +#include "XGUI_MenuGroupPanel.h" +#include "XGUI_Command.h" + +#include +#include +#include +#include + +#include + +XGUI_MenuGroupPanel::XGUI_MenuGroupPanel(QWidget *parent) : + QWidget(parent), myNewRow(0), myNewCol(0), myMaxRow(1) +{ + myLayout = new QGridLayout(this); + myLayout->setSpacing(0); + myLayout->setMargin(0); + myLayout->setContentsMargins(0,0,0,0); +} + + +void XGUI_MenuGroupPanel::addCommand(XGUI_Command* theAction) +{ + addWidget(theAction->requestWidget(this)); +} + +void XGUI_MenuGroupPanel::placeWidget(QWidget* theWgt) +{ + if (myMaxRow == myNewRow) { + myNewRow = 0; + myNewCol++; + } + myLayout->addWidget(theWgt, myNewRow, myNewCol, Qt::AlignLeft); + myNewRow++; +} + +void XGUI_MenuGroupPanel::addWidget(QWidget* theWgt) +{ + placeWidget(theWgt); + myWidgets.append(theWgt); +} + + +void XGUI_MenuGroupPanel::resizeEvent(QResizeEvent* theEvent) +{ + QWidget::resizeEvent(theEvent); + if (myWidgets.size() == 0) + return; + + int aH = theEvent->size().height(); + int aMaxRow = (int) floor(double(aH / MIN_BUTTON_HEIGHT)); + if (aMaxRow == myMaxRow) + return; + + myMaxRow = aMaxRow; + QListIterator aIt(myWidgets); + myNewRow = 0; + myNewCol = 0; + while (aIt.hasNext()) { + placeWidget(aIt.next()); + } +} diff --git a/src/XGUI/XGUI_MenuGroupPanel.h b/src/XGUI/XGUI_MenuGroupPanel.h new file mode 100644 index 000000000..7fe95cff5 --- /dev/null +++ b/src/XGUI/XGUI_MenuGroupPanel.h @@ -0,0 +1,33 @@ + +#ifndef XGUI_MenuGroupPanel_H +#define XGUI_MenuGroupPanel_H + +#include +#include + +class QGridLayout; +class XGUI_Command; + +class XGUI_MenuGroupPanel : public QWidget +{ + Q_OBJECT +public: + explicit XGUI_MenuGroupPanel(QWidget *parent = 0); + + void addCommand(XGUI_Command* theAction); + +protected: + virtual void resizeEvent(QResizeEvent *theEvent); + +private: + void addWidget(QWidget* theWgt); + void placeWidget(QWidget* theWgt); + + QList myWidgets; + QGridLayout* myLayout; + int myNewRow; + int myNewCol; + int myMaxRow; +}; + +#endif \ No newline at end of file diff --git a/src/XGUI/XGUI_Module.h b/src/XGUI/XGUI_Module.h new file mode 100644 index 000000000..bac802a69 --- /dev/null +++ b/src/XGUI/XGUI_Module.h @@ -0,0 +1,24 @@ + +#ifndef XGUI_Module_H +#define XGUI_Module_H + +#include + +class XGUI_Module +{ +public: + //! Returns a string in XML format with definition of the module commands + virtual QString moduleDescription() const = 0; +}; + + +//! This function must return a new module instance. +extern "C" +{ + typedef XGUI_Module* (*CREATE_FUNC)(); +} + +#define CREATE_MODULE "createModule" + + +#endif \ No newline at end of file diff --git a/src/XGUI/XGUI_Tools.cpp b/src/XGUI/XGUI_Tools.cpp new file mode 100644 index 000000000..ef83b089c --- /dev/null +++ b/src/XGUI/XGUI_Tools.cpp @@ -0,0 +1,77 @@ + +#include "XGUI_Tools.h" + +#include + + +//****************************************************************** +QString library( const QString& str ) +{ + QString path = dir( str, false ); + QString name = file( str, false ); + QString ext = extension( str ); + +#ifndef WIN32 + if ( !name.startsWith( "lib" ) ) + name = QString( "lib" ) + name; +#endif + +#ifdef WIN32 + QString libExt( "dll" ); +#else + QString libExt( "so" ); +#endif + + if ( ext.toLower() != QString( "so" ) && ext.toLower() != QString( "dll" ) ) + { + if ( !name.isEmpty() && !ext.isEmpty() ) + name += QString( "." ); + name += ext; + } + + ext = libExt; + + QString fileName = addSlash( path ) + name + QString( "." ) + ext; + + return fileName; +} + +//****************************************************************** +QString dir( const QString& path, bool isAbs ) +{ + QDir aDir = QFileInfo( path ).dir(); + QString dirPath = isAbs ? aDir.absolutePath() : aDir.path(); + if ( dirPath == QString( "." ) ) + dirPath = QString(); + return dirPath; +} + + +//****************************************************************** +QString file( const QString& path, bool withExt ) +{ + QString fPath = path; + while ( !fPath.isEmpty() && ( fPath[fPath.length() - 1] =='\\' || fPath[fPath.length() - 1] == '/' ) ) + fPath.remove( fPath.length() - 1, 1 ); + + if ( withExt ) + return QFileInfo( fPath ).fileName(); + else + return QFileInfo( fPath ).completeBaseName(); +} + +//****************************************************************** +QString extension( const QString& path, bool full ) +{ + return full ? QFileInfo( path ).completeSuffix() : QFileInfo( path ).suffix(); +} + +//****************************************************************** +QString addSlash( const QString& path ) +{ + QString res = path; + if ( !res.isEmpty() && res.at( res.length() - 1 ) != QChar( '/' ) && + res.at( res.length() - 1 ) != QChar( '\\' ) ) + res += QDir::separator(); + return res; +} diff --git a/src/XGUI/XGUI_Tools.h b/src/XGUI/XGUI_Tools.h new file mode 100644 index 000000000..0fe6b2f5a --- /dev/null +++ b/src/XGUI/XGUI_Tools.h @@ -0,0 +1,63 @@ + +#ifndef XGUI_Tools_H +#define XGUI_Tools_H + +#include + +/*! + \brief Convert the given parameter to the platform-specific library name. + + The function appends platform-specific prefix (lib) and suffix (.dll/.so) + to the library file name. + For example, if \a str = "mylib", "libmylib.so" is returned for Linux and + mylib.dll for Windows. + + \param str short library name + \return full library name +*/ +QString library( const QString& str ); + +/*! + \brief Return directory part of the file path. + + If the file path does not include directory part (the file is in the + current directory), null string is returned. + + \param path file path + \param abs if true (default) \a path parameter is treated as absolute file path + \return directory part of the file path +*/ +QString dir( const QString& path, bool isAbs = true); + + +/*! + \brief Return file name part of the file path. + + \param path file path + \param withExt if true (default) complete file name (with all + extension except the last) is returned, otherwise only base name + is returned + \return file name part of the file path +*/ +QString file( const QString& path, bool withExt = true ); + +/*! + \brief Return extension part of the file path. + + \param path file path + \param full if true complete extension (all extensions, dot separated) + is returned, otherwise (default) only last extension is returned + \return extension part of the file path +*/ +QString extension( const QString& path, bool full = false ); + + +/*! + \brief Add a slash (platform-specific) to the end of \a path + if it is not already there. + \param path directory path + \return modified path (with slash added to the end) +*/ +QString addSlash( const QString& path ); + +#endif \ No newline at end of file diff --git a/src/XGUI/XGUI_Workbench.cpp b/src/XGUI/XGUI_Workbench.cpp new file mode 100644 index 000000000..9a539f184 --- /dev/null +++ b/src/XGUI/XGUI_Workbench.cpp @@ -0,0 +1,157 @@ +#include "XGUI_Workbench.h" +#include "XGUI_MenuGroupPanel.h" + +#include +#include +#include + + +#define SCROLL_STEP 20 + +//************************************************** +class CommandsArea : public QScrollArea +{ +public: + CommandsArea(QWidget* theParent) : QScrollArea(theParent) {} + +protected: + virtual void resizeEvent(QResizeEvent * theEvent); +}; + +void CommandsArea::resizeEvent(QResizeEvent* theEvent) +{ + QScrollArea::resizeEvent(theEvent); + QRect aRect = widget()->childrenRect(); + QSize aNewSize = theEvent->size(); + if (aRect.width() > aNewSize.width()) + aNewSize.setWidth(aRect.width() * 2); + widget()->resize(aNewSize); +} + + +//************************************************** +XGUI_Workbench::XGUI_Workbench(QWidget *theParent) : + QWidget(theParent) +{ + setMinimumHeight(30); + QHBoxLayout* aMainLayout = new QHBoxLayout(this); + aMainLayout->setSpacing(0); + aMainLayout->setMargin(0); + aMainLayout->setContentsMargins(0,0,0,0); + + myLeftButton = new QPushButton("<", this); + myLeftButton->setMaximumWidth(14); + //myLeftButton->setEnabled(false); + myLeftButton->setVisible(false); + connect(myLeftButton,SIGNAL(clicked()), this, SLOT(onLeftScroll())); + aMainLayout->addWidget(myLeftButton); + + myCommandsArea = new CommandsArea(this); + aMainLayout->addWidget(myCommandsArea); + + myChildWidget = new QWidget(myCommandsArea); + myCommandsArea->setWidget(myChildWidget); + myCommandsArea->setAlignment(Qt::AlignLeft | Qt::AlignTop); + myCommandsArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + myCommandsArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + + myLayout = new QHBoxLayout(myChildWidget); + myLayout->setSpacing(0); + myLayout->setMargin(0); + myLayout->setContentsMargins(0,0,0,0); + + myRightButton = new QPushButton(">", this); + myRightButton->setMaximumWidth(14); + //myRightButton->setEnabled(false); + myRightButton->setVisible(false); + connect(myRightButton,SIGNAL(clicked()), this, SLOT(onRightScroll())); + aMainLayout->addWidget(myRightButton); + +} + +int XGUI_Workbench::addGroup() +{ + if (!myLayout->isEmpty()) { + int aNb = myLayout->count(); + QLayoutItem* aItem = myLayout->itemAt(aNb - 1); + myLayout->removeItem(aItem); + } + XGUI_MenuGroupPanel* aGroup = new XGUI_MenuGroupPanel(myChildWidget); + myLayout->addWidget(aGroup); + addSeparator(); + myLayout->addStretch(); + myGroups.append(aGroup); + return myGroups.size() - 1; +} + +void XGUI_Workbench::addSeparator() +{ + QFrame* aLine = new QFrame(myChildWidget); + aLine->setFrameShape(QFrame::VLine); + aLine->setFrameShadow(QFrame::Sunken); + myLayout->addWidget(aLine); +} + +void XGUI_Workbench::addCommand(int theGroupId, XGUI_Command* theCommand) +{ + XGUI_MenuGroupPanel* aGroup = myGroups.at(theGroupId); + aGroup->addCommand(theCommand); +} + + +void XGUI_Workbench::resizeEvent(QResizeEvent* theEvent) +{ + QWidget::resizeEvent(theEvent); + QSize aSize = theEvent->size(); + myLeftButton->setMinimumHeight(aSize.height() - 2); + myRightButton->setMinimumHeight(aSize.height() - 2); + + QSize aS = myChildWidget->sizeHint(); + int aW = myChildWidget->width(); + if (aW < aS.width()) + myChildWidget->resize(aS.width(), myChildWidget->height()); + + //myLeftButton->setEnabled(isExceedsLeft()); + //myRightButton->setEnabled(isExceedsRight()); + myLeftButton->setVisible(isExceedsLeft()); + myRightButton->setVisible(isExceedsRight()); +} + + +void XGUI_Workbench::onLeftScroll() +{ + if (!isExceedsLeft()) + return; + myChildWidget->move( myChildWidget->pos().x() + SCROLL_STEP, 0 ); + myLeftButton->setVisible(isExceedsLeft()); + myRightButton->setVisible(isExceedsRight()); + //myLeftButton->setEnabled(isExceedsLeft()); + //myRightButton->setEnabled(isExceedsRight()); +} + + +void XGUI_Workbench::onRightScroll() +{ + if (!isExceedsRight()) + return; + myChildWidget->move( myChildWidget->pos().x() - SCROLL_STEP, 0 ); + //myLeftButton->setEnabled(isExceedsLeft()); + //myRightButton->setEnabled(isExceedsRight()); + myLeftButton->setVisible(isExceedsLeft()); + myRightButton->setVisible(isExceedsRight()); +} + + +bool XGUI_Workbench::isExceedsLeft() +{ + QPoint aPos = myChildWidget->pos(); + return (aPos.x() < 0); +} + +bool XGUI_Workbench::isExceedsRight() +{ + QPoint aPos = myChildWidget->pos(); + int aVPWidth = myCommandsArea->viewport()->rect().width(); + int aWgtWidth = myChildWidget->childrenRect().width(); + return ((aVPWidth - aPos.x()) < aWgtWidth); +} diff --git a/src/XGUI/XGUI_Workbench.h b/src/XGUI/XGUI_Workbench.h new file mode 100644 index 000000000..d7916351a --- /dev/null +++ b/src/XGUI/XGUI_Workbench.h @@ -0,0 +1,48 @@ + +#ifndef XGUI_Workbench_H +#define XGUI_Workbench_H + +#include +#include +#include + +class QHBoxLayout; +class XGUI_MenuGroupPanel; +class QPushButton; +class CommandsArea; +class XGUI_Command; + + +class XGUI_Workbench : public QWidget +{ + Q_OBJECT +public: + XGUI_Workbench(QWidget* theParent); + + int addGroup(); + + void addCommand(int theGroupId, XGUI_Command* theCommand); + +private slots: + void onLeftScroll(); + void onRightScroll(); + +protected: + virtual void resizeEvent(QResizeEvent * theEvent); + +private: + void addSeparator(); + bool isExceedsLeft(); + bool isExceedsRight(); + + + QWidget* myChildWidget; + QHBoxLayout* myLayout; + QList myGroups; + + CommandsArea* myCommandsArea; + QPushButton* myRightButton; + QPushButton* myLeftButton; +}; + +#endif; \ No newline at end of file diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp new file mode 100644 index 000000000..2644722fe --- /dev/null +++ b/src/XGUI/XGUI_Workshop.cpp @@ -0,0 +1,255 @@ +#include "XGUI_Workshop.h" +#include "XGUI_MainWindow.h" +#include "XGUI_MainMenu.h" +#include "XGUI_Command.h" +#include "XGUI_Tools.h" +#include "XGUI_Module.h" + +#include +#include +#include + +#ifdef WIN32 +#include +#else +#include +#endif + + +XGUI_Workshop::XGUI_Workshop() : + QObject() +{ + myMainWindow = new XGUI_MainWindow(); + + // Set Logo + //XGUI_MainMenu* aMenuBar = myMainWindow->menuBar(); + //aMenuBar->setLogo(QPixmap(":pictures/OCCLogo.png")); +} + +//****************************************************** +XGUI_Workshop::~XGUI_Workshop(void) +{ +} + +//****************************************************** +void XGUI_Workshop::startApplication() +{ + initMenu(); + //loadModules(); + myMainWindow->show(); +} + +//****************************************************** +void XGUI_Workshop::initMenu() +{ + int aPageId = addWorkbench(tr("HOME_MENU_TITLE")); + + // File commands group + int aGroupId = addPageGroup(aPageId); + + XGUI_Command* aCommand; + + aCommand = createMenuCommand(aPageId, aGroupId, NEW_CMD, tr("NEW_MENU"), tr("NEW_MENU_TIP"), + QIcon(":pictures/new.png"), QKeySequence::New); + connect(aCommand, SIGNAL(triggered()), this, SLOT(onNew())); + + aCommand = createMenuCommand(aPageId, aGroupId, OPEN_CMD, tr("OPEN_MENU"), tr("OPEN_MENU_TIP"), + QIcon(":pictures/open.png"), QKeySequence::Open); + connect(aCommand, SIGNAL(triggered()), this, SLOT(onOpen())); + + aCommand = createMenuCommand(aPageId, aGroupId, SAVE_CMD, tr("SAVE_MENU"), tr("SAVE_MENU_TIP"), + QIcon(":pictures/save.png"), QKeySequence::Save); + connect(aCommand, SIGNAL(triggered()), this, SLOT(onSave())); + aCommand->setEnabled(false); + + aCommand = createMenuCommand(aPageId, aGroupId, SAVEAS_CMD, tr("SAVEAS_MENU"), tr("SAVEAS_MENU_TIP"), + QIcon(":pictures/save.png")); + connect(aCommand, SIGNAL(triggered()), this, SLOT(onSaveAs())); + aCommand->setEnabled(false); + + aCommand = createMenuCommand(aPageId, aGroupId, EXIT_CMD, tr("EXIT_MENU"), tr("EXIT_MENU_TIP"), + QIcon(":pictures/close.png"), QKeySequence::Close); + connect(aCommand, SIGNAL(triggered()), this, SLOT(onExit())); + + + // Edit commands group + aGroupId = addPageGroup(aPageId); + + aCommand = createMenuCommand(aPageId, aGroupId, UNDO_CMD, tr("UNDO_MENU"), tr("UNDO_MENU_TIP"), + QIcon(":pictures/undo.png"), QKeySequence::Undo); + + aCommand = createMenuCommand(aPageId, aGroupId, REDO_CMD, tr("REDO_MENU"), tr("REDO_MENU_TIP"), + QIcon(":pictures/redo.png"), QKeySequence::Redo); + + aCommand = createMenuCommand(aPageId, aGroupId, CUT_CMD, tr("CUT_MENU"), tr("CUT_MENU_TIP"), + QIcon(":pictures/cut.png"), QKeySequence::Cut); + + aCommand = createMenuCommand(aPageId, aGroupId, COPY_CMD, tr("COPY_MENU"), tr("COPY_MENU_TIP"), + QIcon(":pictures/copy.png"), QKeySequence::Copy); + + aCommand = createMenuCommand(aPageId, aGroupId, PASTE_CMD, tr("PASTE_MENU"), tr("PASTE_MENU_TIP"), + QIcon(":pictures/paste.png"), QKeySequence::Paste); + + // Tests + aPageId = addWorkbench("Primitives"); + aGroupId = addPageGroup(aPageId); + + aCommand = createMenuCommand(aPageId, aGroupId, LAST_CMD, "Box", "Create Box", QIcon(":pictures/box.png")); + aCommand = createMenuCommand(aPageId, aGroupId, LAST_CMD, "Cylinder", "Create Cylinder", QIcon(":pictures/cylinder.png")); + aCommand = createMenuCommand(aPageId, aGroupId, LAST_CMD, "Disk", "Create Disk", QIcon(":pictures/disk.png")); + aCommand = createMenuCommand(aPageId, aGroupId, LAST_CMD, "Torus", "Create Torus", QIcon(":pictures/torus.png")); + + aPageId = addWorkbench("Operations"); + +} + +//****************************************************** +XGUI_Command* XGUI_Workshop::createMenuCommand(int thePageId, int theGroupId, XCommandId theCmdId, + const QString& theTitle, const QString& theTip, + const QIcon& theIcon, const QKeySequence& theKeys) +{ + XGUI_Command* aCommand = new XGUI_Command(theIcon, theTitle, this); + aCommand->setToolTip(theTip); + if (!theKeys.isEmpty()) + aCommand->setShortcut(theKeys); + addCommand(theCmdId, thePageId, theGroupId, aCommand); + return aCommand; +} + +//****************************************************** +int XGUI_Workshop::addWorkbench(const QString& theName) +{ + XGUI_MainMenu* aMenuBar = myMainWindow->menuObject(); + return aMenuBar->addWorkbench(theName); +} + +//****************************************************** +int XGUI_Workshop::addPageGroup(int thePageId) +{ + XGUI_MainMenu* aMenuBar = myMainWindow->menuObject(); + return aMenuBar->addGroup(thePageId); +} + +//****************************************************** +void XGUI_Workshop::addCommand(XCommandId theCommandId, int thePageId, int theGroupId, XGUI_Command* theCommand) +{ + XGUI_MainMenu* aMenuBar = myMainWindow->menuObject(); + aMenuBar->addCommand(thePageId, theGroupId, theCommand); + myCommands[theCommandId] = theCommand; +} + +//****************************************************** +XGUI_Command* XGUI_Workshop::command(XCommandId theId) const +{ + if (myCommands.contains(theId)) + return myCommands[theId]; + return 0; +} + +//****************************************************** +void XGUI_Workshop::onExit() +{ + qApp->exit(); +} + +//****************************************************** +void XGUI_Workshop::onNew() +{ + myMainWindow->showObjectBrowser(); +} + +//****************************************************** +void XGUI_Workshop::onOpen() +{ + QString aFileName = QFileDialog::getOpenFileName(mainWindow()); +} + +//****************************************************** +void XGUI_Workshop::onSave() +{ +} + +//****************************************************** +void XGUI_Workshop::onSaveAs() +{ + QString aFileName = QFileDialog::getSaveFileName(mainWindow()); +} + +//****************************************************** +XGUI_Module* XGUI_Workshop::loadModule(const QString& theModule) +{ + QString libName = library( theModule ); + if ( libName.isEmpty() ) + { + qWarning( qPrintable( tr( "Information about module \"%1\" doesn't exist." ).arg( theModule ) ) ); + return 0; + } + + QString err; + CREATE_FUNC crtInst = 0; + +#ifdef WIN32 + HINSTANCE modLib = ::LoadLibrary( (LPTSTR) libName.utf16() ); + if ( !modLib ) + { + LPVOID lpMsgBuf; + ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, 0, ::GetLastError(), 0, (LPTSTR)&lpMsgBuf, 0, 0 ); + QString aMsg((char*)&lpMsgBuf); + err = QString( "Failed to load %1. %2" ).arg( libName ).arg( aMsg ); + ::LocalFree( lpMsgBuf ); + } + else + { + crtInst = (CREATE_FUNC)::GetProcAddress( modLib, CREATE_MODULE ); + if ( !crtInst ) + { + LPVOID lpMsgBuf; + ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, 0, ::GetLastError(), 0, (LPTSTR)&lpMsgBuf, 0, 0 ); + QString aMsg((char*)&lpMsgBuf); + err = QString( "Failed to find %1 function. %2" ).arg( CREATE_MODULE ).arg(aMsg ); + ::LocalFree( lpMsgBuf ); + } + } +#else + void* modLib = dlopen( libName.toLatin1(), RTLD_LAZY ); + if ( !modLib ) + err = QString( "Can not load library %1. %2" ).arg( libName ).arg( dlerror() ); + else + { + crtInst = (CREATE_FUNC)dlsym( modLib, GET_MODULE_NAME ); + if ( !crtInst ) + err = QString( "Failed to find function %1. %2" ).arg( CREATE_MODULE ).arg( dlerror() ); + } +#endif + + XGUI_Module* aModule = crtInst ? crtInst() : 0; + + if ( !err.isEmpty() ) { + if ( mainWindow() && mainWindow()->isVisible() ) + QMessageBox::warning( mainWindow(), tr( "Error" ), err ); + else + qWarning( qPrintable( err ) ); + } + return aModule; +} + +//****************************************************** +void XGUI_Workshop::loadModules() +{ + // Test of modules loading + QStringList aModules; + aModules << "GeomModule"; + + foreach(QString aName, aModules) { + XGUI_Module* aModule = loadModule(aName); + buildModuleMenu(aModule->moduleDescription()); + } +} + +//****************************************************** +void XGUI_Workshop::buildModuleMenu(const QString& theXML) +{ + +} diff --git a/src/XGUI/XGUI_Workshop.h b/src/XGUI/XGUI_Workshop.h new file mode 100644 index 000000000..9b7980196 --- /dev/null +++ b/src/XGUI/XGUI_Workshop.h @@ -0,0 +1,68 @@ + +#ifndef XGUI_WORKSHOP_H +#define XGUI_WORKSHOP_H + +#include +#include +#include +#include + +class XGUI_MainWindow; +class XGUI_Command; +class XGUI_Module; + +class XGUI_Workshop: public QObject +{ + Q_OBJECT +public: + enum XCommandId { + NEW_CMD, + OPEN_CMD, + SAVE_CMD, + SAVEAS_CMD, + EXIT_CMD, + UNDO_CMD, + REDO_CMD, + COPY_CMD, + CUT_CMD, + PASTE_CMD, + LAST_CMD + }; + + XGUI_Workshop(); + virtual ~XGUI_Workshop(); + + void startApplication(); + + XGUI_Command* command(XCommandId theId) const; + + XGUI_MainWindow* mainWindow() const { return myMainWindow; } + +public slots: + void onNew(); + void onOpen(); + void onSave(); + void onSaveAs(); + void onExit(); + +private: + void initMenu(); + + XGUI_Module* loadModule(const QString& theModule); + void loadModules(); + + void buildModuleMenu(const QString& theXML); + + int addWorkbench(const QString& theName); + int addPageGroup(int thePageId); + void addCommand(XCommandId theCommandId, int thePageId, int theGroupId, XGUI_Command* theCommand); + XGUI_Command* createMenuCommand(int thePageId, int theGroupId, XCommandId theCmdId, + const QString& theTitle, const QString& theTip, + const QIcon& theIcon = QIcon(), const QKeySequence& theKeys = QKeySequence()); + + QMap myCommands; + + XGUI_MainWindow* myMainWindow; +}; + +#endif \ No newline at end of file diff --git a/src/XGUI/XGUI_msg_en.ts b/src/XGUI/XGUI_msg_en.ts new file mode 100644 index 000000000..94a8cc9a9 --- /dev/null +++ b/src/XGUI/XGUI_msg_en.ts @@ -0,0 +1,108 @@ + + + + + @default + + + XGUI_Workshop + + HOME_MENU_TITLE + Home + + + NEW_MENU + New + + + NEW_MENU_TIP + Create new document + + + OPEN_MENU + Open... + + + OPEN_MENU_TIP + Open document + + + SAVE_MENU + Save + + + SAVE_MENU_TIP + Save document + + + SAVEAS_MENU + Save As... + + + SAVEAS_MENU_TIP + Save document in another file + + + EXIT_MENU + Exit + + + EXIT_MENU_TIP + Exit from application + + + UNDO_MENU + Undo + + + UNDO_MENU_TIP + Undo last command + + + REDO_MENU + Redo + + + REDO_MENU_TIP + Redo last command + + + CUT_MENU + Cut + + + CUT_MENU_TIP + Cut selected object + + + COPY_MENU + Copy + + + COPY_MENU_TIP + Copy selected object + + + PASTE_MENU + Paste + + + PASTE_MENU_TIP + Paste copied object + + + + XGUI_MainWindow + + OBJECT_BROWSER_TITLE + Object Browser + + + + XGUI_MainMenu + + MENU_TITLE + Menu + + + diff --git a/src/XGUI/XGUI_pictures.qrc b/src/XGUI/XGUI_pictures.qrc new file mode 100644 index 000000000..f882c6cf9 --- /dev/null +++ b/src/XGUI/XGUI_pictures.qrc @@ -0,0 +1,64 @@ + + + pictures/new.png + pictures/open.png + pictures/save.png + pictures/close.png + pictures/copy.png + pictures/cut.png + pictures/paste.png + pictures/redo.png + pictures/undo.png + + pictures/box.png + pictures/cylinder.png + pictures/disk.png + pictures/torus.png + pictures/ViewPort.png + + pictures/occ_view_ambient.png + pictures/occ_view_anticlockwise.png + pictures/occ_view_back.png + pictures/occ_view_bottom.png + pictures/occ_view_camera_dump.png + pictures/occ_view_clipping.png + pictures/occ_view_clipping_pressed.png + pictures/occ_view_clockwise.png + pictures/occ_view_clone.png + pictures/occ_view_fitall.png + pictures/occ_view_fitarea.png + pictures/occ_view_front.png + pictures/occ_view_glpan.png + pictures/occ_view_graduated_axes.png + pictures/occ_view_left.png + pictures/occ_view_maximized.png + pictures/occ_view_minimized.png + pictures/occ_view_pan.png + pictures/occ_view_preselection.png + pictures/occ_view_presets.png + pictures/occ_view_reset.png + pictures/occ_view_return_3d_view.png + pictures/occ_view_right.png + pictures/occ_view_rotate.png + pictures/occ_view_rotation_point.png + pictures/occ_view_scaling.png + pictures/occ_view_selection.png + pictures/occ_view_shoot.png + pictures/occ_view_style_switch.png + pictures/occ_view_top.png + pictures/occ_view_triedre.png + pictures/occ_view_zoom.png + pictures/occ_view_zooming_style_switch.png + + pictures/wnd_close.png + pictures/wnd_minimize.png + pictures/wnd_maximize.png + + pictures/params_folder.png + pictures/constr_folder.png + pictures/part_ico.png + pictures/properties.png + pictures/features.png + + + diff --git a/src/XGUI/pictures/ViewPort.png b/src/XGUI/pictures/ViewPort.png new file mode 100644 index 000000000..b8273017d Binary files /dev/null and b/src/XGUI/pictures/ViewPort.png differ diff --git a/src/XGUI/pictures/box.png b/src/XGUI/pictures/box.png new file mode 100644 index 000000000..3047d9212 Binary files /dev/null and b/src/XGUI/pictures/box.png differ diff --git a/src/XGUI/pictures/close.png b/src/XGUI/pictures/close.png new file mode 100644 index 000000000..3868c161d Binary files /dev/null and b/src/XGUI/pictures/close.png differ diff --git a/src/XGUI/pictures/constr_folder.png b/src/XGUI/pictures/constr_folder.png new file mode 100644 index 000000000..f82b60a9e Binary files /dev/null and b/src/XGUI/pictures/constr_folder.png differ diff --git a/src/XGUI/pictures/copy.png b/src/XGUI/pictures/copy.png new file mode 100644 index 000000000..0c90599da Binary files /dev/null and b/src/XGUI/pictures/copy.png differ diff --git a/src/XGUI/pictures/cut.png b/src/XGUI/pictures/cut.png new file mode 100644 index 000000000..5f022d096 Binary files /dev/null and b/src/XGUI/pictures/cut.png differ diff --git a/src/XGUI/pictures/cylinder.png b/src/XGUI/pictures/cylinder.png new file mode 100644 index 000000000..a00136dab Binary files /dev/null and b/src/XGUI/pictures/cylinder.png differ diff --git a/src/XGUI/pictures/disk.png b/src/XGUI/pictures/disk.png new file mode 100644 index 000000000..8aad056b9 Binary files /dev/null and b/src/XGUI/pictures/disk.png differ diff --git a/src/XGUI/pictures/features.png b/src/XGUI/pictures/features.png new file mode 100644 index 000000000..eed2b5f2e Binary files /dev/null and b/src/XGUI/pictures/features.png differ diff --git a/src/XGUI/pictures/new.png b/src/XGUI/pictures/new.png new file mode 100644 index 000000000..2321ace5b Binary files /dev/null and b/src/XGUI/pictures/new.png differ diff --git a/src/XGUI/pictures/occ_view_ambient.png b/src/XGUI/pictures/occ_view_ambient.png new file mode 100644 index 000000000..7f4115317 Binary files /dev/null and b/src/XGUI/pictures/occ_view_ambient.png differ diff --git a/src/XGUI/pictures/occ_view_anticlockwise.png b/src/XGUI/pictures/occ_view_anticlockwise.png new file mode 100644 index 000000000..991586fe6 Binary files /dev/null and b/src/XGUI/pictures/occ_view_anticlockwise.png differ diff --git a/src/XGUI/pictures/occ_view_back.png b/src/XGUI/pictures/occ_view_back.png new file mode 100644 index 000000000..51beb0c73 Binary files /dev/null and b/src/XGUI/pictures/occ_view_back.png differ diff --git a/src/XGUI/pictures/occ_view_bottom.png b/src/XGUI/pictures/occ_view_bottom.png new file mode 100644 index 000000000..fa558e20e Binary files /dev/null and b/src/XGUI/pictures/occ_view_bottom.png differ diff --git a/src/XGUI/pictures/occ_view_camera_dump.png b/src/XGUI/pictures/occ_view_camera_dump.png new file mode 100644 index 000000000..b02616f29 Binary files /dev/null and b/src/XGUI/pictures/occ_view_camera_dump.png differ diff --git a/src/XGUI/pictures/occ_view_clipping.png b/src/XGUI/pictures/occ_view_clipping.png new file mode 100644 index 000000000..0356a9a31 Binary files /dev/null and b/src/XGUI/pictures/occ_view_clipping.png differ diff --git a/src/XGUI/pictures/occ_view_clipping_pressed.png b/src/XGUI/pictures/occ_view_clipping_pressed.png new file mode 100644 index 000000000..e38a8aa7e Binary files /dev/null and b/src/XGUI/pictures/occ_view_clipping_pressed.png differ diff --git a/src/XGUI/pictures/occ_view_clockwise.png b/src/XGUI/pictures/occ_view_clockwise.png new file mode 100644 index 000000000..b25471e76 Binary files /dev/null and b/src/XGUI/pictures/occ_view_clockwise.png differ diff --git a/src/XGUI/pictures/occ_view_clone.png b/src/XGUI/pictures/occ_view_clone.png new file mode 100644 index 000000000..441482d20 Binary files /dev/null and b/src/XGUI/pictures/occ_view_clone.png differ diff --git a/src/XGUI/pictures/occ_view_fitall.png b/src/XGUI/pictures/occ_view_fitall.png new file mode 100644 index 000000000..87e001dd8 Binary files /dev/null and b/src/XGUI/pictures/occ_view_fitall.png differ diff --git a/src/XGUI/pictures/occ_view_fitarea.png b/src/XGUI/pictures/occ_view_fitarea.png new file mode 100644 index 000000000..450dc56c6 Binary files /dev/null and b/src/XGUI/pictures/occ_view_fitarea.png differ diff --git a/src/XGUI/pictures/occ_view_front.png b/src/XGUI/pictures/occ_view_front.png new file mode 100644 index 000000000..d91796086 Binary files /dev/null and b/src/XGUI/pictures/occ_view_front.png differ diff --git a/src/XGUI/pictures/occ_view_glpan.png b/src/XGUI/pictures/occ_view_glpan.png new file mode 100644 index 000000000..28ab547ea Binary files /dev/null and b/src/XGUI/pictures/occ_view_glpan.png differ diff --git a/src/XGUI/pictures/occ_view_graduated_axes.png b/src/XGUI/pictures/occ_view_graduated_axes.png new file mode 100644 index 000000000..2b44c06fe Binary files /dev/null and b/src/XGUI/pictures/occ_view_graduated_axes.png differ diff --git a/src/XGUI/pictures/occ_view_left.png b/src/XGUI/pictures/occ_view_left.png new file mode 100644 index 000000000..1b787b043 Binary files /dev/null and b/src/XGUI/pictures/occ_view_left.png differ diff --git a/src/XGUI/pictures/occ_view_maximized.png b/src/XGUI/pictures/occ_view_maximized.png new file mode 100644 index 000000000..8e19d6a23 Binary files /dev/null and b/src/XGUI/pictures/occ_view_maximized.png differ diff --git a/src/XGUI/pictures/occ_view_minimized.png b/src/XGUI/pictures/occ_view_minimized.png new file mode 100644 index 000000000..b38bbeb90 Binary files /dev/null and b/src/XGUI/pictures/occ_view_minimized.png differ diff --git a/src/XGUI/pictures/occ_view_pan.png b/src/XGUI/pictures/occ_view_pan.png new file mode 100644 index 000000000..ec56cacc7 Binary files /dev/null and b/src/XGUI/pictures/occ_view_pan.png differ diff --git a/src/XGUI/pictures/occ_view_preselection.png b/src/XGUI/pictures/occ_view_preselection.png new file mode 100644 index 000000000..cd5baec98 Binary files /dev/null and b/src/XGUI/pictures/occ_view_preselection.png differ diff --git a/src/XGUI/pictures/occ_view_presets.png b/src/XGUI/pictures/occ_view_presets.png new file mode 100644 index 000000000..b436f946d Binary files /dev/null and b/src/XGUI/pictures/occ_view_presets.png differ diff --git a/src/XGUI/pictures/occ_view_reset.png b/src/XGUI/pictures/occ_view_reset.png new file mode 100644 index 000000000..66f81e604 Binary files /dev/null and b/src/XGUI/pictures/occ_view_reset.png differ diff --git a/src/XGUI/pictures/occ_view_return_3d_view.png b/src/XGUI/pictures/occ_view_return_3d_view.png new file mode 100644 index 000000000..01de30bc6 Binary files /dev/null and b/src/XGUI/pictures/occ_view_return_3d_view.png differ diff --git a/src/XGUI/pictures/occ_view_right.png b/src/XGUI/pictures/occ_view_right.png new file mode 100644 index 000000000..5c6e161a0 Binary files /dev/null and b/src/XGUI/pictures/occ_view_right.png differ diff --git a/src/XGUI/pictures/occ_view_rotate.png b/src/XGUI/pictures/occ_view_rotate.png new file mode 100644 index 000000000..28ec89f03 Binary files /dev/null and b/src/XGUI/pictures/occ_view_rotate.png differ diff --git a/src/XGUI/pictures/occ_view_rotation_point.png b/src/XGUI/pictures/occ_view_rotation_point.png new file mode 100644 index 000000000..fc303e3ea Binary files /dev/null and b/src/XGUI/pictures/occ_view_rotation_point.png differ diff --git a/src/XGUI/pictures/occ_view_scaling.png b/src/XGUI/pictures/occ_view_scaling.png new file mode 100644 index 000000000..fa8cbbc71 Binary files /dev/null and b/src/XGUI/pictures/occ_view_scaling.png differ diff --git a/src/XGUI/pictures/occ_view_selection.png b/src/XGUI/pictures/occ_view_selection.png new file mode 100644 index 000000000..21d18e901 Binary files /dev/null and b/src/XGUI/pictures/occ_view_selection.png differ diff --git a/src/XGUI/pictures/occ_view_shoot.png b/src/XGUI/pictures/occ_view_shoot.png new file mode 100644 index 000000000..fa5ba75f2 Binary files /dev/null and b/src/XGUI/pictures/occ_view_shoot.png differ diff --git a/src/XGUI/pictures/occ_view_style_switch.png b/src/XGUI/pictures/occ_view_style_switch.png new file mode 100644 index 000000000..b0a9c807e Binary files /dev/null and b/src/XGUI/pictures/occ_view_style_switch.png differ diff --git a/src/XGUI/pictures/occ_view_top.png b/src/XGUI/pictures/occ_view_top.png new file mode 100644 index 000000000..cef95040a Binary files /dev/null and b/src/XGUI/pictures/occ_view_top.png differ diff --git a/src/XGUI/pictures/occ_view_triedre.png b/src/XGUI/pictures/occ_view_triedre.png new file mode 100644 index 000000000..bc5894dc3 Binary files /dev/null and b/src/XGUI/pictures/occ_view_triedre.png differ diff --git a/src/XGUI/pictures/occ_view_zoom.png b/src/XGUI/pictures/occ_view_zoom.png new file mode 100644 index 000000000..386c966d1 Binary files /dev/null and b/src/XGUI/pictures/occ_view_zoom.png differ diff --git a/src/XGUI/pictures/occ_view_zooming_style_switch.png b/src/XGUI/pictures/occ_view_zooming_style_switch.png new file mode 100644 index 000000000..8f3a48670 Binary files /dev/null and b/src/XGUI/pictures/occ_view_zooming_style_switch.png differ diff --git a/src/XGUI/pictures/open.png b/src/XGUI/pictures/open.png new file mode 100644 index 000000000..ef7e8d4e5 Binary files /dev/null and b/src/XGUI/pictures/open.png differ diff --git a/src/XGUI/pictures/params_folder.png b/src/XGUI/pictures/params_folder.png new file mode 100644 index 000000000..15cae7fdc Binary files /dev/null and b/src/XGUI/pictures/params_folder.png differ diff --git a/src/XGUI/pictures/part_ico.png b/src/XGUI/pictures/part_ico.png new file mode 100644 index 000000000..16b49734b Binary files /dev/null and b/src/XGUI/pictures/part_ico.png differ diff --git a/src/XGUI/pictures/paste.png b/src/XGUI/pictures/paste.png new file mode 100644 index 000000000..12e3ce92c Binary files /dev/null and b/src/XGUI/pictures/paste.png differ diff --git a/src/XGUI/pictures/properties.png b/src/XGUI/pictures/properties.png new file mode 100644 index 000000000..62b3bae74 Binary files /dev/null and b/src/XGUI/pictures/properties.png differ diff --git a/src/XGUI/pictures/redo.png b/src/XGUI/pictures/redo.png new file mode 100644 index 000000000..e60913e19 Binary files /dev/null and b/src/XGUI/pictures/redo.png differ diff --git a/src/XGUI/pictures/save.png b/src/XGUI/pictures/save.png new file mode 100644 index 000000000..a4de28590 Binary files /dev/null and b/src/XGUI/pictures/save.png differ diff --git a/src/XGUI/pictures/torus.png b/src/XGUI/pictures/torus.png new file mode 100644 index 000000000..af76fc00c Binary files /dev/null and b/src/XGUI/pictures/torus.png differ diff --git a/src/XGUI/pictures/undo.png b/src/XGUI/pictures/undo.png new file mode 100644 index 000000000..d69af82ce Binary files /dev/null and b/src/XGUI/pictures/undo.png differ diff --git a/src/XGUI/pictures/wnd_close.png b/src/XGUI/pictures/wnd_close.png new file mode 100644 index 000000000..74b9af919 Binary files /dev/null and b/src/XGUI/pictures/wnd_close.png differ diff --git a/src/XGUI/pictures/wnd_maximize.png b/src/XGUI/pictures/wnd_maximize.png new file mode 100644 index 000000000..3874a2555 Binary files /dev/null and b/src/XGUI/pictures/wnd_maximize.png differ diff --git a/src/XGUI/pictures/wnd_minimize.png b/src/XGUI/pictures/wnd_minimize.png new file mode 100644 index 000000000..f7c3f7bb1 Binary files /dev/null and b/src/XGUI/pictures/wnd_minimize.png differ