try to convert non-b-splines into b-splines; further parameter check

Non b-spline curves are converted into b-splines if possible.
This means circles, lines etc are allowed.

Further parameter checks prohibiting surfaces being accepted as input.
This commit is contained in:
balazs-bamer
2015-02-06 13:04:24 +01:00
committed by wmayer
parent 85c3aa10c1
commit 4e2eede777
2 changed files with 31 additions and 10 deletions

View File

@@ -190,6 +190,12 @@ bool CmdSurfaceBSurf::isActive(void)
}
Part::TopoShape ts = static_cast<Part::Feature*>((*it).pObject)->Shape.getShape();
try {
// make sure the main shape type is edge or wire
TopAbs_ShapeEnum shapeType = ts._Shape.ShapeType();
if(shapeType != TopAbs_WIRE && shapeType != TopAbs_EDGE)
{
return false;
}
TopoDS_Shape shape = ts.getSubShape("Edge1");
if (shape.IsNull())
{
@@ -206,13 +212,7 @@ bool CmdSurfaceBSurf::isActive(void)
Handle_Geom_BezierCurve bez_geom = Handle_Geom_BezierCurve::DownCast(c_geom); //Try to get Bezier curve
if (bez_geom.IsNull())
{
// this one is not Bezier
Handle_Geom_BSplineCurve bsp_geom = Handle_Geom_BSplineCurve::DownCast(c_geom); //Try to get BSpline curve
if (bsp_geom.IsNull()) {
// neither Bezier, nor b-spline, fail
return false;
}
// this one is b-spline
// this one is not Bezier, we hope it can be converted into b-spline
if(willBezier) {
// already found the other type, fail
return false;