ADD_SUBDIRECTORY (src/Config)
#ADD_SUBDIRECTORY (src/ModelAPI)
#ADD_SUBDIRECTORY (src/Model)
-ADD_SUBDIRECTORY (src/GeomModule)
+ADD_SUBDIRECTORY (src/PartSet)
ADD_SUBDIRECTORY (src/XGUI)
+++ /dev/null
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
-
-INCLUDE(Common)
-
-SET(PROJECT_HEADERS
- GeomModule_Defs.h
- GeomModule.h
-)
-
-SET(PROJECT_SOURCES
- GeomModule.cpp
-)
-
-SET(PROJECT_RESOURCES
- GeomModule_icons.qrc
-)
-
-SET(TEXT_RESOURCES
- GeomModule_msg_en.ts
-)
-
-SET(PROJECT_LIBRARIES
- Config
- ${Qt5Widgets_LIBRARIES}
-)
-
-QT5_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES})
-QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
-
-SOURCE_GROUP ("Generated Files" FILES ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES})
-SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES})
-
-ADD_LIBRARY(GeomModule SHARED
- ${PROJECT_SOURCES}
- ${PROJECT_HEADERS}
- ${PROJECT_COMPILED_RESOURCES}
- ${TEXT_RESOURCES}
- ${QM_RESOURCES}
-)
-
-ADD_DEPENDENCIES(GeomModule XGUI)
-
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/XGUI)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/Config)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/Event)
-
-# The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
-TARGET_LINK_LIBRARIES(GeomModule ${PROJECT_LIBRARIES})
-
-INSTALL(TARGETS GeomModule DESTINATION bin)
+++ /dev/null
-#include "GeomModule.h"
-
-#include <Config_XMLReader.h>
-
-#include <QFile>
-#include <QDir>
-#include <QApplication>
-#include <QTextStream>
-
-/*!Create and return new instance of XGUI_Module*/
-extern "C" GM_EXPORT IModule* createModule(IWorkshop* theWshop)
-{
- return new GeomModule(theWshop);
-}
-
-
-GeomModule::GeomModule(IWorkshop* theWshop)
-{
- myWorkshop = theWshop;
-}
-
-
-GeomModule::~GeomModule()
-{
-}
-
-
-void GeomModule::createFeatures()
-{
- Config_XMLReader* aReader =
- new Config_XMLReader("plugin-PartSet.xml");
- aReader->readAll();
-}
+++ /dev/null
-
-#ifndef GeomModule_H
-#define GeomModule_H
-
-#include "GeomModule_Defs.h"
-
-#include <XGUI_Interfaces.h>
-
-class Config_XMLReader;
-
-class GM_EXPORT GeomModule : public IModule
-{
-public:
- GeomModule(IWorkshop* theWshop);
- virtual ~GeomModule();
-
- virtual void createFeatures();
-
-private:
- QString myMenuXML;
-
- IWorkshop* myWorkshop;
-};
-
-#endif
+++ /dev/null
-#ifndef GeomModule_Defs_H
-#define GeomModule_Defs_H
-
-
-#if defined WIN32
-# if defined GeomModule_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
+++ /dev/null
- <!DOCTYPE RCC><RCC version="1.0">
- <qresource>
- <file>icons/point.png</file>
- <file>icons/plane.png</file>
- <file>icons/axis.png</file>
- <file>icons/duplicate.png</file>
- <file>icons/remove.png</file>
- <file>icons/extrusion.png</file>
- <file>icons/cut.png</file>
- <file>icons/fusion.png</file>
- <file>icons/revol.png</file>
- <file>icons/common.png</file>
- <file>icons/import.png</file>
- </qresource>
- </RCC>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="en_US">
-<context>
- <name>@default</name>
-</context>
-<context>
- <name>XGUI_Workshop</name>
- <message>
- <source>HOME_MENU_TITLE</source>
- <translation>Home</translation>
- </message>
- <message>
- <source>NEW_MENU</source>
- <translation>New</translation>
- </message>
-</context>
-</TS>
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
+
+INCLUDE(Common)
+
+SET(PROJECT_HEADERS
+ PartSet.h
+ PartSet_Module.h
+)
+
+SET(PROJECT_SOURCES
+ PartSet_Module.cpp
+)
+
+SET(PROJECT_RESOURCES
+ PartSet_icons.qrc
+)
+
+SET(TEXT_RESOURCES
+ PartSet_msg_en.ts
+)
+
+SET(PROJECT_LIBRARIES
+ Config
+ ${Qt5Widgets_LIBRARIES}
+)
+
+QT5_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES})
+QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
+
+SOURCE_GROUP ("Generated Files" FILES ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES})
+SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES})
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/XGUI)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/Config)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/Event)
+
+ADD_DEFINITIONS(-DPARTSET_EXPORTS)
+ADD_LIBRARY(PartSet SHARED
+ ${PROJECT_SOURCES}
+ ${PROJECT_HEADERS}
+ ${PROJECT_COMPILED_RESOURCES}
+ ${TEXT_RESOURCES}
+ ${QM_RESOURCES}
+)
+
+# The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
+TARGET_LINK_LIBRARIES(PartSet ${PROJECT_LIBRARIES})
+
+INSTALL(TARGETS PartSet DESTINATION bin)
--- /dev/null
+#ifndef PARTSET_H
+#define PARTSET_H
+
+#if defined PARTSET_EXPORTS
+#if defined WIN32
+#define PARTSET_EXPORT __declspec( dllexport )
+#else
+#define PARTSET_EXPORT
+#endif
+#else
+#if defined WIN32
+#define PARTSET_EXPORT __declspec( dllimport )
+#else
+#define PARTSET_EXPORT
+#endif
+#endif
+
+#endif //PARTSET_H
--- /dev/null
+#include "PartSet_Module.h"
+
+#include <Config_XMLReader.h>
+
+#include <QFile>
+#include <QDir>
+#include <QApplication>
+#include <QTextStream>
+
+/*!Create and return new instance of XGUI_Module*/
+extern "C" PARTSET_EXPORT XGUI_Module* createModule(XGUI_Workshop* theWshop)
+{
+ return new PartSet_Module(theWshop);
+}
+
+
+PartSet_Module::PartSet_Module(XGUI_Workshop* theWshop)
+{
+ myWorkshop = theWshop;
+}
+
+
+PartSet_Module::~PartSet_Module()
+{
+}
+
+
+void PartSet_Module::createFeatures()
+{
+ Config_XMLReader* aReader =
+ new Config_XMLReader("plugin-PartSet.xml");
+ aReader->readAll();
+}
--- /dev/null
+
+#ifndef PartSet_Module_H
+#define PartSet_Module_H
+
+#include "PartSet.h"
+
+#include <XGUI_Module.h>
+
+class Config_XMLReader;
+
+class PARTSET_EXPORT PartSet_Module : public XGUI_Module
+{
+public:
+ PartSet_Module(XGUI_Workshop* theWshop);
+ virtual ~PartSet_Module();
+
+ virtual void createFeatures();
+
+private:
+ QString myMenuXML;
+
+ XGUI_Workshop* myWorkshop;
+};
+
+#endif
--- /dev/null
+ <!DOCTYPE RCC><RCC version="1.0">
+ <qresource>
+ <file>icons/point.png</file>
+ <file>icons/plane.png</file>
+ <file>icons/axis.png</file>
+ <file>icons/duplicate.png</file>
+ <file>icons/remove.png</file>
+ <file>icons/extrusion.png</file>
+ <file>icons/cut.png</file>
+ <file>icons/fusion.png</file>
+ <file>icons/revol.png</file>
+ <file>icons/common.png</file>
+ <file>icons/import.png</file>
+ </qresource>
+ </RCC>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+ <name>@default</name>
+</context>
+<context>
+ <name>XGUI_Workshop</name>
+ <message>
+ <source>HOME_MENU_TITLE</source>
+ <translation>Home</translation>
+ </message>
+ <message>
+ <source>NEW_MENU</source>
+ <translation>New</translation>
+ </message>
+</context>
+</TS>
#ifndef XGUI_Command_H
#define XGUI_Command_H
-#include "XGUI_Interfaces.h"
-
#include <QWidgetAction>
#define MIN_BUTTON_HEIGHT 18
#define MIN_BUTTON_WIDTH 40
-class XGUI_Command : public QWidgetAction, public IFeatureMenu
+class XGUI_Command : public QWidgetAction
{
Q_OBJECT
public:
QString myId;
};
-#endif
\ No newline at end of file
+#endif
+++ /dev/null
-
-#ifndef XGUI_Interfaces_H
-#define XGUI_Interfaces_H
-
-#include <QString>
-#include <QIcon>
-#include <QKeySequence>
-
-
-class IFeatureMenu
-{
-public:
- virtual bool enabled() const = 0;
- virtual void enable() = 0;
- virtual void disable() = 0;
- virtual QString getId() const = 0;
- virtual void connectTo(const QObject* theResiver, const char* theSlot) = 0;
-};
-
-
-class IMenuGroup
-{
-public:
- virtual IFeatureMenu* addFeature(const QString& theId,
- const QString& theTitle,
- const QString& theTip,
- const QIcon& theIcon,
- const QKeySequence& theKeys = QKeySequence()) = 0;
-};
-
-
-class IWorkbench
-{
-public:
- virtual IMenuGroup* addGroup(const QString& theName = "") = 0;
- virtual IMenuGroup* findGroup(const QString& theName) = 0;
-};
-
-
-class IWorkshop
-{
-public:
- virtual IWorkbench* addWorkbench(const QString& theName) = 0;
-};
-
-
-class IModule
-{
-public:
- virtual void createFeatures() = 0;
-};
-
-
-//! This function must return a new module instance.
-extern "C"
-{
- typedef IModule* (*CREATE_FUNC)(IWorkshop*);
-}
-
-#define CREATE_MODULE "createModule"
-
-
-#endif
{
}
-IWorkbench* XGUI_MainMenu::addWorkbench(const QString& theTitle)
+XGUI_Workbench* XGUI_MainMenu::addWorkbench(const QString& theTitle)
{
QDockWidget* aDoc = new QDockWidget(myDesktop);
QString workbenchObjName = theTitle + "_Workbench";
/*
* Searches for already created workbench with given name.
*/
-IWorkbench* XGUI_MainMenu::findWorkbench(const QString& theObjName)
+XGUI_Workbench* XGUI_MainMenu::findWorkbench(const QString& theObjName)
{
QDockWidget* aDoc = myDesktop->findChild<QDockWidget*>(theObjName);
if(aDoc) {
- return dynamic_cast<IWorkbench*>(aDoc->widget());
+ return dynamic_cast<XGUI_Workbench*>(aDoc->widget());
}
return NULL;
}
-IMenuGroup* XGUI_MainMenu::addGroup(int thePageId)
+XGUI_MenuGroupPanel* XGUI_MainMenu::addGroup(int thePageId)
{
XGUI_Workbench* aPage = dynamic_cast<XGUI_Workbench*>(myMenuTabs[thePageId]->widget());
return aPage->addGroup();
#ifndef XGUI_MainMenu_H
#define XGUI_MainMenu_H
-#include "XGUI_Interfaces.h"
-
#include <QObject>
#include <QList>
+class XGUI_Command;
+class XGUI_MainWindow;
+class XGUI_Workbench;
+class XGUI_MenuGroupPanel;
+
class QTabWidget;
class QLabel;
class QAction;
-class XGUI_Command;
-class XGUI_MainWindow;
class QDockWidget;
+
class XGUI_MainMenu : public QObject
{
Q_OBJECT
XGUI_MainMenu(XGUI_MainWindow *parent);
virtual ~XGUI_MainMenu();
- IWorkbench* addWorkbench(const QString& theTitle);
- IWorkbench* findWorkbench(const QString& theObjName);
+ XGUI_Workbench* addWorkbench(const QString& theTitle);
+ XGUI_Workbench* findWorkbench(const QString& theObjName);
- IMenuGroup* addGroup(int thePageId);
+ XGUI_MenuGroupPanel* addGroup(int thePageId);
private:
XGUI_MainWindow* myDesktop;
}
}
-IFeatureMenu* XGUI_MenuGroupPanel::addFeature(const QString& theId, const QString& theTitle,
+XGUI_Command* XGUI_MenuGroupPanel::addFeature(const QString& theId, const QString& theTitle,
const QString& theTip,
const QIcon& theIcon,
const QKeySequence& theKeys)
#ifndef XGUI_MenuGroupPanel_H
#define XGUI_MenuGroupPanel_H
-#include "XGUI_Interfaces.h"
-
#include <QWidget>
#include <QMap>
-class QGridLayout;
class XGUI_Command;
+class QGridLayout;
-class XGUI_MenuGroupPanel : public QWidget, public IMenuGroup
+class XGUI_MenuGroupPanel : public QWidget
{
Q_OBJECT
public:
explicit XGUI_MenuGroupPanel(QWidget *parent = 0);
- virtual IFeatureMenu* addFeature(const QString& theId,
- const QString& theTitle,
- const QString& theTip,
- const QIcon& theIcon,
- const QKeySequence& theKeys = QKeySequence());
+ XGUI_Command* addFeature(const QString& theId,
+ const QString& theTitle,
+ const QString& theTip,
+ const QIcon& theIcon,
+ const QKeySequence& theKeys = QKeySequence());
protected:
virtual void resizeEvent(QResizeEvent *theEvent);
int myMaxRow;
};
-#endif
\ No newline at end of file
+#endif
--- /dev/null
+
+#ifndef XGUI_Module_H
+#define XGUI_Module_H
+
+#include <QString>
+#include <QIcon>
+#include <QKeySequence>
+
+#include <XGUI_Workshop.h>
+
+class XGUI_Module
+{
+public:
+ virtual void createFeatures() = 0;
+};
+
+//! This function must return a new module instance.
+extern "C"
+{
+ typedef XGUI_Module* (*CREATE_FUNC)(XGUI_Workshop*);
+}
+
+#define CREATE_MODULE "createModule"
+
+
+#endif //XGUI_Module
* Creates a new group in the workbench with given name.
* If no name provided it would be defined as {workbench_name}_Group_N.
*/
-IMenuGroup* XGUI_Workbench::addGroup(const QString& theName)
+XGUI_MenuGroupPanel* XGUI_Workbench::addGroup(const QString& theName)
{
QString aGroupName = theName;
//Generate a group name.
/*
* Searches for already created group with given name.
*/
-IMenuGroup* XGUI_Workbench::findGroup(const QString& theName)
+XGUI_MenuGroupPanel* XGUI_Workbench::findGroup(const QString& theName)
{
QString aGroupName = theName;
XGUI_MenuGroupPanel* aPanel;
#ifndef XGUI_Workbench_H
#define XGUI_Workbench_H
-#include "XGUI_Interfaces.h"
-
#include <QWidget>
#include <QScrollArea>
#include <QList>
-class QHBoxLayout;
+class XGUI_Command;
class XGUI_MenuGroupPanel;
-class QPushButton;
class CommandsArea;
-class XGUI_Command;
+
+class QHBoxLayout;
+class QPushButton;
+
-class XGUI_Workbench : public QWidget, public IWorkbench
+class XGUI_Workbench : public QWidget
{
Q_OBJECT
public:
XGUI_Workbench(QWidget* theParent);
- virtual IMenuGroup* addGroup(const QString& theName = "");
- virtual IMenuGroup* findGroup(const QString& theName);
+ XGUI_MenuGroupPanel* addGroup(const QString& theName = "");
+ XGUI_MenuGroupPanel* findGroup(const QString& theName);
private slots:
void onLeftScroll();
-#include "XGUI_Workshop.h"
-#include "XGUI_MainWindow.h"
-#include "XGUI_MainMenu.h"
+#include "XGUI_Module.h"
#include "XGUI_Command.h"
+#include "XGUI_MainMenu.h"
+#include "XGUI_MainWindow.h"
+#include "XGUI_MenuGroupPanel.h"
#include "XGUI_Tools.h"
+#include "XGUI_Workbench.h"
+#include "XGUI_Workshop.h"
#include <Config_Message.h>
#include <Event_Loop.hxx>
#ifdef _DEBUG
#include <QDebug>
#endif
-
-
-#include <cstdio>
-
#ifdef WIN32
#include <windows.h>
#else
//******************************************************
void XGUI_Workshop::initMenu()
{
- IWorkbench* aPage = addWorkbench(tr("GEN_MENU_TITLE"));
+ XGUI_Workbench* aPage = addWorkbench(tr("GEN_MENU_TITLE"));
// File commands group
- IMenuGroup* aGroup = aPage->addGroup();
+ XGUI_MenuGroupPanel* aGroup = aPage->addGroup();
- IFeatureMenu* aCommand;
+ XGUI_Command* aCommand;
aCommand = aGroup->addFeature("SAVE_CMD", tr("SAVE_MENU"), tr("SAVE_MENU_TIP"),
QIcon(":pictures/save.png"), QKeySequence::Save);
}
//******************************************************
-IWorkbench* XGUI_Workshop::addWorkbench(const QString& theName)
+XGUI_Workbench* XGUI_Workshop::addWorkbench(const QString& theName)
{
XGUI_MainMenu* aMenuBar = myMainWindow->menuObject();
return aMenuBar->addWorkbench(theName);
}
#ifdef _DEBUG
qDebug() << "XGUI_Workshop::ProcessEvent: "
- << "Got message, but it's not a Config_FeatureMessage";
+ << "Catch message, but it can not be processed.";
#endif
}
+/*
+ *
+ */
void XGUI_Workshop::addFeature(const Config_FeatureMessage* theMessage)
{
XGUI_MainMenu* aMenuBar = myMainWindow->menuObject();
- IWorkbench* aPage = aMenuBar->findWorkbench(tr( "GEN_MENU_TITLE" ) + "_Workbench");
+ XGUI_Workbench* aPage = aMenuBar->findWorkbench(tr( "GEN_MENU_TITLE" ) + "_Workbench");
if(!aPage) {
#ifdef _DEBUG
qDebug() << "XGUI_Workshop::ProcessEvent: "
aPage = addWorkbench(tr( "GEN_MENU_TITLE" ));
}
QString aGroupName = QString::fromStdString(theMessage->m_group);
- IMenuGroup* aGroup = aPage->findGroup(aGroupName);
+ QString aFeatureId = QString::fromStdString(theMessage->m_id);
+ XGUI_MenuGroupPanel* aGroup = aPage->findGroup(aGroupName);
if(!aGroup) {
aGroup = aPage->addGroup(aGroupName);
}
- IFeatureMenu* aCommand;
- aCommand = aGroup->addFeature(
- QString::fromStdString(theMessage->m_id),
+ XGUI_Command* aCommand = aGroup->addFeature(aFeatureId,
QString::fromStdString(theMessage->m_text),
QString::fromStdString(theMessage->m_tooltip),
QIcon(theMessage->m_icon.c_str())
}
//******************************************************
-IModule* XGUI_Workshop::loadModule(const QString& theModule)
+XGUI_Module* XGUI_Workshop::loadModule(const QString& theModule)
{
QString libName = library( theModule );
if ( libName.isEmpty() )
}
#endif
- IModule* aModule = crtInst ? crtInst(this) : 0;
+ XGUI_Module* aModule = crtInst ? crtInst(this) : 0;
if ( !err.isEmpty() ) {
if ( mainWindow() && mainWindow()->isVisible() )
bool XGUI_Workshop::activateModule()
{
// Test of modules loading
- IModule* aModule = loadModule("GeomModule");
+ XGUI_Module* aModule = loadModule("PartSet");
if (!aModule)
return false;
aModule->createFeatures();
#ifndef XGUI_WORKSHOP_H
#define XGUI_WORKSHOP_H
-#include "XGUI_Interfaces.h"
-
#include <Event_Message.hxx>
#include <Event_Listener.hxx>
class XGUI_MainWindow;
class XGUI_Command;
class XGUI_Module;
+class XGUI_Workbench;
class Config_FeatureMessage;
-class XGUI_Workshop: public QObject, public Event_Listener, public IWorkshop
+class XGUI_Workshop: public QObject, public Event_Listener
{
Q_OBJECT
public:
XGUI_MainWindow* mainWindow() const { return myMainWindow; }
- virtual IWorkbench* addWorkbench(const QString& theName);
+ XGUI_Workbench* addWorkbench(const QString& theName);
virtual void ProcessEvent(const Event_Message* theMessage);
private:
void initMenu();
- IModule* loadModule(const QString& theModule);
+ XGUI_Module* loadModule(const QString& theModule);
bool activateModule();
XGUI_MainWindow* myMainWindow;