]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Added reset command and removed extra icons
authorvsv <vitaly.smetannikov@opencascade.com>
Tue, 1 Apr 2014 08:51:53 +0000 (12:51 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Tue, 1 Apr 2014 08:51:53 +0000 (12:51 +0400)
24 files changed:
src/XGUI/XGUI_ViewPort.cpp
src/XGUI/XGUI_ViewPort.h
src/XGUI/XGUI_ViewWindow.cpp
src/XGUI/XGUI_ViewWindow.h
src/XGUI/XGUI_msg_en.ts
src/XGUI/XGUI_pictures.qrc
src/XGUI/pictures/occ_view_ambient.png [deleted file]
src/XGUI/pictures/occ_view_anticlockwise.png [deleted file]
src/XGUI/pictures/occ_view_clipping.png [deleted file]
src/XGUI/pictures/occ_view_clipping_pressed.png [deleted file]
src/XGUI/pictures/occ_view_clockwise.png [deleted file]
src/XGUI/pictures/occ_view_graduated_axes.png [deleted file]
src/XGUI/pictures/occ_view_maximized.png [deleted file]
src/XGUI/pictures/occ_view_minimized.png [deleted file]
src/XGUI/pictures/occ_view_preselection.png [deleted file]
src/XGUI/pictures/occ_view_presets.png [deleted file]
src/XGUI/pictures/occ_view_return_3d_view.png [deleted file]
src/XGUI/pictures/occ_view_rotation_point.png [deleted file]
src/XGUI/pictures/occ_view_scaling.png [deleted file]
src/XGUI/pictures/occ_view_selection.png [deleted file]
src/XGUI/pictures/occ_view_shoot.png [deleted file]
src/XGUI/pictures/occ_view_style_switch.png [deleted file]
src/XGUI/pictures/occ_view_triedre.png [deleted file]
src/XGUI/pictures/occ_view_zooming_style_switch.png [deleted file]

index 2202683d58d01ceac9b7d94707e96723984f173d..c7d5e3208bc991061402cdbfffae59b7ee0eda8f 100644 (file)
@@ -741,3 +741,41 @@ void XGUI_ViewPort::fitAll(bool theKeepScale, bool theWithZ, bool theUpd)
   activeView()->SetZSize(0.);
   emit vpTransformed( );
 }
+
+void XGUI_ViewPort::syncronizeWith( const XGUI_ViewPort* ref )
+{
+  Handle(V3d_View) refView = ref->getView();
+  Handle(V3d_View) tgtView = getView();
+
+  /*  The following params are copied:
+      - view type( ortho/persp )
+      - position of view point
+      - orientation of high point
+      - position of the eye
+      - projection vector
+      - view center ( 2D )
+      - view twist
+      - view scale
+  */
+
+  /* we'll update after setting all params */
+  tgtView->SetImmediateUpdate( Standard_False );
+
+  /* perspective */
+  if ( refView->Type() == V3d_PERSPECTIVE )
+    tgtView->SetFocale( refView->Focale() );
+
+  /* copy params */
+  Standard_Real x, y, z;
+  refView->At( x, y, z ); tgtView->SetAt( x, y, z );
+  refView->Up( x, y, z ); tgtView->SetUp( x, y, z );
+  refView->Eye( x, y, z ); tgtView->SetEye( x, y, z );
+  refView->Proj( x, y, z ); tgtView->SetProj( x, y, z );
+  refView->Center( x, y ); tgtView->SetCenter( x, y );
+  tgtView->SetScale( refView->Scale() );
+  tgtView->SetTwist( refView->Twist() );
+
+  /* update */
+  tgtView->Update();
+  tgtView->SetImmediateUpdate( Standard_True );
+}
index ccffe4f1a3f151059586973994053b23c490d751..5d73031a1605825dceac5624a8f84ba057fd6f1a 100644 (file)
@@ -55,8 +55,11 @@ public:
   {
     return myBackground;
   }
+
   void setBackground(const XGUI_ViewBackground& bgData);
 
+  void syncronizeWith( const XGUI_ViewPort* ref );
+
 signals:
   void vpChangeBackground(const XGUI_ViewBackground&);
   void vpClosed();
index 74356cac6f0747c60d6ceb97fdb90e31ee86798b..db7283557d14b7444234c479a3db52a40cccc887 100644 (file)
@@ -13,7 +13,7 @@
 #include <QMdiArea>
 #include <QMdiSubWindow>
 #include <QPainter>
-//#include <QTime>
+#include <QTimer>
 #include <QFileDialog>
 
 #include <TopoDS_Shape.hxx>
