Sketcher: PR6497 move return statement to new line
This commit is contained in:
@@ -84,7 +84,8 @@ bool ExternalGeometryExtension::getFlagsFromName(std::string str, ExternalGeomet
|
||||
auto pos = std::find_if( ExternalGeometryExtension::flag2str.begin(),
|
||||
ExternalGeometryExtension::flag2str.end(),
|
||||
[str](const char * val) {
|
||||
return strcmp(val,str.c_str())==0;}
|
||||
return strcmp(val,str.c_str())==0;
|
||||
}
|
||||
);
|
||||
|
||||
if( pos != ExternalGeometryExtension::flag2str.end()) {
|
||||
|
||||
@@ -115,7 +115,8 @@ PyObject* ExternalGeometryFacadePy::setFlag(PyObject *args)
|
||||
auto pos = std::find_if(ExternalGeometryExtension::flag2str.begin(),
|
||||
ExternalGeometryExtension::flag2str.end(),
|
||||
[flag](const char * val) {
|
||||
return strcmp(val,flag)==0;}
|
||||
return strcmp(val,flag)==0;
|
||||
}
|
||||
);
|
||||
|
||||
if( pos != ExternalGeometryExtension::flag2str.end()) {
|
||||
|
||||
@@ -114,7 +114,8 @@ bool SketchGeometryExtension::getInternalTypeFromName(std::string str, InternalT
|
||||
auto pos = std::find_if( SketchGeometryExtension::internaltype2str.begin(),
|
||||
SketchGeometryExtension::internaltype2str.end(),
|
||||
[str](const char * val) {
|
||||
return strcmp(val,str.c_str())==0;}
|
||||
return strcmp(val,str.c_str())==0;
|
||||
}
|
||||
);
|
||||
|
||||
if( pos != SketchGeometryExtension::internaltype2str.end()) {
|
||||
@@ -132,7 +133,8 @@ bool SketchGeometryExtension::getGeometryModeFromName(std::string str, GeometryM
|
||||
auto pos = std::find_if( SketchGeometryExtension::geometrymode2str.begin(),
|
||||
SketchGeometryExtension::geometrymode2str.end(),
|
||||
[str](const char * val) {
|
||||
return strcmp(val,str.c_str())==0;}
|
||||
return strcmp(val,str.c_str())==0;
|
||||
}
|
||||
);
|
||||
|
||||
if( pos != SketchGeometryExtension::geometrymode2str.end()) {
|
||||
|
||||
@@ -1807,7 +1807,8 @@ int SketchObject::fillet(int GeoId1, int GeoId2,
|
||||
int filletId;
|
||||
std::unique_ptr<Part::GeomArcOfCircle> arc(
|
||||
Part::createFilletGeometry(lineSeg1, lineSeg2, filletCenter, radius));
|
||||
if (!arc) return -1;
|
||||
if (!arc)
|
||||
return -1;
|
||||
|
||||
// calculate intersection and distances before we invalidate lineSeg1 and lineSeg2
|
||||
if (!find2DLinesIntersection(lineSeg1, lineSeg2, intersection)) {
|
||||
|
||||
@@ -560,7 +560,8 @@ double ConstraintPointOnPerpBisector::error()
|
||||
double ConstraintPointOnPerpBisector::grad(double *param)
|
||||
{
|
||||
//first of all, check that we need to compute anything.
|
||||
if ( findParamInPvec(param) == -1 ) return 0.0;
|
||||
if ( findParamInPvec(param) == -1 )
|
||||
return 0.0;
|
||||
|
||||
double deriv;
|
||||
errorgrad(nullptr, &deriv, param);
|
||||
@@ -1102,7 +1103,8 @@ double ConstraintEllipseTangentLine::error()
|
||||
double ConstraintEllipseTangentLine::grad(double *param)
|
||||
{
|
||||
//first of all, check that we need to compute anything.
|
||||
if ( findParamInPvec(param) == -1 ) return 0.0;
|
||||
if ( findParamInPvec(param) == -1 )
|
||||
return 0.0;
|
||||
|
||||
double deriv;
|
||||
errorgrad(nullptr, &deriv, param);
|
||||
@@ -1228,7 +1230,8 @@ double ConstraintInternalAlignmentPoint2Ellipse::error()
|
||||
double ConstraintInternalAlignmentPoint2Ellipse::grad(double *param)
|
||||
{
|
||||
//first of all, check that we need to compute anything.
|
||||
if ( findParamInPvec(param) == -1 ) return 0.0;
|
||||
if ( findParamInPvec(param) == -1 )
|
||||
return 0.0;
|
||||
|
||||
double deriv;
|
||||
errorgrad(nullptr, &deriv, param);
|
||||
@@ -1361,7 +1364,8 @@ double ConstraintInternalAlignmentPoint2Hyperbola::error()
|
||||
double ConstraintInternalAlignmentPoint2Hyperbola::grad(double *param)
|
||||
{
|
||||
//first of all, check that we need to compute anything.
|
||||
if ( findParamInPvec(param) == -1 ) return 0.0;
|
||||
if ( findParamInPvec(param) == -1 )
|
||||
return 0.0;
|
||||
|
||||
double deriv;
|
||||
errorgrad(nullptr, &deriv, param);
|
||||
@@ -1423,7 +1427,8 @@ double ConstraintEqualMajorAxesConic::error()
|
||||
double ConstraintEqualMajorAxesConic::grad(double *param)
|
||||
{
|
||||
//first of all, check that we need to compute anything.
|
||||
if ( findParamInPvec(param) == -1 ) return 0.0;
|
||||
if ( findParamInPvec(param) == -1 )
|
||||
return 0.0;
|
||||
|
||||
double deriv;
|
||||
errorgrad(nullptr, &deriv, param);
|
||||
@@ -1499,7 +1504,8 @@ double ConstraintEqualFocalDistance::error()
|
||||
double ConstraintEqualFocalDistance::grad(double *param)
|
||||
{
|
||||
//first of all, check that we need to compute anything.
|
||||
if ( findParamInPvec(param) == -1 ) return 0.0;
|
||||
if ( findParamInPvec(param) == -1 )
|
||||
return 0.0;
|
||||
|
||||
double deriv;
|
||||
errorgrad(nullptr, &deriv, param);
|
||||
@@ -1587,7 +1593,8 @@ double ConstraintCurveValue::error()
|
||||
double ConstraintCurveValue::grad(double *param)
|
||||
{
|
||||
//first of all, check that we need to compute anything.
|
||||
if ( findParamInPvec(param) == -1 ) return 0.0;
|
||||
if ( findParamInPvec(param) == -1 )
|
||||
return 0.0;
|
||||
|
||||
double deriv;
|
||||
errorgrad(nullptr, &deriv, param);
|
||||
@@ -1814,7 +1821,8 @@ double ConstraintPointOnParabola::error()
|
||||
double ConstraintPointOnParabola::grad(double *param)
|
||||
{
|
||||
//first of all, check that we need to compute anything.
|
||||
if ( findParamInPvec(param) == -1 ) return 0.0;
|
||||
if ( findParamInPvec(param) == -1 )
|
||||
return 0.0;
|
||||
|
||||
double deriv;
|
||||
errorgrad(nullptr, &deriv, param);
|
||||
@@ -1884,7 +1892,8 @@ double ConstraintAngleViaPoint::error()
|
||||
double ConstraintAngleViaPoint::grad(double *param)
|
||||
{
|
||||
//first of all, check that we need to compute anything.
|
||||
if ( findParamInPvec(param) == -1 ) return 0.0;
|
||||
if ( findParamInPvec(param) == -1 )
|
||||
return 0.0;
|
||||
|
||||
double deriv=0.;
|
||||
|
||||
@@ -2000,7 +2009,8 @@ double ConstraintSnell::grad(double *param)
|
||||
{
|
||||
|
||||
//first of all, check that we need to compute anything.
|
||||
if ( findParamInPvec(param) == -1 ) return 0.0;
|
||||
if ( findParamInPvec(param) == -1 )
|
||||
return 0.0;
|
||||
|
||||
double deriv;
|
||||
errorgrad(nullptr, &deriv, param);
|
||||
@@ -2117,7 +2127,8 @@ double ConstraintEqualLineLength::error()
|
||||
|
||||
double ConstraintEqualLineLength::grad(double *param)
|
||||
{
|
||||
if ( findParamInPvec(param) == -1 ) return 0.0;
|
||||
if ( findParamInPvec(param) == -1 )
|
||||
return 0.0;
|
||||
|
||||
double deriv;
|
||||
errorgrad(nullptr, &deriv, param);
|
||||
|
||||
@@ -181,7 +181,8 @@ void CmdSketcherNewSketch::activated(int iMsg)
|
||||
qApp->translate("Sketcher_NewSketch", "Sketch attachment"),
|
||||
qApp->translate("Sketcher_NewSketch", "Select the method to attach this sketch to selected object"),
|
||||
items, iSugg, false, &ok, Qt::MSWindowsFixedSizeDialogHint);
|
||||
if (!ok) return;
|
||||
if (!ok)
|
||||
return;
|
||||
int index = items.indexOf(text);
|
||||
if (index == 0){
|
||||
bAttach = false;
|
||||
|
||||
@@ -6885,7 +6885,8 @@ void CmdSketcherConstrainSnellsLaw::activated(int iMsg)
|
||||
ui_Datum.labelEdit->setSingleStep(0.05);
|
||||
// Unable to bind, because the constraint does not yet exist
|
||||
|
||||
if (dlg.exec() != QDialog::Accepted) return;
|
||||
if (dlg.exec() != QDialog::Accepted)
|
||||
return;
|
||||
ui_Datum.labelEdit->pushToHistory();
|
||||
|
||||
Base::Quantity newQuant = ui_Datum.labelEdit->value();
|
||||
|
||||
@@ -598,7 +598,8 @@ int DrawSketchHandler::seekAutoConstraint(std::vector<AutoConstraint> &suggested
|
||||
suggestedConstraints.push_back(constr);
|
||||
|
||||
// Do not seek for tangent if we are actually building a primitive
|
||||
if (type == AutoConstraint::VERTEX_NO_TANGENCY) return suggestedConstraints.size();
|
||||
if (type == AutoConstraint::VERTEX_NO_TANGENCY)
|
||||
return suggestedConstraints.size();
|
||||
|
||||
// Find if there are tangent constraints (currently arcs and circles)
|
||||
|
||||
|
||||
@@ -458,7 +458,8 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action)
|
||||
}
|
||||
|
||||
const unsigned char * dataptr = this->image.getValue(imgsize, nc);
|
||||
if (dataptr == nullptr) return; // no image
|
||||
if (dataptr == nullptr) // no image
|
||||
return;
|
||||
|
||||
srcw = imgsize[0];
|
||||
srch = imgsize[1];
|
||||
|
||||
@@ -583,7 +583,8 @@ void ConstraintView::centerSelectedItems()
|
||||
void ConstraintView::deleteSelectedItems()
|
||||
{
|
||||
App::Document* doc = App::GetApplication().getActiveDocument();
|
||||
if (!doc) return;
|
||||
if (!doc)
|
||||
return;
|
||||
|
||||
doc->openTransaction("Delete constraint");
|
||||
std::vector<Gui::SelectionObject> sel = Gui::Selection().getSelectionEx(doc->getName());
|
||||
@@ -1139,7 +1140,8 @@ void TaskSketcherConstraints::on_listWidgetConstraints_itemSelectionChanged(void
|
||||
void TaskSketcherConstraints::on_listWidgetConstraints_itemActivated(QListWidgetItem *item)
|
||||
{
|
||||
ConstraintItem *it = dynamic_cast<ConstraintItem*>(item);
|
||||
if (!it) return;
|
||||
if (!it)
|
||||
return;
|
||||
|
||||
// if its the right constraint
|
||||
if (it->isDimensional()) {
|
||||
@@ -1153,7 +1155,8 @@ void TaskSketcherConstraints::on_listWidgetConstraints_updateDrivingStatus(QList
|
||||
{
|
||||
Q_UNUSED(status);
|
||||
ConstraintItem *citem = dynamic_cast<ConstraintItem*>(item);
|
||||
if (!citem) return;
|
||||
if (!citem)
|
||||
return;
|
||||
|
||||
Gui::Application::Instance->commandManager().runCommandByName("Sketcher_ToggleDrivingConstraint");
|
||||
slotConstraintsChanged();
|
||||
@@ -1163,7 +1166,8 @@ void TaskSketcherConstraints::on_listWidgetConstraints_updateActiveStatus(QListW
|
||||
{
|
||||
Q_UNUSED(status);
|
||||
ConstraintItem *citem = dynamic_cast<ConstraintItem*>(item);
|
||||
if (!citem) return;
|
||||
if (!citem)
|
||||
return;
|
||||
|
||||
Gui::Application::Instance->commandManager().runCommandByName("Sketcher_ToggleActiveConstraint");
|
||||
slotConstraintsChanged();
|
||||
|
||||
@@ -224,7 +224,8 @@ CONTEXT_MEMBER_DEF("Sketcher_SelectVerticalAxis",doSelectVAxis)
|
||||
void ElementView::deleteSelectedItems()
|
||||
{
|
||||
App::Document* doc = App::GetApplication().getActiveDocument();
|
||||
if (!doc) return;
|
||||
if (!doc)
|
||||
return;
|
||||
|
||||
doc->openTransaction("Delete element");
|
||||
std::vector<Gui::SelectionObject> sel = Gui::Selection().getSelectionEx(doc->getName());
|
||||
@@ -614,7 +615,8 @@ void TaskSketcherElements::on_listWidgetElements_itemSelectionChanged(void)
|
||||
void TaskSketcherElements::on_listWidgetElements_itemEntered(QListWidgetItem *item)
|
||||
{
|
||||
ElementItem *it = dynamic_cast<ElementItem*>(item);
|
||||
if (!it) return;
|
||||
if (!it)
|
||||
return;
|
||||
|
||||
Gui::Selection().rmvPreselect();
|
||||
|
||||
@@ -1162,9 +1164,12 @@ TaskSketcherElements::MultIcon::MultIcon(const char* name)
|
||||
|
||||
QIcon TaskSketcherElements::MultIcon::getIcon(bool construction, bool external) const
|
||||
{
|
||||
if (construction && external) return QIcon();
|
||||
if (construction) return Construction;
|
||||
if (external) return External;
|
||||
if (construction && external)
|
||||
return QIcon();
|
||||
if (construction)
|
||||
return Construction;
|
||||
if (external)
|
||||
return External;
|
||||
return Normal;
|
||||
}
|
||||
|
||||
|
||||
@@ -319,7 +319,8 @@ void SketcherValidation::on_delConstrExtr_clicked()
|
||||
tr("Delete constraints to external geom."),
|
||||
tr("You are about to delete ALL constraints that deal with external geometry. This is useful to rescue a sketch with broken/changed links to external geometry. Are you sure you want to delete the constraints?"),
|
||||
QMessageBox::No|QMessageBox::Yes,QMessageBox::No);
|
||||
if(reply!=QMessageBox::Yes) return;
|
||||
if(reply!=QMessageBox::Yes)
|
||||
return;
|
||||
|
||||
App::Document* doc = sketch->getDocument();
|
||||
doc->openTransaction("Delete constraints");
|
||||
|
||||
@@ -523,7 +523,8 @@ void ViewProviderSketch::getProjectingLine(const SbVec2s& pnt, const Gui::View3D
|
||||
}
|
||||
|
||||
SoCamera* pCam = viewer->getSoRenderManager()->getCamera();
|
||||
if (!pCam) return;
|
||||
if (!pCam)
|
||||
return;
|
||||
SbViewVolume vol = pCam->getViewVolume();
|
||||
|
||||
vol.projectPointToLine(SbVec2f(pX,pY), line);
|
||||
|
||||
Reference in New Issue
Block a user