<!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> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=093253021-16082001>Thanks
for the help. 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. Is this possible? 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> </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> </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>
<P>public class FilterMethod <BR>{ <BR> public
FilterMethod() {}
<P> public void execute() {
<P> vtkPolyData input =
pFilt.GetPolyDataInput(); <BR> // do
some stuff like calculate new scalars?
<BR> int numPts =
input.GetNumberOfPoints();
<P> vtkScalars newScalars = new
vtkScalars();
<P> for (int i = 0; i < numPts;
++i) { <BR>
newScalars.InsertScalar(i, 2*i);
<BR> }
<P>
pFilt.GetPolyDataOutput().CopyStructure(input);
<BR>
pFilt.GetPolyDataOutput().GetPointData().SetScalars(newScalars);
<BR> newScalars = null;
<BR> } <BR>}
<P>Mabey you forgot the copy from input to output? <BR>-Jeff <BR>
<BR> <BR>
<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? A call to progfilter.GetOutput or
progfilter.GetPolyDataOutput returns a null. 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> public class MyExecuteMethod {
<P> public MyExecuteMethod(){ }
<P> public void execute(){
<BR>
doStuff().... <BR> }
<BR> } <BR>
<P>Ben Held wrote:
<BLOCKQUOTE TYPE="CITE">Hello,
<P>I need to make use of vtkProgrammableFilter in my java
application. 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 & Applied Research, Inc.
<BR>11520 N. Port Washington Rd. <BR>Suite 101B <BR>Mequon, WI
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: <<A
href="http://public.kitware.com/cgi-bin/vtkfaq">http://public.kitware.com/cgi-bin/vtkfaq</A>>
<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>--
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> </BLOCKQUOTE></BLOCKQUOTE><PRE>--
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> </BLOCKQUOTE></BODY></HTML>