From: pkv Date: Fri, 21 Oct 2005 06:25:44 +0000 (+0000) Subject: fix for Bug GVIEW10327 X-Git-Tag: TG-D5-38-2003_D2005-20-12~132 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0d8d5409c0eba7e726b5baf47e9be4dece70dd42;p=modules%2Fvisu.git fix for Bug GVIEW10327 --- diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 67eef5ef..61be970f 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -301,7 +301,9 @@ VISU_GaussPtsAct theWidget->AddObserver(vtkCommand::DisableEvent, myEventCallbackCommand.GetPointer(), myPriority); - + theWidget->AddObserver(vtkCommand::EndInteractionEvent, + myEventCallbackCommand.GetPointer(), + myPriority); } myWidget = theWidget; @@ -452,6 +454,12 @@ VISU_GaussPtsAct case VISU::UpdatePickingSettingsEvent: UpdatePickingSettings(); break; + case vtkCommand::EndInteractionEvent: + case vtkCommand::EnableEvent: + case vtkCommand::DisableEvent: + myCurrentPL->GetMapper()->Update(); + Highlight(isHighlighted()); + break; default: break; } @@ -508,6 +516,7 @@ bool VISU_GaussPtsAct::PreHighlight(vtkInteractorStyle* theInteractorStyle, return false; vtkIdType aVtkId = myPointPicker->GetPointId(); + if(aVtkId >= 0 && mySelector->IsValid(this,aVtkId,true) && hasIO()){ vtkIdType anObjId = GetNodeObjId( aVtkId ); if(myLastObjPointID != anObjId){ @@ -609,7 +618,7 @@ bool VISU_GaussPtsAct::Highlight(vtkInteractorStyle* theInteractorStyle, } //================================================================== -// function : highlight +// function : Highlight // purpose : //================================================================== void @@ -990,6 +999,7 @@ VISU_GaussPtsAct1 break; } + switch(theEvent){ case vtkCommand::EnableEvent: myCurrentPL = myInsideDeviceActor->GetPipeLine(); @@ -997,8 +1007,10 @@ VISU_GaussPtsAct1 case vtkCommand::DisableEvent: myCurrentPL = myDeviceActor->GetPipeLine(); break; + default: + break; } - + Superclass::OnInteractorEvent(theEvent); } @@ -1070,9 +1082,6 @@ VISU_GaussPtsAct2 } if(theWidget){ - theWidget->AddObserver(vtkCommand::EndInteractionEvent, - myEventCallbackCommand.GetPointer(), - myPriority); myDeviceActor->GetPipeLine()->SetImplicitFunction(theWidget->ImplicitFunction()); myDeviceActor->SetVisibility(Superclass::GetVisibility() && theWidget->IsEnabled()); } @@ -1113,7 +1122,7 @@ VISU_GaussPtsAct2 } break; case vtkCommand::EndInteractionEvent: - //vtkLODActor::SetMapper(GetMapper()); + Update(); break; default: break; diff --git a/src/PIPELINE/SALOME_ExtractGeometry.cxx b/src/PIPELINE/SALOME_ExtractGeometry.cxx index c962e6aa..5a1762e8 100755 --- a/src/PIPELINE/SALOME_ExtractGeometry.cxx +++ b/src/PIPELINE/SALOME_ExtractGeometry.cxx @@ -48,7 +48,8 @@ vtkStandardNewMacro(SALOME_ExtractGeometry); //---------------------------------------------------------------------------- SALOME_ExtractGeometry ::SALOME_ExtractGeometry(): - myStoreMapping(false) + myStoreMapping(false), + myIsDoneShallowCopy(false) {} SALOME_ExtractGeometry @@ -106,9 +107,9 @@ vtkIdType SALOME_ExtractGeometry ::GetElemVTKId(vtkIdType theID) { - if(myElemVTK2ObjIds.empty()) + if(!myStoreMapping||myIsDoneShallowCopy){ return theID; - + } vtkIdType iEnd = myElemVTK2ObjIds.size(); for(vtkIdType i = 0; i < iEnd; i++) if(myElemVTK2ObjIds[i] == theID) @@ -121,9 +122,9 @@ vtkIdType SALOME_ExtractGeometry ::GetNodeVTKId(vtkIdType theID) { - if (myElemVTK2ObjIds.empty()) + if (!myStoreMapping||myIsDoneShallowCopy){ return theID; - + } vtkIdType iEnd = myNodeVTK2ObjIds.size(); for(vtkIdType i = 0; i < iEnd; i++) if(myNodeVTK2ObjIds[i] == theID) @@ -138,14 +139,14 @@ vtkIdType SALOME_ExtractGeometry ::GetElemObjId(int theVtkID) { - if (myElemVTK2ObjIds.empty()) + if (!myStoreMapping||myIsDoneShallowCopy){ return theVtkID; - -#if defined __GNUC_2__ - return myElemVTK2ObjIds[theVtkID]; -#else - return myElemVTK2ObjIds.at(theVtkID); -#endif + } + // + if (theVtkIDImplicitFunction; - bool anIsNothingToDo = !this->ImplicitFunction; - - if(!anIsNothingToDo && myImplicitBoolean.GetPointer()){ + if(!myIsDoneShallowCopy && myImplicitBoolean.GetPointer()){ if(vtkImplicitFunctionCollection* aFunction = myImplicitBoolean->GetFunction()){ - anIsNothingToDo = aFunction->GetNumberOfItems() == 0; + myIsDoneShallowCopy = aFunction->GetNumberOfItems() == 0; } } - if(anIsNothingToDo){ + if(myIsDoneShallowCopy){ GetOutput()->ShallowCopy(GetInput()); Modified(); return; diff --git a/src/PIPELINE/SALOME_ExtractGeometry.h b/src/PIPELINE/SALOME_ExtractGeometry.h index d348fe60..b225434f 100755 --- a/src/PIPELINE/SALOME_ExtractGeometry.h +++ b/src/PIPELINE/SALOME_ExtractGeometry.h @@ -75,6 +75,7 @@ protected: private: bool myStoreMapping; + bool myIsDoneShallowCopy; typedef std::vector TVectorId; TVectorId myElemVTK2ObjIds; TVectorId myNodeVTK2ObjIds;