<div>Sorry I attached wrong code. Here is the function</div>
<div>void CVTKDialogDlg::ShowLandmarks(double current_mode[][3])<br>{<br> CRect rect;<br> CWnd* p = GetDlgItem(IDC_SHOW_FACE);<br> p-&gt;GetClientRect(&amp;rect);</div>
<div> </div>
<div> int index;<br> double x, y, z;</div>
<div> for (int i = 0; i &lt; sizeof(landmarks)/sizeof(double); i++)<br> {<br>  index = landmarks[i];<br>  x = current_mode[index][0];<br>  y = current_mode[index][1];<br>  z = current_mode[index][2];<br>  //newpoints-&gt;InsertPoint(vtkIdType(i), current_mode[index][0], current_mode[index][1], (current_mode[index][2])+0.2);<br>
  newpoints-&gt;InsertPoint(vtkIdType(i), x, y, z+0.2);<br> }</div>
<div> newpolydata-&gt;SetPoints(newpoints);<br> gf = vtkVertexGlyphFilter::New();<br> gf-&gt;AddInput(newpolydata);<br> gf-&gt;Update();</div>
<div> newarray = vtkFloatArray::New();<br> for (int j = 0; j &lt; sizeof(landmarks)/sizeof(double); j++)<br> {<br>  newarray-&gt;InsertTuple1(vtkIdType(j), double(j));<br> }</div>
<div> newpolydata = vtkPolyData::New();<br> newpolydata-&gt;GetPointData()-&gt;SetScalars(newarray);</div>
<div> newmapper = vtkPolyDataMapper::New();<br> newmapper-&gt;SetInputConnection(gf-&gt;GetOutputPort());<br> newmapper-&gt;SetScalarRange(0, 7);<br> newmapper-&gt;SetScalarVisibility(0);</div>
<div> newactor = vtkActor::New();<br> newactor-&gt;SetMapper(newmapper);<br> newactor-&gt;GetProperty()-&gt;SetColor(0.0, 1.0, 0.0);<br> newactor-&gt;GetProperty()-&gt;SetPointSize(10);</div>
<div> ren-&gt;AddActor(newactor);<br> renWin-&gt;AddRenderer(ren);<br> renWin-&gt;SetParentId(p-&gt;m_hWnd);<br> renWin-&gt;SetSize(rect.right-rect.left, rect.bottom-rect.top);</div>
<div> ren-&gt;Render();<br> renWin-&gt;Render();</div>
<div>}</div>
<div> </div>
<div>Yes, I checked it and am sure that it is called as the slider moved.</div>
<div> </div>
<div>It looks like the points moving without refreshing the screen.</div>
<div> </div>
<div>Thank you very much</div>
<div> </div>
<div>Long<br><br></div>
<div class="gmail_quote">2011/10/13 David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div></div>
<div class="h5">On Thu, Oct 13, 2011 at 12:14 PM, Wenlong Wang &lt;<a href="mailto:scc.wwl@gmail.com">scc.wwl@gmail.com</a>&gt; wrote:<br>&gt; Yes, I put the refresh operations into a indepedent function, the source<br>&gt; code is followed.<br>
&gt;<br>&gt; vtkPoints* np = vtkPoints::New();<br>&gt;  float sd[5] = {166.58736074271718, 140.66998311271823, 95.52088334400537,<br>&gt; 65.09632977166221, 59.0649201078395};<br>&gt;  for (int i = 0; i &lt; 5090; i++)<br>
&gt;  {<br>&gt;   for (int j = 0; j&lt;3; j++)<br>&gt;   {<br>&gt;    mode[i][j] = 0.0;<br>&gt;    mode[i][j] = mode1[i][j] * x1 * sd[0] + mode2[i][j] * x2 * sd[1] +<br>&gt; mode3[i][j] * x3 * sd[2] + mode4[i][j] * x4 * sd[3] + mode5[i][j] * x5 *<br>
&gt; sd[4] + meanface[i][j];<br>&gt;   }<br>&gt;  }<br>&gt;  for (int k = 0; k&lt; 5090; k++)<br>&gt;  {<br>&gt;   np-&gt;InsertPoint(k, mode[k]);<br>&gt;  }<br>&gt;<br>&gt;  points-&gt;DeepCopy(np);<br>&gt;<br>&gt;  face-&gt;SetPoints(points);<br>
&gt;  face-&gt;SetPolys(poly);<br>&gt;  face-&gt;GetPointData()-&gt;SetScalars(scalars);<br>&gt;<br>&gt;  faceMapper-&gt;SetInput(face);<br>&gt;  faceMapper-&gt;SetScalarRange(0, 7);<br>&gt;  faceMapper-&gt;SetScalarVisibility(0);<br>
&gt;<br>&gt;  faceActor-&gt;SetMapper(faceMapper);<br>&gt;  faceActor-&gt;GetProperty()-&gt;SetColor(0.9, 0.9, 0.9);<br>&gt;<br>&gt;  ren-&gt;SetBackground(0.1, 0.2, 0.4);<br>&gt;  ren-&gt;AddActor(faceActor);<br>&gt;  ren-&gt;SetActiveCamera(cam);<br>
&gt;  ren-&gt;ResetCamera();<br>&gt;  renWin-&gt;AddRenderer(ren);<br>&gt;  renWin-&gt;SetParentId(p-&gt;m_hWnd);<br>&gt;  renWin-&gt;SetSize(rect.right-rect.left, rect.bottom-rect.top);<br>&gt;  iren-&gt;SetRenderWindow(renWin);<br>
&gt;  renWin-&gt;Render();<br>&gt;<br><br></div></div>Please keep the conversation on the mailing list. You have not shown<br>there when that function is called - are you sure it is called as the<br>slider is being moved?<br>
<font color="#888888"><br>David<br></font></blockquote></div><br>