[Dcmlib] R: R: vtkGdcmReader and vtkProcessObject

luca.picello at gmail.com luca.picello at gmail.com
Mon Jun 5 18:55:38 CEST 2006


A cast to vtkAlgorithm is neither needed by using:
 
    vtkGdcmReader* source = vtkGdcmReader::SafeDownCast(aCaller);
    if( source != NULL )
      ProgressBarValue = source->GetProgress() * 100;

Luca
 
thanks all for your infinite patience
 
 



  _____  

Da: Luca Picello [mailto:luca.picello at gmail.com] 
Inviato: lunedì 5 giugno 2006 17.35
A: Mathieu Malaterre
Cc: dcmlib at creatis.insa-lyon.fr
Oggetto: Re: [Dcmlib] R: vtkGdcmReader and vtkProcessObject


errata corrige:

casting 'source' pointer makes it possible to access (without any error) to
all vtkAlgorithm methods. 



On 6/5/06, Luca Picello <luca.picello at gmail.com> wrote: 

well well well...
I will change compiler when I'll open my fabulous restaurant at carabbeans
;-)
anyway even if I understand your point of view, I have the reason why it
works with BCB and it seems (to me at least) to be reasonable. 

both vtkProcessObject and vtkImageReader (then vtkGdcmReader) are derived
from vtkAlgorithm where the method GetProgress() is implemented.

casting 'source' pointer makes it possible to access (without any error) to
all vtkImageAlgorithm methods. 
Now you make me note it, I know it is wrong. Indeed I'll have to try a
safedowncast to vtkAlgorithm which should be the right cast I need for a
clean source.
when I'll be at home I'll check it, if it is true and if it really works. 

thanks, as usual, for your support
Luca





On 6/5/06, Mathieu Malaterre <  <mailto:mathieu.malaterre at kitware.com>
mathieu.malaterre at kitware.com > wrote: 

luca.picello at gmail.com wrote: 
> with
> vtkProcessObject* source = (vtkProcessObject*)(aCaller);
>
> it works.
> any suggestion is welcome

Change your compiler ! This can't be or this is simply an adress (a
void* basically) and you cannot use it as a ProcessObject anyway. 

See:

http://www.vtk.org/doc/nightly/html/classvtkProcessObject.html
<http://www.vtk.org/doc/nightly/html/classvtkProcessObject.html> 

It's a leaf, nothing derives from it in VTK 5.x

Mathieu





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.creatis.insa-lyon.fr/pipermail/dcmlib/attachments/20060605/5a300beb/attachment.html>


More information about the Dcmlib mailing list