mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +00:00
Batch line and text annotations for View1D
This commit is contained in:
parent
f7c43960e5
commit
c62998bd1b
@ -60,6 +60,8 @@ void View1D::RenderScreenAnnotations()
|
||||
viewportBottom,
|
||||
viewportTop);
|
||||
|
||||
this->GetCanvas().BeginTextRenderingBatch();
|
||||
this->GetWorldAnnotator().BeginLineRenderingBatch();
|
||||
this->HorizontalAxisAnnotation.SetColor(AxisColor);
|
||||
this->HorizontalAxisAnnotation.SetScreenPosition(
|
||||
viewportLeft, viewportBottom, viewportRight, viewportBottom);
|
||||
@ -88,6 +90,9 @@ void View1D::RenderScreenAnnotations()
|
||||
vtkm::rendering::TextAnnotation::VCenter);
|
||||
this->VerticalAxisAnnotation.Render(
|
||||
this->GetCamera(), this->GetWorldAnnotator(), this->GetCanvas());
|
||||
|
||||
this->GetWorldAnnotator().EndLineRenderingBatch();
|
||||
this->GetCanvas().EndTextRenderingBatch();
|
||||
}
|
||||
|
||||
void View1D::RenderColorLegendAnnotations()
|
||||
@ -95,6 +100,8 @@ void View1D::RenderColorLegendAnnotations()
|
||||
if (LegendEnabled)
|
||||
{
|
||||
this->Legend.Clear();
|
||||
this->GetWorldAnnotator().BeginLineRenderingBatch();
|
||||
this->GetCanvas().BeginTextRenderingBatch();
|
||||
for (int i = 0; i < this->GetScene().GetNumberOfActors(); ++i)
|
||||
{
|
||||
vtkm::rendering::Actor act = this->GetScene().GetActor(i);
|
||||
@ -110,6 +117,8 @@ void View1D::RenderColorLegendAnnotations()
|
||||
}
|
||||
this->Legend.SetLabelColor(this->GetCanvas().GetForegroundColor());
|
||||
this->Legend.Render(this->GetCamera(), this->GetWorldAnnotator(), this->GetCanvas());
|
||||
this->GetWorldAnnotator().EndLineRenderingBatch();
|
||||
this->GetCanvas().EndTextRenderingBatch();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user