Fri, 04/22/2011 - 10:53
Forums:
hello everyone:
my programm as follow:
double fir, lst;
TopoDS_Edge aEdge = ...;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aEdge, fir, lst);
Handle(Standard_Type) edgeType = aCurve->DynamicType();
my question is how can i check "aCurve" is a available or NULL Handle,
it is crush sometime in "aCurve->DynamicType();"
Fri, 04/22/2011 - 12:11
Hi tudousi,
The handle may be checked to be null by its method IsNull().
See paragraph "2.2. Programming with Handles" of "Foundation Classes User's Guide"
Regards
Sat, 04/23/2011 - 09:57
Hi sergey zaritchny, thank you for your reply, but IsNull() is not a member of Geom_Curve,
and use "if ( aCurve == NULL ) { ... }" also cann't work.
Best Regards
Sat, 04/23/2011 - 12:48
aCurve is an instance of Handle_Geom_Curve, not Geom_Curve, so it will have an IsNull method.
Pete
Sun, 04/24/2011 - 04:01
You have to use aCurve.IsNull(), not aCurve->IsNull()
Mon, 04/25/2011 - 06:54
yes, you are right, my bug was fixed, thank you.