Salome HOME
Merge branch 'HEAD' of newgeom:newgeom.git
authorsbh <sergey.belash@opencascade.com>
Fri, 18 Apr 2014 08:55:54 +0000 (12:55 +0400)
committersbh <sergey.belash@opencascade.com>
Fri, 18 Apr 2014 08:55:54 +0000 (12:55 +0400)
eclipse.sh [changed mode: 0644->0755]
linux_env.sh
linux_run.sh [changed mode: 0644->0755]
src/PyConsole/PyConsole_Console.cxx
src/XGUI/XGUI_ViewPort.cpp
src/XGUI/XGUI_ViewPort.h
src/XGUI/XGUI_ViewWindow.cpp
src/XGUI/XGUI_ViewWindow.h
src/XGUI/XGUI_Viewer.cpp

old mode 100644 (file)
new mode 100755 (executable)
index 76b880a..de64257
@@ -10,11 +10,11 @@ mkdir -p ${ROOT_DIR}/build
 cd ${ROOT_DIR}/build
 
 CMAKE_ARGS="-D_ECLIPSE_VERSION=4.3"
-CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release"
+CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Debug"
 CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=ON"
 CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${ROOT_DIR}/install"
 CMAKE_ARGS="${CMAKE_ARGS} ${SRC_DIR}"
 
 cmake -G "Eclipse CDT4 - Unix Makefiles" ${CMAKE_ARGS}
 
-/misc/dn21/hdfeditor/sbh/devtools/eclipse-4.3.0/eclipse&
\ No newline at end of file
+/misc/dn48/newgeom/common/eclipse-4.3.0/eclipse -Dosgi.locking=none &
\ No newline at end of file
index 8bd77be37c92c8dcf63a7e4731011d3a0a04bdfc..37ae415084ff732fbadaefec7810a6e869fd3078 100644 (file)
@@ -3,7 +3,7 @@
 # Find absolute path to ROOT_DIR
 export ROOT_DIR=$(pwd)/..
 export ROOT_DIR=`cd "${ROOT_DIR}";pwd`
-export PDIR=${ROOT_DIR}/products
+export PDIR=/dn48/newgeom/common/products
 
 #------ Python ------
 export PYTHON_ROOT_DIR=${PDIR}/Python-2.7.3
old mode 100644 (file)
new mode 100755 (executable)
index 5104f9f..7e06fb1
@@ -7,4 +7,4 @@ SRC_DIR=${ROOT_DIR}/sources
 
 source ${SRC_DIR}/linux_env.sh
 
-${ROOT_DIR}/install/bin/XGUI
+${ROOT_DIR}/install/bin/GeomApp
index 04e244ed08eaad1334fed75719df2ba992c41d0c..54391474f585d3f3c57841cee5d05860284eceb3 100644 (file)
@@ -290,10 +290,10 @@ void PyConsole_Console::createActions()
   connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( selectAll() ) );
   myActions.insert( SelectAllId, a );
   
-  a = new QAction( tr( "EDIT_DUMPCOMMANDS_CMD" ), this );
-  a->setStatusTip( tr( "EDIT_DUMPCOMMANDS_CMD" ) );
-  connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( dump() ) );
-  myActions.insert( DumpCommandsId, a );
+//  a = new QAction( tr( "EDIT_DUMPCOMMANDS_CMD" ), this );
+//  a->setStatusTip( tr( "EDIT_DUMPCOMMANDS_CMD" ) );
+//  connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( dump() ) );
+//  myActions.insert( DumpCommandsId, a );
 }
 
 /*!
index f7edd5d5e297eedfa9f57f9df423408b86c420c4..9dcb2f91429e90905f8fec8daffccd3a682bb2f0 100644 (file)
@@ -11,6 +11,7 @@
 #include <QPaintEvent>
 #include <QPainter>
 #include <QFileInfo>
+#include <QApplication>
 
 #include <V3d_OrthographicView.hxx>
 #include <V3d_PerspectiveView.hxx>
@@ -295,8 +296,8 @@ bool XGUI_ViewPort::mapView(const Handle(V3d_View)& theView)
 
   if (!mapped(theView)) {
     theView->SetWindow(myWindow);
-    if (theView != activeView())
-      theView->View()->Deactivate();
+    //if (theView != activeView())
+      //theView->View()->Deactivate();
   }
 
   /* create static trihedron (16551: EDF PAL 501) */
