<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1><pre><font size=2 face="Courier New"><span
style='font-size:10.0pt'>Thanks a lot Dave,<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>I actually already found the codepiece before but didn&#8217;t believe the function<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>EvaluateFunction would do the trick. Now it works but very slow of course. <o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>Since I only work with pointdata (vtkImageData) I can&#8217;t really use your advice to speed up the process. Or am I wrong and should test cells?<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>First I&#8217;ll try to use vtkThreadedImageAlgorithm instead of vtkImageAlgorithm to use multicores.<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>Then I think I need something like octree to exclude a lot of points from calculation.<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>I&#8217;ve seen there already exist: vtkHyperOctree hope I can use it for the task.<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>Btw: Why does posting to the forum always opens up a new thread? I click on the email-address of the last poster in the thread, it opens Office and should<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>Have gotten information &#8220;in-reply-to &#8230;&#8221; but still it doesn&#8217;t work.<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>Regards and thanks again<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>Michael<o:p></o:p></span></font></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'><o:p>&nbsp;</o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'><o:p>&nbsp;</o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'><o:p>&nbsp;</o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'><o:p>&nbsp;</o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'><o:p>&nbsp;</o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>To answer your original question: look at line 557. This tests a point<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>against the plane equations that define the frustum (when this-&gt;ExactTest is<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>off).<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'><o:p>&nbsp;</o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>If you decide to backport ExtractSelectedFrustum this explanation may help.<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>The algorithm it uses (when this-&gt;ExactTest is&nbsp; on) comes from Ned Greene,<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>Graphics Gems IV, 1994, p 74-82.&nbsp; What it does is, instead of testing each<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>vertex of a cell against all six plane equations that define the frustum,<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>you can determine which vertex is nearest and farthest to each of the<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>planes. By testing just those two vertices against the plane equations you<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>can quickly reject the cells that are completely outside of the frustum and<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>quickly accept the cells that are completely inside the frustum. The cells<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>that are neither completely in or out are then clipped to determine if they<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>really do intersect.<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'><o:p>&nbsp;</o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>In either case when the PassThrough flag is on, it runs through each cell,<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>uses one of the above options to determine if it is in or not and then puts<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>that result into the vtkInsidedness array.<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'><o:p>&nbsp;</o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>To test if a dataset has that array just do:<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'> vtkDataArray *insidedness = ds-&gt;GetCellData()-&gt;GetArray(&quot;vtkInsidedNess);<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>//or GetPointData as the case may be<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'> if (insidedness == NULL)<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>&nbsp;&nbsp; {<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>&nbsp;&nbsp;&nbsp; cerr &lt;&lt; &quot;It doesn't have it.&quot;<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>&nbsp;&nbsp; }<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'><o:p>&nbsp;</o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>cheers,<o:p></o:p></span></font></i></pre><pre><i><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-style:italic'>Dave DeMarle<o:p></o:p></span></font></i></pre>

<p class=MsoNormal><i><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial;font-style:italic'><o:p>&nbsp;</o:p></span></font></i></p>

</div>

</body>

</html>