<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Bookman Old Style">Hi,</FONT></DIV>
<DIV><FONT face="Bookman Old Style">Generally you had better&nbsp;build the 
pipeline in your object constructor. If you have to&nbsp;AddRenderer() as 
pressing&nbsp;a button you can use the code I write, which can avoid adding the 
same renderer twice.</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
<DIV><FONT face="Bookman Old Style">void CMyIADView::MyAddRenderer(vtkRenderer 
*addedRen)<BR>{<BR>&nbsp;vtkRendererCollection *renderers = 
this-&gt;renWin-&gt;GetRenderers();<BR>&nbsp;vtkRenderer *ren;<BR>&nbsp;&nbsp; 
<BR>&nbsp;for (renderers-&gt;InitTraversal(); (ren = 
renderers-&gt;GetNextItem()); )<BR>&nbsp;{<BR>&nbsp;&nbsp;if(ren == 
addedRen)<BR>&nbsp;&nbsp;&nbsp;return;<BR>&nbsp;}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT 
face="Bookman Old Style">&nbsp;this-&gt;renWin-&gt;AddRenderer(addedRen);</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
<DIV><FONT face="Bookman Old Style">}</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
<DIV><FONT face="Bookman Old Style">Cheers,</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
<DIV><FONT face="Bookman Old Style">Yixun Liu</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
<DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
<DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
<DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 9pt &#23435;&#20307;">----- Original Message ----- </DIV>
  <DIV style="BACKGROUND: #e4e4e4; FONT: 9pt &#23435;&#20307;; font-color: black"><B>From:</B> 
  <A title=rashed.karim@gmail.com href="mailto:rashed.karim@gmail.com">Rashed 
  Karim</A> </DIV>
  <DIV style="FONT: 9pt &#23435;&#20307;"><B>To:</B> <A title=yxliu@fudan.edu.cn 
  href="mailto:yxliu@fudan.edu.cn">Yixun Liu</A> ; <A title=vtkusers@vtk.org 
  href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</A> </DIV>
  <DIV style="FONT: 9pt &#23435;&#20307;"><B>Sent:</B> Monday, September 04, 2006 3:10 
PM</DIV>
  <DIV style="FONT: 9pt &#23435;&#20307;"><B>Subject:</B> Re: Why am I always running low on 
  memory?</DIV>
  <DIV><BR></DIV>Hi Liu, <BR><BR>You are right, I am doing renWin -&gt; 
  AddRenderer( ) several times, although not inside a loop. How can I avoid 
  doing this. Everytime I click a button on my program, I am creating a new 
  rendering on the same renderer window and that's why everytime I am doing 
  AddRenderer( ). How can I not do AddRenderer( ) everytime? Any ideas? 
  <BR><BR>Thanks for all your help, <BR><BR>Regards, <BR>Rashed karim <BR><BR>
  <DIV><SPAN class=gmail_quote>On 9/4/06, <B class=gmail_sendername>Yixun 
  Liu</B> &lt;<A href="mailto:yxliu@fudan.edu.cn">yxliu@fudan.edu.cn</A> &gt; 
  wrote:</SPAN>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
    <DIV>
    <DIV bgcolor="#ffffff">
    <DIV><FONT face="Bookman Old Style">Hi,</FONT></DIV>
    <DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
    <DIV><FONT face="Bookman Old Style">You can delete a filter immediately 
    after its output has been past to its downstream filter. For example 
    filter2-&gt;SetInput(filter1-&gt;GetOutput()); 
    filter1-&gt;Delete();</FONT></DIV>
    <DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
    <DIV><FONT face="Bookman Old Style">Do you put renWin-&gt;AddRenderer() in a 
    loop or call renWin-&gt;AddRenderer() often. Note that the same renderer 
    will be added many&nbsp; times in the renWin if you call AddRenderer() in a 
    loop. Two or three renderers will make your program run very 
    slow.</FONT></DIV>
    <DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
    <DIV><FONT face="Bookman Old Style">Cheers,</FONT></DIV>
    <DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
    <DIV><FONT face="Bookman Old Style">Yixun 
  Liu</FONT></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- 
  <BR>Rashed </BLOCKQUOTE></BODY></HTML>