[vtkusers] (no subject)

e.mambrini at llg.it e.mambrini at llg.it
Wed Jun 16 05:54:30 EDT 2004


Hi,

I'm a beginner with vtk. There are some problems when I execute this 
piece of code: 

vtkPolyData *teatro;
	teatro = vtkPolyData::New();
	teatro = riduttore->GetOutput();


	for(int i=0;i<points;i++)
	{
		float coords[3];
		teatro->GetPoint(i,coords);

//there should be a function that returns the values for colors depending 
on coords 

		float colors[3];
		colors[0] = 1;
		colors[1] = 0;
		colors[2] =  0;		

                                vtkFloatArray *data = vtkFloatArray::New();
		data = reinterpret_cast<vtkFloatArray *>
((teatro>GetPointData())->GetScalars());

//If I include any of these lines: prolems at run time
		//data->SetName("ciccio");
		//data->SetNumberOfTuples(1);
		//data->SetTuple(i,colors);
		
		//(((riduttore->GetOutput())->GetPointData())-
>GetScalars())->SetComponent(i,0,colors[0]);
		//(((riduttore->GetOutput())->GetPointData())-
>GetScalars())->SetComponent(i,1,colors[1]);
		//(((riduttore->GetOutput())->GetPointData())-
>GetScalars())->SetComponent(i,2,colors[2]);
	}
Can anybody tell me where is the problem? 

Thanks.
Eleonora

--
Registrati su www.webmail.it - Accesso gratuito fino a 128k
Mailbox da 20Mbyte con antivirus, antispam, accesso pop3 ed imap




More information about the vtkusers mailing list