DiscussionsIssue archiveOther usage issues

Archived discussion

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

Other usage issuesThu, 08/27/2009 - 01:593 replies

Browse this forum
QuestionAuthor

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

Discussion

3 archived replies

Posts are displayed in their archived order.

01Commenter-1

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

02Author

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

03Author

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