void SphereList::Process()
{
-printf("EED SphereList::Process Start\n");
-
+/*
if (bbGetInputRenderer()!=NULL)
{
- int sizeLstX=bbGetInputlstPointX().size();
- int sizeLstY=bbGetInputlstPointY().size();
- int sizeLstZ=bbGetInputlstPointZ().size();
- int sizeLstActors=sphereActor.size();
+ int sizeLstX = bbGetInputlstPointX().size();
+ int sizeLstY = bbGetInputlstPointY().size();
+ int sizeLstZ = bbGetInputlstPointZ().size();
+ int sizeLstActors = sphereActor.size();
if ((sizeLstX==sizeLstY) &&(sizeLstX==sizeLstZ))
{
+ int i,diff;
if (sizeLstActors>sizeLstX)
{
- int i;
- int diff=sizeLstActors-sizeLstX;
+ diff=sizeLstActors-sizeLstX;
for (i=0;i<diff;i++)
{
bbGetInputRenderer()->RemoveActor( sphereActor[0] );
if (sizeLstActors<sizeLstX)
{
- int i;
- int diff=sizeLstX-sizeLstActors;
+ diff=sizeLstX-sizeLstActors;
for (i=0;i<diff;i++)
{
// Sphere
} // if size
// Refresh data
- for (int i = 0; i < sphereActor.size() ; i++)
+ for (i = 0; i < sphereActor.size() ; i++)
{
double px = 0.0;
double py = 0.0;
}// if Renderer
//====================================================================
+*/
+
+ if (bbGetInputRenderer()!=NULL)
+ {
+ int sizeLstX = bbGetInputlstPointX().size();
+ int sizeLstY = bbGetInputlstPointY().size();
+ int sizeLstZ = bbGetInputlstPointZ().size();
+ int sizeLstActors = sphereActor.size();
+ if ((sizeLstX==sizeLstY) &&(sizeLstX==sizeLstZ))
+ {
+ int i;
+ double px,py,pz;
+ double cr,cg,cb;
+ for ( i=0 ; i<sizeLstActors ; i++ )
+ {
+ bbGetInputRenderer()->RemoveActor( sphereActor[i] );
+ vtkspheresourceLst[i]->Delete();
+ vtkpolydatamaperLst[i]->Delete();
+ sphereActor[i]->Delete();
+ } // for
+ vtkspheresourceLst.clear();
+ vtkpolydatamaperLst.clear();
+ sphereActor.clear();
+
+
+ for (i=0;i<sizeLstX;i++)
+ {
+ // Sphere
+ vtkSphereSource * newSphere = vtkSphereSource::New();
+ vtkspheresourceLst.push_back(newSphere);
+ newSphere -> SetThetaResolution(20);
+ newSphere -> SetPhiResolution(20);
+ newSphere -> SetRadius( 1 );
+ vtkPolyDataMapper * newMapper = vtkPolyDataMapper::New();
+ vtkpolydatamaperLst.push_back(newMapper);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ newMapper -> SetInput( newSphere -> GetOutput() );
+#else
+ newSphere -> Update();
+ newMapper -> SetInputData( newSphere -> GetOutput() );
+#endif
+
+ vtkActor * newActor = vtkActor::New();
+ sphereActor.push_back(newActor);
+ newActor -> SetMapper(newMapper);
+ newActor -> SetOrigin(0, 0, 0);
+ if ( bbGetInputTransform()!=NULL )
+ {
+ newActor->SetUserTransform( bbGetInputTransform() );
+ }
+ bbGetInputRenderer()->AddActor( newActor );
+ } // for
+
+
+ // Refresh data
+ for (i = 0; i < sphereActor.size() ; i++)
+ {
+ GetPoint(i, px,py,pz);
+ GetColor(i, cr,cg,cb);
+ sphereActor[i] ->SetPosition( px,py,pz );
+ sphereActor[i] -> GetProperty() -> SetOpacity( bbGetInputOpacity() );
+ sphereActor[i] -> GetProperty() -> SetColor( cr,cg,cb );
+ vtkspheresourceLst[i] -> SetRadius( GetRadio(i) );
+ vtkspheresourceLst[i] -> Update();
+ } // for i
+
+ if (sphereActor.size() != 0)
+ {
+ // Sets the output.
+ bbSetOutputActorList(sphereActor);
+ }
+ } // sizeLstX sizeLstY sizeLstZ
+ } // if Renderer
}