I went ahead and made a minimal test.<br><br>#include &lt;iostream&gt;<br>#include &quot;vtkHyperOctree.h&quot;<br>using namespace std;<br>int main() {<br>    vtkHyperOctree* Octree1 = vtkHyperOctree::New();<br>    vtkHyperOctree* Octree2 = vtkHyperOctree::New();<br>
    Octree2-&gt;DeepCopy(Octree1);<br>    cout &lt;&lt; *Octree1 &lt;&lt; std::endl;<br>    cout &lt;&lt; *Octree2 &lt;&lt; std::endl;<br>}<br><br>This will require adding the line (or something similar) to vtkHyperOctree.cxx near line 112 in the PrintSelf method.<br>
<br>  os &lt;&lt; indent &lt;&lt; &quot;CellTree Ptr &quot; &lt;&lt; this-&gt;CellTree &lt;&lt; endl;<br><br>When I ran this I got (for example)<br><br>// From Octree1<br>... normal stuff... <br>CellTree Ptr 0x219f350<br>
<br>// From Octree2<br>... stuff ...<br>CellTree Ptr 0x219f350<br><br><br>Again, I was not expecting this, because now if I modify Octree1 it also modified Octree2. Which is not desired. <br><br clear="all"><div>-- Trevor<br>
</div>
<br><br><div class="gmail_quote">On 15 January 2013 15:44, Trevor Irons <span dir="ltr">&lt;<a href="mailto:trevorirons@gmail.com" target="_blank">trevorirons@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello. I am having a problem with the vtkHyperOctree-&gt;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&amp; os, vtkIndent indent)<br>{<br>  this-&gt;Superclass::PrintSelf(os,indent);<br><br>  os &lt;&lt; indent &lt;&lt; &quot;Dimension: &quot;&lt;&lt;this-&gt;Dimension&lt;&lt;endl;<br>

  os &lt;&lt; indent &lt;&lt; &quot;Size: &quot;&lt;&lt;this-&gt;Size[0]&lt;&lt;&quot;,&quot;&lt;&lt;this-&gt;Size[1]&lt;&lt;&quot;,&quot;;<br>  os &lt;&lt;this-&gt;Size[2]&lt;&lt;endl;<br>  os &lt;&lt; indent &lt;&lt; &quot;origin: &quot;&lt;&lt;this-&gt;Origin[0]&lt;&lt;&quot;,&quot;&lt;&lt;this-&gt;Origin[1]&lt;&lt;&quot;,&quot;;<br>

  os &lt;&lt;this-&gt;Origin[2]&lt;&lt;endl;<br><br>  os &lt;&lt; indent &lt;&lt; &quot;DualGridFlag: &quot; &lt;&lt; this-&gt;DualGridFlag &lt;&lt; endl;<br>  os &lt;&lt; indent &lt;&lt; &quot;CellTree Ptr &quot; &lt;&lt; this-&gt;CellTree &lt;&lt; endl;  // stream pointer address<br>

  //this-&gt;CellTree-&gt;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-&gt;Octree-&gt;DeepCopy(OctSamp2-&gt;GetOutput())<br>std::cout &lt;&lt; *OctSamp2-&gt;GetOutput() &lt;&lt; std::endl;<br>std::cout &lt;&lt; *Octree &lt;&lt; std::endl;<br>

<br>And the two pointer addresses were the same.<br><br>OctSamp2-&gt; GetOutput()  -&gt;&gt;&gt;&gt;&gt;   CellTree Ptr 0x237fcf0<br>Octree -                           -&gt;&gt;&gt;&gt;&gt;   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><span class="HOEnZb"><font color="#888888"><br clear="all"><div>-- Trevor<br></div>
</font></span></blockquote></div><br>