[vtkusers] pick and update

Tom Radcliffe tradcliffe at predictivepatterns.com
Mon Jan 30 17:52:10 EST 2006


I meant using DeepCopy when I said "make a copy of the output data", so 
you've tried the right thing.  I had forgotten about GC in Python--I 
don't know what effect it might have.  Generally Register and UnRegister 
should be called with a null pointer in C++, which I guess is equivalent 
to None in Python.  The only reason to use something other than null is 
for debugging, so you can see what objects have registered something and 
not unregistered it.

--Tom

Boris Avdeev wrote:

>Thanks for your reply. I tried the second alternative. I guess
>Delete() method is not exported to Python (because of GC?). I tried to
>use the following code instead:
>
>data.Register(None)
>data.Update()
>read.UnRegister(None)
>
>It did not do any good and now I get seg.fault at the exit.
>I did not quite get the copy explanation. What is "make the copy of
>the data from the reader the start of your pipeline"?
>I tried the following with as much success as earlier:
>...
>read.Update()
>data.DeepCopy(read.GetOutput())
>...
>
>Thanks,
>Boris
>
>
>On 1/30/06, Tom Radcliffe <tradcliffe at predictivepatterns.com> wrote:
>  
>
>>The reader's output will be regenerated during the next Update, so your
>>changes will be wiped out.  You should pull the data out of the reader
>>and make a copy.  Then make the copy of the data from the reader the
>>start of your pipeline.
>>
>>To do this without copying you can do something like this (in C++,
>>something similar in Python):
>>
>>vtkPolyData* pData = pReader->GetOutput();
>>pData->Register(0);
>>pReader->Delete();
>>
>>This should drop the reader but keep the data around.
>>
>>--Tom
>>    
>>
>
>  
>


-- 
Tom Radcliffe, Ph.D., P.Eng.
President, Predictive Patterns Software Inc.
http://www.predictivepatterns.com | 613-483-9803
tradcliffe at predictivepatterns.com




More information about the vtkusers mailing list