<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"Pr\00E9format\00E9 HTML Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.PrformatHTMLCar
{mso-style-name:"Pr\00E9format\00E9 HTML Car";
mso-style-priority:99;
mso-style-link:"Pr\00E9format\00E9 HTML";
font-family:"Courier New";
mso-fareast-language:FR;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
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]-->
</head>
<body lang="FR" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:FR">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:FR">Could someone explain me how to use smartly the Modified() method for vtkPolyData.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:FR">In attachment, I give a simple example. I’m with VTK 6.3 and I use Qt bindings.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:FR">I have a timer (200ms) that fill dynamically a vtkPolyData instance.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:maroon;mso-fareast-language:FR">points</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">-><i>Initialize</i>();</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:maroon;mso-fareast-language:FR">vertices</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">->Initialize();</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:maroon;mso-fareast-language:FR">colors</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">-><i>Initialize</i>();</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:olive;mso-fareast-language:FR">for</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:purple;mso-fareast-language:FR">quint8</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:silver;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">i=</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:navy;mso-fareast-language:FR">0</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">;i<</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:maroon;mso-fareast-language:FR">nb_points</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">;i++)</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">{</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:maroon;mso-fareast-language:FR">points</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">->InsertNextPoint(i*</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:navy;mso-fareast-language:FR">0.01</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:silver;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:navy;mso-fareast-language:FR">0.0</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:silver;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:navy;mso-fareast-language:FR">0.0</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">);</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:maroon;mso-fareast-language:FR">vertex</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">->GetPointIds()->SetId(</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:navy;mso-fareast-language:FR">0</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">,i);</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:maroon;mso-fareast-language:FR">vertices</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">->InsertNextCell(</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:maroon;mso-fareast-language:FR">vertex</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">);</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:green;mso-fareast-language:FR">/*</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:silver;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:green;mso-fareast-language:FR">the</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:silver;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:green;mso-fareast-language:FR">first</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:silver;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:green;mso-fareast-language:FR">point</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:silver;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:green;mso-fareast-language:FR">is</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:silver;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:green;mso-fareast-language:FR">red,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:silver;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:green;mso-fareast-language:FR">others</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:silver;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:green;mso-fareast-language:FR">are</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:silver;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:green;mso-fareast-language:FR">blue</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:silver;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:green;mso-fareast-language:FR">*/</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:olive;mso-fareast-language:FR">if</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">(i==</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:navy;mso-fareast-language:FR">0</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:45.8pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:maroon;mso-fareast-language:FR">colors</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">->InsertNextTuple3(</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:navy;mso-fareast-language:FR">255</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:navy;mso-fareast-language:FR">0</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:navy;mso-fareast-language:FR">0</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">);</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:olive;mso-fareast-language:FR">else</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:45.8pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:maroon;mso-fareast-language:FR">colors</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">->InsertNextTuple3(</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:navy;mso-fareast-language:FR">0</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:navy;mso-fareast-language:FR">0</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:navy;mso-fareast-language:FR">255</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR">);</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black;mso-fareast-language:FR">}</span><span lang="EN-US" style="mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">And just after I call : <span style="color:maroon">
polydata</span><span style="color:black">-><i>Modified</i>();<o:p></o:p></span></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">This call produces no effects unless if I click inside my renderWindow or resize it.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">If a add an other timer (100ms) that just call
</span><span lang="EN-US" style="color:maroon">renderWindow</span><span lang="EN-US" style="color:black">-><i>Render</i>(); , then my points are well updated in my renderWindow but the Modified() call seems useless.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">Thanks in advance for your support,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">David<o:p></o:p></span></p>
</div>
</body>
</html>