<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"><<a href="mailto:yas2349@gmail.com" target="_blank">yas2349@gmail.com</a>></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 <GL/glut.h></span>
<span>#else</span>
<span>#include <glut.h></span>
<span>#endif</span>
<span>#include "vtkConeSource.h"</span>
<span>#include "vtkPolyDataMapper.h"</span>
<span>#include "vtkRenderWindow.h"</span>
<span>#include "vtkCamera.h"</span>
<span>#include "vtkActor.h"</span>
<span>#include "vtkRenderer.h"</span>
<span>#include "vtkNew.h"</span>
vtkNew<span><</span>vtkRenderer<span>></span> ren<span>;</span>
vtkNew<span><</span>vtkRenderWindow<span>></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>></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>></span>Render<span>(</span><span>)</span><span>;</span>
ren<span>-</span><span>></span>GetActiveCamera<span>(</span><span>)</span><span>-</span><span>></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>&</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>"VTK-GLUT Example"</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><</span>vtkConeSource<span>></span> cone<span>;</span>
vtkNew<span><</span>vtkPolyDataMapper<span>></span> coneMapper<span>;</span>
coneMapper<span>-</span><span>></span>SetInputConnection<span>(</span> cone<span>-</span><span>></span>GetOutputPort<span>(</span><span>)</span> <span>)</span><span>;</span>
vtkNew<span><</span>vtkActor<span>></span> coneActor<span>;</span>
coneActor<span>-</span><span>></span>SetMapper<span>(</span> coneMapper.<span>GetPointer</span><span>(</span><span>)</span> <span>)</span><span>;</span>
ren<span>-</span><span>></span>AddActor<span>(</span> coneActor.<span>GetPointer</span><span>(</span><span>)</span> <span>)</span><span>;</span>
renWin<span>-</span><span>></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>></span>InitializeFromCurrentContext<span>(</span><span>)</span><span>;</span>
<span>// Let'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>