Salome HOME
Fix on - Bug PAL7606
authorapo <apo@opencascade.com>
Wed, 12 Jan 2005 13:09:15 +0000 (13:09 +0000)
committerapo <apo@opencascade.com>
Wed, 12 Jan 2005 13:09:15 +0000 (13:09 +0000)
   Controls operation aren't work during Clipping

src/SMESHGUI/SMESHGUI_ClippingDlg.cxx
src/SMESHGUI/SMESHGUI_VTKUtils.cxx
src/SMESHGUI/SMESHGUI_VTKUtils.h

index d98228dde97b9bb7bbc93a283cf3b76406fa4808..567d567f347acadad7fd1f2d3264df1b49d81106 100644 (file)
 #include "SALOME_InteractiveObject.hxx"
 #include "SMESH_ActorUtils.h"
 
+#include "VTKViewer_ViewFrame.h"
+#include "VTKViewer_RenderWindow.h"
+
+#include <vtkRenderer.h>
+
 using namespace std;
 
 
@@ -151,8 +156,6 @@ protected:
     myActor->SetInfinitive(true);
     myActor->SetMapper( myMapper );
 
-    static float anOpacity = 0.75;
-
     vtkProperty* aProp = vtkProperty::New();
     float anRGB[3];
     anRGB[0] = SMESH::GetFloat("SMESH:SettingsFillColorRed", 0)/255.;
@@ -375,9 +378,8 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg( QWidget* parent,
 SMESHGUI_ClippingDlg::~SMESHGUI_ClippingDlg()
 {
   // no need to delete child widgets, Qt does it all for us
-  //cout<<"SMESHGUI_ClippingDlg::~SMESHGUI_ClippingDlg\n";
   std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
-  SMESH::GetCurrentVtkView()->Repaint();
+  SMESH::RenderViewFrame(SMESH::GetCurrentVtkView());
 }
 
 
@@ -406,10 +408,8 @@ void SMESHGUI_ClippingDlg::ClickOnApply()
       aCollection->AddItem(anOrientedPlane);
       anOrientedPlane->Delete();
     }
-    
-    myActor->SetVisibility(myActor->GetVisibility());
-    
-    SMESH::GetCurrentVtkView()->Repaint();
+
+    SMESH::RenderViewFrame(SMESH::GetCurrentVtkView());
   }
 }
 
@@ -466,7 +466,7 @@ void SMESHGUI_ClippingDlg::onSelectionChanged()
     }
   }
   Sinchronize();
-  SMESH::GetCurrentVtkView()->Repaint();
+  SMESH::RenderViewFrame(SMESH::GetCurrentVtkView());
 }
 
 
@@ -484,8 +484,7 @@ void SMESHGUI_ClippingDlg::onSelectPlane(int theIndex)
   // Orientation
   SMESH::Orientation anOrientation = aPlane->GetOrientation();
   
-  // Distance and Rotations
-  float aDistance;
+  // Rotations
   double aRot[2] = {aPlane->myAngle[0], aPlane->myAngle[1]};
 
   // Set plane parameters in the dialog
@@ -550,7 +549,7 @@ void SMESHGUI_ClippingDlg::ClickOnDelete()
     ClickOnApply();
 
   Sinchronize();
-  SMESH::GetCurrentVtkView()->Repaint();
+  SMESH::RenderViewFrame(SMESH::GetCurrentVtkView());
 }
 
 
@@ -702,7 +701,6 @@ void SMESHGUI_ClippingDlg::SetCurrentPlaneParam()
   
   myActor->SetPlaneParam(aNormal, getDistance(), aPlane);
 
-  float* anOrig = aPlane->GetOrigin();
   vtkDataSet* aDataSet = myActor->GetInput();
   float *aPnt = aDataSet->GetCenter();
 
@@ -746,11 +744,11 @@ void SMESHGUI_ClippingDlg::SetCurrentPlaneParam()
   if(AutoApplyCheckBox->isChecked())
     ClickOnApply();
   
-  SMESH::GetCurrentVtkView()->Repaint();
+  SMESH::RenderViewFrame(SMESH::GetCurrentVtkView());
 }
 
 
 void SMESHGUI_ClippingDlg::OnPreviewToggle(bool theIsToggled){
   std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(theIsToggled));
-  SMESH::GetCurrentVtkView()->Repaint();
+  SMESH::RenderViewFrame(SMESH::GetCurrentVtkView());
 }
index c2d3deeaa3649fc20125724ea7c178d02f720899..15a7be0391e4de7175d487e57f992512a4c42547 100644 (file)
@@ -156,6 +156,19 @@ namespace SMESH{
   }
 
 
+  void RepaintViewFrame(VTKViewer_ViewFrame* theFrame)
+  {
+    theFrame->Repaint();
+  }
+
+
+  void RenderViewFrame(VTKViewer_ViewFrame* theFrame)
+  {
+    theFrame->getRW()->getRenderWindow()->Render();
+    theFrame->Repaint();
+  }
+
+
   SMESH_Actor* FindActorByEntry(QAD_StudyFrame *theStudyFrame, 
                                const char* theEntry)
   {
@@ -507,7 +520,7 @@ namespace SMESH{
   {
     theName = "";
     if(theIO->hasEntry()){
-      if(SMESH_Actor *anActor = FindActorByEntry(theIO->getEntry())){
+      if(FindActorByEntry(theIO->getEntry())){
        TColStd_IndexedMapOfInteger aMapIndex;
        theSel->GetIndex(theIO,aMapIndex);
        for(int i = 1; i <= aMapIndex.Extent(); i++){
@@ -536,7 +549,7 @@ namespace SMESH{
   {
     theName = "";
     if(theIO->hasEntry()){
-      if(SMESH_Actor *anActor = FindActorByEntry(theIO->getEntry())){
+      if(FindActorByEntry(theIO->getEntry())){
        TColStd_IndexedMapOfInteger aMapIndex;
        theSel->GetIndex(theIO,aMapIndex);
        typedef std::set<int> TIdContainer;
index 9937073b667cbfdad3d8cb9448e003bb1c764b65..a2732f7034df29cbad1fef025df8cb94070d0c81 100644 (file)
@@ -63,6 +63,9 @@ namespace SMESH{
 
   VTKViewer_ViewFrame* GetCurrentVtkView();
 
+  void RepaintViewFrame(VTKViewer_ViewFrame* theFrame);
+
+  void RenderViewFrame(VTKViewer_ViewFrame* theFrame);
 
   //----------------------------------------------------------------------------
   SMESH_Actor* FindActorByEntry(QAD_StudyFrame *theStudyFrame,