ADD_SUBDIRECTORY (src/PyEvent)
ADD_SUBDIRECTORY (src/PyInterp)
ADD_SUBDIRECTORY (src/XGUI)
+ADD_SUBDIRECTORY (src/GeomApp)
SET(CMAKE_AUTOMOC ON)
SET(PROJECT_HEADERS
+ XGUI.h
XGUI_Command.h
XGUI_MainMenu.h
XGUI_MainWindow.h
SET(PROJECT_SOURCES
XGUI_Command.cpp
- XGUI_Main.cpp
XGUI_MainMenu.cpp
XGUI_MainWindow.cpp
XGUI_MenuGroupPanel.cpp
Event
Config
${QT_LIBRARIES}
- ${QT_QTMAIN_LIBRARY}
${CAS_VIEWER}
${CAS_KERNEL}
PyConsole
SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES})
SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES})
-ADD_DEFINITIONS(${CAS_DEFINITIONS} )
+ADD_DEFINITIONS( -DXGUI_EXPORTS ${CAS_DEFINITIONS} )
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/Event
${PROJECT_SOURCE_DIR}/src/Config
LINK_DIRECTORIES($ENV{PYTHON_LIB_DIR})
-ADD_EXECUTABLE(XGUI WIN32
+ADD_LIBRARY(XGUI SHARED
${PROJECT_SOURCES}
${PROJECT_HEADERS}
${PROJECT_COMPILED_RESOURCES}
--- /dev/null
+#ifndef XGUI_H
+#define XGUI_H
+
+#if defined XGUI_EXPORTS
+#if defined WIN32
+#define XGUI_EXPORT __declspec( dllexport )
+#else
+#define XGUI_EXPORT
+#endif
+#else
+#if defined WIN32
+#define XGUI_EXPORT __declspec( dllimport )
+#else
+#define XGUI_EXPORT
+#endif
+#endif
+
+#endif
#ifndef XGUI_Command_H
#define XGUI_Command_H
+#include "XGUI.h"
#include <QWidgetAction>
#define MIN_BUTTON_HEIGHT 18
* \ingroup GUI
* \brief Represents a command item in the application menu (Workbench)
*/
-class XGUI_Command: public QWidgetAction
+class XGUI_EXPORT XGUI_Command: public QWidgetAction
{
Q_OBJECT
public:
-
#ifndef XGUI_DataTreeModel_H
#define XGUI_DataTreeModel_H
+#include "XGUI.h"
+#include "XGUI_Constants.h"
+
#include <ModelAPI_Document.h>
#include <QAbstractItemModel>
-#include "XGUI_Constants.h"
-
/**\class XGUI_FeaturesModel
* \ingroup GUI
* \brief Abstaract class of model object which operates with features data.
*/
-class XGUI_FeaturesModel : public QAbstractItemModel
+class XGUI_EXPORT XGUI_FeaturesModel : public QAbstractItemModel
{
public:
XGUI_FeaturesModel(const std::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent):
#ifndef XGUI_DocumentDataModel_H
#define XGUI_DocumentDataModel_H
+#include "XGUI.h"
#include "XGUI_Constants.h"
#include <QAbstractItemModel>
* \brief This is a proxy data model for Object Browser (QTreeView).
* It contains several sub-models for generation of each sub-part of data tree.
*/
-class XGUI_DocumentDataModel : public QAbstractItemModel, public Event_Listener
+class XGUI_EXPORT XGUI_DocumentDataModel : public QAbstractItemModel, public Event_Listener
{
Q_OBJECT
public:
+++ /dev/null
-#include "XGUI_Workshop.h"
-#include <QApplication>
-#include <QTranslator>
-#include <QDebug>
-
-#ifndef WIN32
-
-#include <X11/Xlib.h>
-#include <GL/glx.h>
-
-/*!
- \brief Open the default X display and returns pointer to it.
- This method is available on Linux only.
- \return Pointer to X display.
- \sa getVisual()
-*/
-Display* getDisplay()
-{
- static Display* pDisplay = NULL;
- if ( !pDisplay )
- pDisplay = XOpenDisplay( NULL );
- return pDisplay;
-}
-
-/*!
- \brief Returns pointer to X visual suitable for 3D rendering.
- This method is available on Linux only.
- \return Pointer to X visual.
- \sa getDisplay()
-*/
-Qt::HANDLE getVisual()
-{
- Qt::HANDLE res = (Qt::HANDLE)NULL;
-
- Display* pDisplay = (Display*)getDisplay();
- if ( !pDisplay )
- return res;
-
- int errorBase;
- int eventBase;
-
- // Make sure OpenGL's GLX extension supported
- if( !glXQueryExtension( pDisplay, &errorBase, &eventBase ) ){
- qCritical( "Could not find glx extension" );
- return res;
- }
-
- // Find an appropriate visual
-
- int doubleBufferVisual[] = {
- GLX_RGBA, // Needs to support OpenGL
- GLX_DEPTH_SIZE, 16, // Needs to support a 16 bit depth buffer
- GLX_DOUBLEBUFFER, // Needs to support double-buffering
- None // end of list
- };
-
- // Try for the double-bufferd visual first
- XVisualInfo *visualInfo = NULL;
- visualInfo = glXChooseVisual( pDisplay, DefaultScreen(pDisplay), doubleBufferVisual );
-
- if( visualInfo == NULL ){
- qCritical( "Could not find matching glx visual" );
- return res;
- }
-
-
- qDebug() << "Picked visual 0x" << hex << XVisualIDFromVisual( visualInfo->visual );
- res = (Qt::HANDLE)( visualInfo->visual );
-
- return res;
-}
-#endif // WIN32
-
-
-
-int main(int argc, char *argv[])
-{
-#ifndef WIN32
- QApplication app(getDisplay(), argc, argv, getVisual());
-#else
- QApplication app(argc, argv);
-#endif
-
- // Install translator
- QTranslator aTranslator;
- aTranslator.load(app.applicationDirPath() + "\\XGUI_msg_en.qm");
- app.installTranslator(&aTranslator);
-
- XGUI_Workshop aWorkshop;
- aWorkshop.startApplication();
-
- return app.exec();
-}
#ifndef XGUI_MainMenu_H
#define XGUI_MainMenu_H
+#include "XGUI.h"
#include <QObject>
#include <QList>
* \ingroup GUI
* \brief Class for creation of main menu (set of workbenches)
*/
-class XGUI_MainMenu: public QObject
+class XGUI_EXPORT XGUI_MainMenu: public QObject
{
Q_OBJECT
public:
#ifndef XGUI_MAINWINDOW_H
#define XGUI_MAINWINDOW_H
+#include "XGUI.h"
#include <QMainWindow>
class XGUI_MainMenu;
* \brief Main window of the application (Desktop).
* It contains: Object Browser, 3d Viewer, Python console, property panel, main menu
*/
-class XGUI_MainWindow: public QMainWindow
+class XGUI_EXPORT XGUI_MainWindow: public QMainWindow
{
Q_OBJECT
#ifndef XGUI_MenuGroupPanel_H
#define XGUI_MenuGroupPanel_H
+#include "XGUI.h"
#include <QWidget>
#include <QMap>
* \ingroup GUI
* \brief Represents a one group in a page of main menu (workbench)
*/
-class XGUI_MenuGroupPanel: public QWidget
+class XGUI_EXPORT XGUI_MenuGroupPanel: public QWidget
{
Q_OBJECT
public:
#ifndef XGUI_ObjectsBrowser_H
#define XGUI_ObjectsBrowser_H
+#include "XGUI.h"
#include "XGUI_Constants.h"
#include <QTreeView>
* \ingroup GUI
* \brief Object browser window object. Represents data tree of current data structure
*/
- class XGUI_ObjectsBrowser : public QTreeView
+ class XGUI_EXPORT XGUI_ObjectsBrowser : public QTreeView
{
Q_OBJECT
public:
#ifndef XGUI_PartDataModel_H
#define XGUI_PartDataModel_H
+#include "XGUI.h"
#include "XGUI_DataTreeModel.h"
/**\class XGUI_TopDataModel
* \brief This is a data model for Object Browser (QTreeView).
* It represents only upper part of data tree (non-parts tree items)
*/
-class XGUI_TopDataModel : public XGUI_FeaturesModel
+class XGUI_EXPORT XGUI_TopDataModel : public XGUI_FeaturesModel
{
Q_OBJECT
public:
#ifndef XGUI_RubberBand_H
#define XGUI_RubberBand_H
+#include "XGUI.h"
#include <QWidget>
/*!
Currently this class does not support Style functionality in full.
*/
-class XGUI_AbstractRubberBand: public QWidget
+class XGUI_EXPORT XGUI_AbstractRubberBand: public QWidget
{
Q_OBJECT
protected:
#ifndef XGUI_SelectionMgr_H
#define XGUI_SelectionMgr_H
+#include "XGUI.h"
#include "XGUI_Constants.h"
#include <QObject>
* \brief Selection manager. Provides selection event on selection in
* Object Browser and Viewer
*/
-class XGUI_SelectionMgr : public QObject
+class XGUI_EXPORT XGUI_SelectionMgr : public QObject
{
Q_OBJECT
public:
#ifndef XGUI_Tools_H
#define XGUI_Tools_H
+#include "XGUI.h"
#include <QString>
#include <QRect>
\param str short library name
\return full library name
*/
-QString library(const QString& str);
+QString XGUI_EXPORT library(const QString& str);
/*!
\brief Return directory part of the 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);
+QString XGUI_EXPORT dir(const QString& path, bool isAbs = true);
/*!
\brief Return file name part of the file path.
is returned
\return file name part of the file path
*/
-QString file(const QString& path, bool withExt = true);
+QString XGUI_EXPORT file(const QString& path, bool withExt = true);
/*!
\brief Return extension part of the file path.
is returned, otherwise (default) only last extension is returned
\return extension part of the file path
*/
-QString extension(const QString& path, bool full = false);
+QString XGUI_EXPORT extension(const QString& path, bool full = false);
/*!
\brief Add a slash (platform-specific) to the end of \a path
\param path directory path
\return modified path (with slash added to the end)
*/
-QString addSlash(const QString& path);
+QString XGUI_EXPORT addSlash(const QString& path);
/*!
Creates a rect with TopLeft = ( min(x1,x2), min(y1,y2) )
and BottomRight = ( TopLeft + (x2-x1)(y2-y1) )
*/
-QRect makeRect(const int x1, const int y1, const int x2, const int y2);
+QRect XGUI_EXPORT makeRect(const int x1, const int y1, const int x2, const int y2);
#endif
#ifndef XGUI_ViewBackground_H
#define XGUI_ViewBackground_H
+#include "XGUI.h"
#include "XGUI_Constants.h"
#include <QColor>
bg.setTextureShown( true ); // draw texture on the solid color background
\endcode
*/
-class XGUI_ViewBackground
+class XGUI_EXPORT XGUI_ViewBackground
{
public:
XGUI_ViewBackground();
#ifndef XGUI_ViewPort_H
#define XGUI_ViewPort_H
+#include "XGUI.h"
#include "XGUI_ViewBackground.h"
#include <QWidget>
class XGUI_ViewWindow;
-class XGUI_ViewPort: public QWidget
+class XGUI_EXPORT XGUI_ViewPort: public QWidget
{
Q_OBJECT
public:
#ifndef XGUI_ViewWindow_H
#define XGUI_ViewWindow_H
+#include "XGUI.h"
#include "XGUI_Constants.h"
#include "XGUI_ViewBackground.h"
It contains a view port object (drawing area) and toolbars for view camera and window management.
Also it managements events in view port
*/
-class XGUI_ViewWindow: public QFrame
+class XGUI_EXPORT XGUI_ViewWindow: public QFrame
{
Q_OBJECT
public:
#ifndef XGUI_Viewer_H
#define XGUI_Viewer_H
+#include "XGUI.h"
#include "XGUI_Constants.h"
#include <QObject>
* \brief Represents a 3d viewer. The viewer manages 3d scene and a set of view windows
* when each of view window is a one point of view on this scene.
*/
-class XGUI_Viewer: public QObject
+class XGUI_EXPORT XGUI_Viewer: public QObject
{
Q_OBJECT
public:
#ifndef XGUI_WIDGETFACTORY_H_
#define XGUI_WIDGETFACTORY_H_
+#include "XGUI.h"
#include <QString>
class QWidget;
class Config_WidgetAPI;
class ModuleBase_Operation;
-class XGUI_WidgetFactory
+class XGUI_EXPORT XGUI_WidgetFactory
{
public:
XGUI_WidgetFactory(ModuleBase_Operation*);
#ifndef XGUI_Workbench_H
#define XGUI_Workbench_H
+#include "XGUI.h"
#include <QWidget>
#include <QScrollArea>
#include <QList>
class QHBoxLayout;
class QPushButton;
-class XGUI_Workbench: public QWidget
+class XGUI_EXPORT XGUI_Workbench: public QWidget
{
Q_OBJECT
public:
#ifndef XGUI_WORKSHOP_H
#define XGUI_WORKSHOP_H
-#include <Event_Message.h>
+#include "XGUI.h"
#include <Event_Listener.h>
#include <QObject>
* \ingroup GUI
* \brief Class which defines a configuration of the application (Workshop) and launches it.
*/
-class XGUI_Workshop: public QObject, public Event_Listener
+class XGUI_EXPORT XGUI_Workshop: public QObject, public Event_Listener
{
Q_OBJECT
public: