]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Temporarily creation VTKViewer and TableViewer.
authornds <nds@opencascade.com>
Fri, 21 Sep 2007 12:46:42 +0000 (12:46 +0000)
committernds <nds@opencascade.com>
Fri, 21 Sep 2007 12:46:42 +0000 (12:46 +0000)
src/STD/STD.pro
src/STD/STD_Application.cxx
src/STD/STD_Application.h
src/STD/resources/STD.xml [new file with mode: 0644]

index ab2ad477680349853fefe8e067d5c5830033e467..f54e7d1201be6a63cf71dab973a37fe9cc581641 100644 (file)
@@ -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
index 35b80fc3943a1123496b56f71fbd27b0cab91e88..b39be0c843da2b5b2fb3b2e66ebe8f3d49b1efc7 100755 (executable)
 #include <SUIT_ViewManager.h>
 #include <SUIT_ResourceMgr.h>
 
+#include <TableViewer_ViewModel.h>
+#include <TableViewer_ViewManager.h>
+
+#include <VTKViewer_ViewModel.h>
+#include <VTKViewer_ViewManager.h>
+
 #include <QtxDockAction.h>
 #include <QtxActionMenuMgr.h>
 #include <QtxActionToolMgr.h>
@@ -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 )
 {
index 3ff6d57bc2cce125a937d638601dcf51a6ef5a13..614ffc39f2d4b5d7e026841008866970ba4f9ff9 100755 (executable)
@@ -37,6 +37,8 @@ class SUIT_ToolWindow;
 class SUIT_Desktop;
 class SUIT_ViewManager;
 class SUIT_PopupClient;
+class TableViewer_ViewManager;
+class VTKViewer_ViewManager;
 
 typedef QList<SUIT_ViewManager*> 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 (file)
index 0000000..9674f02
--- /dev/null
@@ -0,0 +1,94 @@
+<document>
+  <section name="launch">
+    <!-- SALOME launching parameters -->
+    <parameter name="gui"        value="yes"/>
+    <parameter name="splash"     value="yes"/>
+    <parameter name="file"       value="no"/>
+    <parameter name="key"        value="no"/>
+    <parameter name="interp"     value="no"/>
+    <parameter name="modules"    value="LIGHT"/>
+  </section>
+  <section name="language">
+    <!-- Language settings (resource manager)-->
+    <parameter name="language"    value="en"/>
+    <parameter name="translators" value="%P_msg_%L.qm|%P_icons.qm|%P_images.qm"/>
+  </section>
+  <section name="splash" >
+    <!-- Splash screen settings -->
+    <parameter name="image"             value="${GUI_ROOT_DIR}/share/salome/resources/gui/icon_about.png" />
+    <parameter name="constant_info"     value="%A [ %V ]" />
+    <parameter name="text_colors"       value="#5A81BF|#20408F" />
+    <parameter name="hide_on_click"     value="no" />
+    <parameter name="margin"            value="10" />
+    <parameter name="progress_width"    value="20" />
+    <parameter name="progress_flags"    value="bottom,left_to_right" />
+    <parameter name="opacity"           value="0.70" />
+    <parameter name="font"              value="Helvetica,12,bold" />
+    <parameter name="alignment"         value="top,left" />
+    <parameter name="progress_gradient" value="linear|0.3|0.0|1.0|1.0|reflect|0.0|red|0.2|blue|0.5|yellow|0.6|black|1.0|white" />
+    <parameter name="progress_colors"   value="#20408F|#5A81BF|vertical" />
+  </section>
+  <section name="resources">
+    <!-- Resource directories (resource manager)-->
+    <parameter name="SUIT"         value="${GUI_ROOT_DIR}/resources"/>
+    <parameter name="STD"          value="${GUI_ROOT_DIR}/resources"/>
+    <parameter name="Plot2d"       value="${GUI_ROOT_DIR}/resources"/>
+    <parameter name="TableViewer"  value="${GUI_ROOT_DIR}/resources"/>
+    <parameter name="VTKViewer"    value="${GUI_ROOT_DIR}/resources"/>
+    <parameter name="OB"           value="${GUI_ROOT_DIR}/resources"/>
+  </section>
+  <section name="desktop" >
+    <!-- Default GUI desktop state, position, size -->
+    <parameter name="geometry"  value="(800%)x(800%) (+400%) (+400%) :(full)"/>
+    <parameter name="state"  value="normal"/>
+    <parameter name="pos_x"  value="center"/>
+    <parameter name="pos_y"  value="center"/>
+    <parameter name="width"  value="800"/>
+    <parameter name="height" value="600"/>
+  </section>
+  <section name="LIGHT">
+    <!-- LIGHT module settings -->
+    <parameter name="name"       value="Light"/>
+    <parameter name="icon"       value="LIGHT.png"/>
+  </section>
+  <section name="PyConsole">
+    <!-- Python console preferences -->
+    <parameter name="font"                value="Helvetic,12" />
+    <parameter name="additional_families" value="Helvetic;Helvetica;Helvetica[Adobe];Times;Times[Adobe];Sans Serif;Serif;Monospace;Lucida"/>
+  </section>
+  <section name="FileDlg">
+    <!-- "Open/Save File" dialog box preferences-->
+    <parameter name="QuickDirList" value=""/>
+  </section>
+  <section name="Study">
+    <!-- General study settings -->
+    <parameter name="store_positions" value="true" />
+  </section>
+  <section name="OCCViewer" >
+    <!-- OCC viewer preferences -->
+    <parameter name="background"     value="35, 136, 145" />
+    <parameter name="iso_number_u"   value="1" />
+    <parameter name="iso_number_v"   value="1" />
+    <parameter name="trihedron_size" value="100" />
+ </section>
+ <section name="VTKViewer" >
+    <!-- OCC viewer preferences -->
+    <parameter name="background"     value="0, 0, 0"/>
+    <parameter name="trihedron_size" value="100" />
+ </section>
+ <section name="Plot2d" >
+    <!-- Plot2d viewer preferences -->
+    <parameter name="Background"   value="255, 255, 255" />
+    <parameter name="CurveType"    value="1" />
+    <parameter name="HorScaleMode" value="0" />
+    <parameter name="LegendPos"    value="1" />
+    <parameter name="MarkerSize"   value="9" />
+    <parameter name="ShowLegend"   value="true" />
+    <parameter name="VerScaleMode" value="0" />
+  </section>
+  <section name="SUPERVGraph" >
+    <!-- Supervision viewer preferences -->
+    <parameter name="Background" value="144, 208, 211" />
+    <parameter name="Title"      value="63, 213, 255"  />
+  </section>
+</document>