<DIV><PRE>Try ShallowCopy(); it works for me.</PRE><PRE>Madhu.</PRE><PRE>=================================================================</PRE><PRE>I have a function which returns a vtkDataSet*, but subsequent calls
will make the pointer returned in earlier calls invalid, so I want to
copy the output of the function into my own vtkDataSet. I figured
DeepCopy 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 that
GetPointData() returns a valid pointer, but when I try to GetVectors()
from the pointer returned by GetPointData(), i get a segmentation
fault.
So it looks to me as if the vector data isn't being copied. Is this
normal behavior? How / what should I set to enable a complete copy of
the vtkDataSet and all of the data it holds?
Thanks,
-tom
</PRE><!--endarticle--></DIV><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com