]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Invoking custom events instead of vtkCommand::ModifiedEvent
authorouv <ouv@opencascade.com>
Wed, 5 Oct 2005 11:47:23 +0000 (11:47 +0000)
committerouv <ouv@opencascade.com>
Wed, 5 Oct 2005 11:47:23 +0000 (11:47 +0000)
src/OBJECT/VISU_GaussPtsAct.cxx
src/OBJECT/VISU_GaussPtsAct.h
src/VVTK/VVTK_PickingDlg.cxx
src/VVTK/VVTK_SegmentationCursorDlg.cxx

index b085c1543a31a1140f949ed1a271a9243ce4126e..2abca41b62d84e3858c7739a8672fc05bb411e5f 100644 (file)
@@ -52,7 +52,6 @@
 #include <vtkPolyData.h>
 #include <vtkActor.h>
 
-#include <vtkCommand.h>
 #include <vtkObjectFactory.h>
 #include <vtkCallbackCommand.h>
 #include <vtkInteractorStyle.h>
@@ -807,7 +806,7 @@ VISU_GaussPtsAct
   myPickingSettings = thePickingSettings;
 
   if(thePickingSettings)
-    thePickingSettings->AddObserver(vtkCommand::ModifiedEvent, 
+    thePickingSettings->AddObserver(VISU::UpdatePickingSettingsEvent, 
                                    myEventCallbackCommand.GetPointer(), 
                                    myPriority);
 }
@@ -868,7 +867,7 @@ VISU_GaussPtsAct1
 
   myInsideDeviceActor->ShallowCopyPL(aPipeLine);
 
-  myOutsideDeviceActor->ShallowCopyPL(aPipeLine);
+  //myOutsideDeviceActor->ShallowCopyPL(aPipeLine);
   myOutsideDeviceActor->GetMapper()->ScalarVisibilityOff();
   myOutsideDeviceActor->GetPipeLine()->SetExtractInside(true);
 
@@ -1005,7 +1004,7 @@ VISU_GaussPtsAct1
   myOutsideCursorSettings = theOutsideCursorSettings;
 
   if(theOutsideCursorSettings)
-    theOutsideCursorSettings->AddObserver(vtkCommand::ModifiedEvent, 
+    theOutsideCursorSettings->AddObserver(VISU::UpdateOutsideSettingsEvent, 
                                          myEventCallbackCommand.GetPointer(), 
                                          myPriority);
 }
@@ -1025,8 +1024,10 @@ VISU_GaussPtsAct1
 
   myOutsideDeviceActor->GetProperty()->SetColor(myOutsideCursorSettings->GetColor());
 
-  //cout << "UpdateOutsideCursorSettings " << aMapper << endl;
-  //cout << myOutsideCursorSettings->GetAlphaThreshold() << endl;
+  cout << "UpdateOutsideCursorSettings" << endl;
+  cout << this << endl;
+  cout << myOutsideDeviceActor << endl;
+  cout << aMapper << endl;
   
   Update();
 }
@@ -1042,7 +1043,7 @@ VISU_GaussPtsAct1
 {
   if(vtkObject* anObject = reinterpret_cast<vtkObject*>(theClientData))
     if(VISU_GaussPtsAct1* self = dynamic_cast<VISU_GaussPtsAct1*>(anObject))
-      if(theEvent == vtkCommand::ModifiedEvent)
+      if(theEvent == VISU::UpdateOutsideSettingsEvent)
        self->UpdateOutsideCursorSettings();
 
   Superclass::ProcessEvents(theObject,theEvent,theClientData,theCallData);
index e05af940ef3379d269611d5ffa158285823f67bd..3e6c6aac1a97d41673adfe54bbf2e2273a4d77d4 100644 (file)
@@ -32,6 +32,7 @@
 #include "VISU_Actor.h"
 #include "VISU_GaussPtsActorFactory.h"
 
+#include <vtkCommand.h>
 #include <vtkSmartPointer.h>
 
 class VISU_GaussPointsPL;
@@ -60,6 +61,12 @@ class VISU_ScalarBarCtrl;
 
 
 //============================================================================
+namespace VISU
+{
+  const vtkIdType UpdateOutsideSettingsEvent = vtkCommand::UserEvent + 100; 
+  const vtkIdType UpdatePickingSettingsEvent = vtkCommand::UserEvent + 101; 
+}
+
 class VTKOCC_EXPORT VISU_OutsideCursorSettings : public vtkObject
 {
  public:
index 3a029f119078731580a369579be66f108c94ffa4..7d8c977ac0a9636bacb348f0ad147d6776848354 100644 (file)
@@ -217,7 +217,7 @@ void VVTK_PickingDlg::onClickApply()
   myPickingSettings->SetZoomFactor( myZoomFactorSpinBox->value() );
   myPickingSettings->SetStepNumber( myStepNumberSpinBox->value() );
 
-  myPickingSettings->InvokeEvent(vtkCommand::ModifiedEvent,NULL);
+  myPickingSettings->InvokeEvent(VISU::UpdatePickingSettingsEvent,NULL);
 }
 
 void VVTK_PickingDlg::onClickClose()
index 6eda01624e9bda696e563cef7553dc0f102cc2b4..4873da7d974d1a87553db69824a61aa0f1a57048 100644 (file)
@@ -522,7 +522,7 @@ void VVTK_SegmentationCursorDlg::ApplyOutsideCursor()
   aColor[2] = aButtonColor.blue() / 255.0;
   myOutsideCursorSettings->SetColor( aColor );
 
-  myOutsideCursorSettings->InvokeEvent(vtkCommand::ModifiedEvent,NULL);
+  myOutsideCursorSettings->InvokeEvent(VISU::UpdateOutsideSettingsEvent,NULL);
 }
 
 void VVTK_SegmentationCursorDlg::onClickClose()