From: apo Date: Thu, 8 Sep 2005 08:13:26 +0000 (+0000) Subject: To customize ResetCameraClippingRange method X-Git-Tag: BR-D5-38-2003_D2005-12-09~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d619f2c381ba110de4ade8b99248b276a799b9c7;p=modules%2Fgui.git To customize ResetCameraClippingRange method --- 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();