<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hi,<br><br>I would like to copy a vtkPolyData into an other. <br>My goal is to copy the lines of the first vtkPolydata and to set the lines of the second. I know the "GetLines" method, but in my code i want to copy this lines from an vtkActor :<br><br>Example : <br><br>vtkCellArray lines = vtkCellArray.New();<br>/*<br>lines is build<br>*/<br><br>vtkPolyData firstPoly = new vtkPolyData();<br>poly.SetLines(lines);<br><br>vtkPolyDataMapper firstMapper = vtkPolyDataMapper.New();<br>firstMapper.SetInput(firstPoly);<br><br>vtkActor firstActor = new vtkActor();<br>firstActor.SetMapper(firstMapper);<br><br>/* Now i would "catch" the lines, but ...<br><br>Actor.GetMapper().GetInput() returns a vtkDataSet (not a vtkPolyData) so the method "GetLines" doesn't exist in this context. I tried a
cast like this:<br> <br>*/<br>(vtkPolyData)(Actor.GetMapper().GetInput()). GetLines()) <br><br> //but it doesn't work.<br><br>Then, I thought : make a copy! But, i don't know how ! <br>I tried this code<br><br>vtkPolyData copy = vtkPolyData.new();<br>Actor.GetMapper().GetInput().DeepCopy(); // doesn't work<br><br>or<br><br>Actor.GetMapper().GetInput().CopyStructure(); // doesn't work<br><br>So your help would be appreciated.<br><br></div>
</div><br>
</body></html>