<div dir="ltr"><div><div><div><div>Hi,<br><br></div>I did follow this post to add these 2 macros, <a href="http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Factories_now_require_defines">http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Factories_now_require_defines</a><br>
<br></div>But still not resolved this problem. The following is a sample code using cone example on wiki. <br>---------------------------------------------<br><br>#include &quot;stdafx.h&quot;<br><br>#include &quot;vtkConeSource.h&quot;<br>
#include &quot;vtkPolyData.h&quot;<br>#include &quot;vtkSmartPointer.h&quot;<br>#include &quot;vtkPolyDataMapper.h&quot;<br>#include &quot;vtkActor.h&quot;<br>#include &quot;vtkRenderWindow.h&quot;<br>#include &quot;vtkRenderer.h&quot;<br>
#include &quot;vtkRenderWindowInteractor.h&quot;<br> <br><br>#define vtkRenderingCore_AUTOINIT 4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)<br>#define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL)<br>
<br><br><br>int main(int, char *[])<br>{<br>  //Create a cone<br>  vtkSmartPointer&lt;vtkConeSource&gt; coneSource =<br>    vtkSmartPointer&lt;vtkConeSource&gt;::New();<br>  coneSource-&gt;Update();<br> <br>  //Create a renderer, render window, and interactor<br>
  vtkSmartPointer&lt;vtkRenderer&gt; renderer =<br>    vtkSmartPointer&lt;vtkRenderer&gt;::New();<br><br>  if (!renderer)<br>    std::cout &lt;&lt; &quot;renderer is null &quot; &lt;&lt; std::endl;<br><br>  vtkSmartPointer&lt;vtkRenderWindow&gt; renderWindow =<br>
    vtkSmartPointer&lt;vtkRenderWindow&gt;::New();<br>  renderWindow-&gt;AddRenderer(renderer);<br>  vtkSmartPointer&lt;vtkRenderWindowInteractor&gt; renderWindowInteractor =<br>    vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;::New();<br>
  renderWindowInteractor-&gt;SetRenderWindow(renderWindow);<br><br>  //Create a mapper and actor<br>  vtkSmartPointer&lt;vtkPolyDataMapper&gt; mapper =<br>    vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();<br>  mapper-&gt;SetInputConnection(coneSource-&gt;GetOutputPort());<br>
 <br>  vtkSmartPointer&lt;vtkActor&gt; actor =<br>    vtkSmartPointer&lt;vtkActor&gt;::New();<br>  actor-&gt;SetMapper(mapper);<br> <br> <br>  //Add the actors to the scene<br>  renderer-&gt;AddActor(actor);<br>  renderer-&gt;SetBackground(.3, .2, .1); // Background color dark red<br>
 <br>  //Render and interact<br>  renderWindow-&gt;Render();<br>  renderWindowInteractor-&gt;Start();<br> <br>  return EXIT_SUCCESS;<br>}<br>---------------------------------------------------------------------<br><br></div>
Any comment or answer is very appreciated.<br><br></div>Chao<br></div>