[vtkusers] What's wrong with me?

Amy Squillacote amy.squillacote at kitware.com
Wed Sep 14 13:28:12 EDT 2005


Hi Jenny,

Please be more specific about the problem you're seeing.  What 
breaks?  Does the program seg fault?  If so, please include a stack 
trace.  Does the program run but produce results you aren't 
expecting?  If so, please explain what you expected to happen and how 
that differs from the behavior you see.  Also, if this problem could 
be platform-specific, please describe the platform: OS, compiler, 
anything unusual about the hardware, etc.

- Amy

At 12:47 PM 9/14/2005, yaolu at engineering.uiowa.edu wrote:
>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
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list