<html><div style='background-color:'><DIV>I am rendering a 3d model containing 50,000 sub-pieces of a vtkCylinder and a vtkSphere. 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> </DIV>
<DIV>I render the cylinders as such (the spheres are done in a like manner):</DIV>
<DIV> </DIV>
<DIV> vtkCylinderSource *cylinder = vtkCylinderSource::New();<BR> cylinder->SetHeight( norm );<BR> cylinder->SetRadius( radius );<BR> cylinder->SetResolution( 50.0 );<BR> cylinder->SetCapping( 1 );</DIV>
<DIV> vpx = vz;<BR> vpy = 0.0;<BR> vpz = -vx;<BR> <BR> vtkTransform *trans1 = vtkTransform::New();<BR> trans1->RotateWXYZ( angle*(180.0/pai), vpx, vpy, vpz );</DIV>
<DIV> vtkTransformPolyDataFilter *transpoly1 = vtkTransformPolyDataFilter::New();<BR> transpoly1->SetInput( cylinder->GetOutput() );<BR> transpoly1->SetTransform( trans1 );</DIV>
<DIV> vtkTransform *trans2 = vtkTransform::New();<BR> trans2->Translate( (sx+ex)/2.0, (sy+ey)/2.0, (sz+ez)/2.0 );</DIV>
<DIV> vtkTransformPolyDataFilter *transpoly2 = vtkTransformPolyDataFilter::New(); transpoly2->SetInput( transpoly1->GetOutput() );<BR> transpoly2->SetTransform( trans2 );</DIV>
<DIV> vtkPolyDataMapper *cylinderMapper = vtkPolyDataMapper::New();<BR> cylinderMapper->SetInput( transpoly2->GetOutput() );</DIV>
<DIV> vtkActor *cylinderActor = vtkActor::New();<BR> cylinderActor->SetMapper( cylinderMapper );<BR></DIV>
<DIV>...</DIV>
<DIV> </DIV>
<DIV> actors.push_back( cylinderActor );<BR></DIV>
<DIV> renderer = vtkwindow->getRenderer();<BR> renderer->SetBackground( 0, 0, 0 );<BR> renderer->AddActor( cylinderActor );<BR></DIV>
<DIV> cylinder->Delete();<BR> cylinderMapper->Delete();<BR> trans1->Delete();<BR> trans2->Delete();<BR> transpoly1->Delete();<BR> transpoly2->Delete();<BR></DIV>
<DIV>There is a function: 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> </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> </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>