From: apo Date: Mon, 3 Oct 2005 06:26:53 +0000 (+0000) Subject: To improve update outside presentation fcuntionality X-Git-Tag: BR-D5-38-2003_D2005-12-10~95 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=290fc584577d9c91de91cb3ab588902f7f21f1ec;p=modules%2Fvisu.git To improve update outside presentation fcuntionality --- diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.cxx b/src/VVTK/VVTK_SegmentationCursorDlg.cxx index 1f295ccf..7033e2bb 100644 --- a/src/VVTK/VVTK_SegmentationCursorDlg.cxx +++ b/src/VVTK/VVTK_SegmentationCursorDlg.cxx @@ -47,7 +47,6 @@ using namespace std; VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const char* name ) :QDialog( parent, name, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ), myEventCallbackCommand( vtkCallbackCommand::New() ), - myActorCollection( vtkActorCollection::New() ), myOutsideCursorSettings( VISU_OutsideCursorSettings::New() ) { myPriority = 0.0; @@ -317,16 +316,14 @@ VVTK_SegmentationCursorDlg::~VVTK_SegmentationCursorDlg() { } -void VVTK_SegmentationCursorDlg::AddActor( VISU_GaussPtsAct* theActor ) +void VVTK_SegmentationCursorDlg::AddActor( VISU_GaussPtsAct1* theActor ) { - myActorCollection->AddItem( theActor ); - theActor->SetOutsideCursorSettings( myOutsideCursorSettings.GetPointer() ); } -void VVTK_SegmentationCursorDlg::RemoveActor( VISU_GaussPtsAct* theActor ) +void VVTK_SegmentationCursorDlg::RemoveActor( VISU_GaussPtsAct1* theActor ) { - myActorCollection->RemoveItem( theActor ); + theActor->SetOutsideCursorSettings( NULL ); } void VVTK_SegmentationCursorDlg::SetWidget( VISU_ImplicitFunctionWidget* theWidget ) @@ -525,13 +522,7 @@ void VVTK_SegmentationCursorDlg::ApplyOutsideCursor() aColor[2] = aButtonColor.blue() / 255.0; myOutsideCursorSettings->SetColor( aColor ); - vtkActor* anActor; - for( myActorCollection->InitTraversal(); ( anActor = myActorCollection->GetNextActor() ) != 0; ) - { - VISU_GaussPtsAct* aGPActor = dynamic_cast( anActor ); - if( aGPActor ) - aGPActor->UpdateOutsideCursorSettings(); - } + myOutsideCursorSettings->InvokeEvent(vtkCommand::ModifiedEvent,NULL); } void VVTK_SegmentationCursorDlg::onClickClose() diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.h b/src/VVTK/VVTK_SegmentationCursorDlg.h index 6694a38d..910b40ac 100644 --- a/src/VVTK/VVTK_SegmentationCursorDlg.h +++ b/src/VVTK/VVTK_SegmentationCursorDlg.h @@ -30,7 +30,7 @@ class QVBox; class QtxAction; class QtxDblSpinBox; -class VISU_GaussPtsAct; +class VISU_GaussPtsAct1; class VISU_OutsideCursorSettings; class VISU_ImplicitFunctionWidget; @@ -42,8 +42,8 @@ public: VVTK_SegmentationCursorDlg( QWidget* parent = 0, const char* name = 0 ); ~VVTK_SegmentationCursorDlg(); - void AddActor( VISU_GaussPtsAct* ); - void RemoveActor( VISU_GaussPtsAct* ); + void AddActor( VISU_GaussPtsAct1* ); + void RemoveActor( VISU_GaussPtsAct1* ); void SetWidget( VISU_ImplicitFunctionWidget* ); void SetAction( QtxAction* theAction ) { myAction = theAction; } @@ -116,7 +116,6 @@ private: QString myMainTexture; QString myAlphaTexture; - vtkSmartPointer myActorCollection; vtkSmartPointer myOutsideCursorSettings; };