From: apo Date: Wed, 16 Nov 2005 09:37:25 +0000 (+0000) Subject: To fix Bug GVIEW10544 X-Git-Tag: BR-D5-38-2003_D2005-24-11~36 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=35591aca1d2f0d9e347bb768a0db4212b192bf3a;p=modules%2Fvisu.git To fix Bug GVIEW10544 segmentation plane not fast enough --- diff --git a/src/OBJECT/VISU_Actor.cxx b/src/OBJECT/VISU_Actor.cxx index c576c022..2889338f 100644 --- a/src/OBJECT/VISU_Actor.cxx +++ b/src/OBJECT/VISU_Actor.cxx @@ -196,7 +196,6 @@ void VISU_Actor ::Update() { - myActorFactory->UpdateActor(this); Superclass::Update(); } diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index a39c6266..3eb35114 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -304,6 +304,9 @@ VISU_GaussPtsAct theWidget->AddObserver(vtkCommand::DisableEvent, myEventCallbackCommand.GetPointer(), myPriority); + theWidget->AddObserver(vtkCommand::StartInteractionEvent, + myEventCallbackCommand.GetPointer(), + myPriority); theWidget->AddObserver(vtkCommand::EndInteractionEvent, myEventCallbackCommand.GetPointer(), myPriority); @@ -940,8 +943,6 @@ VISU_GaussPtsAct1 myOutsideDeviceActor->GetPipeLine()->SetImplicitFunction(NULL); myOutsideDeviceActor->SetVisibility(false); - - myCurrentPL = myDeviceActor->GetPipeLine(); } if(theWidget){ @@ -950,8 +951,6 @@ VISU_GaussPtsAct1 myOutsideDeviceActor->GetPipeLine()->SetImplicitFunction(theWidget->ImplicitFunction()); myOutsideDeviceActor->SetVisibility(GetVisibility() && theWidget->IsEnabled()); - - myCurrentPL = myInsideDeviceActor->GetPipeLine(); } Superclass::SetImplicitFunctionWidget(theWidget); @@ -1063,8 +1062,14 @@ VISU_GaussPtsAct1 ::OnInteractorEvent(unsigned long theEvent) { switch(theEvent){ + case vtkCommand::StartInteractionEvent: + myDeviceActor->SetVisibility(GetVisibility()); + myInsideDeviceActor->SetVisibility(false); + myOutsideDeviceActor->SetVisibility(false); + break; case vtkCommand::EnableEvent: case vtkCommand::DisableEvent: + case vtkCommand::EndInteractionEvent: myDeviceActor->SetVisibility(GetVisibility() && !myWidget->IsEnabled()); myInsideDeviceActor->SetVisibility(GetVisibility() && myWidget->IsEnabled()); myOutsideDeviceActor->SetVisibility(GetVisibility() && myWidget->IsEnabled()); @@ -1072,18 +1077,6 @@ VISU_GaussPtsAct1 default: break; } - - - switch(theEvent){ - case vtkCommand::EnableEvent: - myCurrentPL = myInsideDeviceActor->GetPipeLine(); - break; - case vtkCommand::DisableEvent: - myCurrentPL = myDeviceActor->GetPipeLine(); - break; - default: - break; - } Superclass::OnInteractorEvent(theEvent); } diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx index 86eb25d2..519a74da 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx @@ -40,6 +40,9 @@ #include #include #include +#include +#include + #include "utilities.h" #ifdef _DEBUG_ @@ -80,6 +83,46 @@ VISU_GaussPtsDeviceActor } +//---------------------------------------------------------------- +void +VISU_GaussPtsDeviceActor +::Render(vtkRenderer *ren, vtkMapper *vtkNotUsed(m)) +{ + if (this->Mapper == NULL) + { + vtkErrorMacro("No mapper for actor."); + return; + } + + // render the property + if (!this->Property) + { + // force creation of a property + this->GetProperty(); + } + this->Property->Render(this, ren); + if (this->BackfaceProperty) + { + this->BackfaceProperty->BackfaceRender(this, ren); + this->Device->SetBackfaceProperty(this->BackfaceProperty); + } + this->Device->SetProperty(this->Property); + + // render the texture + if (this->Texture) + { + this->Texture->Render(ren); + } + + // make sure the device has the same matrix + vtkMatrix4x4 *matrix = this->Device->GetUserMatrix(); + this->GetMatrix(matrix); + + this->Device->Render(ren,Mapper); + this->EstimatedRenderTime = Mapper->GetTimeToDraw(); +} + + //---------------------------------------------------------------- void VISU_GaussPtsDeviceActor diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.h b/src/OBJECT/VISU_GaussPtsDeviceActor.h index 4f4d5e3e..41f4ebd3 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.h +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.h @@ -52,6 +52,10 @@ class VISU_GaussPtsDeviceActor: public vtkLODActor VISU_GaussPtsDeviceActor* New(); + virtual + void + Render(vtkRenderer *, vtkMapper *); + //---------------------------------------------------------------------------- void AddToRender(vtkRenderer* theRenderer);