@@ -78,33 +78,40 @@ const char* imageCrossCursor[] = { "32 32 3 1", ". c None", "a c #000000", "# c
     "................................", "................................" };
 
 //**************************************************************************
-void ViewerToolbar::paintEvent(QPaintEvent* theEvent)
+void ViewerToolbar::repaintBackground()
 {
-  //QTime aTime;
-  //aTime.start();
   QRect aRect = rect();
   QRect aVPRect = myVPort->rect();
   QPoint aGlobPnt = mapToGlobal(aRect.topLeft());
   QPoint aPnt = myVPort->mapFromGlobal(aGlobPnt);
 
-  QRect aImgRect(
-      QRect(aPnt.x(), aPnt.y() + aVPRect.height() - aRect.height(), aRect.width(), aRect.height()));
+  QRect aImgRect(QRect(aPnt.x(), aPnt.y() + aVPRect.height() - aRect.height(), 
+                       aRect.width(), aRect.height()));
   QPainter(this).drawImage(aRect, myVPort->dumpView(aImgRect, false));
-  //QString aMsg = QString("### Painted in %1").arg(aTime.elapsed());
-  //qDebug(qPrintable(aMsg));
+}
+
+void ViewerToolbar::paintEvent(QPaintEvent* theEvent)
+{
+  repaintBackground();
+  QToolBar::paintEvent(theEvent);
 }
 
 //**************************************************************************
-void ViewerLabel::paintEvent(QPaintEvent* theEvent)
+void ViewerLabel::repaintBackground()
 {
   QRect aRect = rect();
   QRect aVPRect = myVPort->rect();
   QPoint aGlobPnt = mapToGlobal(aRect.topLeft());
   QPoint aPnt = myVPort->mapFromGlobal(aGlobPnt);
 
-  QRect aImgRect(
-      QRect(aPnt.x(), aPnt.y() + aVPRect.height() - aRect.height(), aRect.width(), aRect.height()));
+  QRect aImgRect(QRect(aPnt.x(), aPnt.y() + aVPRect.height() - aRect.height(), 
+                 aRect.width(), aRect.height()));
   QPainter(this).drawImage(aRect, myVPort->dumpView(aImgRect, false));
+}
+
+void ViewerLabel::paintEvent(QPaintEvent* theEvent)
+{
+  repaintBackground();
   QLabel::paintEvent(theEvent);
 }
 
@@ -153,79 +160,75 @@ XGUI_ViewWindow::XGUI_ViewWindow(XGUI_Viewer* theViewer, V3d_TypeOfView theType)
   myGripWgt->setGeometry(BORDER_SIZE + 2, BORDER_SIZE + 2, 19, 32);
   myGripWgt->setMouseTracking(true);
   myGripWgt->installEventFilter(this);
-  connect(myViewPort, SIGNAL(vpTransformed()), myGripWgt, SLOT(update()));
-  connect(myViewPort, SIGNAL(vpUpdated()), myGripWgt, SLOT(update()));
 
     // Create Viewer management buttons
   myViewBar = new ViewerToolbar(this, myViewPort);
 
   QAction* aBtn;
 
