[Insight-users] SpatialObjects GetParent() problem

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Fri May 9 05:28:38 EDT 2008


Le 9 mai 08 à 10:58, Xabier Artaechevarria Artieda a écrit :

> Hi all,
>
> I am developing a new class inherited from BlobSpatialObject, which  
> I call SegmentSpatialObject.
>
> I have a problem when using the GetParent() method, because it  
> returns a pointer to a SpatialObject, and not to a  
> SegmentSpatialObject.
> Then, with that pointer, I can not access the methods that are  
> specific to SegmentSpatialObject.
>
> Is there any simple way in which GetParent() could return a  
> SegmentSpatialObject pointer, without having to rewrite all the  
> methods for hierarchy management?
>

Hi,

Can't you simply dynamic_cast your SpatialObject pointer to a  
SegmentSpatialObject pointer?

Regards,

Gaëtan


-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr  http://www.mandriva.org
http://www.itk.org  http://www.clavier-dvorak.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080509/68fddd58/attachment.pgp>


More information about the Insight-users mailing list