From efe93fa30f50e1a3a5160fc862976dc2537b2aac Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 21 Sep 2007 12:46:42 +0000 Subject: [PATCH] Temporarily creation VTKViewer and TableViewer. --- src/STD/STD.pro | 12 +++-- src/STD/STD_Application.cxx | 44 +++++++++++++++++ src/STD/STD_Application.h | 9 +++- src/STD/resources/STD.xml | 94 +++++++++++++++++++++++++++++++++++++ 4 files changed, 155 insertions(+), 4 deletions(-) create mode 100644 src/STD/resources/STD.xml diff --git a/src/STD/STD.pro b/src/STD/STD.pro index ab2ad4776..f54e7d120 100644 --- a/src/STD/STD.pro +++ b/src/STD/STD.pro @@ -4,8 +4,13 @@ DESTDIR = ../../$(CONFIG_ID)/lib MOC_DIR = ../../moc OBJECTS_DIR = ../../$(CONFIG_ID)/obj/$$TARGET -INCLUDEPATH = ../../include -LIBS += -L../../$(CONFIG_ID)/lib -lSUIT -lQtx +VTKHOME = $$(VTKHOME) +VTK_INCLUDES = $${VTKHOME}/include/vtk + +VTK_LIBS = -L$${VTKHOME}/lib/vtk -L$${VTKHOME}/lib/vtk/python -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets -lGL -L/usr/X11R6/lib -lGLU -L/usr/X11R6/lib -lX11 -lXt + +INCLUDEPATH = ../../include $${VTK_INCLUDES} +LIBS += -L../../$(CONFIG_ID)/lib $${VTK_LIBS} -lSUIT -lQtx -lTableViewer -lVTKViewer CONFIG -= debug release debug_and_release CONFIG += qt thread debug dll shared @@ -20,7 +25,8 @@ SOURCES = *.cxx TRANSLATIONS = resources/STD_images.ts \ resources/STD_msg_en.ts -ICONS = resources/*.png +ICONS = resources/*.png \ + STD.xml includes.files = $$HEADERS includes.path = ../../include diff --git a/src/STD/STD_Application.cxx b/src/STD/STD_Application.cxx index 35b80fc39..b39be0c84 100755 --- a/src/STD/STD_Application.cxx +++ b/src/STD/STD_Application.cxx @@ -28,6 +28,12 @@ #include #include +#include +#include + +#include +#include + #include #include #include @@ -52,6 +58,8 @@ STD_Application::STD_Application() myEditEnabled( true ) { setDesktop( new STD_MDIDesktop() ); + myTableMgr = 0; + myVTKMgr = 0; } /*!Destructor.*/ @@ -185,6 +193,16 @@ void STD_Application::createActions() tr( "MEN_DESK_EDIT_PASTE" ), tr( "PRP_DESK_EDIT_PASTE" ), Qt::CTRL+Qt::Key_V, desk, false, this, SLOT( onPaste() ) ); + createAction( TableViewId, tr( "Table view" ), + resMgr->loadPixmap( "STD", tr( "ICON_EDIT_COPY" ) ), + tr( "Table view" ), tr( "Table view" ), + Qt::CTRL+Qt::Key_T, desk, false, this, SLOT( onTableView() ) ); + + createAction( VTKViewId, tr( "VTK view" ), + resMgr->loadPixmap( "STD", tr( "ICON_EDIT_COPY" ) ), + tr( "VTK view" ), tr( "VTK view" ), + Qt::CTRL+Qt::Key_V, desk, false, this, SLOT( onVTKView() ) ); + QAction* a = createAction( ViewStatusBarId, tr( "TOT_DESK_VIEW_STATUSBAR" ), QIcon(), tr( "MEN_DESK_VIEW_STATUSBAR" ), tr( "PRP_DESK_VIEW_STATUSBAR" ), Qt::SHIFT+Qt::Key_S, desk, true ); @@ -229,6 +247,8 @@ void STD_Application::createActions() createMenu( EditCopyId, editMenu ); createMenu( EditPasteId, editMenu ); + createMenu( TableViewId, editMenu ); + createMenu( VTKViewId, editMenu ); createMenu( separator(), editMenu ); createMenu( ViewToolBarsId, viewMenu, 0 ); @@ -253,6 +273,8 @@ void STD_Application::createActions() createTool( separator(), stdTBar ); createTool( EditCopyId, stdTBar ); createTool( EditPasteId, stdTBar ); + createTool( TableViewId, stdTBar ); + createTool( VTKViewId, stdTBar ); } /*!Opens new application*/ @@ -576,6 +598,28 @@ void STD_Application::onPaste() { } +void STD_Application::onTableView() +{ + if ( !myTableMgr ) { + if ( !activeStudy() ) + createEmptyStudy(); + myTableMgr = new TableViewer_ViewManager( activeStudy(), desktop() ); + TableViewer_Viewer* vm = new TableViewer_Viewer(); + myTableMgr->setViewModel( vm ); + } + myTableMgr->createView(); +} + +void STD_Application::onVTKView() +{ + if ( !myVTKMgr ) { + if ( !activeStudy() ) + createEmptyStudy(); + myVTKMgr = new VTKViewer_ViewManager( activeStudy(), desktop() ); + } + myVTKMgr->createView(); +} + /*!Sets \a theEnable for menu manager and for tool manager.*/ void STD_Application::setEditEnabled( bool theEnable ) { diff --git a/src/STD/STD_Application.h b/src/STD/STD_Application.h index 3ff6d57bc..614ffc39f 100755 --- a/src/STD/STD_Application.h +++ b/src/STD/STD_Application.h @@ -37,6 +37,8 @@ class SUIT_ToolWindow; class SUIT_Desktop; class SUIT_ViewManager; class SUIT_PopupClient; +class TableViewer_ViewManager; +class VTKViewer_ViewManager; typedef QList ViewManagerList; @@ -51,7 +53,8 @@ class STD_EXPORT STD_Application : public SUIT_Application public: enum { FileNewId, FileOpenId, FileCloseId, FileSaveId, FileSaveAsId, FileExitId, ViewWindowsId, ViewToolBarsId, ViewStatusBarId, NewWindowId, - EditCutId, EditCopyId, EditPasteId, HelpAboutId, UserID }; + EditCutId, EditCopyId, EditPasteId, HelpAboutId, + TableViewId, VTKViewId, UserID }; enum { CloseSave, CloseDiscard, CloseCancel }; @@ -121,6 +124,8 @@ public slots: virtual void onCopy(); virtual void onPaste(); + virtual void onTableView(); + virtual void onVTKView(); virtual void onViewStatusBar( bool ); @@ -168,6 +173,8 @@ private: private: bool myExitConfirm; bool myEditEnabled; + TableViewer_ViewManager* myTableMgr; + VTKViewer_ViewManager* myVTKMgr; }; #if defined WIN32 diff --git a/src/STD/resources/STD.xml b/src/STD/resources/STD.xml new file mode 100644 index 000000000..9674f0247 --- /dev/null +++ b/src/STD/resources/STD.xml @@ -0,0 +1,94 @@ + +
+ + + + + + + +
+
+ + + +
+
+ + + + + + + + + + + + + +
+
+ + + + + + + +
+
+ + + + + + + +
+
+ + + +
+
+ + + +
+
+ + +
+
+ + +
+
+ + + + + +
+
+ + + +
+
+ + + + + + + + +
+
+ + + +
+
-- 2.39.2