Hello. I am having a problem with the vtkHyperOctree->DeepCopy method. The underlying CellTree is being shallow copied. <br><br>I made the following modification to vtkHyperOctree.cxx:112<br><br>//-----------------------------------------------------------------------------<br>
// because the PrintSelf test is not smart, PrintSelf has to be here.<br>void vtkHyperOctree::PrintSelf(ostream& os, vtkIndent indent)<br>{<br> this->Superclass::PrintSelf(os,indent);<br><br> os << indent << "Dimension: "<<this->Dimension<<endl;<br>
os << indent << "Size: "<<this->Size[0]<<","<<this->Size[1]<<",";<br> os <<this->Size[2]<<endl;<br> os << indent << "origin: "<<this->Origin[0]<<","<<this->Origin[1]<<",";<br>
os <<this->Origin[2]<<endl;<br><br> os << indent << "DualGridFlag: " << this->DualGridFlag << endl;<br> os << indent << "CellTree Ptr " << this->CellTree << endl; // stream pointer address<br>
//this->CellTree->PrintSelf(os,indent);<br>}<br><br>Just to check the address of the underlying tree. Then in a piece of (c++) code <br><br>vtkHyperOctreeSampleFunction* OctSamp2 = vtkHyperOctreeSampleFunction::New();<br>
vtkHyperOctree* Octree = vtkHyperOctree::New();<br>// Do the sampling<br>this->Octree->DeepCopy(OctSamp2->GetOutput())<br>std::cout << *OctSamp2->GetOutput() << std::endl;<br>std::cout << *Octree << std::endl;<br>
<br>And the two pointer addresses were the same.<br><br>OctSamp2-> GetOutput() ->>>>> CellTree Ptr 0x237fcf0<br>Octree - ->>>>> CellTree Ptr 0x237fcf0<br><br>
Which I did not expect, and is causing errors in my application. Is there a way to get a true deep copy? <br><br>If this is indeed an error I can generate a test file exhibiting the problem. But my method of checking involved mucking with the vtk source file. <br>
<br>Thanks for any help or input. <br><br clear="all"><div>-- Trevor<br></div>