[vtkusers] DeepCopy doesn't copy vectors?

Madhusudhanan Balasubramanian madhu_lsu at yahoo.com
Fri Sep 3 16:16:40 EDT 2004


Try ShallowCopy(); it works for me.

Madhu.

=================================================================

I have a function which returns a vtkDataSet*, but subsequent callswill make the pointer returned in earlier calls invalid, so I want tocopy the output of the function into my own vtkDataSet. I figuredDeepCopy would do what I want, but it doesn't seem to copy (at least)the vector data from the point data of the source dataset.To spell it out better:vtkDataSet* MyObj::func(){	this->Data = some_filter->GetOutput();	return this->Data; //Data is a vtkDataSet*}void MyObj::SomeOtherFunc(){	vtkDataSet *my_data = vtkDataSet::New();	my_data->DeepCopy(this->func());	/*** CRASH HERE ***/	my_data->GetPointData()->GetVectors();	/*** CRASH HERE ***/}Psuedo-ish code, of course. Running through gdb, it seems thatGetPointData() returns a valid pointer, but when I try to GetVectors()from the pointer returned by GetPointData(), i get a segmentationfault.So it looks to me as if the vector data isn't being copied. Is thisnormal behavior? How / what should I set to enable a complete copy ofthe vtkDataSet
 and all of the data it holds?Thanks,-tom


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040903/9aeb9161/attachment.htm>


More information about the vtkusers mailing list