Make uniform the use of B-spline visible to users

Forum thread: https://forum.freecadweb.org/viewtopic.php?f=8&t=25411
This commit does not include fixes to source  comments unless they were 'doxygenated'.
No .xml files were altered either.
This commit is contained in:
luzpaz
2017-11-17 19:30:37 -05:00
parent 247166405f
commit cc87c20afe
16 changed files with 29 additions and 29 deletions

View File

@@ -232,7 +232,7 @@ private:
std::vector<double> m_Output_time2;
/** @brief timestep for the simulation-output*/
double m_step;
/** @brief pointing to the knot-vector of the current B-Spline Curve*/
/** @brief pointing to the knot-vector of the current B-spline Curve*/
TColStd_Array1OfReal *m_Knots;
/** @brief maximum curvature of current curve*/
double m_curMax;

View File

@@ -5133,8 +5133,8 @@ class _BSpline(_DraftObject):
def __init__(self, obj):
_DraftObject.__init__(self,obj,"BSpline")
obj.addProperty("App::PropertyVectorList","Points","Draft", QT_TRANSLATE_NOOP("App::Property","The points of the b-spline"))
obj.addProperty("App::PropertyBool","Closed","Draft",QT_TRANSLATE_NOOP("App::Property","If the b-spline is closed or not"))
obj.addProperty("App::PropertyVectorList","Points","Draft", QT_TRANSLATE_NOOP("App::Property","The points of the B-spline"))
obj.addProperty("App::PropertyBool","Closed","Draft",QT_TRANSLATE_NOOP("App::Property","If the B-spline is closed or not"))
obj.addProperty("App::PropertyBool","MakeFace","Draft",QT_TRANSLATE_NOOP("App::Property","Create a face if this spline is closed"))
obj.MakeFace = getParam("fillmode",True)
obj.Closed = False
@@ -5355,9 +5355,9 @@ class _Shape2DView(_DraftObject):
obj.addProperty("App::PropertyEnumeration","ProjectionMode","Draft",QT_TRANSLATE_NOOP("App::Property","The way the viewed object must be projected"))
obj.addProperty("App::PropertyIntegerList","FaceNumbers","Draft",QT_TRANSLATE_NOOP("App::Property","The indices of the faces to be projected in Individual Faces mode"))
obj.addProperty("App::PropertyBool","HiddenLines","Draft",QT_TRANSLATE_NOOP("App::Property","Show hidden lines"))
obj.addProperty("App::PropertyBool","Tessellation","Draft",QT_TRANSLATE_NOOP("App::Property","Tessellate Ellipses and BSplines into line segments"))
obj.addProperty("App::PropertyBool","Tessellation","Draft",QT_TRANSLATE_NOOP("App::Property","Tessellate Ellipses and B-splines into line segments"))
obj.addProperty("App::PropertyBool","InPlace","Draft",QT_TRANSLATE_NOOP("App::Property","For Cutlines and Cutfaces modes, this leaves the faces at the cut location"))
obj.addProperty("App::PropertyFloat","SegmentLength","Draft",QT_TRANSLATE_NOOP("App::Property","Length of line segments if tessellating Ellipses or BSplines into line segments"))
obj.addProperty("App::PropertyFloat","SegmentLength","Draft",QT_TRANSLATE_NOOP("App::Property","Length of line segments if tessellating Ellipses or B-splines into line segments"))
obj.Projection = Vector(0,0,1)
obj.ProjectionMode = ["Solid","Individual Faces","Cutlines","Cutfaces"]
obj.HiddenLines = False

View File

