An update will be applied January 25th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit 9e3b00d4 authored by Philippe Pébay's avatar Philippe Pébay
Browse files

Properly construct, release, and destroy enhanced scalar bar

Change-Id: I46bfec36dc709991db503ec66ef1717cfde1598f
parent fb487d65
......@@ -160,6 +160,25 @@ vtkScalarBarActor::vtkScalarBarActor()
this->MaximumWidthInPixels = VTK_INT_MAX;
this->MaximumHeightInPixels = VTK_INT_MAX;
this->BackgroundProperty = vtkProperty2D::New();
this->FrameProperty = vtkProperty2D::New();
this->DrawBackground = 0;
this->Background = vtkPolyData::New();
this->BackgroundMapper = vtkPolyDataMapper2D::New();
this->BackgroundMapper->SetInput(this->Background);
this->BackgroundActor = vtkActor2D::New();
this->BackgroundActor->SetMapper(this->BackgroundMapper);
this->BackgroundActor->GetPositionCoordinate()->SetReferenceCoordinate(this->PositionCoordinate);
this->DrawFrame = 0;
this->Frame = vtkPolyData::New();
this->FrameMapper = vtkPolyDataMapper2D::New();
this->FrameMapper->SetInput(this->Frame);
this->FrameActor = vtkActor2D::New();
this->FrameActor->SetMapper(this->FrameMapper);
this->FrameActor->GetPositionCoordinate()->SetReferenceCoordinate(this->PositionCoordinate);
}
//----------------------------------------------------------------------------
......@@ -177,6 +196,8 @@ void vtkScalarBarActor::ReleaseGraphicsResources(vtkWindow *win)
}
}
this->ScalarBarActor->ReleaseGraphicsResources(win);
this->BackgroundActor->ReleaseGraphicsResources(win);
this->FrameActor->ReleaseGraphicsResources(win);
}
//----------------------------------------------------------------------------
......@@ -224,6 +245,14 @@ vtkScalarBarActor::~vtkScalarBarActor()
this->Texture->Delete();
this->TextureActor->Delete();
this->TexturePolyData->Delete();
this->Background->Delete();
this->BackgroundMapper->Delete();
this->BackgroundActor->Delete();
this->Frame->Delete();
this->FrameMapper->Delete();
this->FrameActor->Delete();
this->SetBackgroundProperty(NULL);
this->SetFrameProperty(NULL);
}
//----------------------------------------------------------------------------
......
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