Dear all,
I want to set the text size of the angle arc to a size but it does not work. The size is very small and it is not visible. I have tried several options but only the sace waorks and i want a fixed size as the distancewidget does:
//OPTION 1:
vtkNew<vtkAngleWidget>angleWidget;
angleWidget->SetInteractor(windows_interactor);
vtkSmartPointer<vtkAngleRepresentation2D> angle_rep =
vtkAngleRepresentation2D::SafeDownCast(
angleWidget->GetRepresentation());
angle_rep->SetLabelFormat("%-#6.3g grad");
angle_rep->GetArc()->GetLabelTextProperty()->SetFontSize(15);
angle_rep->GetArc()->SetLabelFactor(3.0);
angleWidget->Modified();
//option 2
vtkNew<vtkAngleWidget>angleWidget;
angleWidget->SetInteractor(windows_interactor);
vtkSmartPointer<vtkAngleRepresentation3D> node1 =
vtkSmartPointer<vtkAngleRepresentation3D>::New();
//double scale[3] = { 0.09, 0.09, 0.09 };
//node1->SetTextActorScale(scale);
node1->GetRay1()->GetProperty()->SetColor(1, 1, 1);
node1->GetRay2()->GetProperty()->SetColor(1, 1, 1);
node1->GetArc()->GetProperty()->SetColor(1, 1, 1);
node1->GetTextActor()->GetProperty()->SetColor(1, 1, 1);
node1->GetTextActor()->GetProperty()->SetPointSize(15.0);
node1->GetTextActor()->GetProperty()->SetPointSize(15);
angleWidget->SetRepresentation(node1);
angleWidget->CreateDefaultRepresentation();
vtkAngleRepresentation::SafeDownCast(angleWidget->GetRepresentation())
->SetLabelFormat("%-#6.3g grad");
angleWidget->On();
angleWidgets_.push_back(angleWidget);
However, the distancewidget is allowed to set a text:
vtkNew<vtkDistanceWidget> distanceWidget;
distanceWidget->SetInteractor(windows_interactor);
distanceWidget->CreateDefaultRepresentation();
vtkSmartPointer<vtkDistanceRepresentation2D> distance_rep =
vtkDistanceRepresentation2D::SafeDownCast(
distanceWidget->GetRepresentation());
distance_rep->GetAxisProperty()->SetColor(1, 1, 1);
distance_rep->GetAxis()->SetLabelFactor(3.0);
distance_rep->SetLabelFormat("%-#6.3g mm");
distanceWidget->On();
//Define the size of the text label
vtkSmartPointer<vtkAxisActor2D> axis = distance_rep->GetAxis();
axis->UseFontSizeFromPropertyOn();
axis->GetTitleTextProperty()->SetFontSize(15);