So, all descendant of SVTK package should not do care about memory management.
Only simple pointers should be stored (do not use any smart pointers).
The VTK's RenderWindow/Renderer/RenderWindowInteractor/InteractorStyle classes have close conversation and should be destroyed in strict order. Therefore all the memory manemgemnt code was moved to corresponding basic classes.
float myPriority;
vtkSmartPointer<vtkImplicitPlaneWidget> myImplicitPlaneWidget1;
- vtkSmartPointer<VVTK_Renderer1> myRenderer1;
vtkSmartPointer<vtkPlane> myFunction;
+ VVTK_Renderer1* myRenderer1;
};
::Initialize()
{
myRenderer = VVTK_Renderer1::New();
- VVTK_MainWindowBase::Initialize(myRenderer.GetPointer());
+ VVTK_MainWindowBase::Initialize(myRenderer);
myRenderer->Delete();
}
VVTK_MainWindow1
::GetRenderer1()
{
- return myRenderer.GetPointer();
+ return myRenderer;
}
//----------------------------------------------------------------------------
::Initialize()
{
myRenderer = VVTK_Renderer2::New();
- VVTK_MainWindowBase::Initialize(myRenderer.GetPointer());
+ VVTK_MainWindowBase::Initialize(myRenderer);
myRenderer->Delete();
myRenderer->SetRenderer1(myMainWindow->GetRenderer1());
void OnPlaneSegmentationSwitch(bool theIsPlaneSegmentationOn);
protected:
- vtkSmartPointer<VVTK_Renderer1> myRenderer;
+ VVTK_Renderer1* myRenderer;
};
protected:
VVTK_MainWindow1* myMainWindow;
- vtkSmartPointer<VVTK_Renderer2> myRenderer;
+ VVTK_Renderer2* myRenderer;
};