<!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 build the
pipeline in your object constructor. If you have to AddRenderer() as
pressing 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> </DIV>
<DIV><FONT face="Bookman Old Style">void CMyIADView::MyAddRenderer(vtkRenderer
*addedRen)<BR>{<BR> vtkRendererCollection *renderers =
this->renWin->GetRenderers();<BR> vtkRenderer *ren;<BR>
<BR> for (renderers->InitTraversal(); (ren =
renderers->GetNextItem()); )<BR> {<BR> if(ren ==
addedRen)<BR> return;<BR> }</FONT></DIV>
<DIV> </DIV>
<DIV><FONT
face="Bookman Old Style"> this->renWin->AddRenderer(addedRen);</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">}</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">Cheers,</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">Yixun Liu</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 9pt 宋体">----- Original Message ----- </DIV>
<DIV style="BACKGROUND: #e4e4e4; FONT: 9pt 宋体; 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 宋体"><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 宋体"><B>Sent:</B> Monday, September 04, 2006 3:10
PM</DIV>
<DIV style="FONT: 9pt 宋体"><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 ->
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> <<A href="mailto:yxliu@fudan.edu.cn">yxliu@fudan.edu.cn</A> >
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> </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->SetInput(filter1->GetOutput());
filter1->Delete();</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">Do you put renWin->AddRenderer() in a
loop or call renWin->AddRenderer() often. Note that the same renderer
will be added many 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> </DIV>
<DIV><FONT face="Bookman Old Style">Cheers,</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </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>