//------------------------------------------------------------------------------
void vvToolProfile::RemoveVTKObjects()
{
- for(int i=0;i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
- mCurrentSlicerManager->GetSlicer(i)->GetRenderer()->RemoveActor(mLineActors[i]);
- }
+ if (mCurrentSlicerManager)
+ {
+ for(int i=0;i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
+ mCurrentSlicerManager->GetSlicer(i)->GetRenderer()->RemoveActor(mLineActors[i]);
+ }
- if (mPoint1Selected)
- mCurrentSlicerManager->GetLandmarks()->RemoveLandmarkWithLabel("P1", mPoint1[3]);
- if (mPoint2Selected)
- mCurrentSlicerManager->GetLandmarks()->RemoveLandmarkWithLabel("P2", mPoint2[3]);
+ if (mPoint1Selected)
+ mCurrentSlicerManager->GetLandmarks()->RemoveLandmarkWithLabel("P1", mPoint1[3]);
+ if (mPoint2Selected)
+ mCurrentSlicerManager->GetLandmarks()->RemoveLandmarkWithLabel("P2", mPoint2[3]);
-
- if (mCurrentSlicerManager)
mCurrentSlicerManager->Render();
+ }
}
//------------------------------------------------------------------------------