From 290fc584577d9c91de91cb3ab588902f7f21f1ec Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 3 Oct 2005 06:26:53 +0000 Subject: [PATCH] To improve update outside presentation fcuntionality --- src/VVTK/VVTK_SegmentationCursorDlg.cxx | 17 ++++------------- src/VVTK/VVTK_SegmentationCursorDlg.h | 7 +++---- 2 files changed, 7 insertions(+), 17 deletions(-) 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; }; -- 2.39.2