2021-05-29 Scalar Bar 颜色条

代码

#include 
#include 
#include 
vtkSmartPointer hueLut 
  = vtkSmartPointer::New();
vtkSmartPointer sBarActor
  = vtkSmartPointer::New();
vtkSmartPointer scalarBarWidget
  = vtkSmartPointer::New();
vtkSmartPointer renWin 
  = vtkSmartPointer::New();

......
sBarActor->SetLookupTable(ugridMapper->GetLookupTable());
sBarActor->SetNumberOfLabels(8);
sBarActor->SetTitle("height");
 /*
sBarActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
sBarActor->GetPositionCoordinate()->SetValue(0.1,0.1);
sBarActor->SetWidth(0.8);
sBarActor->SetHeight(0.2);
*/
sBarActor->SetOrientationToHorizontal();

scalarBarWidget->SetInteractor(iren);
scalarBarWidget->SetScalarBarActor(sBarActor);
scalarBarWidget->On();
scalarBarWidget->SetEnabled(1);

iren->SetRenderWindow(renWin);
renWin->Render();
iren->Start();

你可能感兴趣的:(2021-05-29 Scalar Bar 颜色条)