diff --git a/src/Mod/Mesh/App/Core/Algorithm.cpp b/src/Mod/Mesh/App/Core/Algorithm.cpp index e63cdc721e..298246ffe2 100644 --- a/src/Mod/Mesh/App/Core/Algorithm.cpp +++ b/src/Mod/Mesh/App/Core/Algorithm.cpp @@ -789,7 +789,8 @@ bool MeshAlgorithm::FillupHole(const std::vector& boundary, void MeshAlgorithm::SetFacetsProperty(const std::vector &raulInds, const std::vector &raulProps) const { - if (raulInds.size() != raulProps.size()) return; + if (raulInds.size() != raulProps.size()) + return; std::vector::const_iterator iP = raulProps.begin(); for (std::vector::const_iterator i = raulInds.begin(); i != raulInds.end(); ++i, ++iP) diff --git a/src/Mod/Mesh/App/Core/Builder.cpp b/src/Mod/Mesh/App/Core/Builder.cpp index e32a2bfcf8..248f758df5 100644 --- a/src/Mod/Mesh/App/Core/Builder.cpp +++ b/src/Mod/Mesh/App/Core/Builder.cpp @@ -275,7 +275,8 @@ struct MeshFastBuilder::Private { } bool operator<(const Vertex& rhs) const { - if (x != rhs.x) return x < rhs.x; + if (x != rhs.x) + return x < rhs.x; else if (y != rhs.y) return y < rhs.y; else if (z != rhs.z) return z < rhs.z; else return false; diff --git a/src/Mod/Mesh/App/Core/Degeneration.cpp b/src/Mod/Mesh/App/Core/Degeneration.cpp index 321a22259b..02b06a0ff3 100644 --- a/src/Mod/Mesh/App/Core/Degeneration.cpp +++ b/src/Mod/Mesh/App/Core/Degeneration.cpp @@ -301,7 +301,8 @@ struct MeshFacet_Less if (y1 > y2) { tmp = y1; y1 = y2; y2 = tmp; } - if (x0 < y0) return true; + if (x0 < y0) + return true; else if (x0 > y0) return false; else if (x1 < y1) return true; else if (x1 > y1) return false; @@ -1065,7 +1066,9 @@ bool MeshEvalRangePoint::Evaluate() PointIndex ulCtPoints = _rclMesh.CountPoints(); for (MeshFacetArray::_TConstIterator it = rFaces.begin(); it != rFaces.end(); ++it) { - if (std::find_if(it->_aulPoints, it->_aulPoints + 3, [ulCtPoints](PointIndex i) { return i >= ulCtPoints; }) < it->_aulPoints + 3) + if (std::find_if(it->_aulPoints, it->_aulPoints + 3, [ulCtPoints](PointIndex i) { + return i >= ulCtPoints; + }) < it->_aulPoints + 3) return false; } @@ -1080,7 +1083,9 @@ std::vector MeshEvalRangePoint::GetIndices() const PointIndex ind=0; for (MeshFacetArray::_TConstIterator it = rFaces.begin(); it != rFaces.end(); ++it, ind++) { - if (std::find_if(it->_aulPoints, it->_aulPoints + 3, [ulCtPoints](PointIndex i) { return i >= ulCtPoints; }) < it->_aulPoints + 3) + if (std::find_if(it->_aulPoints, it->_aulPoints + 3, [ulCtPoints](PointIndex i) { + return i >= ulCtPoints; + }) < it->_aulPoints + 3) aInds.push_back(ind); } diff --git a/src/Mod/Mesh/App/Core/MeshIO.cpp b/src/Mod/Mesh/App/Core/MeshIO.cpp index eca94ac74d..f338d623be 100644 --- a/src/Mod/Mesh/App/Core/MeshIO.cpp +++ b/src/Mod/Mesh/App/Core/MeshIO.cpp @@ -250,7 +250,8 @@ bool MeshInput::LoadSTL (std::istream &rstrIn) // the file size has only 134 bytes in this case. On the other hand we must overread the first 80 bytes // because it can happen that the file is binary but contains one of these keywords. std::streambuf* buf = rstrIn.rdbuf(); - if (!buf) return false; + if (!buf) + return false; buf->pubseekoff(80, std::ios::beg, std::ios::in); uint32_t ulCt, ulBytes=50; rstrIn.read((char*)&ulCt, sizeof(ulCt)); diff --git a/src/Mod/Mesh/App/Core/TopoAlgorithm.cpp b/src/Mod/Mesh/App/Core/TopoAlgorithm.cpp index 22f9d7d2a6..ab36dcc34b 100644 --- a/src/Mod/Mesh/App/Core/TopoAlgorithm.cpp +++ b/src/Mod/Mesh/App/Core/TopoAlgorithm.cpp @@ -1406,7 +1406,8 @@ void MeshTopoAlgorithm::SplitNeighbourFacet(FacetIndex ulFacetPos, unsigned shor bool MeshTopoAlgorithm::RemoveDegeneratedFacet(FacetIndex index) { - if (index >= _rclMesh._aclFacetArray.size()) return false; + if (index >= _rclMesh._aclFacetArray.size()) + return false; MeshFacet& rFace = _rclMesh._aclFacetArray[index]; // coincident corners (either topological or geometrical) @@ -1475,7 +1476,8 @@ bool MeshTopoAlgorithm::RemoveDegeneratedFacet(FacetIndex index) bool MeshTopoAlgorithm::RemoveCorruptedFacet(FacetIndex index) { - if (index >= _rclMesh._aclFacetArray.size()) return false; + if (index >= _rclMesh._aclFacetArray.size()) + return false; MeshFacet& rFace = _rclMesh._aclFacetArray[index]; // coincident corners (topological) diff --git a/src/Mod/Mesh/App/Core/Triangulation.cpp b/src/Mod/Mesh/App/Core/Triangulation.cpp index 799e806e0e..6c0fa88766 100644 --- a/src/Mod/Mesh/App/Core/Triangulation.cpp +++ b/src/Mod/Mesh/App/Core/Triangulation.cpp @@ -383,13 +383,15 @@ bool EarClippingTriangulator::Triangulate::Snip(const std::vector (((Bx-Ax)*(Cy-Ay)) - ((By-Ay)*(Cx-Ax)))) return false; + if (FLOAT_EPS > (((Bx-Ax)*(Cy-Ay)) - ((By-Ay)*(Cx-Ax)))) + return false; for (p=0;pgetPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); @@ -107,7 +108,8 @@ FlipNormals::~FlipNormals() App::DocumentObjectExecReturn *FlipNormals::execute() { App::DocumentObject* link = Source.getValue(); - if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); + if (!link) + return new App::DocumentObjectExecReturn("No mesh linked"); App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); @@ -135,7 +137,8 @@ FixNonManifolds::~FixNonManifolds() App::DocumentObjectExecReturn *FixNonManifolds::execute() { App::DocumentObject* link = Source.getValue(); - if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); + if (!link) + return new App::DocumentObjectExecReturn("No mesh linked"); App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); @@ -163,7 +166,8 @@ FixDuplicatedFaces::~FixDuplicatedFaces() App::DocumentObjectExecReturn *FixDuplicatedFaces::execute() { App::DocumentObject* link = Source.getValue(); - if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); + if (!link) + return new App::DocumentObjectExecReturn("No mesh linked"); App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); @@ -191,7 +195,8 @@ FixDuplicatedPoints::~FixDuplicatedPoints() App::DocumentObjectExecReturn *FixDuplicatedPoints::execute() { App::DocumentObject* link = Source.getValue(); - if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); + if (!link) + return new App::DocumentObjectExecReturn("No mesh linked"); App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); @@ -219,7 +224,8 @@ FixDegenerations::~FixDegenerations() App::DocumentObjectExecReturn *FixDegenerations::execute() { App::DocumentObject* link = Source.getValue(); - if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); + if (!link) + return new App::DocumentObjectExecReturn("No mesh linked"); App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); @@ -248,7 +254,8 @@ FixDeformations::~FixDeformations() App::DocumentObjectExecReturn *FixDeformations::execute() { App::DocumentObject* link = Source.getValue(); - if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); + if (!link) + return new App::DocumentObjectExecReturn("No mesh linked"); App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); @@ -278,7 +285,8 @@ FixIndices::~FixIndices() App::DocumentObjectExecReturn *FixIndices::execute() { App::DocumentObject* link = Source.getValue(); - if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); + if (!link) + return new App::DocumentObjectExecReturn("No mesh linked"); App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); @@ -308,7 +316,8 @@ FillHoles::~FillHoles() App::DocumentObjectExecReturn *FillHoles::execute() { App::DocumentObject* link = Source.getValue(); - if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); + if (!link) + return new App::DocumentObjectExecReturn("No mesh linked"); App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); @@ -339,7 +348,8 @@ RemoveComponents::~RemoveComponents() App::DocumentObjectExecReturn *RemoveComponents::execute() { App::DocumentObject* link = Source.getValue(); - if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); + if (!link) + return new App::DocumentObjectExecReturn("No mesh linked"); App::Property* prop = link->getPropertyByName("Mesh"); if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) { Mesh::PropertyMeshKernel* kernel = static_cast(prop); diff --git a/src/Mod/Mesh/App/Mesh.cpp b/src/Mod/Mesh/App/Mesh.cpp index 4aeafa3f1d..b7475173a1 100644 --- a/src/Mod/Mesh/App/Mesh.cpp +++ b/src/Mod/Mesh/App/Mesh.cpp @@ -1454,7 +1454,9 @@ void MeshObject::removeSelfIntersections(const std::vector& indices) if (indices.size() % 2 != 0) return; unsigned long cntfacets = _kernel.CountFacets(); - if (std::find_if(indices.begin(), indices.end(), [cntfacets](FacetIndex v) { return v >= cntfacets; }) < indices.end()) + if (std::find_if(indices.begin(), indices.end(), [cntfacets](FacetIndex v) { + return v >= cntfacets; + }) < indices.end()) return; std::vector > selfIntersections; std::vector::const_iterator it; diff --git a/src/Mod/Mesh/App/MeshPyImp.cpp b/src/Mod/Mesh/App/MeshPyImp.cpp index 440ed4b5b3..5b23ff0583 100644 --- a/src/Mod/Mesh/App/MeshPyImp.cpp +++ b/src/Mod/Mesh/App/MeshPyImp.cpp @@ -72,7 +72,8 @@ int MeshPy::PyInit(PyObject* args, PyObject*) try { this->parentProperty = nullptr; // if no mesh is given - if (!pcObj) return 0; + if (!pcObj) + return 0; if (PyObject_TypeCheck(pcObj, &(MeshPy::Type))) { getMeshObjectPtr()->operator = (*static_cast(pcObj)->getMeshObjectPtr()); } @@ -80,13 +81,15 @@ int MeshPy::PyInit(PyObject* args, PyObject*) PyObject* ret = addFacets(args); bool ok = (ret!=nullptr); Py_XDECREF(ret); - if (!ok) return -1; + if (!ok) + return -1; } else if (PyTuple_Check(pcObj)) { PyObject* ret = addFacets(args); bool ok = (ret!=nullptr); Py_XDECREF(ret); - if (!ok) return -1; + if (!ok) + return -1; } else if (PyUnicode_Check(pcObj)) { getMeshObjectPtr()->load(PyUnicode_AsUTF8(pcObj)); diff --git a/src/Mod/Mesh/Gui/Command.cpp b/src/Mod/Mesh/Gui/Command.cpp index 9bbd35519a..f50b26d9ee 100644 --- a/src/Mod/Mesh/Gui/Command.cpp +++ b/src/Mod/Mesh/Gui/Command.cpp @@ -102,7 +102,8 @@ CmdMeshTransform::CmdMeshTransform() void CmdMeshTransform::activated(int) { unsigned int n = getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()); - if ( n!=1 ) return; + if ( n!=1 ) + return; std::string fName = getUniqueObjectName("Move"); std::vector cSel = getSelection().getSelection(); @@ -141,7 +142,8 @@ CmdMeshDemolding::CmdMeshDemolding() void CmdMeshDemolding::activated(int) { unsigned int n = getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()); - if ( n!=1 ) return; + if ( n!=1 ) + return; std::string fName = getUniqueObjectName("Demolding"); std::vector cSel = getSelection().getSelection(); @@ -608,7 +610,8 @@ void CmdMeshFromGeometry::activated(int) bool CmdMeshFromGeometry::isActive() { App::Document* doc = App::GetApplication().getActiveDocument(); - if (!doc) return false; + if (!doc) + return false; return getSelection().countObjectsOfType(App::GeoFeature::getClassTypeId()) >= 1; } @@ -1647,7 +1650,8 @@ void CmdMeshFillupHoles::activated(int) bool ok; int FillupHolesOfLength = QInputDialog::getInt(Gui::getMainWindow(), QObject::tr("Fill holes"), QObject::tr("Fill holes with maximum number of edges:"), 3, 3, 10000, 1, &ok, Qt::MSWindowsFixedSizeDialogHint); - if (!ok) return; + if (!ok) + return; openCommand(QT_TRANSLATE_NOOP("Command", "Fill up holes")); for (std::vector::const_iterator it = meshes.begin(); it != meshes.end(); ++it) { doCommand(Doc,"App.activeDocument().getObject(\"%s\").Mesh.fillupHoles(%d)" diff --git a/src/Mod/Mesh/Gui/MeshSelection.cpp b/src/Mod/Mesh/Gui/MeshSelection.cpp index 319c3bd07f..8e2936326c 100644 --- a/src/Mod/Mesh/Gui/MeshSelection.cpp +++ b/src/Mod/Mesh/Gui/MeshSelection.cpp @@ -163,7 +163,8 @@ Gui::View3DInventorViewer* MeshSelection::getViewer() const return ivViewer; Gui::Document* doc = Gui::Application::Instance->activeDocument(); - if (!doc) return nullptr; + if (!doc) + return nullptr; Gui::MDIView* view = doc->getActiveView(); if (view && view->getTypeId().isDerivedFrom(Gui::View3DInventor::getClassTypeId())) { Gui::View3DInventorViewer* viewer = static_cast(view)->getViewer(); diff --git a/src/Mod/Mesh/Gui/RemoveComponents.cpp b/src/Mod/Mesh/Gui/RemoveComponents.cpp index 81f29f2446..fc23a0b491 100644 --- a/src/Mod/Mesh/Gui/RemoveComponents.cpp +++ b/src/Mod/Mesh/Gui/RemoveComponents.cpp @@ -125,7 +125,8 @@ void RemoveComponents::on_cbDeselectComp_toggled(bool on) void RemoveComponents::deleteSelection() { Gui::Document* doc = Gui::Application::Instance->activeDocument(); - if (!doc) return; + if (!doc) + return; // delete all selected faces doc->openCommand(QT_TRANSLATE_NOOP("Command", "Delete selection")); bool ok = meshSel.deleteSelection(); diff --git a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp index 2ac9a6c008..8d9d0467c1 100644 --- a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp +++ b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp @@ -909,7 +909,8 @@ void SoFCIndexedFaceSet::doAction(SoAction * action) { if (action->getTypeId() == Gui::SoGLSelectAction::getClassTypeId()) { SoNode* node = action->getNodeAppliedTo(); - if (!node) return; // on no node applied + if (!node) // on no node applied + return; // The node we have is the parent of this node and the coordinate node // thus we search there for it. @@ -919,7 +920,8 @@ void SoFCIndexedFaceSet::doAction(SoAction * action) sa.setType(SoCoordinate3::getClassTypeId(), 1); sa.apply(node); SoPath * path = sa.getPath(); - if (!path) return; + if (!path) + return; // make sure we got the node we wanted SoNode* coords = path->getNodeFromTail(0); @@ -931,7 +933,8 @@ void SoFCIndexedFaceSet::doAction(SoAction * action) } else if (action->getTypeId() == Gui::SoVisibleFaceAction::getClassTypeId()) { SoNode* node = action->getNodeAppliedTo(); - if (!node) return; // on no node applied + if (!node) // on no node applied + return; // The node we have is the parent of this node and the coordinate node // thus we search there for it. @@ -941,7 +944,8 @@ void SoFCIndexedFaceSet::doAction(SoAction * action) sa.setType(SoCoordinate3::getClassTypeId(), 1); sa.apply(node); SoPath * path = sa.getPath(); - if (!path) return; + if (!path) + return; // make sure we got the node we wanted SoNode* coords = path->getNodeFromTail(0); diff --git a/src/Mod/Mesh/Gui/SoFCMeshFaceSet.cpp b/src/Mod/Mesh/Gui/SoFCMeshFaceSet.cpp index 13a3d9b780..8b43ff947a 100644 --- a/src/Mod/Mesh/Gui/SoFCMeshFaceSet.cpp +++ b/src/Mod/Mesh/Gui/SoFCMeshFaceSet.cpp @@ -114,7 +114,9 @@ SbBool SoSFMeshFacetArray::readValue(SoInput *in) } value->resize(numtoread); - if (!this->readBinaryValues(in, numtoread)) { return FALSE; } + if (!this->readBinaryValues(in, numtoread)) { + return FALSE; + } } // ** ASCII format ******************************************************* @@ -135,7 +137,8 @@ SbBool SoSFMeshFacetArray::readValue(SoInput *in) // makeRoom() makes sure the allocation strategy is decent. if (currentidx >= value->size()) value->resize(currentidx + 1); - if (!this->read1Value(in, currentidx++)) return FALSE; + if (!this->read1Value(in, currentidx++)) + return FALSE; READ_VAL(c); if (c == ',') { READ_VAL(c); } // Treat trailing comma as whitespace. @@ -158,7 +161,8 @@ SbBool SoSFMeshFacetArray::readValue(SoInput *in) else { in->putBack(c); value->resize(1); - if (!this->read1Value(in, 0)) return FALSE; + if (!this->read1Value(in, 0)) + return FALSE; } } @@ -1046,7 +1050,8 @@ void SoFCMeshFaceSet::computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢e */ void SoFCMeshFaceSet::getPrimitiveCount(SoGetPrimitiveCountAction * action) { - if (!this->shouldPrimitiveCount(action)) return; + if (!this->shouldPrimitiveCount(action)) + return; SoState* state = action->getState(); const MeshCore::MeshFacetArray * coordIndex = SoFCMeshFacetElement::get(state); action->addNumTriangles(coordIndex->size()); @@ -1193,7 +1198,8 @@ void SoFCMeshOpenEdgeSet::computeBBox(SoAction *action, SbBox3f &box, SbVec3f &c */ void SoFCMeshOpenEdgeSet::getPrimitiveCount(SoGetPrimitiveCountAction * action) { - if (!this->shouldPrimitiveCount(action)) return; + if (!this->shouldPrimitiveCount(action)) + return; SoState* state = action->getState(); const MeshCore::MeshFacetArray * rFaces = SoFCMeshFacetElement::get(state); diff --git a/src/Mod/Mesh/Gui/SoFCMeshNode.cpp b/src/Mod/Mesh/Gui/SoFCMeshNode.cpp index 69d613d90b..1a9b8f7fef 100644 --- a/src/Mod/Mesh/Gui/SoFCMeshNode.cpp +++ b/src/Mod/Mesh/Gui/SoFCMeshNode.cpp @@ -566,7 +566,8 @@ void SoFCMeshNode::computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er) */ void SoFCMeshNode::getPrimitiveCount(SoGetPrimitiveCountAction * action) { - if (!this->shouldPrimitiveCount(action)) return; + if (!this->shouldPrimitiveCount(action)) + return; action->addNumTriangles(countTriangles()); } @@ -591,7 +592,8 @@ void SoFCMeshNode::write( SoWriteAction* action ) else if (out->getStage() == SoOutput::WRITE) { const MeshCore::MeshPointArray& rPoints = _mesh->getKernel().GetPoints(); const MeshCore::MeshFacetArray& rFacets = _mesh->getKernel().GetFacets(); - if (this->writeHeader(out, FALSE, FALSE)) return; + if (this->writeHeader(out, FALSE, FALSE)) + return; point.setNum(rPoints.size()); unsigned int pos=0; for (MeshCore::MeshPointArray::_TConstIterator cP=rPoints.begin(); cP!=rPoints.end(); ++cP) @@ -744,7 +746,8 @@ void SoFCMeshOpenEdge::computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢ */ void SoFCMeshOpenEdge::getPrimitiveCount(SoGetPrimitiveCountAction * action) { - if (!this->shouldPrimitiveCount(action)) return; + if (!this->shouldPrimitiveCount(action)) + return; // Count number of open edges first int ctEdges=0; diff --git a/src/Mod/Mesh/Gui/SoFCMeshObject.cpp b/src/Mod/Mesh/Gui/SoFCMeshObject.cpp index d4206eda16..777fbd2105 100644 --- a/src/Mod/Mesh/Gui/SoFCMeshObject.cpp +++ b/src/Mod/Mesh/Gui/SoFCMeshObject.cpp @@ -634,7 +634,8 @@ void SoFCMeshObjectShape::GLRender(SoGLRenderAction *action) SbBool mode = Gui::SoFCInteractiveElement::get(state); const Mesh::MeshObject * mesh = SoFCMeshObjectElement::get(state); - if (!mesh || mesh->countPoints() == 0) return; + if (!mesh || mesh->countPoints() == 0) + return; Binding mbind = this->findMaterialBinding(state); @@ -974,7 +975,8 @@ void SoFCMeshObjectShape::doAction(SoAction * action) { if (action->getTypeId() == Gui::SoGLSelectAction::getClassTypeId()) { SoNode* node = action->getNodeAppliedTo(); - if (!node) return; // on no node applied + if (!node) // on no node applied + return; // The node we have is the parent of this node and the coordinate node // thus we search there for it. @@ -984,7 +986,8 @@ void SoFCMeshObjectShape::doAction(SoAction * action) sa.setType(SoFCMeshObjectNode::getClassTypeId(), 1); sa.apply(node); SoPath * path = sa.getPath(); - if (!path) return; + if (!path) + return; // make sure we got the node we wanted SoNode* coords = path->getNodeFromTail(0); @@ -1241,7 +1244,8 @@ void SoFCMeshObjectShape::computeBBox(SoAction *action, SbBox3f &box, SbVec3f &c */ void SoFCMeshObjectShape::getPrimitiveCount(SoGetPrimitiveCountAction * action) { - if (!this->shouldPrimitiveCount(action)) return; + if (!this->shouldPrimitiveCount(action)) + return; SoState* state = action->getState(); const Mesh::MeshObject * mesh = SoFCMeshObjectElement::get(state); action->addNumTriangles(mesh->countFacets()); @@ -1284,7 +1288,8 @@ void SoFCMeshSegmentShape::GLRender(SoGLRenderAction *action) SbBool mode = Gui::SoFCInteractiveElement::get(state); const Mesh::MeshObject * mesh = SoFCMeshObjectElement::get(state); - if (!mesh) return; + if (!mesh) + return; Binding mbind = this->findMaterialBinding(state); @@ -1652,7 +1657,8 @@ void SoFCMeshSegmentShape::computeBBox(SoAction *action, SbBox3f &box, SbVec3f & */ void SoFCMeshSegmentShape::getPrimitiveCount(SoGetPrimitiveCountAction * action) { - if (!this->shouldPrimitiveCount(action)) return; + if (!this->shouldPrimitiveCount(action)) + return; SoState* state = action->getState(); const Mesh::MeshObject * mesh = SoFCMeshObjectElement::get(state); if (mesh && mesh->countSegments() > this->index.getValue()) { @@ -1684,7 +1690,8 @@ void SoFCMeshObjectBoundary::GLRender(SoGLRenderAction *action) { SoState* state = action->getState(); const Mesh::MeshObject * mesh = SoFCMeshObjectElement::get(state); - if (!mesh) return; + if (!mesh) + return; SoMaterialBundle mb(action); SoTextureCoordinateBundle tb(action, true, false); @@ -1801,7 +1808,8 @@ void SoFCMeshObjectBoundary::computeBBox(SoAction *action, SbBox3f &box, SbVec3f */ void SoFCMeshObjectBoundary::getPrimitiveCount(SoGetPrimitiveCountAction * action) { - if (!this->shouldPrimitiveCount(action)) return; + if (!this->shouldPrimitiveCount(action)) + return; SoState* state = action->getState(); const Mesh::MeshObject * mesh = SoFCMeshObjectElement::get(state); if (!mesh) diff --git a/src/Mod/Mesh/Gui/SoFCMeshVertex.cpp b/src/Mod/Mesh/Gui/SoFCMeshVertex.cpp index 92e667f495..61c711d5ac 100644 --- a/src/Mod/Mesh/Gui/SoFCMeshVertex.cpp +++ b/src/Mod/Mesh/Gui/SoFCMeshVertex.cpp @@ -91,7 +91,9 @@ SbBool SoSFMeshPointArray::readValue(SoInput *in) } value->resize(numtoread); - if (!this->readBinaryValues(in, numtoread)) { return FALSE; } + if (!this->readBinaryValues(in, numtoread)) { + return FALSE; + } } // ** ASCII format ******************************************************* @@ -112,7 +114,8 @@ SbBool SoSFMeshPointArray::readValue(SoInput *in) // makeRoom() makes sure the allocation strategy is decent. if (currentidx >= value->size()) value->resize(currentidx + 1); - if (!this->read1Value(in, currentidx++)) return FALSE; + if (!this->read1Value(in, currentidx++)) + return FALSE; READ_VAL(c); if (c == ',') { READ_VAL(c); } // Treat trailing comma as whitespace. @@ -135,7 +138,8 @@ SbBool SoSFMeshPointArray::readValue(SoInput *in) else { in->putBack(c); value->resize(1); - if (!this->read1Value(in, 0)) return FALSE; + if (!this->read1Value(in, 0)) + return FALSE; } } diff --git a/src/Mod/Mesh/Gui/SoPolygon.cpp b/src/Mod/Mesh/Gui/SoPolygon.cpp index 42d6ea9b50..9024fd990d 100644 --- a/src/Mod/Mesh/Gui/SoPolygon.cpp +++ b/src/Mod/Mesh/Gui/SoPolygon.cpp @@ -81,9 +81,11 @@ void SoPolygon::GLRender(SoGLRenderAction *action) { SoState* state = action->getState(); const SoCoordinateElement * coords = SoCoordinateElement::getInstance(state); - if (!coords) return; + if (!coords) + return; const SbVec3f * points = coords->getArrayPtr3(); - if (!points) return; + if (!points) + return; SoMaterialBundle mb(action); SoTextureCoordinateBundle tb(action, true, false); @@ -145,9 +147,11 @@ void SoPolygon::computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er) { SoState* state = action->getState(); const SoCoordinateElement * coords = SoCoordinateElement::getInstance(state); - if (!coords) return; + if (!coords) + return; const SbVec3f * points = coords->getArrayPtr3(); - if (!points) return; + if (!points) + return; float maxX=-FLT_MAX, minX=FLT_MAX, maxY=-FLT_MAX, minY=FLT_MAX, maxZ=-FLT_MAX, minZ=FLT_MAX; diff --git a/src/Mod/Mesh/Gui/ViewProvider.cpp b/src/Mod/Mesh/Gui/ViewProvider.cpp index cc90768278..f4501fd719 100644 --- a/src/Mod/Mesh/Gui/ViewProvider.cpp +++ b/src/Mod/Mesh/Gui/ViewProvider.cpp @@ -1260,8 +1260,10 @@ std::vector ViewProviderMesh::getFacetsOfRegion(const SbViewpo void ViewProviderMesh::panCamera(SoCamera * cam, float aspectratio, const SbPlane & panplane, const SbVec2f & currpos, const SbVec2f & prevpos) { - if (cam == nullptr) return; // can happen for empty scenegraph - if (currpos == prevpos) return; // useless invocation + if (cam == nullptr) // can happen for empty scenegraph + return; + if (currpos == prevpos) // useless invocation + return; // Find projection points for the last and current mouse coordinates. diff --git a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp index 1fdceddf8d..49f764e1fc 100644 --- a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp @@ -309,7 +309,8 @@ void ViewProviderMeshCurvature::updateData(const App::Property* prop) } else if (prop->getTypeId() == Mesh::PropertyCurvatureList::getClassTypeId()) { const Mesh::PropertyCurvatureList* curv = static_cast(prop); - if (curv->getSize() < 3) return; // invalid array + if (curv->getSize() < 3) // invalid array + return; #if 0 // FIXME: Do not always change the range init(curv); // init color bar #endif diff --git a/src/Mod/Mesh/Gui/ViewProviderMeshNode.cpp b/src/Mod/Mesh/Gui/ViewProviderMeshNode.cpp index bf012a7c5f..7bca56a1b3 100644 --- a/src/Mod/Mesh/Gui/ViewProviderMeshNode.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderMeshNode.cpp @@ -258,7 +258,8 @@ std::vector ViewProviderMeshNode::getDisplayModes(void) const bool ViewProviderMeshNode::setEdit(int ModNum) { - if ( m_bEdit ) return true; + if ( m_bEdit ) + return true; m_bEdit = true; return true; }