From d619f2c381ba110de4ade8b99248b276a799b9c7 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 8 Sep 2005 08:13:26 +0000 Subject: [PATCH] To customize ResetCameraClippingRange method --- src/SVTK/SVTK_Renderer.cxx | 20 +++++++++++++++++--- src/SVTK/SVTK_Renderer.h | 1 + 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/SVTK/SVTK_Renderer.cxx b/src/SVTK/SVTK_Renderer.cxx index ae067194f..d04ad8936 100644 --- a/src/SVTK/SVTK_Renderer.cxx +++ b/src/SVTK/SVTK_Renderer.cxx @@ -101,10 +101,13 @@ SVTK_Renderer myEventCallbackCommand->SetClientData(this); myEventCallbackCommand->SetCallback(SVTK_Renderer::ProcessEvents); + this->AddObserver(vtkCommand::ConfigureEvent, + myEventCallbackCommand.GetPointer(), + myPriority); this->AddObserver(vtkCommand::ResetCameraEvent, myEventCallbackCommand.GetPointer(), myPriority); - this->AddObserver(vtkCommand::ConfigureEvent, + this->AddObserver(vtkCommand::ResetCameraClippingRangeEvent, myEventCallbackCommand.GetPointer(), myPriority); } @@ -127,11 +130,12 @@ SVTK_Renderer case vtkCommand::ConfigureEvent: self->onResetView(); break; - } - switch(theEvent){ case vtkCommand::ResetCameraEvent: self->onFitAll(); break; + case vtkCommand::ResetCameraClippingRangeEvent: + self->onResetClippingRange(); + break; } } //---------------------------------------------------------------------------- @@ -422,6 +426,16 @@ SVTK_Renderer } +//---------------------------------------------------------------------------- +void +SVTK_Renderer +::onResetClippingRange() +{ + return; + ::ResetCameraClippingRange(this); +} + + //---------------------------------------------------------------------------- void SVTK_Renderer diff --git a/src/SVTK/SVTK_Renderer.h b/src/SVTK/SVTK_Renderer.h index 6f78b4383..feb48827f 100644 --- a/src/SVTK/SVTK_Renderer.h +++ b/src/SVTK/SVTK_Renderer.h @@ -101,6 +101,7 @@ class SVTK_EXPORT SVTK_Renderer : public SVTK_RENDERER_SUPERCLASS void onFitAll(); void onResetView(); + void onResetClippingRange(); void onFrontView(); void onBackView(); -- 2.39.2