@@ -480,7 +481,7 @@ void XGUI_ViewPort::paintEvent(QPaintEvent* theEvent)
   mapView( activeView() );
 #endif
   if (!myWindow.IsNull()) {
-    //QGuiApplication::sync();
+    QApplication::syncX();
     QRect rc = theEvent->rect();
     //if ( !myPaintersRedrawing ) {
     //activeView()->Redraw();
@@ -496,16 +497,17 @@ void XGUI_ViewPort::paintEvent(QPaintEvent* theEvent)
 }
 
 //***********************************************
-void XGUI_ViewPort::resizeEvent(QResizeEvent*)
+void XGUI_ViewPort::resizeEvent(QResizeEvent* theEvent)
 {
 #ifdef WIN32
   /* Win32 : map before first show to avoid flicker */
   if (!mapped(activeView()))
     mapView(activeView());
 #endif
-  //QGuiApplication::sync();
-  if (!activeView().IsNull())
+  QApplication::syncX();
+  if (!activeView().IsNull()) {
     activeView()->MustBeResized();
+  }
 }
 
 //***********************************************
@@ -524,7 +526,7 @@ QImage XGUI_ViewPort::dumpView(QRect theRect, bool toUpdate)
     aWidth = theRect.width();
     aHeight = theRect.height();
   }
