title: How to make the code flow without closing the VTK render window?
body: <p>I'm using Visual Studio 2010, VTK 5.6 and configure my projects without using CMake.</p>
  
  <p>I'm dealing with numerical computing and want to generate several plots during the runtime using VTK. Starting with the line plot example given in the VTK web page I managed to generate the plot that I want. The problem is that the code doesn't continue without closing the plot window.</p>
  
  <p>From my "main.cpp" file, I send the command to a header file, where the VTK procedure is initiated.  </p>
  
  <pre><code>residualPlotter(x,xdim1d);
  </code></pre>
  
  <p>"residualPlotter" is the function that generates the plot. It's given below:</p>
  
  <pre><code>int residualPlotter(double* res, int size)
  {
  
    // Create a table with some points in it
    vtkSmartPointer&lt;vtkTable&gt; table = 
      vtkSmartPointer&lt;vtkTable&gt;::New();
  
    vtkSmartPointer&lt;vtkFloatArray&gt; arrX = 
      vtkSmartPointer&lt;vtkFloatArray&gt;::New();
    arrX-&gt;SetName("X Axis");
    table-&gt;AddColumn(arrX);
  
    vtkSmartPointer&lt;vtkFloatArray&gt; arrF = 
      vtkSmartPointer&lt;vtkFloatArray&gt;::New();
    arrF-&gt;SetName("Function");
    table-&gt;AddColumn(arrF);
  
    // Fill in the table with some example values
    table-&gt;SetNumberOfRows(size);
    for (int i = 0; i &lt; size; ++i)
    {
      table-&gt;SetValue(i, 0, i);
      table-&gt;SetValue(i, 1, res[i]);
    }
  
    // Set up the view
    vtkSmartPointer&lt;vtkContextView&gt; view = 
      vtkSmartPointer&lt;vtkContextView&gt;::New();
    view-&gt;GetRenderer()-&gt;SetBackground(1.0, 1.0, 1.0);
    view-&gt;GetRenderWindow()-&gt;SetSize(800,600);
  
    // Add multiple line plots, setting the colors etc
    vtkSmartPointer&lt;vtkChartXY&gt; chart = 
      vtkSmartPointer&lt;vtkChartXY&gt;::New();
    view-&gt;GetScene()-&gt;AddItem(chart);
    vtkPlot *line = chart-&gt;AddPlot(vtkChart::LINE);
    line-&gt;SetInput(table, 0, 1);
    line-&gt;SetColor(0, 100, 0, 255);
    line-&gt;SetWidth(1.75);
  
  
    // Set up an interactor and start
    vtkSmartPointer&lt;vtkRenderWindowInteractor&gt; renderWindowInteractor = 
      vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;::New();
    renderWindowInteractor-&gt;SetRenderWindow(view-&gt;GetRenderWindow());
    renderWindowInteractor-&gt;Initialize();
    renderWindowInteractor-&gt;Start();
  
  
    return EXIT_SUCCESS;
  
  }
  </code></pre>
  
  <p>So, I want the code to continue without the need to close the window. How should I modify the code?</p>
  
  <p>Thank you all.</p>