@@ -745,8 +745,8 @@ class BSpline(Line):
def GetResources(self):
return {'Pixmap' : 'Draft_BSpline',
'Accel' : "B, S",
'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_BSpline", "B-Spline"),
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_BSpline", "Creates a multiple-point b-spline. CTRL to snap, SHIFT to constrain")}
'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_BSpline", "B-spline"),
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_BSpline", "Creates a multiple-point B-spline. CTRL to snap, SHIFT to constrain")}
def Activated(self):
Line.Activated(self,name=translate("draft","BSpline"))
@@ -824,7 +824,7 @@ class BSpline(Line):
# building command string
rot,sup,pts,fil = self.getStrings()
FreeCADGui.addModule("Draft")
self.commit(translate("draft","Create BSpline"),
self.commit(translate("draft","Create B-spline"),
['points = '+pts,
'spline = Draft.makeBSpline(points,closed='+str(closed)+',face='+fil+',support='+sup+')',
'Draft.autogroup(spline)'])
@@ -4460,7 +4460,7 @@ class AddPoint(Modifier):
def GetResources(self):
return {'Pixmap' : 'Draft_AddPoint',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_AddPoint", "Add Point"),
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_AddPoint", "Adds a point to an existing wire/bspline")}
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_AddPoint", "Adds a point to an existing Wire or B-spline")}
def IsActive(self):
if FreeCADGui.Selection.getSelection():
@@ -4485,7 +4485,7 @@ class DelPoint(Modifier):
def GetResources(self):
return {'Pixmap' : 'Draft_DelPoint',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_DelPoint", "Remove Point"),
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_DelPoint", "Removes a point from an existing wire or bspline")}
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_DelPoint", "Removes a point from an existing Wire or B-spline")}
def IsActive(self):
if FreeCADGui.Selection.getSelection():
@@ -4509,8 +4509,8 @@ class WireToBSpline(Modifier):
def GetResources(self):
return {'Pixmap' : 'Draft_WireToBSpline',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_WireToBSpline", "Wire to BSpline"),
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_WireToBSpline", "Converts between Wire and BSpline")}
'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_WireToBSpline", "Wire to B-spline"),
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_WireToBSpline", "Converts between Wire and B-spline")}
def IsActive(self):
if FreeCADGui.Selection.getSelection():

View File

@@ -85,7 +85,7 @@ int BSplineCurvePy::PyInit(PyObject* args, PyObject* kwd)
return -1;
}
PyErr_SetString(PyExc_TypeError, "B-Spline constructor accepts:\n"
PyErr_SetString(PyExc_TypeError, "B-spline constructor accepts:\n"
"-- poles, [ periodic, degree, interpolate ]\n"
"-- empty parameter list\n");
return -1;

View File

@@ -70,7 +70,7 @@ int BSplineCurve2dPy::PyInit(PyObject* args, PyObject* /*kwd*/)
return 0;
}
PyErr_SetString(PyExc_TypeError, "B-Spline constructor accepts:\n"
PyErr_SetString(PyExc_TypeError, "B-spline constructor accepts:\n"
"-- empty parameter list\n");
return -1;
}

View File

@@ -739,7 +739,7 @@ PyObject* Curve2dPy::toBSpline(PyObject * args)
ShapeConstruct_Curve scc;
Handle(Geom2d_BSplineCurve) spline = scc.ConvertToBSpline(c, u, v, Precision::Confusion());
if (spline.IsNull())
Standard_NullValue::Raise("Conversion to B-Spline failed");
Standard_NullValue::Raise("Conversion to B-spline failed");
return new BSplineCurve2dPy(new Geom2dBSplineCurve(spline));
}
}

View File

@@ -369,7 +369,7 @@ GeomBSplineCurve* GeomCurve::toBSpline(double first, double last) const
Handle(Geom_Curve) c = Handle(Geom_Curve)::DownCast(handle());
Handle(Geom_BSplineCurve) spline = scc.ConvertToBSpline(c, first, last, Precision::Confusion());
if (spline.IsNull())
throw Base::RuntimeError("Conversion to B-Spline failed");
throw Base::RuntimeError("Conversion to B-spline failed");
return new GeomBSplineCurve(spline);
}

View File

@@ -148,10 +148,10 @@ public:
TopoDS_Shape toShape() const;
/*!
* \brief toBSpline Converts the curve to a B-Spline
* \brief toBSpline Converts the curve to a B-spline
* \param This is the start parameter of the curve
* \param This is the end parameter of the curve
* \return a B-Spline curve
* \return a B-spline curve
*/
GeomBSplineCurve* toBSpline(double first, double last) const;
/*!

View File

@@ -760,7 +760,7 @@ PyObject* GeometrySurfacePy::toBSpline(PyObject * args)
return new BSplineSurfacePy(new GeomBSplineSurface(cvt.Surface()));
}
else {
Standard_Failure::Raise("Cannot convert to B-Spline surface");
Standard_Failure::Raise("Cannot convert to B-spline surface");
}
}
catch (Standard_Failure& e) {

View File

@@ -180,7 +180,7 @@ PyObject* PlateSurfacePy::makeApprox(PyObject *args, PyObject* kwds)
return new Part::BSplineSurfacePy(new Part::GeomBSplineSurface(hSurf));
}
PyErr_SetString(PyExc_RuntimeError, "Approximation of B-Spline surface failed");
PyErr_SetString(PyExc_RuntimeError, "Approximation of B-spline surface failed");
return 0;
} PY_CATCH_OCC;
}

View File

@@ -250,7 +250,7 @@ private:
return Py::asObject(new Part::BSplineSurfacePy(new Part::GeomBSplineSurface(hSurf)));
}
throw Py::RuntimeError("Computation of B-Spline surface failed");
throw Py::RuntimeError("Computation of B-spline surface failed");
}
catch (const Py::Exception&) {
// re-throw
@@ -577,7 +577,7 @@ Mesh.show(m)
return Py::asObject(new Part::BSplineSurfacePy(new Part::GeomBSplineSurface(hSurf)));
}
throw Py::RuntimeError("Computation of B-Spline surface failed");
throw Py::RuntimeError("Computation of B-spline surface failed");
}
#endif
#if defined(HAVE_PCL_FILTERS)

View File

@@ -56,8 +56,8 @@ CmdApproxSurface::CmdApproxSurface()
{
sAppModule = "Reen";
sGroup = QT_TR_NOOP("Reverse Engineering");
sMenuText = QT_TR_NOOP("Approximate B-Spline surface...");
sToolTipText = QT_TR_NOOP("Approximate a B-Spline surface");
sMenuText = QT_TR_NOOP("Approximate B-spline surface...");
sToolTipText = QT_TR_NOOP("Approximate a B-spline surface");
sWhatsThis = "Reen_ApproxSurface";
sStatusTip = sToolTipText;
sPixmap = "actions/FitSurface";

View File

@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Fit B-Spline surface</string>
<string>Fit B-spline surface</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">

View File

@@ -206,7 +206,7 @@ public:
*/
int deleteUnusedInternalGeometry(int GeoId, bool delgeoid=false);
/*!
\brief Approximates the given geometry with a B-Spline
\brief Approximates the given geometry with a B-spline
\param GeoId - the geometry to approximate
\param delgeoid - if true in addition to the unused internal geometry also deletes the GeoId geometry
\retval bool - returns true if the approximation succeeded, or false if it did not succeed.

View File

@@ -164,7 +164,7 @@ App::DocumentObjectExecReturn *GeomFillSurface::execute(void)
return new App::DocumentObjectExecReturn("Curves are disjoint.");
}
catch (StdFail_NotDone) {
return new App::DocumentObjectExecReturn("A curve was not a b-spline and could not be converted into one.");
return new App::DocumentObjectExecReturn("A curve was not a B-spline and could not be converted into one.");
}
catch (Standard_Failure& e) {
@@ -331,7 +331,7 @@ void GeomFillSurface::createBSplineSurface(TopoDS_Wire& aWire)
ShapeConstruct_Curve scc;
Handle(Geom_BSplineCurve) spline = scc.ConvertToBSpline(c_geom, u1, u2, Precision::Confusion());
if (spline.IsNull())
Standard_Failure::Raise("A curve was not a b-spline and could not be converted into one.");
Standard_Failure::Raise("A curve was not a B-spline and could not be converted into one.");
gp_Trsf transf = heloc2.Transformation();
spline->Transform(transf); // apply original transformation to control points
crvs.push_back(spline);

View File

@@ -273,7 +273,7 @@ QPainterPath QGIViewPart::geomToPainterPath(TechDrawGeometry::BaseGeom *baseGeom
Rez::guiX(it->pnts[2].x), Rez::guiX(it->pnts[2].y),
Rez::guiX(it->pnts[3].x), Rez::guiX(it->pnts[3].y));
} else { //can only handle lines,quads,cubes
Base::Console().Error("Bad pole count (%d) for BezierSegment of BSpline geometry\n",it->poles);
Base::Console().Error("Bad pole count (%d) for BezierSegment of B-spline geometry\n",it->poles);
path.lineTo(it->pnts[1].x, it->pnts[1].y); //show something for debugging
}
}