]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To fix Bug GVIEW10544
authorapo <apo@opencascade.com>
Wed, 16 Nov 2005 09:37:25 +0000 (09:37 +0000)
committerapo <apo@opencascade.com>
Wed, 16 Nov 2005 09:37:25 +0000 (09:37 +0000)
   segmentation plane not fast enough

src/OBJECT/VISU_Actor.cxx
src/OBJECT/VISU_GaussPtsAct.cxx
src/OBJECT/VISU_GaussPtsDeviceActor.cxx
src/OBJECT/VISU_GaussPtsDeviceActor.h

index c576c022445dd9e526d683276156256a442754bc..2889338fcfff6ec696a98a2eb9efff1c81908840 100644 (file)
@@ -196,7 +196,6 @@ void
 VISU_Actor
 ::Update()
 {
-  myActorFactory->UpdateActor(this);
   Superclass::Update();
 }
 
index a39c626692fb81080a60f81aa6726321d2d9338b..3eb35114a2fbde793a55f98c2f1b32da4e841d54 100644 (file)
@@ -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);
 }
index 86eb25d28ca33793a8c8960166342ba94c96a82b..519a74da5ebfcfb88287aaf4e6c4ea7f1399362b 100644 (file)
@@ -40,6 +40,9 @@
 #include <vtkPolyData.h>
 #include <vtkRenderer.h>
 #include <vtkTextProperty.h>
+#include <vtkProperty.h>
+#include <vtkTexture.h>
+
 #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
index 4f4d5e3e88dbbda3cf2dbebc0e61cad38a28a208..41f4ebd3b375cd9ee8c1e646caaabb1404f7547e 100644 (file)
@@ -52,6 +52,10 @@ class VISU_GaussPtsDeviceActor: public vtkLODActor
   VISU_GaussPtsDeviceActor* 
   New();
 
+  virtual
+  void
+  Render(vtkRenderer *, vtkMapper *);
+
   //----------------------------------------------------------------------------
   void
   AddToRender(vtkRenderer* theRenderer);