-    // Dump view
-    aBtn = new QAction(QIcon(":pictures/occ_view_camera_dump.png"), tr("DUMP_VIEW"), myViewBar);
-    connect(aBtn, SIGNAL(triggered()), SLOT(dumpView()));
-    myViewBar->addAction(aBtn);
-    // Fit all
-    aBtn = new QAction(QIcon(":pictures/occ_view_fitall.png"), tr("FIT_ALL"), myViewBar);
-    connect(aBtn, SIGNAL(triggered()), SLOT(fitAll()));
-    myViewBar->addAction(aBtn);
-    // Fit area
-    aBtn = new QAction(QIcon(":pictures/occ_view_fitarea.png"), tr("FIT_AREA"), myViewBar);
-    connect(aBtn, SIGNAL(triggered()), SLOT(activateWindowFit()));
-    myViewBar->addAction(aBtn);
-    // Zoom
-    aBtn = new QAction(QIcon(":pictures/occ_view_zoom.png"), tr("ZOOM_VIEW"), myViewBar);
-    connect(aBtn, SIGNAL(triggered()), SLOT(activateZoom()));
-    myViewBar->addAction(aBtn);
-    // Pan
-    aBtn = new QAction(QIcon(":pictures/occ_view_pan.png"), tr("PAN_VIEW"), myViewBar);
-    connect(aBtn, SIGNAL(triggered()), SLOT(activatePanning()));
-    myViewBar->addAction(aBtn);
-    // Global Panning
-    aBtn = new QAction(QIcon(":pictures/occ_view_glpan.png"), tr("GLOB_PAN_VIEW"), myViewBar);
-    connect(aBtn, SIGNAL(triggered()), SLOT(activateGlobalPanning()));
-    myViewBar->addAction(aBtn);
-    // Rotation
-    aBtn = new QAction(QIcon(":pictures/occ_view_rotate.png"), tr("ROTATE_VIEW"), myViewBar);
-    connect(aBtn, SIGNAL(triggered()), SLOT(activateRotation()));
-    myViewBar->addAction(aBtn);
-    // Front view
-    aBtn = new QAction(QIcon(":pictures/occ_view_front.png"), tr("FRONT_VIEW"), myViewBar);
-    connect(aBtn, SIGNAL(triggered()), SLOT(frontView()));
-    myViewBar->addAction(aBtn);
-    // Back view
-    aBtn = new QAction(QIcon(":pictures/occ_view_back.png"), tr("BACK_VIEW"), myViewBar);
-    connect(aBtn, SIGNAL(triggered()), SLOT(backView()));
-    myViewBar->addAction(aBtn);
-    // Top view
-    aBtn = new QAction(QIcon(":pictures/occ_view_top.png"), tr("TOP_VIEW"), myViewBar);
-    connect(aBtn, SIGNAL(triggered()), SLOT(topView()));
-    myViewBar->addAction(aBtn);
-    // Bottom view
-    aBtn = new QAction(QIcon(":pictures/occ_view_bottom.png"), tr("BOTTOM_VIEW"), myViewBar);
-    connect(aBtn, SIGNAL(triggered()), SLOT(bottomView()));
-    myViewBar->addAction(aBtn);
-    // Left view
-    aBtn = new QAction(QIcon(":pictures/occ_view_left.png"), tr("LEFT_VIEW"), myViewBar);
-    connect(aBtn, SIGNAL(triggered()), SLOT(leftView()));
-    myViewBar->addAction(aBtn);
-    // Right view
-    aBtn = new QAction(QIcon(":pictures/occ_view_right.png"), tr("RIGHT_VIEW"), myViewBar);
-    connect(aBtn, SIGNAL(triggered()), SLOT(rightView()));
-    myViewBar->addAction(aBtn);
-    // Clone view
-    aBtn = new QAction(QIcon(":pictures/occ_view_clone.png"), tr("CLONE_VIEW"), myViewBar);
-    connect(aBtn, SIGNAL(triggered()), SLOT(cloneView()));
-    myViewBar->addAction(aBtn);
-
-    //Support copy of background on updating of viewer
-  connect(myViewPort, SIGNAL(vpTransformed()), myViewBar, SLOT(update()));
-  connect(myViewPort, SIGNAL(vpUpdated()), myViewBar, SLOT(update()));
+  // Dump view
+  aBtn = new QAction(QIcon(":pictures/occ_view_camera_dump.png"), tr("DUMP_VIEW"), myViewBar);
+  connect(aBtn, SIGNAL(triggered()), SLOT(dumpView()));
+  myViewBar->addAction(aBtn);
+  // Fit all
+  aBtn = new QAction(QIcon(":pictures/occ_view_fitall.png"), tr("FIT_ALL"), myViewBar);
+  connect(aBtn, SIGNAL(triggered()), SLOT(fitAll()));
+  myViewBar->addAction(aBtn);
+  // Fit area
+  aBtn = new QAction(QIcon(":pictures/occ_view_fitarea.png"), tr("FIT_AREA"), myViewBar);
+  connect(aBtn, SIGNAL(triggered()), SLOT(activateWindowFit()));
+  myViewBar->addAction(aBtn);
+  // Zoom
+  aBtn = new QAction(QIcon(":pictures/occ_view_zoom.png"), tr("ZOOM_VIEW"), myViewBar);
+  connect(aBtn, SIGNAL(triggered()), SLOT(activateZoom()));
+  myViewBar->addAction(aBtn);
+  // Pan
+  aBtn = new QAction(QIcon(":pictures/occ_view_pan.png"), tr("PAN_VIEW"), myViewBar);
+  connect(aBtn, SIGNAL(triggered()), SLOT(activatePanning()));
+  myViewBar->addAction(aBtn);
+  // Global Panning
+  aBtn = new QAction(QIcon(":pictures/occ_view_glpan.png"), tr("GLOB_PAN_VIEW"), myViewBar);
+  connect(aBtn, SIGNAL(triggered()), SLOT(activateGlobalPanning()));
+  myViewBar->addAction(aBtn);
+  // Rotation
+  aBtn = new QAction(QIcon(":pictures/occ_view_rotate.png"), tr("ROTATE_VIEW"), myViewBar);
+  connect(aBtn, SIGNAL(triggered()), SLOT(activateRotation()));
+  myViewBar->addAction(aBtn);
+  // Reset
+  aBtn = new QAction(QIcon(":pictures/occ_view_reset.png"), tr("RESET_VIEW"), myViewBar);
+  connect(aBtn, SIGNAL(triggered()), SLOT(reset()));
+  myViewBar->addAction(aBtn);
+  // Front view
+  aBtn = new QAction(QIcon(":pictures/occ_view_front.png"), tr("FRONT_VIEW"), myViewBar);
+  connect(aBtn, SIGNAL(triggered()), SLOT(frontView()));
+  myViewBar->addAction(aBtn);
+  // Back view
+  aBtn = new QAction(QIcon(":pictures/occ_view_back.png"), tr("BACK_VIEW"), myViewBar);
+  connect(aBtn, SIGNAL(triggered()), SLOT(backView()));
+  myViewBar->addAction(aBtn);
+  // Top view
+  aBtn = new QAction(QIcon(":pictures/occ_view_top.png"), tr("TOP_VIEW"), myViewBar);
+  connect(aBtn, SIGNAL(triggered()), SLOT(topView()));
+  myViewBar->addAction(aBtn);
+  // Bottom view
+  aBtn = new QAction(QIcon(":pictures/occ_view_bottom.png"), tr("BOTTOM_VIEW"), myViewBar);
+  connect(aBtn, SIGNAL(triggered()), SLOT(bottomView()));
+  myViewBar->addAction(aBtn);
+  // Left view
+  aBtn = new QAction(QIcon(":pictures/occ_view_left.png"), tr("LEFT_VIEW"), myViewBar);
+  connect(aBtn, SIGNAL(triggered()), SLOT(leftView()));
+  myViewBar->addAction(aBtn);
+  // Right view
+  aBtn = new QAction(QIcon(":pictures/occ_view_right.png"), tr("RIGHT_VIEW"), myViewBar);
+  connect(aBtn, SIGNAL(triggered()), SLOT(rightView()));
+  myViewBar->addAction(aBtn);
+  // Clone view
+  aBtn = new QAction(QIcon(":pictures/occ_view_clone.png"), tr("CLONE_VIEW"), myViewBar);
+  connect(aBtn, SIGNAL(triggered()), SLOT(cloneView()));
+  myViewBar->addAction(aBtn);
 
     // Create Window management buttons
   myWindowBar = new ViewerToolbar(this, myViewPort);
