#endif
#if ENABLE_SUPERVGRAPHVIEWER
-# INCLUDEPATH += ../SUPERVGraph
+ INCLUDEPATH += ../SUPERVGraph
#else !ENABLE_SUPERVGRAPHVIEWER
# DEFINES += DISABLE_SUPERVGRAPHVIEWER
#endif
#endif
#if ENABLE_SUPERVGRAPHVIEWER
-# LIBS += -lSUPERVGraph
+ LIBS += -lSUPERVGraph
#endif
CONFIG -= debug release debug_and_release
libLightApp_la_LIBADD+= ../PyInterp/libPyInterp.la ../PyConsole/libPyConsole.la
endif
if ENABLE_SUPERVGRAPHVIEWER
-# libLightApp_la_LIBADD+= ../SUPERVGraph/libSUPERVGraph.la
+ libLightApp_la_LIBADD+= ../SUPERVGraph/libSUPERVGraph.la
endif
# VSR: this is the original packages list
# SUBDIRS += SUPERVGraph
# VSR: already migrated to Qt4 packages
- SUBDIRS +=
+ SUBDIRS += SUPERVGraph
endif
SUBDIRS += Event LightApp ResExporter
#include "SUPERVGraph.h"
#include "SUPERVGraph_ViewFrame.h"
+#include "SUIT_Desktop.h"
+#include "SUIT_ViewWindow.h"
+
using namespace std;
/*!
*/
SUIT_ViewWindow* SUPERVGraph::createView(SUIT_Desktop* parent)
{
- return new SUPERVGraph_ViewFrame( parent/*, "vtkView"*/ );
+ return new SUPERVGraph_ViewFrame( parent );
}
extern "C"
#ifndef SUPERVGraph_HeaderFile
#define SUPERVGraph_HeaderFile
-#include "SUIT_Desktop.h"
-#include "SUIT_ViewWindow.h"
-
#ifdef WIN32
#ifdef SUPERVGRAPH_EXPORTS
#define SUPERVGRAPH_EXPORT __declspec(dllexport)
#pragma warning ( disable: 4251 )
#endif
+#include <QObject>
+
+class SUIT_Desktop;
+class SUIT_ViewWindow;
+
class SUPERVGRAPH_EXPORT SUPERVGraph : public QObject
{
Q_OBJECT
public :
- /*Standard_EXPORT*/ static SUIT_ViewWindow* createView ( SUIT_Desktop* parent);
+ static SUIT_ViewWindow* createView ( SUIT_Desktop* parent);
};
--- /dev/null
+TEMPLATE = lib
+TARGET = SUPERVGraph
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
+
+BOOST_CPPFLAGS = $$(BOOSTDIR)/include
+
+QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
+
+INCLUDEPATH += $${QT_INCLUDES} $${CAS_CPPFLAGS} $${PYTHON_INCLUDES} $${BOOST_CPPFLAGS} ../Qtx ../SUIT ../OBJECT
+
+LIBS += $${QT_MT_LIBS} -L../../lib -lsuit
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += SUPERVGRAPH_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS = SUPERVGraph_ViewFrame.h
+HEADERS += SUPERVGraph_ViewManager.h
+HEADERS += SUPERVGraph_ViewModel.h
+HEADERS += SUPERVGraph.h
+
+SOURCES = SUPERVGraph.cxx
+SOURCES += SUPERVGraph_ViewFrame.cxx
+SOURCES += SUPERVGraph_ViewManager.cxx
+SOURCES += SUPERVGraph_ViewModel.cxx
+
+TRANSLATIONS = resources/SUPERVGraph_images.ts \
+ resources/SUPERVGraph_msg_en.ts
+
+ICONS = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
#include <SUIT_Session.h>
//QT Include
-#include <qlayout.h>
-#include <qcolordialog.h>
+#include <QVBoxLayout>
+#include <QToolBar>
using namespace std;
/*!
Builds popup for SUPERVGraph viewer
*/
-void SUPERVGraph_View::contextMenuPopup( QPopupMenu* )
+void SUPERVGraph_View::contextMenuPopup( QMenu* )
{
// to be implemented
}
setBackgroundColor(QColor(R,G,B));*/
myToolBar = new QToolBar(this);
- myToolBar->setCloseMode(QDockWindow::Undocked);
- myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
+ //myToolBar->setCloseMode(QDockWindow::Undocked);
+ myToolBar->setWindowTitle(tr("LBL_TOOLBAR_LABEL"));
createActions();
createToolBar();
}
{
if (!myActionsMap.isEmpty()) return;
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- QAction* aAction;
+ QtxAction* aAction;
// Panning
- aAction = new QAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_PAN" ) ),
- tr( "MNU_PAN_VIEW" ), 0, this);
+ aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_PAN" ) ),
+ tr( "MNU_PAN_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_PAN_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan()));
myActionsMap[ PanId ] = aAction;
// Reset
- aAction = new QAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_RESET" ) ),
- tr( "MNU_RESET_VIEW" ), 0, this);
+ aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_RESET" ) ),
+ tr( "MNU_RESET_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_RESET_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset()));
myActionsMap[ ResetId ] = aAction;
*/
void SUPERVGraph_ViewFrame::setBackgroundColor( const QColor& color )
{
- if (myView)
- myView->setPaletteBackgroundColor(color);
+ if (myView) {
+ QPalette palette;
+ palette.setColor(myView->backgroundRole(), color);
+ myView->setPalette(palette);
+ }
}
/*!
QColor SUPERVGraph_ViewFrame::backgroundColor() const
{
if (myView)
- return myView->paletteBackgroundColor();
- return QMainWindow::backgroundColor();
+ return myView->palette().color( myView->backgroundRole() );
+ return palette().color( backgroundRole() );
}
/*!
#include "SUIT_PopupClient.h"
#include "SUIT_ViewWindow.h"
-#include <qaction.h>
+#include <QtxAction.h>
#ifdef WIN32
#pragma warning ( disable:4251 )
/* redefine functions from SUIT_PopupClient */
virtual QString popupClientType() const { return Type(); }
- virtual void contextMenuPopup( QPopupMenu* );
+ virtual void contextMenuPopup( QMenu* );
virtual void resizeView( QResizeEvent* theEvent ) {};
//! Actions ID
enum { PanId, ResetId };
- typedef QMap<int, QAction*> ActionsMap;
+ typedef QMap<int, QtxAction*> ActionsMap;
ActionsMap myActionsMap;
QToolBar* myToolBar;
//
#include "SUPERVGraph_ViewManager.h"
+#include "SUIT_ViewWindow.h"
+
int SUPERVGraph_ViewManager::myMaxId = 0;
/*!
*/
void SUPERVGraph_ViewManager::setViewName(SUIT_ViewWindow* theView)
{
- int aPos = myViews.find(theView);
- theView->setCaption( QString( "SUPERVISION scene:%1 - viewer:%2" ).arg( myId ).arg(aPos+1));
+ int aPos = myViews.indexOf(theView);
+ theView->setWindowTitle( QString( "SUPERVISION scene:%1 - viewer:%2" ).arg( myId ).arg(aPos+1));
}
/*!
Fills popup menu with custom actions
\param popup - popup menu to be filled with
*/
-void SUPERVGraph_ViewManager::contextMenuPopup( QPopupMenu* thePopup)
+void SUPERVGraph_ViewManager::contextMenuPopup( QMenu* thePopup)
{
SUIT_ViewManager::contextMenuPopup( thePopup );
// to be implemented
#include "SUPERVGraph.h"
-#include "SUPERVGraph_ViewModel.h"
#include "SUIT_ViewManager.h"
class SUIT_Desktop;
SUPERVGraph_ViewManager( SUIT_Study* theStudy, SUIT_Desktop* theDesktop, SUIT_ViewModel* theViewModel = 0 );
~SUPERVGraph_ViewManager();
- virtual void contextMenuPopup( QPopupMenu* thePopup );
+ virtual void contextMenuPopup( QMenu* thePopup );
protected:
void setViewName(SUIT_ViewWindow* theView);
SUBDIRS += SOCC
SUBDIRS += Plot2d
SUBDIRS += SPlot2d
+SUBDIRS += SUPERVGraph
SUBDIRS += Event
SUBDIRS += LightApp
SUBDIRS += ResExporter