diff --git a/Interaction/Widgets/Testing/Cxx/TestImplicitCylinderWidget2.cxx b/Interaction/Widgets/Testing/Cxx/TestImplicitCylinderWidget2.cxx index 41785fdc1c0cda26b805ebfa4521a962a2a4605c..1efd806c88f740d1a05da8e3e59e7dd6e6158624 100644 --- a/Interaction/Widgets/Testing/Cxx/TestImplicitCylinderWidget2.cxx +++ b/Interaction/Widgets/Testing/Cxx/TestImplicitCylinderWidget2.cxx @@ -286,10 +286,10 @@ public: virtual void Execute(vtkObject *caller, unsigned long, void*) { - vtkImplicitCylinderWidget *planeWidget = + vtkImplicitCylinderWidget *cylWidget = reinterpret_cast(caller); vtkImplicitCylinderRepresentation *rep = - reinterpret_cast(planeWidget->GetRepresentation()); + reinterpret_cast(cylWidget->GetRepresentation()); rep->GetCylinder(this->Cylinder); this->Actor->VisibilityOn(); } @@ -379,11 +379,11 @@ int TestImplicitCylinderWidget2(int vtkNotUsed(argc), char *vtkNotUsed(argv)[]) rep->SetPlaceFactor(1.25); rep->PlaceWidget(glyph->GetOutput()->GetBounds()); - vtkSmartPointer planeWidget = + vtkSmartPointer cylWidget = vtkSmartPointer::New(); - planeWidget->SetInteractor(iren); - planeWidget->SetRepresentation(rep); - planeWidget->AddObserver(vtkCommand::InteractionEvent,myCallback); + cylWidget->SetInteractor(iren); + cylWidget->SetRepresentation(rep); + cylWidget->AddObserver(vtkCommand::InteractionEvent,myCallback); ren1->AddActor(maceActor); ren1->AddActor(selectActor); @@ -396,7 +396,7 @@ int TestImplicitCylinderWidget2(int vtkNotUsed(argc), char *vtkNotUsed(argv)[]) // Tests double wbounds[6]; double center[3], center1[3], center2[3]; - planeWidget->SetEnabled(1); + cylWidget->SetEnabled(1); rep->GetCenter(center); // #1: With ConstrainCenter on, center SHOULD NOT be settable outside widget bounds @@ -433,7 +433,7 @@ int TestImplicitCylinderWidget2(int vtkNotUsed(argc), char *vtkNotUsed(argv)[]) } rep->SetCenter(center); - planeWidget->SetEnabled(0); + cylWidget->SetEnabled(0); // #3: With ConstrainCenter on and OutsideBounds off, the translation of the // widget should be limited diff --git a/Interaction/Widgets/vtkImplicitCylinderWidget.cxx b/Interaction/Widgets/vtkImplicitCylinderWidget.cxx index a5c4d7fe48cbb2bd3a7e8936de6a7d4fe1674cf9..c4336fa698bfd60503c3154a87ef268fcce2a269 100644 --- a/Interaction/Widgets/vtkImplicitCylinderWidget.cxx +++ b/Interaction/Widgets/vtkImplicitCylinderWidget.cxx @@ -30,26 +30,6 @@ vtkStandardNewMacro(vtkImplicitCylinderWidget); -// The implicit cylinder widget observes its representation. The representation -// may invoke an InteractionEvent when the camera moves when LockedNormalToCamera -// is enabled. -class vtkInteractionCallback : public vtkCommand -{ -public: - static vtkInteractionCallback *New() - { return new vtkInteractionCallback; } - virtual void Execute(vtkObject*, unsigned long eventId, void*) - { - switch (eventId) - { - case vtkCommand::ModifiedEvent: - this->CylinderWidget->InvokeInteractionCallback(); - break; - } - } - vtkImplicitCylinderWidget *CylinderWidget; -}; - //---------------------------------------------------------------------------- vtkImplicitCylinderWidget::vtkImplicitCylinderWidget() { @@ -93,15 +73,11 @@ vtkImplicitCylinderWidget::vtkImplicitCylinderWidget() vtkEvent::AnyModifier, 29, 1, "Left", vtkWidgetEvent::Down, this, vtkImplicitCylinderWidget::MoveCylinderAction); - - this->InteractionCallback = vtkInteractionCallback::New(); - this->InteractionCallback->CylinderWidget = this; } //---------------------------------------------------------------------------- vtkImplicitCylinderWidget::~vtkImplicitCylinderWidget() { - this->InteractionCallback->Delete(); } //---------------------------------------------------------------------- @@ -336,11 +312,6 @@ void vtkImplicitCylinderWidget::SetEnabled(int enabling) return; } - if(this->GetCurrentRenderer() && !enabling) - { - this->GetCurrentRenderer()->GetActiveCamera()->RemoveObserver(this->InteractionCallback); - } - Superclass::SetEnabled(enabling); } @@ -385,21 +356,6 @@ int vtkImplicitCylinderWidget::UpdateCursorShape( int state ) return 0; } -//---------------------------------------------------------------------------- -void vtkImplicitCylinderWidget::InvokeInteractionCallback() -{ - unsigned long previousMtime; - vtkImplicitCylinderRepresentation* widgetRep = - reinterpret_cast(this->WidgetRep); - - previousMtime = widgetRep->GetMTime(); - - if(widgetRep->GetMTime() > previousMtime) - { - this->InvokeEvent(vtkCommand::InteractionEvent,NULL); - } -} - //---------------------------------------------------------------------------- void vtkImplicitCylinderWidget::PrintSelf(ostream& os, vtkIndent indent) { diff --git a/Interaction/Widgets/vtkImplicitCylinderWidget.h b/Interaction/Widgets/vtkImplicitCylinderWidget.h index 458e59ba7a30d1a9e6d00c594044d824432ddd64..db2ca06721f894000bd19ceb1296dea44b929148 100644 --- a/Interaction/Widgets/vtkImplicitCylinderWidget.h +++ b/Interaction/Widgets/vtkImplicitCylinderWidget.h @@ -87,12 +87,9 @@ #include "vtkAbstractWidget.h" class vtkImplicitCylinderRepresentation; -class vtkInteractionCallback; class VTKINTERACTIONWIDGETS_EXPORT vtkImplicitCylinderWidget : public vtkAbstractWidget { - friend class vtkInteractionCallback; - public: // Description: // Instantiate the object. @@ -144,11 +141,6 @@ protected: // if the cursor shape requested is different from the existing one. int UpdateCursorShape( int interactionState ); - // Description: - // Handle the interaction callback that may come from the representation - vtkInteractionCallback *InteractionCallback; - void InvokeInteractionCallback(); - private: vtkImplicitCylinderWidget(const vtkImplicitCylinderWidget&); //Not implemented void operator=(const vtkImplicitCylinderWidget&); //Not implemented