]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Some corrections concerning PAL10048:
authormkr <mkr@opencascade.com>
Wed, 29 Nov 2006 07:11:07 +0000 (07:11 +0000)
committermkr <mkr@opencascade.com>
Wed, 29 Nov 2006 07:11:07 +0000 (07:11 +0000)
it is impossible to release "Select Point from View" button...

src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/SVTK/SVTK_InteractorStyle.cxx
src/SVTK/SVTK_SetRotationPointDlg.cxx

index 1ce5ab4a445c0fbd6ca9d4e85b9b0d74d8117743..0aed2c230fd9a64bd963ae236085d65edb686f6b 100644 (file)
@@ -186,7 +186,11 @@ OCCViewer_SetRotationPointDlg
   setEnabled(myGroupBoxCoord,!myIsBBCenter->isChecked());
   
   if ( myIsBBCenter->isChecked() )
+  {
+    if ( mySelectPoint->state() == QButton::On )
+      mySelectPoint->toggle();
     myView->activateSetRotationGravity();
+  }
   else
     myView->activateSetRotationSelected(myX->text().toDouble(), 
                                        myY->text().toDouble(), 
@@ -197,6 +201,8 @@ void
 OCCViewer_SetRotationPointDlg
 ::onToOrigin()
 {
+  if ( mySelectPoint->state() == QButton::On )
+    mySelectPoint->toggle();
   setCoords();
   myView->activateSetRotationSelected(myX->text().toDouble(), 
                                      myY->text().toDouble(), 
@@ -218,9 +224,15 @@ OCCViewer_SetRotationPointDlg
 ::onCoordChanged()
 {
   if ( !myIsBBCenter->isChecked() )
+  {
+    if ( mySelectPoint->state() == QButton::On
+        &&
+        ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
+      mySelectPoint->toggle();
     myView->activateSetRotationSelected(myX->text().toDouble(), 
                                        myY->text().toDouble(), 
                                        myZ->text().toDouble());
+  }
 }
 
 void
index d921e3053b2761acd787274cdc9378356af8cb55..0ec1a641d213a41b57c65d1b53e070bf467d3d61 100755 (executable)
@@ -356,7 +356,11 @@ void OCCViewer_ViewWindow::vpMousePressEvent(QMouseEvent* theEvent)
            if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
            {
              gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) ); 
-             if ( mySetRotationPointDlg ) mySetRotationPointDlg->setCoords(aPnt.X(), aPnt.Y(), aPnt.Z());
+             if ( mySetRotationPointDlg )
+             {
+               myRotationPointSelection = false;
+               mySetRotationPointDlg->setCoords(aPnt.X(), aPnt.Y(), aPnt.Z());
+             }
            }    
            else 
            {
@@ -507,6 +511,16 @@ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, dou
 */
 void OCCViewer_ViewWindow::activateSetRotationGravity()
 {
+  if ( myRotationPointSelection )
+  {
+    Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
+    ic->CloseAllContexts();
+    myOperation = NOTHING; 
+    setCursor( myCursor );
+    myCursorIsHand = false;
+    myRotationPointSelection = false;
+  }
+
   myPrevPointType = myCurrPointType;
   myCurrPointType = GRAVITY;
 
@@ -533,6 +547,16 @@ void OCCViewer_ViewWindow::updateGravityCoords()
 */
 void OCCViewer_ViewWindow::activateSetRotationSelected(double theX, double theY, double theZ)
 {
+  if ( myRotationPointSelection )
+  {
+    Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
+    ic->CloseAllContexts();
+    myOperation = NOTHING; 
+    setCursor( myCursor );
+    myCursorIsHand = false;
+    myRotationPointSelection = false;
+  }
+
   myPrevPointType = myCurrPointType;
   myCurrPointType = SELECTED;
   mySelectedPoint.SetCoord(theX,theY,theZ);
@@ -1074,8 +1098,6 @@ void OCCViewer_ViewWindow::onFitAll()
 */
 void OCCViewer_ViewWindow::onSetRotationPoint( bool on )
 {
-  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-  
   if ( on )
     {
       if ( !mySetRotationPointDlg )
index de0dbbb740756c95b862a9171710298753e9a885..08f0f213465d76ece71647f7b6fee60e9080d87a 100644 (file)
@@ -536,10 +536,6 @@ SVTK_InteractorStyle
          
          // invoke event for update coordinates in SVTK_SetRotationPointDlg
          InvokeEvent(SVTK::RotationPointChanged,(void*)aCoords);
-         
-         myHighlightRotationPointActor->SetVisibility( false );
-         if(GetCurrentRenderer() != NULL)
-           GetCurrentRenderer()->RemoveActor( myHighlightRotationPointActor.GetPointer() );
        }
        else
        {
@@ -555,6 +551,10 @@ SVTK_InteractorStyle
        myCurrRotationPointType = myPrevRotationPointType;
       }
     
+      myHighlightRotationPointActor->SetVisibility( false );
+      if(GetCurrentRenderer() != NULL)
+       GetCurrentRenderer()->RemoveActor( myHighlightRotationPointActor.GetPointer() );
+
       GetRenderWidget()->setCursor(myDefCursor); 
     }
     else
@@ -1586,6 +1586,13 @@ SVTK_InteractorStyle
        return;
 
       case SVTK::SetRotateGravity:
+       if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
+       {
+         self->myHighlightRotationPointActor->SetVisibility( false );
+         if( self->GetCurrentRenderer() != NULL )
+           self->GetCurrentRenderer()->RemoveActor( self->myHighlightRotationPointActor.GetPointer() );
+         self->GetRenderWidget()->setCursor(self->myDefCursor); 
+       }
        self->myPrevRotationPointType = self->myCurrRotationPointType;
        self->myCurrRotationPointType = SVTK::SetRotateGravity;
        if ( ComputeBBCenter(self->GetCurrentRenderer(),aCenter) ) 
@@ -1597,6 +1604,13 @@ SVTK_InteractorStyle
        return;
 
       case SVTK::ChangeRotationPoint:
+       if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
+       {
+         self->myHighlightRotationPointActor->SetVisibility( false );
+         if( self->GetCurrentRenderer() != NULL )
+           self->GetCurrentRenderer()->RemoveActor( self->myHighlightRotationPointActor.GetPointer() );
+         self->GetRenderWidget()->setCursor(self->myDefCursor); 
+       }
        self->myPrevRotationPointType = self->myCurrRotationPointType;
        self->myCurrRotationPointType = SVTK::SetRotateSelected;
        aSelectedPoint = (vtkFloatingPointType*)callData;
index 248e3ecd04c3fb187955aecef453790bcecb6032..d98efaa21ab4571c58773f3e7b630af0171dfb08 100755 (executable)
@@ -260,7 +260,10 @@ SVTK_SetRotationPointDlg
   setEnabled(myGroupBoxCoord,!myIsBBCenter->isChecked());
   
   if ( myIsBBCenter->isChecked() )
-  { // activate mode : the rotation point is the center of the bounding box
+  { 
+    if ( mySelectPoint->state() == QButton::On )
+      mySelectPoint->toggle();
+    // activate mode : the rotation point is the center of the bounding box
     // send the data to the SVTK_InteractorStyle: set the type of the rotation point
     //                                            calculate coordinates of the rotation point
     myMainWindow->activateSetRotationGravity();
@@ -277,6 +280,8 @@ void
 SVTK_SetRotationPointDlg
 ::onToOrigin()
 {
+  if ( mySelectPoint->state() == QButton::On )
+    mySelectPoint->toggle();
   myX->setText(QString::number(0.0));
   myY->setText(QString::number(0.0));
   myZ->setText(QString::number(0.0));
@@ -297,6 +302,10 @@ SVTK_SetRotationPointDlg
 ::onCoordChanged()
 {
   if ( !myIsBBCenter->isChecked() ) {
+    if ( mySelectPoint->state() == QButton::On
+        &&
+        ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
+      mySelectPoint->toggle();
     vtkFloatingPointType aCenter[3] = {myX->text().toDouble(), 
                                       myY->text().toDouble(), 
                                       myZ->text().toDouble()};