//----------------------------------------------------------------------------
VVTK_Renderer1::VVTK_Renderer1():
- //myImplicitFunctionWidget(VISU_ImplicitFunctionWidget::New()),
myWidgetCtrl(VISU_WidgetCtrl::New()),
myOutsideCursorSettings(NULL)
{
if(MYDEBUG) INFOS("VVTK_Renderer1() - "<<this);
- //myImplicitFunctionWidget->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();
}
}
+
//----------------------------------------------------------------------------
void
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 (dX<dXmin){
- dXmin=dX;
- }
- }
- pSphereWidget->SetRadius(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
}
//----------------------------------------------------------------------------
-VISU_WidgetCtrl* VVTK_Renderer1::GetWidgetCtrl()
+VISU_WidgetCtrl*
+VVTK_Renderer1
+::GetWidgetCtrl()
{
return myWidgetCtrl.GetPointer();
}