[vtkusers] Convex hull visuzlization crash problem in qvtkWidget

Xiaopeng Yang yxp233 at postech.ac.kr
Sat Jan 15 02:38:14 EST 2011


Dear Members,

 

I made a system by QT, VTK, and ITK. In the system, 10 convex hulls are
generated and visualized by the same vtkRenderer in a qvtkWidget. After
visualization, the interaction function does not work. I could not drag and
rotate the convex hulls. But I can zoom in and out through the mouse wheel.
Then after 2 or 3 seconds, the program crashed out. I tried many different
ways to solve the problem since last weekend, however, still I did not
succeed yet. I would appreciate a lot if anyone can give me some advice. I
attach the code here for reference. Thank you very much!

 

      if (seg_no == 0)

       {

              for (i = 0; i < spl_max; i++)

              {

                     points1->InsertNextPoint(segment_point_list[i][0],
segment_point_list[i][1], segment_point_list[i][2]);

              }

              polydata1->SetPoints(points1);

              delaunay3D1->SetInput (polydata1);

              delaunay3D1->Update();

 
delaunayMapper1->SetInputConnection(delaunay3D1->GetOutputPort());

              delaunayActor1->SetMapper(delaunayMapper1);

              delaunayActor1->GetProperty()->SetColor(1,0,0);

       }

       else if (seg_no == 1)

       {

              for (i = 0; i < spl_max; i++)

              {

                     points2->InsertNextPoint(segment_point_list[i][0],
segment_point_list[i][1], segment_point_list[i][2]);

              }

              polydata2->SetPoints(points2);

              delaunay3D2->SetInput (polydata2);

 
delaunayMapper2->SetInputConnection(delaunay3D2->GetOutputPort());

              delaunayActor2->SetMapper(delaunayMapper2);

              delaunayActor2->GetProperty()->SetColor(1,1,0);

       }

.

 

vtkSmartPointer<vtkRenderWindow> renderWindow      =
vtkSmartPointer<vtkRenderWindow>::New();

renderWindow = this->ui->qvtkWidget_4->GetRenderWindow();

renderWindow->AddRenderer(delaunayRenderer);

 

vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();

renderWindowInteractor->SetRenderWindow(renderWindow);

 

delaunayRenderer->AddActor(delaunayActor1);

delaunayRenderer->AddActor(delaunayActor2);

delaunayRenderer->AddActor(delaunayActor3);

delaunayRenderer->AddActor(delaunayActor4);

delaunayRenderer->AddActor(delaunayActor5);

delaunayRenderer->AddActor(delaunayActor6);

delaunayRenderer->AddActor(delaunayActor7);

delaunayRenderer->AddActor(delaunayActor8);

delaunayRenderer->AddActor(delaunayActor9);

delaunayRenderer->AddActor(delaunayActor10);

 

delaunayRenderer->SetBackground(1,1,1);

 

renderWindow->Render();

renderWindowInteractor->Initialize();

renderWindowInteractor->Start();

}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110115/1d63dcaf/attachment.htm>


More information about the vtkusers mailing list