]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Correct compilation on Linux
authorabd <abd@opencascade.com>
Mon, 28 Apr 2008 06:18:56 +0000 (06:18 +0000)
committerabd <abd@opencascade.com>
Mon, 28 Apr 2008 06:18:56 +0000 (06:18 +0000)
adm_local/unix/config_files/check_opengl.m4
src/OCCViewer/OCCViewer_ViewWindow.h
src/PythonConsole/PythonConsole_PyInterp.cxx
src/QxGraph/QxGraph_CanvasView.cxx
src/QxGraph/QxGraph_CanvasView.h
src/SALOME_PYQT/SalomePyQt/SalomePyQt_v4.sip
src/SVTK/SVTK_InteractorStyle.cxx
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/resources/SalomeApp_msg_en.po
src/Session/SALOME_Session_Server.cxx
src/VTKViewer/VTKViewer_ViewWindow.cxx

index 8a56e0f54841b65eaedaf5ad1de9f2657ed7cdcf..a1eb48ee2ab54bd59ae81f021a7f60d31a88721a 100644 (file)
@@ -162,6 +162,40 @@ if test "x${OpenGL_libs_ok}" = "xyes" ; then
       break
     fi
   done
+
+  # workaround a problem with libGL library location
+  for idir in $dirs; do
+    if test -r "${idir}/libGLU.la"; then
+      GLU_LA_PATH="${idir}/libGLU.la"
+      GL_LA_PATH_TO_CHECK=`cat ${GLU_LA_PATH} | awk '{ for(i=1;i<NF;i++){ if(gsub("libGL.la","&",$i)>0) print $i } }'`
+      if test -z ${GL_LA_PATH_TO_CHECK} || test -r ${GL_LA_PATH_TO_CHECK}; then
+        # nothing to do
+        break
+      fi
+      for jdir in $dirs; do
+        if test -r "${jdir}/libGL.la"; then
+          GL_LA_PATH="${jdir}/libGL.la"
+          # copy the libGLU.la file and set correct libGL.la path in it
+          NEW_GLU_LA_PATH=${ROOT_BUILDDIR}
+          NEW_GLU_LA_FILE="${NEW_GLU_LA_PATH}/libGLU.la"
+          sed -e "s%${GL_LA_PATH_TO_CHECK}%${GL_LA_PATH}%" ${GLU_LA_PATH} > "${NEW_GLU_LA_FILE}"
+          chmod -f --reference=${GLU_LA_PATH} "${NEW_GLU_LA_FILE}"
+          # set a new libGLU.la path
+          GLU_LIB_PATH="-L${NEW_GLU_LA_PATH}"
+          # create a simbolic link to libGLU.so
+          for kdir in $dirs; do
+            if test -r "${kdir}/libGLU.so"; then
+              cp -fs "${kdir}/libGLU.so" "${NEW_GLU_LA_PATH}/libGLU.so"
+              break
+            fi
+          done
+          break
+        fi
+      done
+      break
+    fi
+  done
+
   LDFLAGS_old="${LDFLAGS}"
   LDFLAGS="${LDFLAGS} ${OGL_LIBS} ${GLU_LIB_PATH}"
   AC_CHECK_LIB([GLU],
@@ -193,3 +227,4 @@ AC_SUBST(OGL_LIBS)
 AC_LANG_RESTORE
 
 ])dnl
+
index 698a9f095f96a623e40a8e74c3f06e42bd1ea481..c3e7ca9f48390079725cea2cee9e05ac215daa6c 100755 (executable)
@@ -20,6 +20,7 @@
 #define OCCVIEWER_VIEWWINDOW_H
 
 #include "OCCViewer_ViewModel.h"
+#include "OCCViewer_ViewSketcher.h"
 
 #include "SUIT_ViewWindow.h"
 
@@ -30,7 +31,6 @@
 
 class SUIT_Desktop;
 class OCCViewer_ViewPort3d;
-class OCCViewer_ViewSketcher;
 
 class OCCViewer_ClippingDlg;
 class OCCViewer_SetRotationPointDlg;
index 0046f02e34be8f300443280d43b4e3a866ede53b..e540237796529b00b44dff2ee97d6238ede9ce0f 100755 (executable)
@@ -108,6 +108,16 @@ bool PythonConsole_PyInterp::initState()
    * will have the same __builtin__ module
    */
  
