[vtkusers] What's wrong with me?

yaolu at engineering.uiowa.edu yaolu at engineering.uiowa.edu
Wed Sep 14 12:47:12 EDT 2005


Hi all,

I don't understand what's wrong with my code. There is no compile error, but
when i  run it, it breaks.

vtkImageGridSource *imageGrid = vtkImageGridSource::New();
	imageGrid->SetGridSpacing(10,10,20);
	//imageGrid->SetGridOrigin(-94.710373,-69.638529,15.593220);
	imageGrid->SetDataExtent(0,160, 0, 160, 0, 20);
	imageGrid->SetDataScalarTypeToUnsignedChar();
	imageGrid->SetLineValue(1);
	imageGrid->SetFillValue(0);
	imageGrid->Update();

vtkTransform *Rotation = vtkTransform::New();
	//Rotation->SetMatrix(RotationMatrix);

	vtkImageToPolyDataFilter *imagepolydata = vtkImageToPolyDataFilter::New();
	imagepolydata->SetInput(imageGrid->GetOutput());
	imagepolydata->Update();

	vtkTransformPolyDataFilter *RotationFilter = vtkTransformPolyDataFilter::New();
	RotationFilter->SetTransform(Rotation);
	RotationFilter->SetInput(imagepolydata->GetOutput());
	RotationFilter->Update();

	vtkPolyDataMapper *rgridMapper = vtkPolyDataMapper::New();
	rgridMapper->SetInput(RotationFilter->GetOutput());

	vtkActor *wireActor = vtkActor::New();
	wireActor->SetMapper(rgridMapper);

	m_Renderer->AddActor(wireActor);
	m_Renderer->SetBackground(0,0,0);
	fltkRenderWindowInteractor->Initialize();
	fltkRenderWindowInteractor->show();
	fltkRenderWindowInteractor->redraw();

Thanks a lot!

Jenny




More information about the vtkusers mailing list