::~VISU_GaussPtsAct()
{
if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::~VISU_GaussPtsAct - this = "<<this);
+ SetImplicitFunctionWidget(NULL);
+ SetInteractor(NULL);
}
::SetImplicitFunctionWidget(VISU_ImplicitFunctionWidget* theWidget)
{
if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::SetImplicitFunctionWidget - this = "<<this);
+ if(myWidget == theWidget)
+ return;
+
+ if(myWidget)
+ myWidget->RemoveObserver(myEventCallbackCommand.GetPointer());
+
+ if(theWidget){
+ theWidget->AddObserver(vtkCommand::EnableEvent,
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
+ theWidget->AddObserver(vtkCommand::DisableEvent,
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
+ }
myWidget = theWidget;
- theWidget->AddObserver(vtkCommand::EnableEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
- theWidget->AddObserver(vtkCommand::DisableEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
}
bool
{
if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct1::SetImplicitFunctionWidget - this = "<<this);
- Superclass::SetImplicitFunctionWidget(theWidget);
+ if(myWidget == theWidget)
+ return;
- myInsideDeviceActor->GetPipeLine()->SetImplicitFunction(theWidget->ImplicitFunction());
- myInsideDeviceActor->SetVisibility(GetVisibility() && theWidget->IsEnabled());
+ if(myWidget){
+ myInsideDeviceActor->GetPipeLine()->SetImplicitFunction(NULL);
+ myInsideDeviceActor->SetVisibility(false);
+
+ myOutsideDeviceActor->GetPipeLine()->SetImplicitFunction(NULL);
+ myOutsideDeviceActor->SetVisibility(false);
+ }
- myOutsideDeviceActor->GetPipeLine()->SetImplicitFunction(theWidget->ImplicitFunction());
- myOutsideDeviceActor->SetVisibility(GetVisibility() && theWidget->IsEnabled());
+ if(theWidget){
+ myInsideDeviceActor->GetPipeLine()->SetImplicitFunction(theWidget->ImplicitFunction());
+ myInsideDeviceActor->SetVisibility(GetVisibility() && theWidget->IsEnabled());
+
+ myOutsideDeviceActor->GetPipeLine()->SetImplicitFunction(theWidget->ImplicitFunction());
+ myOutsideDeviceActor->SetVisibility(GetVisibility() && theWidget->IsEnabled());
+ }
+
+ Superclass::SetImplicitFunctionWidget(theWidget);
}
if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
myInsideDeviceActor->SetPipeLine(aPipeLine);
}
+
if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
myOutsideDeviceActor->SetPipeLine(aPipeLine);
{
if(MYDEBUG2) MESSAGE("VISU_GaussPtsAct2::SetImplicitFunctionWidget - this = "<<this);
- Superclass::SetImplicitFunctionWidget(theWidget);
+ if(myWidget == theWidget)
+ return;
- theWidget->AddObserver(vtkCommand::EndInteractionEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ if(myWidget){
+ theWidget->RemoveObserver(myEventCallbackCommand.GetPointer());
+ myDeviceActor->GetPipeLine()->SetImplicitFunction(NULL);
+ myDeviceActor->SetVisibility(false);
+ }
- myDeviceActor->GetPipeLine()->SetImplicitFunction(theWidget->ImplicitFunction());
- myDeviceActor->SetVisibility(GetVisibility() && theWidget->IsEnabled());
+ if(theWidget){
+ theWidget->AddObserver(vtkCommand::EndInteractionEvent,
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
+ myDeviceActor->GetPipeLine()->SetImplicitFunction(theWidget->ImplicitFunction());
+ myDeviceActor->SetVisibility(GetVisibility() && theWidget->IsEnabled());
+ }
+
+ Superclass::SetImplicitFunctionWidget(theWidget);
}