[vtkusers] vtkXMLPolyDataReader/Writer problem

madz madaramh at gmail.com
Thu Nov 7 22:14:00 EST 2013


	
Hi Bill,
The code I used to set up the colour looks as below.

vtkSmartPointer<vtkLookupTable> colorLookupTable =
vtkSmartPointer<vtkLookupTable>::New();

	colorLookupTable->SetTableRange(-100,500);
	double vmin,vmax; 
	colorLookupTable->GetHueRange(vmin,vmax);
	if(vmin!=vmax)
	{
		colorLookupTable->SetHueRange(0.6667,0.0);
	}
	colorLookupTable->Build();

	vtkSmartPointer<vtkContourFilter> contourFilter =
vtkSmartPointer<vtkContourFilter>::New();
	contourFilter->SetInputConnection(polydata->GetProducerPort()); 
	contourFilter->ComputeScalarsOn();
	contourFilter->GenerateValues(20,-100,500);

	// Visualize
	vtkSmartPointer<vtkPolyDataMapper> mapper1 =
		vtkSmartPointer<vtkPolyDataMapper>::New();
	//mapper->SetInputConnection(reader->GetOutputPort());

	
	mapper1->SetInputConnection(contourFilter->GetOutputPort());
	mapper1->SetScalarRange(-100,500);
	mapper1->SetLookupTable(colorLookupTable);



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkXMLPolyDataReader-Writer-problem-tp5724345p5724353.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list