+  if(!builtinmodule) // PAL18041: deepcopy function don't work in Salome
+  {
+    //builtinmodule is static member of PyInterp class
+    //If it is not NULL (initialized to the builtin module of the main interpreter
+    //all the sub interpreters will have the same builtin
+    //_interp is a static member and is the main interpreter
+    //The first time we initialized it to the builtin of main interpreter
+    builtinmodule=PyDict_GetItemString(_interp->modules, "__builtin__");
+  }
+
   if(builtinmodule)
     { 
     PyObject *m = PyImport_GetModuleDict();
index be0d7dcbf7cfeacf8d2dfc47220dd281ad7f6427..e7f726b13c72f999398e13da96d7aaf0e916c3c4 100644 (file)
@@ -113,7 +113,8 @@ QxGraph_CanvasView::QxGraph_CanvasView(QxGraph_Canvas* theCanvas, QxGraph_ViewWi
   myCurrentItem(0),
   myHilightedItem(0),
   mySelectedItem(0),
-  myMovingDone(false)
+  myMovingDone(false),
+  myCenter(0,0)
 {
   printf("Construct QxGraph_CanvasView\n");
   setName("QxGraph_CanvasView");
@@ -174,6 +175,11 @@ void QxGraph_CanvasView::contentsMousePressEvent(QMouseEvent* theEvent)
       QPixmap zoomPixmap (imageZoomCursor);
       QCursor zoomCursor (zoomPixmap);
       setCursor(zoomCursor);
+
+      // the center of the view before zooming
+      int aXVCenter = viewport()->width()/2;
+      int aYVCenter = viewport()->height()/2;
+      myCenter = viewportToContents(QPoint(aXVCenter,aYVCenter));
     }
     return;
   }
@@ -213,6 +219,7 @@ void QxGraph_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent)
     scrollBy(myGlobalPoint.x() - aGlobalPoint.x(),
             myGlobalPoint.y() - aGlobalPoint.y());
     myGlobalPoint = aGlobalPoint;
+    myMovingDone = true;
     return;
   }
 
@@ -243,23 +250,41 @@ void QxGraph_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent)
 
   if ( myOperation == ZOOMVIEW )
   { // Zoom
+    QCanvasItemList aList = canvas()->allItems();
+    for (QCanvasItemList::Iterator it = aList.begin(); it != aList.end(); ++it)
+      (*it)->hide();
+
+    int aXContCenter = myCenter.x();
+    int aYContCenter = myCenter.y();
+    
     QWMatrix m = worldMatrix();
 
     double dx = aGlobalPoint.x() - myGlobalPoint.x();
     double s = 1. + fabs(dx)*( (m.m11() < 1) ? m.m11() : 1. )/70.;
     if (dx < 0) s = 1./s;
     
+    int aXContCenterScaled = aXContCenter*s;
+    int aYContCenterScaled = aYContCenter*s;
+    
     m.scale(s, s);
     setWorldMatrix(m);
 
+    center(aXContCenterScaled,aYContCenterScaled);
+
+    myCenter.setX(aXContCenterScaled);
+    myCenter.setY(aYContCenterScaled);
+
     // remember the canvas view's current transformation matrix in all canvas items
-    QCanvasItemList aList = canvas()->allItems();
+    aList = canvas()->allItems();
     for (QCanvasItemList::Iterator it = aList.begin(); it != aList.end(); ++it) {
       QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
       if ( anActItem ) anActItem->setTMatrix(m);
+      (*it)->show();
     }
        
     myGlobalPoint = aGlobalPoint;
+    myMovingDone = true;
+
     return;
   }
 
@@ -429,6 +454,8 @@ void QxGraph_CanvasView::contentsMouseReleaseEvent(QMouseEvent* theEvent)
     myOperation = NOTHING;
     viewport()->setMouseTracking(true);
     setCursor(myCursor);
+
+    emit viewOperationDone();
   }
 
   if ( myOperation == PANGLOBAL )
@@ -436,6 +463,8 @@ void QxGraph_CanvasView::contentsMouseReleaseEvent(QMouseEvent* theEvent)
     myOperation = NOTHING;
     center( theEvent->x(), theEvent->y() );
     setCursor(myCursor);
+
+    emit viewOperationDone();
   }
 
   if ( myOperation == WINDOWFIT )
