I am trying to make a vector of vector of pointers to my class. When this small demo enters the inner loop for the second time, I get a whole bunch of "Deleting unknown object: vtkObject".<br><br>Does anyone see a problem with this code? Or is there potentially a problem inside one of my vtkRay or vtkLidarPoint? I'm assuming something is happening when one of these is going out of scope since the errors occur on the loop entrance, but I don't see the problem with what is done here.<br>
<br>#include "vtkLidarPoint.h"<br>#include "vtkRay.h"<br><br>#include "vtkSmartPointer.h"<br><br>#include <vector><br><br>int main()<br>{<br><br> vtkstd::cout << "Deleting unknown object example2:" << vtkstd::endl;<br>
<br> vtkstd::vector<vtkstd::vector<vtkLidarPoint*> > OutputGrid;<br> OutputGrid.resize(10);<br> <br> for(unsigned int thetaCounter = 0; thetaCounter < 10; thetaCounter++)<br> {<br> vtkstd::vector<vtkLidarPoint*> Column;<br>
Column.clear();<br> Column.resize(10);<br> <br> for(unsigned int phiCounter = 0; phiCounter < 10; phiCounter++) //THIS LINE<br> {<br> vtkSmartPointer<vtkRay> Ray = vtkSmartPointer<vtkRay>::New();<br>
<br> vtkSmartPointer<vtkLidarPoint> LidarPoint = vtkSmartPointer<vtkLidarPoint>::New();<br> LidarPoint->SetRay(Ray);<br> <br> Column[phiCounter] = LidarPoint;<br> <br> }<br> <br>
OutputGrid[thetaCounter] = Column;<br> }<br> <br> return 0;<br>}<br><br>Any comments?<br><br clear="all">Thanks,<br><br>David<br>