Check for unvalid object (null, not set...?)

Hi,
does anybody know how i can test if an TopoDs Shape, in this case a vertex is set?

TopoDS_Vertex vertex;
gp_Pnt casPoint = BRep_Tool::Pnt(vertex)

The vertex is not null but invalid - how can I check this before going on...?
Thanks Simon

haowei's picture

TopoDS_Vertex vertex;
if(!vertex.IsNull())
gp_Pnt casPoint = BRep_Tool::Pnt(vertex);

samscore's picture

Thanks!

and how can I handle the exception if I dont code the '!IsNull' case? I read something about exception handling in the manual but I dont find it anymore... perhaps somebody can tell me where to find it...

Regards
Simon

samscore's picture

ok, I found it once again in the foundation classes pdf-file at page 29 :-)