Problem 2 probably isn't a bug. The red book says that, "OpenGL is not a pixel-exact specificaiton" and for this reason the exact pixels and thus cells returned by the selector may vary. The TestAreaSelection test can produce slightly different images on Mesa and a graphics card because of this for example.
<br><br>Problem 1 probably is a bug and I&#39;ll take a look.<br><br><div><span class="gmail_quote">On 3/23/07, <b class="gmail_sendername">Lim, Theodore</b> &lt;<a href="mailto:T.Lim@hw.ac.uk">T.Lim@hw.ac.uk</a>&gt; wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<div>
<div dir="ltr">
<div dir="ltr"><font color="#000000" face="Arial" size="2">Hi David, and fellow 
vtk-er&#39;s,</font></div>
<div dir="ltr"><font face="Arial" size="2"></font>&nbsp;</div>
<div dir="ltr"><font face="Arial" size="2">I&#39;ve made a test to check the changes. What 
i&#39;ve done is to create a bounding sphere that encompass a test object.&nbsp; For 
each long-lat intersection of the sphere source, I re-locate the current camera 
position to&nbsp;a long-lat intersection and set the camera&#39;s focal point to the 
center of the bounding sphere. Once the camera is in its new position, it is 
reset so as to view the whole object. Then the visible test is 
performed.</font></div>
<div dir="ltr"><font face="Arial" size="2"></font>&nbsp;</div>
<div dir="ltr"><font face="Arial" size="2">The OffScreen&nbsp;works great but now i 
have a problem with OnScreen rendering. I&#39;ve attached my code 
below.</font></div>
<div dir="ltr"><font face="Arial" size="2"></font>&nbsp;</div>
<div dir="ltr"><font face="Arial" size="2">Test subject:</font></div>
<div dir="ltr"><font face="Arial" size="2"></font>&nbsp;</div>
<div dir="ltr"><font face="Arial" size="2">Using STL model - 424000-IDGH.stl (located 
in vtkData branch)</font></div>
<div dir="ltr"><font face="Arial" size="2"></font>&nbsp;</div>
<div dir="ltr"><font face="Arial" size="2">Problem 1:</font></div>
<div dir="ltr"><font face="Arial" size="2"></font>&nbsp;</div>
<div dir="ltr"><font face="Arial" size="2">When&nbsp; </font><font face="Arial" size="2">renWin-&gt;SetOffScreenRendering(0)&nbsp;, the first time through the 
&#39;for&#39; loop (i.e. when i = 0), vtkVisibleCellSelector works fine. The number of 
cells returned is 2114 (based on the window size 800x800).</font></div>
<div dir="ltr"><font face="Arial" size="2"></font>&nbsp;</div>
<div dir="ltr"><font face="Arial" size="2">Then, for any value of&nbsp;i&nbsp;&gt; 0, 
vtkVisibleCellSelector always returns 1 cell. Why??</font></div>
<div dir="ltr"><font face="Arial" size="2"></font>&nbsp;</div>
<div dir="ltr"><font face="Arial" size="2">Problem 2:</font></div>
<div dir="ltr"><font face="Arial" size="2"></font>&nbsp;</div>
<div dir="ltr"><font face="Arial" size="2">When&nbsp; 
renWin-&gt;SetOffScreenRendering(1), and i = 0, the number of cells returned is 
2116. Shouldn&#39;t this be the same as when renWin-&gt;SetOffScreenRendering(0), 
i.e. return 2114 cells??</font></div>
<div dir="ltr"><font face="Arial" size="2"></font>&nbsp;</div>
<div dir="ltr"><font face="Arial" size="2">For any value i &gt; 0, there are always 
cells being returned (Yay!). Some results: When i = 1 (3448 cells), i = 2 (2574 
cells). No complaints here, i&#39;m getting cells back eventhough there are a couple 
extra (perhaps?).</font></div>
<div dir="ltr"><font face="Arial" size="2"></font>&nbsp;</div>
<div dir="ltr"><font face="Arial" size="2">Would appreciate if you or anyone else can 
spot&nbsp;the errors i&#39;m getting and how to solve it.</font></div>
<div dir="ltr"><font face="Arial" size="2"></font>&nbsp;</div>
<div dir="ltr"><font face="Arial" size="2">Many thanks in advance, </font></div>
<div dir="ltr"><font face="Arial" size="2">Theo.</font></div>
<div dir="ltr"><font face="Arial" size="2"></font>&nbsp;</div>
<div dir="ltr"><font face="Arial" size="2">//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
</font></div>
<div dir="ltr"><font face="Arial" size="2"></font>&nbsp;</div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">// TestVCellSelector.cpp : 
Defines the entry point for the console application.<br>//<br>#include 
&lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include 
&lt;iostream&gt;<br>#include &lt;fstream&gt;<br>#include 
&lt;tchar.h&gt;</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">#include 
&quot;vtkRenderer.h&quot;<br>#include &quot;vtkRenderWindow.h&quot;<br>#include 
&quot;vtkRenderWindowInteractor.h&quot;<br>#include &quot;vtkSphereSource.h&quot;<br>#include 
&quot;vtkPolyDataMapper.h&quot;<br>#include &quot;vtkActor.h&quot;<br>#include 
&quot;vtkInteractorStyleTrackballCamera.h&quot;<br>#include 
&quot;vtkCallbackCommand.h&quot;<br>#include &quot;vtkVisibleCellSelector.h&quot;<br>#include 
&quot;vtkSelection.h&quot;<br>#include &quot;vtkExtractSelectedPolyDataIds.h&quot;<br>#include 
&quot;vtkIdTypeArray.h&quot;<br>#include &quot;vtkCamera.h&quot;<br>#include 
&quot;vtkSmartPointer.h&quot;</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">#include 
&quot;vtkSTLReader.h&quot;<br>#include &quot;vtkProperty.h&quot;<br>#include 
&quot;vtkPoints.h&quot;</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">#include 
&quot;vtkWin32OpenGLRenderWindow.h&quot;<br>#include 
&quot;vtkWindowToImageFilter.h&quot;<br>#include &quot;vtkJPEGWriter.h&quot;</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">#include 
&quot;vtkUnsignedCharArray.h&quot;</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">using namespace 
std;</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">int main()<br>{<br>&nbsp;// 
Standard rendering classes<br>&nbsp;vtkSmartPointer&lt;vtkRenderer&gt; renderer 
= vtkSmartPointer&lt;vtkRenderer&gt;::New();<br>&nbsp;// set up the 
view<br>&nbsp;renderer-&gt;GetActiveCamera()-&gt;SetViewUp(0, 1, 
0);<br>&nbsp;renderer-&gt;SetBackground(0.0,0.0,0.0);<br>&nbsp;// set render 
window<br>&nbsp;vtkSmartPointer&lt;vtkRenderWindow&gt; renWin = 
vtkSmartPointer&lt;vtkRenderWindow&gt;::New();<br>&nbsp;renWin-&gt;AddRenderer(renderer);<br>&nbsp;renWin-&gt;SetSize(800,800);<br>&nbsp;/***********************************/<br>&nbsp;// 
In &#39;for&#39; loop below:<br>&nbsp;// Works great offscreen with 
vtkVisibleCellSelector 
(huzzahhh!)<br>&nbsp;//renWin-&gt;SetOffScreenRendering(1);<br>&nbsp;// Works 
1st time when set onscreen, faults after that (returns only 1 cell -- 
why??!!).<br>&nbsp;renWin-&gt;SetOffScreenRendering(0);<br>&nbsp;/***********************************/<br>&nbsp;// 
set interactor<br>&nbsp;vtkSmartPointer&lt;vtkRenderWindowInteractor&gt; iren = 
vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;::New();<br>&nbsp;iren-&gt;SetRenderWindow(renWin); 
<br>&nbsp;//use the trackball camera interactor 
style<br>&nbsp;vtkSmartPointer&lt;vtkInteractorStyleTrackballCamera&gt; style = 
vtkSmartPointer&lt;vtkInteractorStyleTrackballCamera&gt;::New();<br>&nbsp;iren-&gt;SetInteractorStyle(style);</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;////////////////////////////////////////////////////////////<br>&nbsp;// 
load test part<br>&nbsp;vtkSmartPointer&lt;vtkSTLReader&gt; reader = 
vtkSmartPointer&lt;vtkSTLReader&gt;::New();<br>&nbsp;reader-&gt;SetFileName(&quot;C:/VTKData/Data/42400-IDGH.stl&quot;);</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;// set on-screen 
mapper<br>&nbsp;vtkSmartPointer&lt;vtkPolyDataMapper&gt; map1 = 
vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();&nbsp;<br>&nbsp;map1-&gt;SetInput(reader-&gt;GetOutput());<br>&nbsp;map1-&gt;Update();</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;// set on-screen 
actor<br>&nbsp;vtkSmartPointer&lt;vtkActor&gt; act1 = 
vtkSmartPointer&lt;vtkActor&gt;::New();<br>&nbsp;act1-&gt;SetMapper(map1);<br>&nbsp;renderer-&gt;AddActor(act1);</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;// make a scaning 
sphere template<br>&nbsp;int res = 10;<br>&nbsp;double diagonal = 
act1-&gt;GetLength();<br>&nbsp;double *center = 
act1-&gt;GetCenter();<br>&nbsp;vtkSmartPointer&lt;vtkSphereSource&gt; S = 
vtkSmartPointer&lt;vtkSphereSource&gt;::New();<br>&nbsp;S-&gt;SetThetaResolution(res);<br>&nbsp;S-&gt;SetPhiResolution(res);<br>&nbsp;S-&gt;SetRadius(diagonal);<br>&nbsp;S-&gt;SetCenter(center);<br>&nbsp;S-&gt;Update();</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;// Get longLat 
intersect points<br>&nbsp;vtkSmartPointer&lt;vtkPoints&gt; pts = 
S-&gt;GetOutput()-&gt;GetPoints();</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;// Number of visible 
cells<br>&nbsp;vtkIdType numCells;</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;// Set visible cell 
selector<br>&nbsp;vtkSmartPointer&lt;vtkVisibleCellSelector&gt; sel1 = 
vtkSmartPointer&lt;vtkVisibleCellSelector&gt;::New();<br>&nbsp;sel1-&gt;SetRenderer(renderer);<br>&nbsp;sel1-&gt;SetRenderPasses(0,1,0,1,1);<br>&nbsp;int 
*size = 
renderer-&gt;GetSize();<br>&nbsp;sel1-&gt;SetArea(size[0],size[1],size[2],size[3]);</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;// Get visible cell 
scan at each long-Lat intersection<br>&nbsp;for (int i = 0; i &lt; 
pts-&gt;GetNumberOfPoints(); i++)<br>&nbsp;{<br>&nbsp;&nbsp;// set camera 
position at long-lat 
intersection&nbsp;&nbsp;<br>&nbsp;&nbsp;renderer-&gt;GetActiveCamera()-&gt;SetPosition(pts-&gt;GetPoint(i));<br>&nbsp;&nbsp;renderer-&gt;GetActiveCamera()-&gt;SetFocalPoint(center);<br>&nbsp;&nbsp;renderer-&gt;ResetCamera();</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;&nbsp;// Update view 
when not using offscreen, so can see orientation of camera relative to viewed 
object<br>&nbsp;&nbsp;if 
(!renWin-&gt;GetOffScreenRendering())<br>&nbsp;&nbsp;&nbsp;renWin-&gt;Render();</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;&nbsp;// 
Test...<br>&nbsp;&nbsp;////////////////////////////////////////////////////////////<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;// 
grab all visible cells in render 
window<br>&nbsp;&nbsp;sel1-&gt;Select();</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;&nbsp;// get selected 
ids<br>&nbsp;&nbsp;vtkSelection *res1 = 
vtkSelection::New();<br>&nbsp;&nbsp;sel1-&gt;GetSelectedIds(res1);<br>&nbsp;&nbsp;// 
extract cell id list<br>&nbsp;&nbsp;vtkSelection *cellids = 
res1-&gt;GetChild(0);<br>&nbsp;&nbsp;// get number of visible cells 
<br>&nbsp;&nbsp;vtkIdTypeArray *idArray = 
vtkIdTypeArray::SafeDownCast(cellids-&gt;GetSelectionList());<br>&nbsp;&nbsp;numCells 

idArray-&gt;GetNumberOfComponents()*idArray-&gt;GetNumberOfTuples();</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;&nbsp;////////////////////////////////////////////////////////////</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;&nbsp;res1-&gt;Delete();</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;}</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;// 
render&nbsp;<br>&nbsp;renWin-&gt;Render();</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;// 
start<br>&nbsp;iren-&gt;Initialize();<br>&nbsp;iren-&gt;Start();</font></div>
<div dir="ltr"><font color="#000000" face="Arial" size="2">&nbsp;return 
0;<br>}<br></font></div></div>
<div dir="ltr"><br>
<hr>
<font face="Tahoma" size="2"><b>From:</b> David E DeMarle 
[mailto:<a href="mailto:dave.demarle@kitware.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">dave.demarle@kitware.com</a>]<br><b>Sent:</b> Thu 22/03/2007 
19:12<br><b>To:</b> Lim, Theodore <br><b>Cc:</b> vtk-users<br><b>Subject:</b> 
Re: [vtkusers] Win32 OffScreen Rendering and Visibility cell 
selector<br></font><br></div>
<div>I&#39;ve just committed a change to vtkOpenGLRenderWindow which appears to fix 
it. The change is to return default values if the window isn&#39;t mapped like 
getColorDepth does.<br><br>cheers<br>Dave DeMarle<br><br>
<div><span class="gmail_quote">On 3/22/07, <b class="gmail_sendername">David E 
DeMarle</b> &lt;<a href="mailto:dave.demarle@kitware.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">dave.demarle@kitware.com</a>&gt; 
wrote:</span> 
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hmmm, 
  the program looks ok to me, with the exception of two calls to a &quot;render&quot; 
  instead of &quot;ofsrender&quot;.<br>I will try cell selection with offscreen rendering 
  on windows and see if I can reproduce the problem. <br><br>cheers<br>Dave 
  DeMarle<br><br><br>
  <div>
  <div><span><span class="gmail_quote">On 3/20/07, 
  <b class="gmail_sendername">Lim, Theodore</b> &lt;<a href="mailto:T.Lim@hw.ac.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> T.Lim@hw.ac.uk</a>&gt; 
  wrote:</span></span></div>
  <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div>
    <div><span>
    <div dir="ltr">
    <div dir="ltr"><font color="#000000" face="Arial" size="2"></font>Hi,</div>
    <div dir="ltr">&nbsp;</div>
    <div dir="ltr">Not sure how to put this but here goes...</div>
    <div dir="ltr">&nbsp;</div>
    <div dir="ltr">I&#39;m trying to get get visible cell data for a series of camera 
    positions and would like to do this using the Win32 offscreen rendering 
    capabilities.</div>
    <div dir="ltr">&nbsp;</div>
    <div dir="ltr">However, i discovered that the offscreen render window color 
    buffer size returns all 0 values. This seems to be the reason why the 
    visible cell selector fails. Is there a way to set (or force) values into 
    it?</div>
    <div dir="ltr">&nbsp;</div>
    <div dir="ltr">Or rather, can the new class vtkVisibilityCellSelector be used 
    in Offscreen rendering mode? And if so, how can this be achieved. I&#39;ve 
    attached the code which i&#39;m testing below.</div>
    <div dir="ltr">&nbsp;</div>
    <div dir="ltr">One note: i compiled with cmake option VTK_USE_OFFSCREEN set to 
    &#39;Off&#39; as this caused the vtkMFC examples (i.e. vtkDLG, vtkSDI, 
    vtkMDI)&nbsp;to crash. It also caused the same response to my own VTK-MFC 
    app. Not sure if this has anything to do with it not being able to use 
    Offscreen. In the test code below, i use the vtkWindowToImageFilter to grab 
    a snapshot of the offscreen render window and the results was as 
    expected.</div>
    <div dir="ltr">&nbsp;</div>
    <div dir="ltr">Any help would be greatly appreciated.</div>
    <div dir="ltr">&nbsp;</div>
    <div dir="ltr">Many thanks, Theo.</div>
    <div dir="ltr">&nbsp;</div>
    <div dir="ltr">/**************************************************************************************************/</div>
    <div dir="ltr">int main()<br>{<br>&nbsp;//Load 
    model<br>&nbsp;vtkSmartPointer&lt;vtkSTLReader&gt; reader = 
    vtkSmartPointer&lt;vtkSTLReader&gt;::New();<br>&nbsp;reader-&gt;SetFileName(&quot;C:/Model/Data/MillCut.stl&quot;);</div>
    <div dir="ltr">&nbsp;vtkSmartPointer&lt;vtkPolyDataMapper&gt; map1 = 
    vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();&nbsp;<br>&nbsp;map1-&gt;SetInput(reader-&gt;GetOutput());</div>
    <div dir="ltr"><br>&nbsp;// set up offscreen 
    renderer<br>&nbsp;vtkSmartPointer&lt;vtkRenderer&gt; ofsrenderer = 
    vtkSmartPointer&lt;vtkRenderer&gt;::New();<br>&nbsp;ofsrenderer-&gt;SetBackground(0.0,0.0,0.0); 
    <br>&nbsp;vtkSmartPointer&lt;vtkRenderWindow&gt; ofsrenWin = 
    vtkSmartPointer&lt;vtkRenderWindow&gt;::New();<br>&nbsp;ofsrenWin-&gt;AddRenderer(ofsrenderer);<br>&nbsp;ofsrenWin-&gt;SetSize(800,800);<br>&nbsp;ofsrenWin-&gt;SetOffScreenRendering(1);</div>
    <div dir="ltr">&nbsp;// set 
    interactor<br>&nbsp;vtkSmartPointer&lt;vtkRenderWindowInteractor&gt; iren = 
    vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;::New();<br>&nbsp;iren-&gt;SetRenderWindow(ofsrenWin);&nbsp; 
    </div>
    <div dir="ltr"><br>&nbsp;//set up the 
    view<br>&nbsp;renderer-&gt;GetActiveCamera()-&gt;SetViewUp(0, 1, 
    0);<br>&nbsp;renderer-&gt;SetBackground(0.0,0.0,0.0); 
    <br>&nbsp;&nbsp;<br>&nbsp;<br>&nbsp;// set 
    actor<br>&nbsp;vtkSmartPointer&lt;vtkActor&gt; act1 = 
    vtkSmartPointer&lt;vtkActor&gt;::New();<br>&nbsp;act1-&gt;SetMapper(map1);</div>
    <div dir="ltr">&nbsp;// add actor to renderer<br>&nbsp;double diagonal = 
    act1-&gt;GetLength();<br>&nbsp;double *center = 
    act1-&gt;GetCenter();&nbsp;<br>&nbsp;ofsrenderer-&gt;AddActor(act1);<br>&nbsp;ofsrenderer-&gt;GetActiveCamera()-&gt;SetFocalPoint(center);<br>&nbsp;ofsrenderer-&gt;GetActiveCamera()-&gt;SetPosition(20, 
    -20, -27);<br>&nbsp;ofsrenderer-&gt;ResetCamera();</div>
    <div dir="ltr"><br>&nbsp;ofsrenWin-&gt;Render();</div>
    <div dir="ltr">&nbsp;//-----------------------------------------------<br>&nbsp;// 
    check offscreen render window...<br>&nbsp;int 
    rgba[4];<br>&nbsp;ofsrenWin-&gt;GetColorBufferSizes(rgba);</div>
    <div dir="ltr">&nbsp;vtkSmartPointer&lt;vtkWindowToImageFilter&gt; wif = 
    vtkSmartPointer&lt;vtkWindowToImageFilter&gt;::New();//<br>&nbsp;wif-&gt;SetInput(ofsrenWin);<br>&nbsp;wif-&gt;Update();&nbsp;</div>
    <div dir="ltr">&nbsp;vtkSmartPointer&lt;vtkJPEGWriter&gt; jpgw = 
    vtkSmartPointer&lt;vtkJPEGWriter&gt;::New();<br>&nbsp;jpgw-&gt;SetInput(wif-&gt;GetOutput());<br>&nbsp;jpgw-&gt;SetQuality(100);<br>&nbsp;jpgw-&gt;SetFileName(&quot;D:/Projects/VTK/testoffscreen.jpg&quot;);<br>&nbsp;jpgw-&gt;Write();</div>

    <div dir="ltr">&nbsp;//-----------------------------------------------</div>
    <div dir="ltr"><br>&nbsp;// get visible 
    cells<br>&nbsp;vtkSmartPointer&lt;vtkVisibleCellSelector&gt; sel1 = 
    vtkSmartPointer&lt;vtkVisibleCellSelector&gt;::New();<br>&nbsp;sel1-&gt;SetRenderer(ofsrenderer);</div>
    <div dir="ltr">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // grab everything 
    in the render window viewport<br>&nbsp;int *size = 
    ofsrenderer-&gt;GetRenderWindow()-&gt;GetSize();<br>&nbsp;sel1-&gt;SetRenderPasses(0,1,0,1,1);<br>&nbsp;sel1-&gt;SetArea(size[0],size[1],size[2],size[3]);<br>&nbsp;sel1-&gt;Select();<br>&nbsp;vtkSmartPointer&lt;vtkSelection&gt; 
    res1 = 
    vtkSmartPointer&lt;vtkSelection&gt;::New();<br>&nbsp;sel1-&gt;GetSelectedIds(res1);</div>
    <div dir="ltr">&nbsp;vtkSmartPointer&lt;vtkSelection&gt; cellids = 
    res1-&gt;GetChild(0);<br>&nbsp;vtkSmartPointer&lt;vtkExtractSelectedPolyDataIds&gt; 
    extr = 
    vtkSmartPointer&lt;vtkExtractSelectedPolyDataIds&gt;::New();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    if (cellids)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    extr-&gt;SetInput(1, 
    act1-&gt;GetMapper()-&gt;GetInput());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    extr-&gt;SetInput(0, 
    cellids);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    extr-&gt;Update();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    sMap-&gt;SetInput(extr-&gt;GetOutput());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cerr &lt;&lt; 
    &quot;Empty color buffer selection -&quot; &lt;&lt; 
    endl;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cerr 
    &lt;&lt; &quot;Check display color depth. Must be at least 24 bit.&quot; &lt;&lt; 
    endl;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    sMap-&gt;SetInput(emptyPD);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    }</div>
    <div dir="ltr">&nbsp;////////////////////////////////////////////////////////////</div>
    <div dir="ltr">&nbsp;ofsrenWin-&gt;Render();</div>
    <div dir="ltr"><br>&nbsp;// Set the user method (bound to key 
    &#39;u&#39;)<br>&nbsp;iren-&gt;Initialize();<br>&nbsp;iren-&gt;Start();</div>
    <div dir="ltr"><br>&nbsp;return 0;<br>}</div>
    <div dir="ltr">&nbsp;</div>
    <div dir="ltr">&nbsp;</div></div></span></div></div><br>_______________________________________________<br>This 
    is the private VTK discussion list.<br>Please keep messages on-topic. Check 
    the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to 
    subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.vtk.org/mailman/listinfo/vtkusers 
  </a><br><br></blockquote></div><br></blockquote></div><br></div></div></blockquote></div><br>