From c639b9c0bae7c122ac4095081a7eb2c386960370 Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 19 Dec 2005 11:33:12 +0000 Subject: [PATCH] Do notm update outside / inside cursor settings when the segementation functionality is not avaialble --- src/OBJECT/VISU_GaussPtsAct.cxx | 65 +++++++++++++++++++-------------- src/OBJECT/VISU_GaussPtsAct.h | 10 ++--- 2 files changed, 43 insertions(+), 32 deletions(-) diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 42156e20..b0716f9e 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -459,6 +459,8 @@ VISU_GaussPtsAct return myGaussPtsActorFactory; } + +//---------------------------------------------------------------------------- void VISU_GaussPtsAct ::SetVisibility(int theMode) @@ -468,6 +470,14 @@ VISU_GaussPtsAct Highlight(isHighlighted()); } +int +VISU_GaussPtsAct +::IsSegmentationEnabled() +{ + return myWidgetCtrl && myWidgetCtrl->GetEnabled(); +} + + //---------------------------------------------------------------------------- void VISU_GaussPtsAct @@ -1021,6 +1031,9 @@ VISU_GaussPtsAct if(!myInsideCursorSettings || myInsideCursorSettings->GetInitial()) return; + if(!IsSegmentationEnabled()) + return; + VISU_GaussPointsPL* aPipeline = theActor->GetPipeLine(); SALOME_ExtractGeometry* anExtractGeometry = aPipeline->GetExtractGeometryFilter(); @@ -1149,15 +1162,15 @@ VISU_GaussPtsAct1 myOutsideDeviceActor->SetVisibility(false); } + Superclass::SetWidgetCtrl(theWidgetCtrl); + if(theWidgetCtrl){ myInsideDeviceActor->GetPipeLine()->SetImplicitFunction(theWidgetCtrl->ImplicitFunction()); - myInsideDeviceActor->SetVisibility(GetVisibility() && theWidgetCtrl->GetEnabled()); + myInsideDeviceActor->SetVisibility(GetVisibility() && IsSegmentationEnabled()); myOutsideDeviceActor->GetPipeLine()->SetImplicitFunction(theWidgetCtrl->ImplicitFunction()); - myOutsideDeviceActor->SetVisibility(GetVisibility() && theWidgetCtrl->GetEnabled()); + myOutsideDeviceActor->SetVisibility(GetVisibility() && IsSegmentationEnabled()); } - - Superclass::SetWidgetCtrl(theWidgetCtrl); } @@ -1194,7 +1207,7 @@ VISU_GaussPtsAct1 vtkDataArray *theScalarArray) { VISU_GaussPointsPL* aPipeLine = myDeviceActor->GetPipeLine(); - if(myWidgetCtrl && myWidgetCtrl->GetEnabled()){ + if(IsSegmentationEnabled()){ if(myInsideDeviceActor->GetPipeLine()->GetNodeVTKID(theObjID) < 0) aPipeLine = myOutsideDeviceActor->GetPipeLine(); else @@ -1210,7 +1223,7 @@ VISU_GaussPtsAct1 ::GetMagnification(vtkIdType theObjID) { VISU_GaussPointsPL* aPipeLine = myDeviceActor->GetPipeLine(); - if(myWidgetCtrl && myWidgetCtrl->GetEnabled()){ + if(IsSegmentationEnabled()){ if(myInsideDeviceActor->GetPipeLine()->GetNodeVTKID(theObjID) < 0) aPipeLine = myOutsideDeviceActor->GetPipeLine(); else @@ -1225,7 +1238,7 @@ float VISU_GaussPtsAct1 ::GetClamp(vtkIdType theObjID) { - if(myWidgetCtrl && myWidgetCtrl->GetEnabled()){ + if(IsSegmentationEnabled()){ if(myInsideDeviceActor->GetPipeLine()->GetNodeVTKID(theObjID) < 0) return ::GetClamp(myOutsideDeviceActor->GetPipeLine()); else @@ -1251,10 +1264,11 @@ VISU_GaussPtsAct1 Superclass::SetVisibility(theMode); - bool anIsSegementation = !myWidgetCtrl || myWidgetCtrl->GetEnabled(); - myDeviceActor->SetVisibility(GetVisibility() && !anIsSegementation); - myInsideDeviceActor->SetVisibility(GetVisibility() && anIsSegementation); - myOutsideDeviceActor->SetVisibility(GetVisibility() && anIsSegementation); + bool aVisisbility = GetVisibility(); + bool anIsSegementation = IsSegmentationEnabled(); + myDeviceActor->SetVisibility(aVisisbility && !anIsSegementation); + myInsideDeviceActor->SetVisibility(aVisisbility && anIsSegementation); + myOutsideDeviceActor->SetVisibility(aVisisbility && anIsSegementation); mySetVisibilitySignal(GetVisibility()); } @@ -1296,6 +1310,9 @@ VISU_GaussPtsAct1 if(!myOutsideCursorSettings || myOutsideCursorSettings->GetInitial()) return; + if(!IsSegmentationEnabled()) + return; + VISU_GaussPointsPL* aPipeline = myOutsideDeviceActor->GetPipeLine(); SALOME_ExtractGeometry* anExtractGeometry = aPipeline->GetExtractGeometryFilter(); @@ -1374,10 +1391,11 @@ VISU_GaussPtsAct1 case vtkCommand::EnableEvent: case vtkCommand::DisableEvent: case vtkCommand::EndInteractionEvent: { - bool anIsSegementation = !myWidgetCtrl || myWidgetCtrl->GetEnabled(); - myDeviceActor->SetVisibility(GetVisibility() && !anIsSegementation); - myInsideDeviceActor->SetVisibility(GetVisibility() && anIsSegementation); - myOutsideDeviceActor->SetVisibility(GetVisibility() && anIsSegementation); + bool aVisisbility = GetVisibility(); + bool anIsSegementation = IsSegmentationEnabled(); + myDeviceActor->SetVisibility(aVisisbility && !anIsSegementation); + myInsideDeviceActor->SetVisibility(aVisisbility && anIsSegementation); + myOutsideDeviceActor->SetVisibility(anIsSegementation); break; } default: @@ -1451,12 +1469,12 @@ VISU_GaussPtsAct2 myDeviceActor->SetVisibility(false); } + Superclass::SetWidgetCtrl(theWidgetCtrl); + if(theWidgetCtrl){ myDeviceActor->GetPipeLine()->SetImplicitFunction(theWidgetCtrl->ImplicitFunction()); - myDeviceActor->SetVisibility(Superclass::GetVisibility()); + myDeviceActor->SetVisibility(GetVisibility() && IsSegmentationEnabled()); } - - Superclass::SetWidgetCtrl(theWidgetCtrl); } @@ -1469,14 +1487,7 @@ VISU_GaussPtsAct2 Superclass::SetVisibility(theMode); - myDeviceActor->SetVisibility(GetVisibility()); -} - -int -VISU_GaussPtsAct2 -::GetVisibility() -{ - return Superclass::GetVisibility(); + myDeviceActor->SetVisibility(GetVisibility() && IsSegmentationEnabled()); } void @@ -1486,7 +1497,7 @@ VISU_GaussPtsAct2 switch(theEvent){ case vtkCommand::EnableEvent: case vtkCommand::DisableEvent: - myDeviceActor->SetVisibility(GetVisibility()); + myDeviceActor->SetVisibility(GetVisibility() && IsSegmentationEnabled()); if(theEvent == vtkCommand::EnableEvent) Update(); break; diff --git a/src/OBJECT/VISU_GaussPtsAct.h b/src/OBJECT/VISU_GaussPtsAct.h index 3b8a81e6..822238f4 100644 --- a/src/OBJECT/VISU_GaussPtsAct.h +++ b/src/OBJECT/VISU_GaussPtsAct.h @@ -158,6 +158,11 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor void SetVisibility(int theMode); + //! Get segmentation visibility. + virtual + int + IsSegmentationEnabled(); + //! Set Scalar Bar Control to the actor. VISU_ScalarBarCtrl* GetScalarBarCtrl(); @@ -445,11 +450,6 @@ class VTKOCC_EXPORT VISU_GaussPtsAct2 : public VISU_GaussPtsAct void SetVisibility(int theMode); - //! Get actor visibility. - virtual - int - GetVisibility(); - virtual void SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl); protected: -- 2.39.2