-  connect(myViewPort, SIGNAL(vpTransformed()), myWindowBar, SLOT(update()));
-  connect(myViewPort, SIGNAL(vpUpdated()), myWindowBar, SLOT(update()));
 
   myMinimizeBtn = new QAction(myWindowBar);
   myMinimizeBtn->setIcon(MinimizeIco);
@@ -245,6 +248,13 @@ XGUI_ViewWindow::XGUI_ViewWindow(XGUI_Viewer* theViewer, V3d_TypeOfView theType)
   myViewBar->hide();
   myWindowBar->hide();
   myGripWgt->hide();
+
+  //Support copy of background on updating of viewer
+  connect(myViewPort, SIGNAL(vpTransformed()), this, SLOT(updateToolBar()));
+  connect(myViewPort, SIGNAL(vpUpdated()), this, SLOT(updateToolBar()));
+  connect(this, SIGNAL(vpTransformationFinished(XGUI_ViewWindow::OperationType)), 
+          this, SLOT(updateToolBar()));
+
 }
 
 //****************************************************************
@@ -294,13 +304,13 @@ void XGUI_ViewWindow::changeEvent(QEvent* theEvent)
 //****************************************************************
 void XGUI_ViewWindow::onClose()
 {
-    if (parentWidget()) {
-        emit tryClosing(this);
-        if (closable()) {
-            emit closed(static_cast<QMdiSubWindow*>(parentWidget()));
-            parentWidget()->close();
-        }
+  if (parentWidget()) {
+    emit tryClosing(this);
+    if (closable()) {
+      emit closed(static_cast<QMdiSubWindow*>(parentWidget()));
+      parentWidget()->close();
     }
+  }
 }
 
 //****************************************************************
@@ -308,7 +318,7 @@ void XGUI_ViewWindow::enterEvent(QEvent* theEvent)
 {
   if (!isMinimized()) {
     myViewBar->show();
-        myWindowBar->show();
+    myWindowBar->show();
     if (!isMaximized())
       myGripWgt->show();
   }
@@ -447,8 +457,9 @@ bool XGUI_ViewWindow::eventFilter(QObject *theObj, QEvent *theEvent)
     if (processWindowControls(theObj, theEvent))
       return true;
   } else if (theObj == myViewPort) {
-    if (processViewPort(theEvent))
+    if (processViewPort(theEvent)) {
       return true;
+    }
   }
   return QFrame::eventFilter(theObj, theEvent);
 }
