[vtkusers] What exactly happens in this scenario?

Rakesh Patil rakeshthp at in.com
Fri Jun 25 07:43:04 EDT 2010


Hello,I want to know what exactly happens in this scenario. I have a C++ class say, "myClass"myClass{ ... vtkActor2D *elementNumberActor; ...public: ... // Constructors and destructors void DisplayElementNumbers(); ...};Now, i have the function body as follows:void myClass::DisplayElementNumbers(){ vtkIdFilter *ids = vtkIdFilter::New(); ids>SetInputConnection( programmableFilter> GetOutputPort() ); ids>CellIdsOn(); ids>FieldDataOn(); vtkCellCenters *cellC = vtkCellCenters::New(); cellC>SetInputConnection( ids>GetOutputPort() );vtkSelecttVisiblePoints *vispts = vtkSelectVisiblePoints::New(); vispts>SetInputConnection( cellC>GetOutputPort() ); vispts>SetRenderer( pRenderer ); vtkLabelDataMapper *ldm = vtkLabelDataMapper::New(); ldm>SetInputConnection( vispts>GetOutputPort() ); ldm>SetLabelModeToLabelFieldData(); elementNumberActor = vtkActor2D::New(); elementNumberActor>SetMapper (ldm ); ldm>Delete();vispts>Delete();cellC>Delete();ids>Delete();}Well, the statement in the box is
  elementNumberActor = vtkActor2D::New();If i call this function again and again, will this statement cause in memory leak ?? How and what will be the performance of my application??Thanks in advanceRegardsRakesh PatilDear VTK ! Get Yourself a cool, short @in.com Email ID now!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100625/87cb1191/attachment.htm>


More information about the vtkusers mailing list