@@ -477,6 +506,8 @@ void QxGraph_CanvasView::contentsMouseReleaseEvent(QMouseEvent* theEvent)
     
     viewport()->setMouseTracking(true);
     setCursor(myCursor);
+
+    emit viewOperationDone();
   }
 
   if ( myOperation == ZOOMVIEW )
@@ -484,6 +515,8 @@ void QxGraph_CanvasView::contentsMouseReleaseEvent(QMouseEvent* theEvent)
     myOperation = NOTHING;
     viewport()->setMouseTracking(true);
     setCursor(myCursor);
+
+    emit viewOperationDone();
   }
 
   if ( theEvent->button() == RightButton )
@@ -618,6 +651,8 @@ void QxGraph_CanvasView::activateFitAll()
   
   canvas()->update();
   //myOperation = NOTHING;
+
+  emit viewOperationDone();
 }
 
 void QxGraph_CanvasView::activateFitRect()
@@ -672,6 +707,8 @@ void QxGraph_CanvasView::activateReset()
   }
 
   //myOperation = NOTHING;
+
+  emit viewOperationDone();
 }
 
 void QxGraph_CanvasView::onTimeout() 
index f14e1277e433be85654812520303bd904b829b80..6aa5c3b799068f920cc3efe8aff0baec51c9df35 100644 (file)
@@ -58,6 +58,9 @@ class QXGRAPH_EXPORT QxGraph_CanvasView : public QCanvasView {
   void setSelectedItem( QxGraph_ActiveItem* theItem );
   QxGraph_ActiveItem* getSelectedItem() const;
 
+ signals:
+  void viewOperationDone();
+
  public slots:
   void onTimeout();
    //void changeBackground();
@@ -76,6 +79,7 @@ class QXGRAPH_EXPORT QxGraph_CanvasView : public QCanvasView {
   QPoint            myPoint;
   QPoint            myGlobalPoint;
   bool              myMovingDone;
+  QPoint            myCenter;
   
   // for control toolbar actions
   OperationType     myOperation;
index ba6700477c23f0ed9c93a94dd9a6f70d9673c253..1239326a37975a341295df8166f8eeebccf1073d 100644 (file)
@@ -10,9 +10,9 @@
 
 %Import qtmod.sip
 
-//%ExportedHeaderCode
-//#include <SalomePyQt.h>
-//%End
+%ExportedHeaderCode
+#include <SalomePyQt.h>
+%End
 
 class SALOME_Selection : QObject
 {
index 37756f98d28de487c0c9f6138fe4ae3ec28203ff..1f662ca7b49c96f8c3a96011dfbb931b31968f3a 100644 (file)
@@ -1207,7 +1207,7 @@ SVTK_InteractorStyle
 ::onCursorMove(QPoint mousePos) 
 {
   // processing highlighting
-  SVTK_SelectionEvent* aSelectionEvent = GetSelectionEventFlipY();
+   SVTK_SelectionEvent* aSelectionEvent = GetSelectionEventFlipY();
   this->FindPokedRenderer(aSelectionEvent->myX,aSelectionEvent->myY);
 
   bool anIsChanged = false;
@@ -1218,13 +1218,7 @@ SVTK_InteractorStyle
   {
     myHighlightRotationPointActor->SetVisibility( false );
 
-    SALOME_Actor *anCurrActor;
-    if ( anActor ) anCurrActor = anActor;
-    else if ( myLastPreHighlitedActor.GetPointer() 
-             && 
-             myLastPreHighlitedActor.GetPointer() != anActor )
-      anCurrActor = myLastPreHighlitedActor.GetPointer();
-    if ( anCurrActor )
+    if ( anActor )
     {
       myPointPicker->Pick( aSelectionEvent->myX, aSelectionEvent->myY, 0.0, GetCurrentRenderer() );
       int aVtkId = myPointPicker->GetPointId();
index 771c0d7deeb2f9174d984676938faa873d1915c9..802d7d7b0fd5ea10fc7d4ff3161750f9ff73592f 100644 (file)
@@ -702,8 +702,27 @@ void SalomeApp_Application::onDumpStudy( )
   fd->setFilters( aFilters );
   fd->myPublishChk->setChecked( true );
   fd->mySaveGUIChk->setChecked( true );
-  fd->exec();
-  QString aFileName = fd->selectedFile();
+  QString aFileName;
+  while (1) {
+    fd->exec();
+    fd->raise();
+    aFileName = fd->selectedFile();
+    if (!aFileName.isEmpty()) {
+      if ( (aFileName.find('-', 0) == -1) && (aFileName.find('!', 0) == -1) && (aFileName.find('?', 0) == -1) &&
+          (aFileName.find('#', 0) == -1) && (aFileName.find('*', 0) == -1) && (aFileName.find('&', 0) == -1)) {
+       break;
+      }
+      else {
+      SUIT_MessageBox::warn1 ( desktop(),
+                              QObject::tr("WRN_WARNING"),
+                              tr("WRN_FILE_NAME_BAD"),
+                              QObject::tr("BUT_OK") );
+      }
+    }
+    else {
+      break;
+    }
+  }
   bool toPublish = fd->myPublishChk->isChecked();
   bool toSaveGUI = fd->mySaveGUIChk->isChecked();
   delete fd;
index 40f7e95f1f6b3e390783320e4e0298d21c443d1f..d6a6d6d90d3d8d6fa40d414aa2b4d6a329cdd75c 100644 (file)
@@ -221,6 +221,9 @@ msgstr "Publish in study"
 msgid "SalomeApp_Application::WRN_DUMP_STUDY_FAILED"
 msgstr "Dump study failed"
 
+msgid "SalomeApp_Application::WRN_FILE_NAME_BAD"
+msgstr "Please enter correct file name"
+
 msgid "SAVE_POINT_OBJECT_TOOLTIP"
 msgstr "Saved GUI state: %1"
 
index 37823d43aef08f82dd7520e219d5fe7b4e3a9ab7..daa2dbb18e7e80014e75aeaac5c071a6afae4993 100755 (executable)
@@ -348,7 +348,8 @@ void killOmniNames()
       cmd += QString("[ m.update(i) for i in pids ]; ");
       cmd += QString("pids=filter(lambda a: 'notifd' in m[a], m.keys()); ");
       cmd += QString("[ os.kill(pid, 9) for pid in pids ]; ");
-      cmd = QString("python -c \"%1\"").arg(cmd);
+      cmd += QString("os.remove(filedict); ");
+      cmd  = QString("python -c \"%1\" > /dev/null").arg(cmd);
       system( cmd.latin1() );
     }
 
@@ -687,10 +688,8 @@ int main( int argc, char **argv )
   // unlock Session mutex
   _SessionMutex.unlock();
   
-  if ( shutdown ) {
+  if ( shutdown )
     shutdownServers( _NS );
-    killOmniNames();
-  }
 
   if ( myServerLauncher )
     myServerLauncher->KillAll(); // kill embedded servers
@@ -709,11 +708,17 @@ int main( int argc, char **argv )
     }
   catch(...) 
     {
-      std::cerr << "Caught unexpected exception on destroy : ignored !!" << std::endl;
+      //////////////////////////////////////////////////////////////
+      // VSR: silently skip exception:
+      // CORBA.BAD_INV_ORDER.BAD_INV_ORDER_ORBHasShutdown 
+      // exception is raised when orb->destroy() is called and
+      // cpp continer is launched in the embedded mode
+      //////////////////////////////////////////////////////////////
+      // std::cerr << "Caught unexpected exception on destroy : ignored !!" << std::endl;
     }
 
-  //  if ( shutdown )
-  //    killOmniNames();
+  if ( shutdown )
+    killOmniNames();
 
   return result;
 }
index f28c446b1f0a0e5f5b3f50cf980dc686dc223a81..e885ed8ccf16b4de302a36a6bde6ec5312d47d93 100755 (executable)
@@ -455,8 +455,8 @@ void VTKViewer_ViewWindow::onAdjustTrihedron(){
                      (bnd[5]-bnd[4])*(bnd[5]-bnd[4]));
     }else{
       aLength = bnd[1]-bnd[0];
-      aLength = QMAX((bnd[3]-bnd[2]),aLength);
-      aLength = QMAX((bnd[5]-bnd[4]),aLength);
+      aLength = std::max((bnd[3]-bnd[2]),aLength);
+      aLength = std::max((bnd[5]-bnd[4]),aLength);
     }
    
     static vtkFloatingPointType aSizeInPercents = 105;