<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">You sent this to the wrong list. You should have sent it to VTK users, not Insight users.</div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Mon, Feb 25, 2013 at 7:14 AM, yas --- <span dir="ltr">&lt;<a href="mailto:yas2349@gmail.com" target="_blank">yas2349@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr" style="text-align:left"><div><pre><span>#ifndef __APPLE_CC__</span>
<span>#include &lt;GL/glut.h&gt;</span>
<span>#else</span>
<span>#include &lt;glut.h&gt;</span>
<span>#endif</span>
<span>#include &quot;vtkConeSource.h&quot;</span>
<span>#include &quot;vtkPolyDataMapper.h&quot;</span>
<span>#include &quot;vtkRenderWindow.h&quot;</span>
<span>#include &quot;vtkCamera.h&quot;</span>
<span>#include &quot;vtkActor.h&quot;</span>
<span>#include &quot;vtkRenderer.h&quot;</span>
<span>#include &quot;vtkNew.h&quot;</span>
 
vtkNew<span>&lt;</span>vtkRenderer<span>&gt;</span> ren<span>;</span>
vtkNew<span>&lt;</span>vtkRenderWindow<span>&gt;</span> renWin<span>;</span>
 
<span>void</span> Reshape<span>(</span> <span>int</span> width, <span>int</span> height <span>)</span>
<span>{</span>          
  renWin<span>-</span><span>&gt;</span>SetSize<span>(</span> width, height <span>)</span><span>;</span>
<span>}</span>          
 
<span>void</span> Draw<span>(</span><span>)</span>
<span>{</span>         
  renWin<span>-</span><span>&gt;</span>Render<span>(</span><span>)</span><span>;</span>
  ren<span>-</span><span>&gt;</span>GetActiveCamera<span>(</span><span>)</span><span>-</span><span>&gt;</span>Azimuth<span>(</span> <span>1</span> <span>)</span><span>;</span>
  glutPostRedisplay<span>(</span><span>)</span><span>;</span>
<span>}</span>
 
<span>I write follow code,but renwin hast not member InitializeFromCurrentContext()?<br>How to solve this problem,and how to use opengl in vtk?<br>int</span> main<span>(</span> <span>int</span> argc, <span>char</span> <span>**</span>argv <span>)</span>
<span>{</span>
  <span>// GLUT initialization</span>
  glutInit<span>(</span> <span>&amp;</span>argc, argv <span>)</span><span>;</span>
  glutInitDisplayMode<span>(</span> GLUT_RGBA <span>|</span> GLUT_DOUBLE <span>|</span> GLUT_DEPTH <span>)</span><span>;</span>
  glutCreateWindow<span>(</span> <span>&quot;VTK-GLUT Example&quot;</span><span>)</span> <span>;</span>
  glutReshapeFunc<span>(</span> Reshape <span>)</span><span>;</span>
  glutDisplayFunc<span>(</span> Draw <span>)</span><span>;</span>
 
  <span>// Creation of a simple VTK pipeline</span>
  vtkNew<span>&lt;</span>vtkConeSource<span>&gt;</span> cone<span>;</span>
 
  vtkNew<span>&lt;</span>vtkPolyDataMapper<span>&gt;</span> coneMapper<span>;</span>
  coneMapper<span>-</span><span>&gt;</span>SetInputConnection<span>(</span> cone<span>-</span><span>&gt;</span>GetOutputPort<span>(</span><span>)</span> <span>)</span><span>;</span>
 
  vtkNew<span>&lt;</span>vtkActor<span>&gt;</span> coneActor<span>;</span>
  coneActor<span>-</span><span>&gt;</span>SetMapper<span>(</span> coneMapper.<span>GetPointer</span><span>(</span><span>)</span> <span>)</span><span>;</span>
 
  ren<span>-</span><span>&gt;</span>AddActor<span>(</span> coneActor.<span>GetPointer</span><span>(</span><span>)</span> <span>)</span><span>;</span>
  renWin<span>-</span><span>&gt;</span>AddRenderer<span>(</span> ren.<span>GetPointer</span><span>(</span><span>)</span> <span>)</span><span>;</span>
 
  <span>// Here is the trick: we ask the RenderWindow to join the current OpenGL context created by GLUT</span>
  renWin<span>-</span><span>&gt;</span>InitializeFromCurrentContext<span>(</span><span>)</span><span>;</span>
 
  <span>// Let&#39;s start the main GLUT rendering loop</span>
  glutMainLoop<span>(</span><span>)</span><span>;</span>
 
  <span>return</span> <span>EXIT_SUCCESS</span><span>;</span>
<span>}</span></pre></div></div>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div>