- py = bbGetInputlstPointY()[i]*spc[1];
- }
- if (bbGetInputlstPointZ().size() == bbGetInputlstPointX().size() )
- {
- pz = bbGetInputlstPointZ()[i]*spc[2];
- }
-
- // If the number of elements in the radio list is different from the number of X coordinates, the radio value is set to 1.
- if (bbGetInputlstRadio().size() == bbGetInputlstPointX().size() )
- {
- radio = bbGetInputlstRadio()[i];
- }
- else
- {
- if (bbGetInputlstRadio().size()>=1){
- radio = bbGetInputlstRadio()[ bbGetInputlstRadio().size() - 1 ];
- } else {
- radio = 1.0;
- }
- }
-
- // Sphere
- vtkSphereSource * newSphere = vtkSphereSource::New();
- vtkSphere.push_back(newSphere);
-
- newSphere -> SetThetaResolution(20);
- newSphere -> SetPhiResolution(20);
- newSphere -> SetRadius(radio);
-
- vtkPolyDataMapper * newMapper = vtkPolyDataMapper::New();
- sphereMapper.push_back(newMapper);
- newMapper -> SetInput( newSphere -> GetOutput() );
-
- vtkActor * newActor = vtkActor::New();
- sphereActor.push_back(newActor);
- newActor -> SetMapper(newMapper);
- newActor -> SetOrigin(0, 0, 0);
-
- unsigned int j = 3*i +2;
- if (j < bbGetInputColour().size() )
- {
- newActor -> GetProperty() -> SetColor( bbGetInputColour()[3*i] , bbGetInputColour()[3*i + 1] , bbGetInputColour()[3*i + 2] );
- last_valid_color_index = 3*i;
- }
- else
- newActor -> GetProperty() -> SetColor( bbGetInputColour()[last_valid_color_index] , bbGetInputColour()[last_valid_color_index + 1] , bbGetInputColour()[last_valid_color_index + 2] );
-
- newActor -> GetProperty() -> SetOpacity( bbGetInputOpacity() );
- newActor -> SetPosition( px,py,pz );
-
- if ( bbGetInputTransform()!=NULL )
+ int i;
+ int diff=sizeLstActors-sizeLstX;
+ for (i=0;i<diff;i++)
+ {
+ bbGetInputRenderer()->RemoveActor( sphereActor[0] );
+ vtkspheresourceLst[0]->Delete();
+ sphereActor[0]->Delete();
+ vtkspheresourceLst.erase( vtkspheresourceLst.begin() );
+ sphereActor.erase( sphereActor.begin() );
+ } // for
+ } // if size
+
+ if (sizeLstActors<sizeLstX)