Commit 30adba44 authored by Andreas Buykx's avatar Andreas Buykx

Fix warnings when ShallowCopying vtkCaptionActor2D

ShallowCopying a vtkCaptionActor2D now explicitly checks if
a leader-glyph connection is present before copying it to
prevent warnings being emitted unnecessarily.
parent 6aa7b028
Pipeline #124871 passed with stage
......@@ -225,6 +225,10 @@ void vtkCaptionActor2D::SetLeaderGlyphData(vtkPolyData* leader)
//----------------------------------------------------------------------------
vtkPolyData* vtkCaptionActor2D::GetLeaderGlyph()
{
if (this->LeaderGlyphConnectionHolder->GetNumberOfInputConnections(0) < 1)
{
return nullptr;
}
return vtkPolyData::SafeDownCast(
this->LeaderGlyphConnectionHolder->GetInputDataObject(0, 0));
}
......@@ -572,8 +576,15 @@ void vtkCaptionActor2D::ShallowCopy(vtkProp *prop)
this->SetBorder(a->GetBorder());
this->SetLeader(a->GetLeader());
this->SetThreeDimensionalLeader(a->GetThreeDimensionalLeader());
this->SetLeaderGlyphConnection(
a->LeaderGlyphConnectionHolder->GetInputConnection(0, 0));
if (a->LeaderGlyphConnectionHolder->GetNumberOfInputConnections(0) < 1)
{
this->SetLeaderGlyphConnection(nullptr);
}
else
{
this->SetLeaderGlyphConnection(
a->LeaderGlyphConnectionHolder->GetInputConnection(0, 0));
}
this->SetLeaderGlyphSize(a->GetLeaderGlyphSize());
this->SetMaximumLeaderGlyphSize(a->GetMaximumLeaderGlyphSize());
this->SetPadding(a->GetPadding());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment