[vtkusers] Bugs in vtkSource

Carsten Kuebler kuebler at ira.uka.de
Thu Jan 30 07:38:48 EST 2003


Zitat von John Biddiscombe <john.biddiscombe at mirada-solutions.com>:

> RE:Bugs. I'll not comment until I've looked again...
> 
> BUT...
> 
> 
> 
> 	vtkPlaneSource *p1;
> 		p1 = vtkPlaneSource::New();
> 
> 	vtkPolyData *pd;
> 		pd = p1->GetOutput();
> 		pd->Register(NULL);
> 		p1->Delete();
> 
> 	vtkPlaneSource *p2;
> 		p2 = vtkPlaneSource::New();
> 
> 		p2->SetOutput(pd);
> NO NO Naughty Naughty. You mustn't do a p2->SetOutput(pd); like this. You are
> breaking everything. Why take the output of a planesource and then stuff it
> into the output of another one? No wonder you broke it. What were you trying
> to achieve?
> 
> 		p2->Delete();
> 		pd->Update();
> 		pd->UnRegister();

I know that it isn't nice.
I don't think that i'm breaking everything.
I try to create an own vtkPolyDataSource, which create a polydata of a camera.
So I derived my vtkCameraSource from vtkPolyDataSource.
To create a camera polydata, I can use several vtkPolyDataSources and combine 
them to one PolyData with vtkAppendPolyDataFilter (in Execute method of my 
vtkCameraSource).
Instead of updating the vtkAppendPolyDataFilter and copying the polydata of 
that filter into the output polydata of my vtkCameraSource, I redirect my 
Output to the vtkAppendPolyDataFilter (at that moment I did not know that a 
PolyData has exactly one Source).
Theoreticcally it would work (with the side-effect, that my vtkCameraSource
looses its output after Execute() resp. Update(). Practically it doesn't work 
because of the "bugs".
Now I'm copying the Polydatas because I don't want to loose my Output 
polydata!!!

Carsten

----------------------------------------------------------
This mail was sent through ATIS: http://atiswww.ira.uka.de



More information about the vtkusers mailing list