-  //QApplication::syncX();
+  QApplication::syncX();
 
   OpenGLUtils_FrameBuffer aFrameBuffer;
   if (aFrameBuffer.init(aWidth, aHeight)) {
index 0f62915b62782e1e0e6a289b5c02509fe3feab42..cb8327d26f8bb162da3495b74d06ada727ea120d 100644 (file)
@@ -41,7 +41,7 @@ public:
   void fitRect(const QRect& rect);
   void startZoomAtPoint(int x, int y);
   void zoom(int x0, int y0, int x, int y);
-    void fitAll(bool theKeepScale = false, bool theWithZ = true, bool theUpd = true);
+  void fitAll(bool theKeepScale = false, bool theWithZ = true, bool theUpd = true);
 
   void setAdvancedZoomingEnabled(const bool theState)
   {
index 4e4e54c72543aa7df34fe79c72d7d929583ab77b..000e4b4ae31602285764dcf54194dca7809712fe 100644 (file)
@@ -81,6 +81,9 @@ const char* imageCrossCursor[] = { "32 32 3 1", ". c None", "a c #000000", "# c
 
 void ViewerToolbar::paintEvent(QPaintEvent* theEvent)
 {
+  //QApplication::syncX();
+  //printf("### ViewerToolbar::paintEvent\n");
+  //QToolBar::paintEvent(theEvent);
   // Paint background
   QPainter aPainter(this);
   QRect aRect = rect();
@@ -88,7 +91,7 @@ void ViewerToolbar::paintEvent(QPaintEvent* theEvent)
   QPoint aGlobPnt = mapToGlobal(aRect.topLeft());
   QPoint aPnt = myVPort->mapFromGlobal(aGlobPnt);
 
-  QRect aImgRect(QRect(aPnt.x(), aPnt.y() + aVPRect.height() - aRect.height(), 
+  QRect aImgRect(QRect(aPnt.x(), aPnt.y() + aVPRect.height() - aRect.height(),
                        aRect.width(), aRect.height()));
   aPainter.drawImage(aRect, myVPort->dumpView(aImgRect, false));
 
@@ -142,6 +145,7 @@ XGUI_ViewWindow::XGUI_ViewWindow(XGUI_Viewer* theViewer, V3d_TypeOfView theType)
     myClosable(true),
     myStartX(0), myStartY(0), myCurrX(0), myCurrY(0), myCurScale(0.0), myCurSketch(0),
     myDrawRect(false), myEnableDrawMode(false), myCursorIsHand(false), myEventStarted(false),
+    myIsActive(false),
     myLastState(WindowNormalState), myOperation(NOTHING)
 {
   mySelectedPoint = gp_Pnt(0., 0., 0.);
@@ -278,8 +282,8 @@ void XGUI_ViewWindow::resizeEvent(QResizeEvent* theEvent)
   QSize aWndBarSize = myWindowBar->sizeHint();
   QSize myViewBarSize = myViewBar->sizeHint();
 
-  myWindowBar->move(aSize.width() - aWndBarSize.width() - BORDER_SIZE - 4,
-  BORDER_SIZE + 2);
+  myWindowBar->setGeometry(aSize.width() - aWndBarSize.width() - BORDER_SIZE - 4, BORDER_SIZE + 2,
+      aWndBarSize.width(), aWndBarSize.height());
   int aViewBarWidth = aSize.width() - aWndBarSize.width() - myGripWgt->width() - 8;
   if (aViewBarWidth > myViewBarSize.width())
     aViewBarWidth = myViewBarSize.width();
@@ -292,21 +296,25 @@ void XGUI_ViewWindow::changeEvent(QEvent* theEvent)
 
   if (theEvent->type() == QEvent::WindowStateChange) {
     if (isMinimized()) {
-      myViewBar->hide();
-      myGripWgt->hide(); 
-      myWindowBar->hide();
-      myViewPort->hide();
-      myPicture->show();
+      if (myPicture->isHidden()) {
+        myViewBar->hide();
+        myGripWgt->hide(); 
+        myWindowBar->hide();
+        myViewPort->hide();
+        myPicture->show();
+      }
     } else {
-      myPicture->hide();
-      myViewPort->show();
+      if (myPicture->isVisible()) {
+        myPicture->hide();
+        myViewPort->show();
+      }
       if (isMaximized()) {
         myMinimizeBtn->setIcon(MinimizeIco);
         myMaximizeBtn->setIcon(RestoreIco);
       }
-      myViewBar->setVisible(isActiveWindow());
-      myWindowBar->setVisible(isActiveWindow());
-      myGripWgt->setVisible(isActiveWindow() && (!isMaximized())); 
+      myViewBar->setVisible(myIsActive);
+      myWindowBar->setVisible(myIsActive);
+      myGripWgt->setVisible(myIsActive && (!isMaximized()));
     }
   } else
     QWidget::changeEvent(theEvent);
@@ -314,18 +322,36 @@ void XGUI_ViewWindow::changeEvent(QEvent* theEvent)
 
 
 
+//****************************************************************
 void XGUI_ViewWindow::windowActivated()
 {
-  myViewBar->show();
-  myWindowBar->show();
-  myGripWgt->setVisible(!(isMaximized() || isMinimized())); 
+  myIsActive = true;
+  if (!isMinimized()) {
+    myViewBar->show();
+    myWindowBar->show();
+    myGripWgt->setVisible(!(isMaximized() || isMinimized()));
+    if (isMaximized()) {
+      myMaximizeBtn->setIcon(RestoreIco);
+    } else {
+      myMaximizeBtn->setIcon(MaximizeIco);
+    }
+  }
 }
 
+//****************************************************************
 void XGUI_ViewWindow::windowDeactivated()
 {
-  myViewBar->hide();
-  myWindowBar->hide();
-  myGripWgt->hide(); 
+  myIsActive = false;
+  if (!isMinimized()) {
+    myViewBar->hide();
+    myWindowBar->hide();
+    myGripWgt->hide(); 
+    if (isMaximized()) {
+      myMaximizeBtn->setIcon(RestoreIco);
+    } else {
+      myMaximizeBtn->setIcon(MaximizeIco);
+    }
+  }
 }
 
 
@@ -367,22 +393,23 @@ void XGUI_ViewWindow::onMinimize()
   int aW = width();
   int aH = height();
   double aR = aW / 100.;
-    int aNewH = int(aH / aR);
-    myPicture->setPixmap(aPMap.scaled(100,  aNewH));
+  int aNewH = int(aH / aR);
+  myPicture->setPixmap(aPMap.scaled(100,  aNewH));
 
-  myLastState = isMaximized() ? MaximizedState : WindowNormalState;
+  myLastState = (isMaximized() || parentWidget()->isMaximized()) ? MaximizedState : WindowNormalState;
+  //parentWidget()->showMinimized();
   showMinimized();
-    parentWidget()->setGeometry(parentWidget()->x(), parentWidget()->y(),
-                                100, aNewH);
+  parentWidget()->setGeometry(parentWidget()->x(), parentWidget()->y(), 100, aNewH);
 }
 
 //****************************************************************
 void XGUI_ViewWindow::onMaximize()
 {
-  if (isMaximized()) {
+  if (isMaximized() || parentWidget()->isMaximized()) {
     myMaximizeBtn->setIcon(MaximizeIco);
     myGripWgt->show();
     showNormal();
+    parentWidget()->showNormal();
   } else {
     myMaximizeBtn->setIcon(RestoreIco);
     myGripWgt->hide();
index 01fd18ddfb736bad43da235917fcc0bcad3c6f63..77a127e5ec1df5a7a7d214ae68610ae41694b25b 100644 (file)
@@ -269,6 +269,7 @@ private:
   bool myIsKeyFree;
   bool myEventStarted;       // set when transformation is in process 
   bool myClosable;
+  bool myIsActive;
 
   QCursor myCursor;
 
@@ -323,7 +324,9 @@ public:
   ViewerLabel(QWidget* theParent, XGUI_ViewPort* thePort)
       : QLabel(theParent), myVPort(thePort)
   {
+    setBackgroundRole(QPalette::NoRole);
     setAttribute(Qt::WA_NoSystemBackground);
+    setAttribute(Qt::WA_PaintOnScreen);
   }
 
   void repaintBackground();
index dc5faa611bf657024289bb6c0a78c500a1974751..6d207e991b56425e08d9a8e3bca975d39d2f6586 100644 (file)
@@ -388,7 +388,7 @@ void XGUI_Viewer::addView(QMdiSubWindow* theView)
             this,    SIGNAL(tryCloseView(XGUI_ViewWindow*)));
 
     connect(aWindow, SIGNAL(mousePressed(XGUI_ViewWindow*, QMouseEvent*)),
-            this,    SLOT(onMousePressed(XGUI_ViewWindow*, QMouseEvent*)));
+            this,    SIGNAL(mousePress(XGUI_ViewWindow*, QMouseEvent*)));
 
     connect(aWindow, SIGNAL(mouseReleased(XGUI_ViewWindow*, QMouseEvent*)),
             this,    SIGNAL(mouseRelease(XGUI_ViewWindow*, QMouseEvent*)));
@@ -405,8 +405,8 @@ void XGUI_Viewer::addView(QMdiSubWindow* theView)
     connect(aWindow, SIGNAL(keyReleased(XGUI_ViewWindow*, QKeyEvent*)),
             this,    SIGNAL(keyRelease(XGUI_ViewWindow*, QKeyEvent*)));
 
-    connect(aWindow, SIGNAL(contextMenuRequested( QContextMenuEvent* )),
-            this,    SLOT  (onContextMenuRequested( QContextMenuEvent* )));
+//    connect(aWindow, SIGNAL(contextMenuRequested( QContextMenuEvent* )),
+//            this,    SLOT  (onContextMenuRequested( QContextMenuEvent* )));
 
     myViews.append(theView);
 }