<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,&nbsp;<div><br></div><div><div>Let's assume I have two actors with exactly the same shape. To avoid creating the vtkPolyData and vtkPolyDataMapper twice, I decided to let both actors share the same vtkPolyDataMapper.</div><div><br></div><div>vtkSmartPointer&lt;vtkPolyDataMapper&gt; sphereMapper = ...</div><div><br></div><div><br></div><div>// Sphere</div><div>vtkSmartPointer&lt;vtkActor&gt; sphereActor1 = ...</div><div>sphereActor1-&gt;SetMapper(sphereMapper);</div><div><br></div><div>//&nbsp;Sphere</div><div><div>vtkSmartPointer&lt;vtkActor&gt;&nbsp;sphereActor2&nbsp;= ...</div><div>sphereActor2-&gt;SetMapper(sphereMapper);</div><div><br></div><div><br></div><div>// Cube</div><div>vtkSmartPointer&lt;vtkPolyDataMapper&gt; cubeMapper = ...</div><div><div>vtkSmartPointer&lt;vtkActor&gt; cubeActor = ...</div><div>cubeActor-&gt;SetMapper(cubeMapper);</div></div><div><br></div><div>I was expecting sphereActor1 and sphereActor2 to be displayed as spheres while cubeActor would be a cube. Here is what I sometimes get:</div><div><br></div><div>sphereActor1 ---&gt; sphere</div><div>sphereActor2 --&gt; sphere &nbsp; &nbsp;</div><div>cubeActor ---&gt; ***&nbsp;sphere***&nbsp;</div><div><br></div><div>The cubeActor seems to be using the shereMapper. It has the correct position, color, scale, etc. Only the shape is wrong.</div><div><br></div><div>I can avoid this problem by doing this:</div><div>sphereMapper-&gt;<span class="Apple-style-span" style="font-family: Monaco; font-size: 12px; ">ImmediateModeRenderingOn();</span></div><div><font class="Apple-style-span" face="Monaco"><br></font></div><div>Doing a shallowCopy also seems to prevent that bug from happening:</div><div>vtkSmartPointer&lt;vtkPolyDataMapper&gt; sphereMapper1 =&nbsp;vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();</div><div>sphereMapper1-&gt;ShallowCopy(sphereMapper);</div><div>sphereActor1-&gt;SetMapper(sphereMapper1);</div><div><br></div><div>Am I missing something? Can multiple actors safely share the same mapper?</div><div><br></div><div>Thanks!</div><div><br></div><div>I am using&nbsp;VTK 5.7 on&nbsp;Mac OS X 10.6.7.</div><div><br></div><div>______________________</div><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Pascal Augustin</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Rogue Research Inc.<br>Montreal (Quebec), Canada<br><a href="http://www.rogue-research.com">www.rogue-research.com</a><br><br></div></div>
</div>
<br></div></div></body></html>