Fix on - Bug PAL7606

Controls operation aren't work during Clipping
This commit is contained in:
apo 2005-01-12 13:09:15 +00:00
parent fe2a7b95ba
commit 959198f20f
3 changed files with 31 additions and 17 deletions

View File

@ -63,6 +63,11 @@
#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());
}
@ -407,9 +409,7 @@ void SMESHGUI_ClippingDlg::ClickOnApply()
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());
}

View 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;

View 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,