From 55ecf713f4a390e801bb41160f9f9db9a0df4179 Mon Sep 17 00:00:00 2001 From: ouv Date: Wed, 5 Oct 2005 11:47:23 +0000 Subject: [PATCH] Invoking custom events instead of vtkCommand::ModifiedEvent --- src/OBJECT/VISU_GaussPtsAct.cxx | 15 ++++++++------- src/OBJECT/VISU_GaussPtsAct.h | 7 +++++++ src/VVTK/VVTK_PickingDlg.cxx | 2 +- src/VVTK/VVTK_SegmentationCursorDlg.cxx | 2 +- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index b085c154..2abca41b 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -52,7 +52,6 @@ #include #include -#include #include #include #include @@ -807,7 +806,7 @@ VISU_GaussPtsAct myPickingSettings = thePickingSettings; if(thePickingSettings) - thePickingSettings->AddObserver(vtkCommand::ModifiedEvent, + thePickingSettings->AddObserver(VISU::UpdatePickingSettingsEvent, myEventCallbackCommand.GetPointer(), myPriority); } @@ -868,7 +867,7 @@ VISU_GaussPtsAct1 myInsideDeviceActor->ShallowCopyPL(aPipeLine); - myOutsideDeviceActor->ShallowCopyPL(aPipeLine); + //myOutsideDeviceActor->ShallowCopyPL(aPipeLine); myOutsideDeviceActor->GetMapper()->ScalarVisibilityOff(); myOutsideDeviceActor->GetPipeLine()->SetExtractInside(true); @@ -1005,7 +1004,7 @@ VISU_GaussPtsAct1 myOutsideCursorSettings = theOutsideCursorSettings; if(theOutsideCursorSettings) - theOutsideCursorSettings->AddObserver(vtkCommand::ModifiedEvent, + theOutsideCursorSettings->AddObserver(VISU::UpdateOutsideSettingsEvent, myEventCallbackCommand.GetPointer(), myPriority); } @@ -1025,8 +1024,10 @@ VISU_GaussPtsAct1 myOutsideDeviceActor->GetProperty()->SetColor(myOutsideCursorSettings->GetColor()); - //cout << "UpdateOutsideCursorSettings " << aMapper << endl; - //cout << myOutsideCursorSettings->GetAlphaThreshold() << endl; + cout << "UpdateOutsideCursorSettings" << endl; + cout << this << endl; + cout << myOutsideDeviceActor << endl; + cout << aMapper << endl; Update(); } @@ -1042,7 +1043,7 @@ VISU_GaussPtsAct1 { if(vtkObject* anObject = reinterpret_cast(theClientData)) if(VISU_GaussPtsAct1* self = dynamic_cast(anObject)) - if(theEvent == vtkCommand::ModifiedEvent) + if(theEvent == VISU::UpdateOutsideSettingsEvent) self->UpdateOutsideCursorSettings(); Superclass::ProcessEvents(theObject,theEvent,theClientData,theCallData); diff --git a/src/OBJECT/VISU_GaussPtsAct.h b/src/OBJECT/VISU_GaussPtsAct.h index e05af940..3e6c6aac 100644 --- a/src/OBJECT/VISU_GaussPtsAct.h +++ b/src/OBJECT/VISU_GaussPtsAct.h @@ -32,6 +32,7 @@ #include "VISU_Actor.h" #include "VISU_GaussPtsActorFactory.h" +#include #include class VISU_GaussPointsPL; @@ -60,6 +61,12 @@ class VISU_ScalarBarCtrl; //============================================================================ +namespace VISU +{ + const vtkIdType UpdateOutsideSettingsEvent = vtkCommand::UserEvent + 100; + const vtkIdType UpdatePickingSettingsEvent = vtkCommand::UserEvent + 101; +} + class VTKOCC_EXPORT VISU_OutsideCursorSettings : public vtkObject { public: diff --git a/src/VVTK/VVTK_PickingDlg.cxx b/src/VVTK/VVTK_PickingDlg.cxx index 3a029f11..7d8c977a 100644 --- a/src/VVTK/VVTK_PickingDlg.cxx +++ b/src/VVTK/VVTK_PickingDlg.cxx @@ -217,7 +217,7 @@ void VVTK_PickingDlg::onClickApply() myPickingSettings->SetZoomFactor( myZoomFactorSpinBox->value() ); myPickingSettings->SetStepNumber( myStepNumberSpinBox->value() ); - myPickingSettings->InvokeEvent(vtkCommand::ModifiedEvent,NULL); + myPickingSettings->InvokeEvent(VISU::UpdatePickingSettingsEvent,NULL); } void VVTK_PickingDlg::onClickClose() diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.cxx b/src/VVTK/VVTK_SegmentationCursorDlg.cxx index 6eda0162..4873da7d 100644 --- a/src/VVTK/VVTK_SegmentationCursorDlg.cxx +++ b/src/VVTK/VVTK_SegmentationCursorDlg.cxx @@ -522,7 +522,7 @@ void VVTK_SegmentationCursorDlg::ApplyOutsideCursor() aColor[2] = aButtonColor.blue() / 255.0; myOutsideCursorSettings->SetColor( aColor ); - myOutsideCursorSettings->InvokeEvent(vtkCommand::ModifiedEvent,NULL); + myOutsideCursorSettings->InvokeEvent(VISU::UpdateOutsideSettingsEvent,NULL); } void VVTK_SegmentationCursorDlg::onClickClose() -- 2.39.2