<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 5.50.4616.200" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=093253021-16082001>Jeff,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=093253021-16082001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=093253021-16082001>Thanks 
for the help.&nbsp; However, one thing that I forgot to mention is that I need 
to use the programmable filter to change the type of the data from 
vtkUnstructuredGrid to vtkPolyData.&nbsp; Is this possible?&nbsp; It appears 
that the programmable filter sets the output type to match the input type - is 
there a way to overload this or something?</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=093253021-16082001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=093253021-16082001>Thanks,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=093253021-16082001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=093253021-16082001>Ben</SPAN></FONT></DIV>
<BLOCKQUOTE>
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> jal@megadodo.segNET.COM 
  [mailto:jal@megadodo.segNET.COM]<B>On Behalf Of </B>J.A. Lee<BR><B>Sent:</B> 
  Thursday, August 16, 2001 1:55 PM<BR><B>To:</B> Ben Held<BR><B>Subject:</B> 
  Re: [vtkusers] How to use vtkProgrammableFilter in 
  Java<BR><BR></FONT></DIV>Ben, <BR>Presumably: <BR>vtkProgrammableFilter pFilt 
  = new vtkProgrammableFilter(); <BR>pFilt.SetInput(source.GetOutput()); // 
  mabey source is output of another filter? <BR>pFilt.SetExecuteMethod(new 
  FilterMethod(), "execute"); <BR>&nbsp; 
  <P>public class FilterMethod <BR>{ <BR>&nbsp;&nbsp;&nbsp; public 
  FilterMethod() {} 
  <P>&nbsp;&nbsp;&nbsp; public void execute() { 
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkPolyData input = 
  pFilt.GetPolyDataInput(); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // do 
  some stuff like calculate new scalars? 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int numPts = 
  input.GetNumberOfPoints(); 
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkScalars newScalars = new 
  vtkScalars(); 
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; numPts; 
  ++i) { <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  newScalars.InsertScalar(i, 2*i); 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } 
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  pFilt.GetPolyDataOutput().CopyStructure(input); 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  pFilt.GetPolyDataOutput().GetPointData().SetScalars(newScalars); 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newScalars = null; 
  <BR>&nbsp;&nbsp;&nbsp; } <BR>} 
  <P>Mabey you forgot the copy from input to output? <BR>-Jeff <BR>&nbsp; 
  <BR>&nbsp; <BR>&nbsp; 
  <P>Ben Held wrote: 
  <BLOCKQUOTE TYPE="CITE"><SPAN class=781331918-16082001><FONT 
    face=Arial><FONT color=#0000ff><FONT size=-1>Any idea how to setup up the 
    output for the programmable filter?&nbsp; A call to progfilter.GetOutput or 
    progfilter.GetPolyDataOutput returns a null.&nbsp; Calling 
    progfilter.SetOutput(new vtkPolyData()) seems to work, but my output isn't 
    rendered (I see nothing).</SPAN><SPAN class=781331918-16082001></SPAN><SPAN 
    class=781331918-16082001>Ben</FONT></FONT></FONT></SPAN> 
    <BLOCKQUOTE>
      <DIV class=OutlookMessageHeader dir=ltr><FONT face=Tahoma><FONT 
      size=-1>-----Original Message-----</FONT></FONT> <BR><FONT 
      face=Tahoma><FONT size=-1><B>From:</B> jal@megadodo.segNET.COM [<A 
      href="mailto:jal@megadodo.segNET.COM">mailto:jal@megadodo.segNET.COM</A>]<B>On 
      Behalf Of </B>J.A. Lee</FONT></FONT> <BR><FONT face=Tahoma><FONT 
      size=-1><B>Sent:</B> Thursday, August 16, 2001 12:32 PM</FONT></FONT> 
      <BR><FONT face=Tahoma><FONT size=-1><B>To:</B> Ben Held</FONT></FONT> 
      <BR><FONT face=Tahoma><FONT size=-1><B>Subject:</B> Re: [vtkusers] How to 
      use vtkProgrammableFilter in Java</FONT></FONT></DIV>Ben, 
      <P>filt.SetExecuteMethod(new MyExecuteMethod(), "execute"); 
      <P>&nbsp;&nbsp;&nbsp; public class MyExecuteMethod { 
      <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public MyExecuteMethod(){ } 
      <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void execute(){ 
      <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      doStuff().... <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } 
      <BR>&nbsp;&nbsp;&nbsp; } <BR>&nbsp; 
      <P>Ben Held wrote: 
      <BLOCKQUOTE TYPE="CITE">Hello, 
        <P>I need to make use of vtkProgrammableFilter in my java 
        application.&nbsp; There <BR>are not any examples of how to set the 
        execute function to a Java function. <BR>I need to know the function 
        signatures and how to call SetExecuteMethod... 
        <P>Thanks, <BR>Ben 
        <P>Ben L. Held <BR>Simulation Technology &amp; Applied Research, Inc. 
        <BR>11520 N. Port Washington Rd. <BR>Suite 101B <BR>Mequon, WI&nbsp; 
        53092 <BR>Phone: (262) 240-0291 x101 <BR>FAX: (262) 240-0294 <BR>e-mail: 
        ben.held@staarinc.com <BR>web: <A 
        href="http://www.staarinc.com">http://www.staarinc.com</A> 
        <P>_______________________________________________ <BR>This is the 
        private VTK discussion list. <BR>Please keep messages on-topic. Check 
        the FAQ at: &lt;<A 
        href="http://public.kitware.com/cgi-bin/vtkfaq">http://public.kitware.com/cgi-bin/vtkfaq</A>&gt; 
        <BR>Follow this link to subscribe/unsubscribe: <BR><A 
        href="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/mailman/listinfo/vtkusers</A></P></BLOCKQUOTE><PRE>--&nbsp;
J.A. Lee
Software Engineer
Computational Dynamics North America
3 Schoolhouse Lane
Etna NH, 03750
ph: 603-643-9993 x109, fax: 603-643-9994</PRE>&nbsp;</BLOCKQUOTE></BLOCKQUOTE><PRE>--&nbsp;
J.A. Lee
Software Engineer
Computational Dynamics North America
3 Schoolhouse Lane
Etna NH, 03750
ph: 603-643-9993 x109, fax: 603-643-9994</PRE>&nbsp; </BLOCKQUOTE></BODY></HTML>