[vtkusers] How to refresh the screnn

David Doria daviddoria at gmail.com
Thu Oct 13 12:36:27 EDT 2011


On Thu, Oct 13, 2011 at 12:14 PM, Wenlong Wang <scc.wwl at gmail.com> wrote:
> Yes, I put the refresh operations into a indepedent function, the source
> code is followed.
>
> vtkPoints* np = vtkPoints::New();
>  float sd[5] = {166.58736074271718, 140.66998311271823, 95.52088334400537,
> 65.09632977166221, 59.0649201078395};
>  for (int i = 0; i < 5090; i++)
>  {
>   for (int j = 0; j<3; j++)
>   {
>    mode[i][j] = 0.0;
>    mode[i][j] = mode1[i][j] * x1 * sd[0] + mode2[i][j] * x2 * sd[1] +
> mode3[i][j] * x3 * sd[2] + mode4[i][j] * x4 * sd[3] + mode5[i][j] * x5 *
> sd[4] + meanface[i][j];
>   }
>  }
>  for (int k = 0; k< 5090; k++)
>  {
>   np->InsertPoint(k, mode[k]);
>  }
>
>  points->DeepCopy(np);
>
>  face->SetPoints(points);
>  face->SetPolys(poly);
>  face->GetPointData()->SetScalars(scalars);
>
>  faceMapper->SetInput(face);
>  faceMapper->SetScalarRange(0, 7);
>  faceMapper->SetScalarVisibility(0);
>
>  faceActor->SetMapper(faceMapper);
>  faceActor->GetProperty()->SetColor(0.9, 0.9, 0.9);
>
>  ren->SetBackground(0.1, 0.2, 0.4);
>  ren->AddActor(faceActor);
>  ren->SetActiveCamera(cam);
>  ren->ResetCamera();
>  renWin->AddRenderer(ren);
>  renWin->SetParentId(p->m_hWnd);
>  renWin->SetSize(rect.right-rect.left, rect.bottom-rect.top);
>  iren->SetRenderWindow(renWin);
>  renWin->Render();
>

Please keep the conversation on the mailing list. You have not shown
there when that function is called - are you sure it is called as the
slider is being moved?

David



More information about the vtkusers mailing list