@@ -928,41 +939,42 @@ void XGUI_ViewWindow::setBackground(const XGUI_ViewBackground& theBackground)
 void XGUI_ViewWindow::cloneView()
 {
   QMdiSubWindow* vw = myViewer->createView();
-  //vw->show();
+  XGUI_ViewWindow* aNewWnd = static_cast<XGUI_ViewWindow*>(vw->widget());
+  aNewWnd->viewPort()->syncronizeWith(myViewPort);
   emit viewCloned( vw );
 }
 
 void XGUI_ViewWindow::dumpView()
 {
-    QString aFilter(tr("OCC_IMAGE_FILES"));
-    QString aSelectedFilter;
-    QString aFileName = QFileDialog::getSaveFileName(this, "Save picture", QString(), aFilter, &aSelectedFilter);
-    if (!aFileName.isNull()) {
-        QApplication::setOverrideCursor( Qt::WaitCursor );
-        QImage aPicture = myViewPort->dumpView();
-
-        QString aFmt = extension(aFileName).toUpper();
-        if( aFmt.isEmpty() )
-            aFmt = QString( "BMP" ); // default format
-        else if( aFmt == "JPG" )
-            aFmt = "JPEG";
-          
-        Handle(Visual3d_View) a3dView = myViewPort->getView()->View();
-        if (aFmt == "PS")
-            a3dView->Export(strdup(qPrintable(aFileName)), Graphic3d_EF_PostScript);
-        else if (aFmt == "EPS")
-            a3dView->Export(strdup(qPrintable(aFileName)), Graphic3d_EF_EnhPostScript);
-        else
-            aPicture.save( aFileName, aFmt.toLatin1() );
-        QApplication::restoreOverrideCursor();
-    }
+  QString aFilter(tr("OCC_IMAGE_FILES"));
+  QString aSelectedFilter;
+  QString aFileName = QFileDialog::getSaveFileName(this, "Save picture", QString(), aFilter, &aSelectedFilter);
+  if (!aFileName.isNull()) {
+    QApplication::setOverrideCursor( Qt::WaitCursor );
+    QImage aPicture = myViewPort->dumpView();
+
+    QString aFmt = extension(aFileName).toUpper();
+    if( aFmt.isEmpty() )
+      aFmt = QString( "BMP" ); // default format
+    else if( aFmt == "JPG" )
+      aFmt = "JPEG";
+
+    Handle(Visual3d_View) a3dView = myViewPort->getView()->View();
+    if (aFmt == "PS")
+      a3dView->Export(strdup(qPrintable(aFileName)), Graphic3d_EF_PostScript);
+    else if (aFmt == "EPS")
+      a3dView->Export(strdup(qPrintable(aFileName)), Graphic3d_EF_EnhPostScript);
+    else
+      aPicture.save( aFileName, aFmt.toLatin1() );
+    QApplication::restoreOverrideCursor();
+  }
 }
 
 void XGUI_ViewWindow::fitAll()
 {
-    emit vpTransformationStarted( FITALLVIEW );
-    myViewPort->fitAll();
-    emit vpTransformationFinished( FITALLVIEW );
+  emit vpTransformationStarted( FITALLVIEW );
+  myViewPort->fitAll();
+  emit vpTransformationFinished( FITALLVIEW );
 }
 
 /*!
@@ -977,8 +989,7 @@ void XGUI_ViewWindow::activateWindowFit()
 
   if ( myOperation != WINDOWFIT ) {
     QCursor handCursor (Qt::PointingHandCursor);
-    if( setTransformRequested ( WINDOWFIT ) )
-    {
+    if( setTransformRequested ( WINDOWFIT ) ) {
       myViewPort->setCursor ( handCursor );
       myCursorIsHand = true;
     }
@@ -993,7 +1004,8 @@ void XGUI_ViewWindow::frontView()
 {
   emit vpTransformationStarted ( FRONTVIEW );
   Handle(V3d_View) aView3d = myViewPort->getView();
-  if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Xpos);
+  if ( !aView3d.IsNull() ) 
+    aView3d->SetProj (V3d_Xpos);
   myViewPort->fitAll();
   emit vpTransformationFinished ( FRONTVIEW );
 }
@@ -1005,7 +1017,8 @@ void XGUI_ViewWindow::backView()
 {
   emit vpTransformationStarted ( BACKVIEW );
   Handle(V3d_View) aView3d = myViewPort->getView();
-  if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Xneg);
+  if ( !aView3d.IsNull() ) 
+    aView3d->SetProj (V3d_Xneg);
   myViewPort->fitAll();
   emit vpTransformationFinished ( BACKVIEW );
 }
@@ -1017,7 +1030,8 @@ void XGUI_ViewWindow::topView()
 {
   emit vpTransformationStarted ( TOPVIEW );
   Handle(V3d_View) aView3d = myViewPort->getView();
-  if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Zpos);
+  if ( !aView3d.IsNull() ) 
+    aView3d->SetProj (V3d_Zpos);
   myViewPort->fitAll();
   emit vpTransformationFinished ( TOPVIEW );
 }
@@ -1029,7 +1043,8 @@ void XGUI_ViewWindow::bottomView()
 {
   emit vpTransformationStarted ( BOTTOMVIEW );
   Handle(V3d_View) aView3d = myViewPort->getView();
-  if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Zneg);
+  if ( !aView3d.IsNull() ) 
+    aView3d->SetProj (V3d_Zneg);
   myViewPort->fitAll();
   emit vpTransformationFinished ( BOTTOMVIEW );
 }
@@ -1041,7 +1056,8 @@ void XGUI_ViewWindow::leftView()
 {
   emit vpTransformationStarted ( LEFTVIEW );
   Handle(V3d_View) aView3d = myViewPort->getView();
-  if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Yneg);
+  if ( !aView3d.IsNull() ) 
+    aView3d->SetProj (V3d_Yneg);
   myViewPort->fitAll();
   emit vpTransformationFinished ( LEFTVIEW );
 }
@@ -1053,7 +1069,35 @@ void XGUI_ViewWindow::rightView()
 {
   emit vpTransformationStarted ( RIGHTVIEW );
   Handle(V3d_View) aView3d = myViewPort->getView();
-  if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Ypos);
+  if ( !aView3d.IsNull() ) 
+    aView3d->SetProj (V3d_Ypos);
   myViewPort->fitAll();
   emit vpTransformationFinished ( RIGHTVIEW );
 }
+
+void XGUI_ViewWindow::reset()
+{
+  emit vpTransformationStarted( RESETVIEW );
+  bool upd = myViewPort->getView()->SetImmediateUpdate( false );
+  myViewPort->getView()->Reset( false );
+  myViewPort->fitAll( false, true, false );
+  myViewPort->getView()->SetImmediateUpdate( upd );
+  myViewPort->getView()->Update();
+  emit vpTransformationFinished( RESETVIEW );
+}
+
+
+void XGUI_ViewWindow::updateToolBar()
+{
+  myGripWgt->repaint();
+  myViewBar->repaint();
+  myWindowBar->repaint();
+  //QTimer::singleShot(300, this, SLOT(repaintToolBar()));
+}
+
+/*void XGUI_ViewWindow::repaintToolBar()
+{
+  myGripWgt->repaint();
+  myViewBar->repaint();
+  myWindowBar->repaint();
+}*/
index de6837a5a4e0770c84aad9f4e434a5ff80162cc2..cd3db6862e6be1cd778aac4674634a8495b61460 100644 (file)
@@ -64,48 +64,51 @@ public:
   XGUI_ViewBackground background() const;
   void setBackground(const XGUI_ViewBackground& theBackground);
 
