Surface: [skip ci] fix minor issues found by code checkers

This commit is contained in:
wmayer
2022-08-24 18:47:48 +02:00
parent c38d8479bc
commit 65b22c2f51
4 changed files with 10 additions and 8 deletions

View File

@@ -47,9 +47,11 @@ BlendCurve::BlendCurve(const std::vector<BlendPoint>& blendPointsList)
if (nb_pts > 2) {
throw Base::NotImplementedError("Not implemented");
}
else if (nb_pts < 2) {
if (nb_pts < 2) {
throw Base::ValueError("Need two points for working");
}
blendPoints = blendPointsList;
}

View File

@@ -42,7 +42,7 @@ public:
* Constructor
*\param std::vector<BlendPoint>
*/
BlendCurve(const std::vector<BlendPoint>& blendPointsList);
explicit BlendCurve(const std::vector<BlendPoint>& blendPointsList);
~BlendCurve() = default;
/*!
* Perform the interpolate algorithm

View File

@@ -33,9 +33,9 @@ namespace Surface
{
/*!
* Create a list of vectors formed by a point and some derivatives
* Create a list of vectors formed by a point and some derivatives
* obtained from a curve or surface
*/
*/
class SurfaceExport BlendPoint
{
public:
@@ -46,7 +46,7 @@ public:
* Constructor
*\param std::vector<Base::Vector3d>
*/
BlendPoint(const std::vector<Base::Vector3d>& vectorList);
explicit BlendPoint(const std::vector<Base::Vector3d>& vectorList);
~BlendPoint() = default;
/*!
* Scale the blendpoint vectors

View File

@@ -212,8 +212,8 @@ CmdSurfaceCurveOnMesh::CmdSurfaceCurveOnMesh()
void CmdSurfaceCurveOnMesh::activated(int)
{
doCommand(Doc,"import MeshPartGui, FreeCADGui\n"
"FreeCADGui.runCommand('MeshPart_CurveOnMesh')\n");
doCommand(Doc, "import MeshPartGui, FreeCADGui\n"
"FreeCADGui.runCommand('MeshPart_CurveOnMesh')\n");
}
bool CmdSurfaceCurveOnMesh::isActive()
@@ -367,7 +367,7 @@ void CmdSurfaceExtendFace::activated(int)
std::string FeatName = getUniqueObjectName("Surface");
std::string supportString = faceFilter.Result[0][0].getAsPropertyLinkSubString();
doCommand(Doc, "App.ActiveDocument.addObject(\"Surface::Extend\",\"%s\")", FeatName.c_str());
doCommand(Doc, "App.ActiveDocument.%s.Face = %s",FeatName.c_str(),supportString.c_str());
doCommand(Doc, "App.ActiveDocument.%s.Face = %s", FeatName.c_str(), supportString.c_str());
updateActive();
commitCommand();
}