借助拓扑结构与Geometry直接的桥梁BRepAdaptor,可以判断给定TopoDS_Shape的具体类型。
extern TopoDS_Shape& shap;
// -------------- Edge-----------------
BRepAdaptor_Curve cu3d;
cu3d.Initialize (TopoDS::Edge(shap));
GeomAbs_CurveType type = cu3d.GetType());
GeomAbs_Line,
GeomAbs_Circle,
GeomAbs_Ellipse,
GeomAbs_Hyperbola,
GeomAbs_Parabola,
GeomAbs_BezierCurve,
GeomAbs_BSplineCurve,
GeomAbs_OtherCurve
// ---------------------- Face ------------
BRepAdaptor_Surface BS;
BS.Initialize (TopoDS::Face(shap));
GeomAbs_SurfaceType type = BS.GetType();
GeomAbs_Plane,
GeomAbs_Cylinder,
GeomAbs_Cone,
GeomAbs_Sphere,
GeomAbs_Torus,
GeomAbs_BezierSurface,
GeomAbs_BSplineSurface,
GeomAbs_SurfaceOfRevolution,
GeomAbs_SurfaceOfExtrusion,
GeomAbs_OffsetSurface,
GeomAbs_OtherSurface