-    bool closable() const { return myClosable; }
-    void setClosable( const bool isClosable ) { myClosable = isClosable; }
+  bool closable() const { return myClosable; }
+  void setClosable( const bool isClosable ) { myClosable = isClosable; }
 
 signals:
-  void vpTransformationStarted(XGUI_ViewWindow::OperationType type);
-  void vpTransformationFinished(XGUI_ViewWindow::OperationType type);
+    void vpTransformationStarted(XGUI_ViewWindow::OperationType type);
+    void vpTransformationFinished(XGUI_ViewWindow::OperationType type);
 
-  void Show(QShowEvent *);
-  void Hide(QHideEvent *);
-  void maximized(XGUI_ViewWindow*, bool);
-  void returnedTo3d();
+    void Show(QShowEvent *);
+    void Hide(QHideEvent *);
+    void maximized(XGUI_ViewWindow*, bool);
+    void returnedTo3d();
 
-  void tryClosing(XGUI_ViewWindow*);
+    void tryClosing(XGUI_ViewWindow*);
     void closed( QMdiSubWindow* );
-  void mousePressed(XGUI_ViewWindow*, QMouseEvent*);
-  void mouseReleased(XGUI_ViewWindow*, QMouseEvent*);
-  void mouseDoubleClicked(XGUI_ViewWindow*, QMouseEvent*);
-  void mouseMoving(XGUI_ViewWindow*, QMouseEvent*);
-  void keyPressed(XGUI_ViewWindow*, QKeyEvent*);
-  void keyReleased(XGUI_ViewWindow*, QKeyEvent*);
-  void contextMenuRequested(QContextMenuEvent *e);
-
-  void viewModified(XGUI_ViewWindow*);
+    void mousePressed(XGUI_ViewWindow*, QMouseEvent*);
+    void mouseReleased(XGUI_ViewWindow*, QMouseEvent*);
+    void mouseDoubleClicked(XGUI_ViewWindow*, QMouseEvent*);
+    void mouseMoving(XGUI_ViewWindow*, QMouseEvent*);
+    void keyPressed(XGUI_ViewWindow*, QKeyEvent*);
+    void keyReleased(XGUI_ViewWindow*, QKeyEvent*);
+    void contextMenuRequested(QContextMenuEvent *e);
+
+    void viewModified(XGUI_ViewWindow*);
     void viewCloned( QMdiSubWindow* theView );
 
 public slots:
   void activateZoom();
   void activateRotation();
   void activatePanning();
