<html><div style='background-color:'><DIV>I am rendering a 3d model containing 50,000 sub-pieces of a vtkCylinder and a vtkSphere.&nbsp; My program works fine for smaller numbers, but when too-many branches are loaded, the computer will continue to tick away memory (I end the program after it reaches 1.5 GB).</DIV>
<DIV>&nbsp;</DIV>
<DIV>I render the cylinders as such (the spheres are done in a like manner):</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;vtkCylinderSource&nbsp;*cylinder = vtkCylinderSource::New();<BR>&nbsp;&nbsp;cylinder-&gt;SetHeight( norm );<BR>&nbsp;&nbsp;cylinder-&gt;SetRadius( radius );<BR>&nbsp;&nbsp;cylinder-&gt;SetResolution( 50.0 );<BR>&nbsp;&nbsp;cylinder-&gt;SetCapping( 1 );</DIV>
<DIV>&nbsp;&nbsp;vpx = vz;<BR>&nbsp;&nbsp;vpy = 0.0;<BR>&nbsp;&nbsp;vpz = -vx;<BR>&nbsp;<BR>&nbsp;&nbsp;vtkTransform&nbsp;*trans1 = vtkTransform::New();<BR>&nbsp;&nbsp;trans1-&gt;RotateWXYZ( angle*(180.0/pai), vpx, vpy, vpz );</DIV>
<DIV>&nbsp;&nbsp;vtkTransformPolyDataFilter *transpoly1 = vtkTransformPolyDataFilter::New();<BR>&nbsp;&nbsp;transpoly1-&gt;SetInput( cylinder-&gt;GetOutput() );<BR>&nbsp;&nbsp;transpoly1-&gt;SetTransform( trans1 );</DIV>
<DIV>&nbsp;&nbsp;vtkTransform&nbsp;*trans2 = vtkTransform::New();<BR>&nbsp;&nbsp;trans2-&gt;Translate( (sx+ex)/2.0, (sy+ey)/2.0, (sz+ez)/2.0 );</DIV>
<DIV>&nbsp;&nbsp;vtkTransformPolyDataFilter&nbsp;*transpoly2 = vtkTransformPolyDataFilter::New();&nbsp;transpoly2-&gt;SetInput( transpoly1-&gt;GetOutput() );<BR>&nbsp;&nbsp;transpoly2-&gt;SetTransform( trans2 );</DIV>
<DIV>&nbsp;&nbsp;vtkPolyDataMapper&nbsp;*cylinderMapper = vtkPolyDataMapper::New();<BR>&nbsp;&nbsp;cylinderMapper-&gt;SetInput( transpoly2-&gt;GetOutput() );</DIV>
<DIV>&nbsp;&nbsp;vtkActor&nbsp;*cylinderActor = vtkActor::New();<BR>&nbsp;&nbsp;cylinderActor-&gt;SetMapper( cylinderMapper );<BR></DIV>
<DIV>...</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;actors.push_back( cylinderActor );<BR></DIV>
<DIV>&nbsp;&nbsp;renderer = vtkwindow-&gt;getRenderer();<BR>&nbsp;&nbsp;renderer-&gt;SetBackground( 0, 0, 0 );<BR>&nbsp;&nbsp;renderer-&gt;AddActor( cylinderActor );<BR></DIV>
<DIV>&nbsp;&nbsp;cylinder-&gt;Delete();<BR>&nbsp;&nbsp;cylinderMapper-&gt;Delete();<BR>&nbsp;&nbsp;trans1-&gt;Delete();<BR>&nbsp;&nbsp;trans2-&gt;Delete();<BR>&nbsp;&nbsp;transpoly1-&gt;Delete();<BR>&nbsp;&nbsp;transpoly2-&gt;Delete();<BR></DIV>
<DIV>There is a function: &nbsp; void ReleaseGraphicsResources(vtkWindow *);</DIV>
<DIV>However, the function requires that I render with a vtkWindow (I am using a FOX-GUI renderering window widget class called FXVTKWindow).</DIV>
<DIV>&nbsp;</DIV>
<DIV>Is there anything I can do to reduce the amount of memory spent on each actor or else recover the memory after each actor is created?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Brian<BR></DIV></div><br clear=all><hr>MSN Photos is the easiest way to share and print your photos: <a href='http://g.msn.com/1HM305401/46'>Click Here</a><br></html>