From 5924602c70047c9ec42759e49820be0bb19b8042 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 9 Feb 2006 13:16:37 +0000 Subject: [PATCH] Code layouting --- src/VVTK/VVTK_Renderer.cxx | 57 ++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/src/VVTK/VVTK_Renderer.cxx b/src/VVTK/VVTK_Renderer.cxx index 484eff95..8a171986 100644 --- a/src/VVTK/VVTK_Renderer.cxx +++ b/src/VVTK/VVTK_Renderer.cxx @@ -236,19 +236,17 @@ vtkStandardNewMacro(VVTK_Renderer1); //---------------------------------------------------------------------------- VVTK_Renderer1::VVTK_Renderer1(): - //myImplicitFunctionWidget(VISU_ImplicitFunctionWidget::New()), myWidgetCtrl(VISU_WidgetCtrl::New()), myOutsideCursorSettings(NULL) { if(MYDEBUG) INFOS("VVTK_Renderer1() - "<SetPlaceFactor(1.1); myWidgetCtrl->SetPlaceFactor(1.1); // - VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget(); - pPlanesWidget->SetOutlineTranslation(false); - vtkProperty* aSelectedPlaneProperty = pPlanesWidget->GetSelectedPlaneProperty(); - vtkProperty* aPlaneProperty = pPlanesWidget->GetPlaneProperty(); + VISU_PlanesWidget *aPlanesWidget = myWidgetCtrl->GetPlanesWidget(); + aPlanesWidget->SetOutlineTranslation(false); + vtkProperty* aSelectedPlaneProperty = aPlanesWidget->GetSelectedPlaneProperty(); + vtkProperty* aPlaneProperty = aPlanesWidget->GetPlaneProperty(); aPlaneProperty->SetOpacity(aSelectedPlaneProperty->GetOpacity()*1.5); // myWidgetCtrl->Delete(); @@ -274,6 +272,7 @@ VVTK_Renderer1 } } + //---------------------------------------------------------------------------- void VVTK_Renderer1 @@ -286,30 +285,32 @@ VVTK_Renderer1 AdjustWidgetCtrl(); } } + + //---------------------------------------------------------------------------- -void VVTK_Renderer1::AdjustWidgetCtrl() +void +VVTK_Renderer1 +::AdjustWidgetCtrl() { - if(SVTK_Renderer::OnAdjustActors()){ - VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget(); - pPlanesWidget->InitialPlaceWidget(myBndBox); - pPlanesWidget->SetOrigin(0.5*(myBndBox[1] + myBndBox[0]), - 0.5*(myBndBox[3] + myBndBox[2]), - 0.5*(myBndBox[5] + myBndBox[4])); - // - VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget(); - pSphereWidget->SetCenter(0.5*(myBndBox[1] + myBndBox[0]), - 0.5*(myBndBox[3] + myBndBox[2]), - 0.5*(myBndBox[5] + myBndBox[4])); - float dX, dXmin=1.e20; - for (int i=0; i<3; ++i) { - dX=myBndBox[2*i+1]-myBndBox[2*i]; - if (dXSetRadius(dXmin); + VISU_PlanesWidget *aPlanesWidget = myWidgetCtrl->GetPlanesWidget(); + aPlanesWidget->InitialPlaceWidget(myBndBox); + aPlanesWidget->SetOrigin(0.5*(myBndBox[1] + myBndBox[0]), + 0.5*(myBndBox[3] + myBndBox[2]), + 0.5*(myBndBox[5] + myBndBox[4])); + // + VISU_SphereWidget *aSphereWidget = myWidgetCtrl->GetSphereWidget(); + aSphereWidget->SetCenter(0.5*(myBndBox[1] + myBndBox[0]), + 0.5*(myBndBox[3] + myBndBox[2]), + 0.5*(myBndBox[5] + myBndBox[4])); + + float aMinLength = VTK_LARGE_FLOAT; + for (int i=0; i<3; ++i) { + float aLength = myBndBox[2*i+1]-myBndBox[2*i]; + aMinLength = std::min(aMinLength,aLength); } + aSphereWidget->SetRadius(aMinLength); } + //---------------------------------------------------------------------------- void VVTK_Renderer1 @@ -329,7 +330,9 @@ VVTK_Renderer1 } //---------------------------------------------------------------------------- -VISU_WidgetCtrl* VVTK_Renderer1::GetWidgetCtrl() +VISU_WidgetCtrl* +VVTK_Renderer1 +::GetWidgetCtrl() { return myWidgetCtrl.GetPointer(); } -- 2.39.2