[vtkusers] VtkDataset java and deep copy

Sebastien Jourdain sebastien.jourdain at kitware.com
Mon Apr 18 14:35:37 EDT 2011


Hi Romain,

you should try to do something like that

vtkDataSet clone = oldDataSet.NewInstance();
clone.DeepCopy(oldDataSet);

If there is no NewInstance(); available from VTK you can still use
Java capability to create the same kind of object.

Seb

On Mon, Apr 18, 2011 at 12:26 PM, LEGUAY Romain <romain.leguay at gmail.com> wrote:
> Thanks for your answer Seb.
> Here an  example of my code:
>
> vtkDataSet clone = new vtkDataSet();
> clone.DeepCopy(oldDataSet); //with oldDataSet instance of vtkUnstructured DataSet
>
> All the clone's data seem the same as oldDataSet except from the type of the object.
>
> Romain
>
> Le 18 avr. 2011 à 15:53, Sebastien Jourdain <sebastien.jourdain at kitware.com> a écrit :
>
>> Could you post your piece of code ? So we can understand what you try
>> to do. On the other hand you may have use DeepCopy in the wrong order
>> meaning if you want to do "a = b;", you have to do "a.DeepCopy(b);"
>>
>> Seb
>>
>> On Mon, Apr 18, 2011 at 9:15 AM, LEGUAY Romain <romain.leguay at gmail.com> wrote:
>>> Hello everyone!
>>> I try to do a clone of my vtkDataSet but when I call deepcopy method the new vtkDataSet is not the same type of the original vtkDataSet. I try tu call updateData, updateData and updateInformation methods but I have no change on my vtkDataSet.
>>> Does anyone have any ideas?
>>>
>>> Thanks,
>>> Romain
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>



More information about the vtkusers mailing list