-    void activateWindowFit();
-    void activateGlobalPanning();
-
-    void cloneView();
-    void dumpView();
-    void fitAll();
-    
-    void frontView();
-    void backView();
-    void topView();
-    void bottomView();
-    void leftView();
-    void rightView();
+  void activateWindowFit();
+  void activateGlobalPanning();
+
+  void cloneView();
+  void dumpView();
+  void fitAll();
+
+  void frontView();
+  void backView();
+  void topView();
+  void bottomView();
+  void leftView();
+  void rightView();
+
+  void reset();
+
 
 protected:
   virtual void resizeEvent(QResizeEvent* theEvent);
@@ -122,6 +125,9 @@ private slots:
   void onMinimize();
   void onMaximize();
 
+  void updateToolBar();
+  //void repaintToolBar();
+
 private:
   enum WindowState
   {
@@ -191,7 +197,7 @@ private:
   bool myCursorIsHand;
   bool myIsKeyFree;
   bool myEventStarted;       // set when transformation is in process 
-    bool myClosable;
+  bool myClosable;
 
   QCursor myCursor;
 
@@ -218,6 +224,8 @@ public:
   {
   }
 
+  void repaintBackground();
+
 protected:
   virtual void paintEvent(QPaintEvent* theEvent);
 
@@ -235,6 +243,8 @@ public:
   {
   }
 
+  void repaintBackground();
+
 protected:
   virtual void paintEvent(QPaintEvent* theEvent);
 
index f9090d15d24e2465561be66ac6b35824d9f5944d..4789649276989aeb1a894c04a6233024e0b39df2 100644 (file)
         <source>RIGHT_VIEW</source>
         <translation>Right</translation>
     </message>
+    <message>
+        <source>RESET_VIEW</source>
+        <translation>Reset</translation>
+    </message>
 </context>
 </TS>
index 0645767cc9a21f1e126b0a14d771e28fd52658bb..283bb434bc36bf3be83868977e25ef12faa6f1e6 100644 (file)
 
      <file>pictures/ViewPort.png</file>
      
-     <file>pictures/occ_view_ambient.png</file>
-     <file>pictures/occ_view_anticlockwise.png</file>
      <file>pictures/occ_view_back.png</file>
      <file>pictures/occ_view_bottom.png</file>
      <file>pictures/occ_view_camera_dump.png</file>
-     <file>pictures/occ_view_clipping.png</file>
-     <file>pictures/occ_view_clipping_pressed.png</file>
-     <file>pictures/occ_view_clockwise.png</file>
      <file>pictures/occ_view_clone.png</file>
      <file>pictures/occ_view_fitall.png</file>
      <file>pictures/occ_view_fitarea.png</file>
      <file>pictures/occ_view_front.png</file>
-     <file>pictures/occ_view_glpan.png</file>
-     <file>pictures/occ_view_graduated_axes.png</file>
      <file>pictures/occ_view_left.png</file>
-     <file>pictures/occ_view_maximized.png</file>
-     <file>pictures/occ_view_minimized.png</file>
      <file>pictures/occ_view_pan.png</file>
-     <file>pictures/occ_view_preselection.png</file>
-     <file>pictures/occ_view_presets.png</file>
+     <file>pictures/occ_view_glpan.png</file>
      <file>pictures/occ_view_reset.png</file>
-     <file>pictures/occ_view_return_3d_view.png</file>
      <file>pictures/occ_view_right.png</file>
      <file>pictures/occ_view_rotate.png</file>
-     <file>pictures/occ_view_rotation_point.png</file>
-     <file>pictures/occ_view_scaling.png</file>
-     <file>pictures/occ_view_selection.png</file>
-     <file>pictures/occ_view_shoot.png</file>
-     <file>pictures/occ_view_style_switch.png</file>
      <file>pictures/occ_view_top.png</file>
-     <file>pictures/occ_view_triedre.png</file>
      <file>pictures/occ_view_zoom.png</file>
-     <file>pictures/occ_view_zooming_style_switch.png</file>
      
      <file>pictures/wnd_close.png</file>
      <file>pictures/wnd_minimize.png</file>
diff --git a/src/XGUI/pictures/occ_view_ambient.png b/src/XGUI/pictures/occ_view_ambient.png
deleted file mode 100644 (file)
index 7f41153..0000000
Binary files a/src/XGUI/pictures/occ_view_ambient.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_anticlockwise.png b/src/XGUI/pictures/occ_view_anticlockwise.png
deleted file mode 100644 (file)
index 991586f..0000000
Binary files a/src/XGUI/pictures/occ_view_anticlockwise.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_clipping.png b/src/XGUI/pictures/occ_view_clipping.png
deleted file mode 100644 (file)
index 0356a9a..0000000
Binary files a/src/XGUI/pictures/occ_view_clipping.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_clipping_pressed.png b/src/XGUI/pictures/occ_view_clipping_pressed.png
deleted file mode 100644 (file)
index e38a8aa..0000000
Binary files a/src/XGUI/pictures/occ_view_clipping_pressed.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_clockwise.png b/src/XGUI/pictures/occ_view_clockwise.png
deleted file mode 100644 (file)
index b25471e..0000000
Binary files a/src/XGUI/pictures/occ_view_clockwise.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_graduated_axes.png b/src/XGUI/pictures/occ_view_graduated_axes.png
deleted file mode 100644 (file)
index 2b44c06..0000000
Binary files a/src/XGUI/pictures/occ_view_graduated_axes.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_maximized.png b/src/XGUI/pictures/occ_view_maximized.png
deleted file mode 100644 (file)
index 8e19d6a..0000000
Binary files a/src/XGUI/pictures/occ_view_maximized.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_minimized.png b/src/XGUI/pictures/occ_view_minimized.png
deleted file mode 100644 (file)
index b38bbeb..0000000
Binary files a/src/XGUI/pictures/occ_view_minimized.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_preselection.png b/src/XGUI/pictures/occ_view_preselection.png
deleted file mode 100644 (file)
index cd5baec..0000000
Binary files a/src/XGUI/pictures/occ_view_preselection.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_presets.png b/src/XGUI/pictures/occ_view_presets.png
deleted file mode 100644 (file)
index b436f94..0000000
Binary files a/src/XGUI/pictures/occ_view_presets.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_return_3d_view.png b/src/XGUI/pictures/occ_view_return_3d_view.png
deleted file mode 100644 (file)
index 01de30b..0000000
Binary files a/src/XGUI/pictures/occ_view_return_3d_view.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_rotation_point.png b/src/XGUI/pictures/occ_view_rotation_point.png
deleted file mode 100644 (file)
index fc303e3..0000000
Binary files a/src/XGUI/pictures/occ_view_rotation_point.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_scaling.png b/src/XGUI/pictures/occ_view_scaling.png
deleted file mode 100644 (file)
index fa8cbbc..0000000
Binary files a/src/XGUI/pictures/occ_view_scaling.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_selection.png b/src/XGUI/pictures/occ_view_selection.png
deleted file mode 100644 (file)
index 21d18e9..0000000
Binary files a/src/XGUI/pictures/occ_view_selection.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_shoot.png b/src/XGUI/pictures/occ_view_shoot.png
deleted file mode 100644 (file)
index fa5ba75..0000000
Binary files a/src/XGUI/pictures/occ_view_shoot.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_style_switch.png b/src/XGUI/pictures/occ_view_style_switch.png
deleted file mode 100644 (file)
index b0a9c80..0000000
Binary files a/src/XGUI/pictures/occ_view_style_switch.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_triedre.png b/src/XGUI/pictures/occ_view_triedre.png
deleted file mode 100644 (file)
index bc5894d..0000000
Binary files a/src/XGUI/pictures/occ_view_triedre.png and /dev/null differ
diff --git a/src/XGUI/pictures/occ_view_zooming_style_switch.png b/src/XGUI/pictures/occ_view_zooming_style_switch.png
deleted file mode 100644 (file)
index 8f3a486..0000000
Binary files a/src/XGUI/pictures/occ_view_zooming_style_switch.png and /dev/null differ