<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
<br>
<span style="font-size: 10pt; font-family: DotumChe;">The default
vtkRenderWindowInteractor</span> from New() doesn't work with Qt.<br>
You should either get the interactor from QVTKWidget or make a
QVTKInteractor.<br>
<br>
Clint<br>
<br>
On 01/15/2011 12:38 AM, Xiaopeng Yang wrote:
<blockquote cite="mid:00f601cbb487$2b494d80$81dbe880$@ac.kr"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Malgun Gothic";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:DotumChe;
        panose-1:2 11 6 9 0 1 1 1 1 1;}
@font-face
        {font-family:"\@DotumChe";
        panose-1:2 11 6 9 0 1 1 1 1 1;}
@font-face
        {font-family:"\@Malgun Gothic";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Dear Members,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe; color: blue;"> if</span><span
style="font-size: 10pt; font-family: DotumChe;"> (seg_no ==
0)<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;"> {<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;"> <span style="color:
blue;">for</span> (i = 0; i < spl_max; i++)<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;"> {<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">
points1->InsertNextPoint(segment_point_list[i][0],
segment_point_list[i][1], segment_point_list[i][2]);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;"> }<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">
polydata1->SetPoints(points1);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">
delaunay3D1->SetInput (polydata1);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">
delaunay3D1->Update();<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">
delaunayMapper1->SetInputConnection(delaunay3D1->GetOutputPort());<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">
delaunayActor1->SetMapper(delaunayMapper1);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">
delaunayActor1->GetProperty()->SetColor(1,0,0);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;"> }<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;"> <span style="color: blue;">else</span>
<span style="color: blue;">if</span> (seg_no == 1)<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;"> {<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;"> <span style="color:
blue;">for</span> (i = 0; i < spl_max; i++)<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;"> {<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">
points2->InsertNextPoint(segment_point_list[i][0],
segment_point_list[i][1], segment_point_list[i][2]);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;"> }<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">
polydata2->SetPoints(points2);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">
delaunay3D2->SetInput (polydata2);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">
delaunayMapper2->SetInputConnection(delaunay3D2->GetOutputPort());<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">
delaunayActor2->SetMapper(delaunayMapper2);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">
delaunayActor2->GetProperty()->SetColor(1,1,0);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family:
DotumChe;"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 22pt; font-family:
"Times New Roman","serif";">…</span><span
style="font-size: 22pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;"><o:p> </o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">vtkSmartPointer<vtkRenderWindow>
renderWindow =
vtkSmartPointer<vtkRenderWindow>::New();<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">renderWindow = <span style="color:
blue;">this</span>->ui->qvtkWidget_4->GetRenderWindow();<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">renderWindow->AddRenderer(delaunayRenderer);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;"><o:p> </o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">vtkSmartPointer<vtkRenderWindowInteractor>
renderWindowInteractor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">renderWindowInteractor->SetRenderWindow(renderWindow);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;"><o:p> </o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">delaunayRenderer->AddActor(delaunayActor1);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">delaunayRenderer->AddActor(delaunayActor2);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">delaunayRenderer->AddActor(delaunayActor3);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">delaunayRenderer->AddActor(delaunayActor4);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">delaunayRenderer->AddActor(delaunayActor5);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">delaunayRenderer->AddActor(delaunayActor6);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">delaunayRenderer->AddActor(delaunayActor7);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">delaunayRenderer->AddActor(delaunayActor8);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">delaunayRenderer->AddActor(delaunayActor9);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">delaunayRenderer->AddActor(delaunayActor10);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;"><o:p> </o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">delaunayRenderer->SetBackground(1,1,1);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;"><o:p> </o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">renderWindow->Render();<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">renderWindowInteractor->Initialize();<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt;
font-family: DotumChe;">renderWindowInteractor->Start();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family:
DotumChe;">}</span><o:p></o:p></p>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the VTK FAQ at: <a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a>
</pre>
</blockquote>
<br>
</body>
</html>