diff --git a/src/Mod/Mesh/App/MeshPyImp.cpp b/src/Mod/Mesh/App/MeshPyImp.cpp index fbeb0e9438..1f4422e008 100644 --- a/src/Mod/Mesh/App/MeshPyImp.cpp +++ b/src/Mod/Mesh/App/MeshPyImp.cpp @@ -66,6 +66,7 @@ struct MeshPropertyLock private: PropertyMeshKernel* prop; + FC_DISABLE_COPY_MOVE(MeshPropertyLock) }; int MeshPy::PyInit(PyObject* args, PyObject*) @@ -345,7 +346,7 @@ PyObject* MeshPy::write(PyObject* args, PyObject* kwds) PyObject* MeshPy::writeInventor(PyObject* args) { - float creaseangle = 0.0f; + float creaseangle = 0.0F; if (!PyArg_ParseTuple(args, "|f", &creaseangle)) { return nullptr; } @@ -374,7 +375,9 @@ PyObject* MeshPy::offset(PyObject* args) PyObject* MeshPy::offsetSpecial(PyObject* args) { - float Float {}, zmin {}, zmax {}; + float Float {}; + float zmin {}; + float zmax {}; if (!PyArg_ParseTuple(args, "fff", &Float, &zmin, &zmax)) { return nullptr; } @@ -392,7 +395,7 @@ PyObject* MeshPy::crossSections(PyObject* args) { PyObject* obj {}; PyObject* poly = Py_False; - float min_eps = 1.0e-2f; + float min_eps = 1.0e-2F; if (!PyArg_ParseTuple(args, "O|fO!", &obj, &min_eps, &PyBool_Type, &poly)) { return nullptr; } @@ -554,7 +557,7 @@ PyObject* MeshPy::section(PyObject* args, PyObject* kwds) { PyObject* pcObj {}; PyObject* connectLines = Py_True; - float fMinDist = 0.0001f; + float fMinDist = 0.0001F; static const std::array keywords_section {"Mesh", "ConnectLines", @@ -601,7 +604,9 @@ PyObject* MeshPy::coarsen(PyObject* args) PyObject* MeshPy::translate(PyObject* args) { - float x {}, y {}, z {}; + float x {}; + float y {}; + float z {}; if (!PyArg_ParseTuple(args, "fff", &x, &y, &z)) { return nullptr; } @@ -619,7 +624,9 @@ PyObject* MeshPy::translate(PyObject* args) PyObject* MeshPy::rotate(PyObject* args) { - double x {}, y {}, z {}; + double x {}; + double y {}; + double z {}; if (!PyArg_ParseTuple(args, "ddd", &x, &y, &z)) { return nullptr; } @@ -677,7 +684,15 @@ PyObject* MeshPy::getEigenSystem(PyObject* args) PyObject* MeshPy::addFacet(PyObject* args) { - double x1 {}, y1 {}, z1 {}, x2 {}, y2 {}, z2 {}, x3 {}, y3 {}, z3 {}; + double x1 {}; + double y1 {}; + double z1 {}; + double x2 {}; + double y2 {}; + double z2 {}; + double x3 {}; + double y3 {}; + double z3 {}; if (PyArg_ParseTuple(args, "ddddddddd", &x1, &y1, &z1, &x2, &y2, &z2, &x3, &y3, &z3)) { getMeshObjectPtr()->addFacet( MeshCore::MeshGeomFacet(Base::Vector3f((float)x1, (float)y1, (float)z1), @@ -687,7 +702,9 @@ PyObject* MeshPy::addFacet(PyObject* args) } PyErr_Clear(); - PyObject *v1 {}, *v2 {}, *v3 {}; + PyObject* v1 {}; + PyObject* v2 {}; + PyObject* v3 {}; if (PyArg_ParseTuple(args, "O!O!O!", &(Base::VectorPy::Type), @@ -908,7 +925,9 @@ PyObject* MeshPy::movePoint(PyObject* args) Base::Vector3d vec; do { - double x = 0.0, y = 0.0, z = 0.0; + double x = 0.0; + double y = 0.0; + double z = 0.0; if (PyArg_ParseTuple(args, "kddd", &index, &x, &y, &z)) { vec.Set(x, y, z); break; @@ -961,7 +980,7 @@ PyObject* MeshPy::addSegment(PyObject* args) segment.reserve(list.size()); for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { Py::Long value(*it); - Mesh::FacetIndex index = static_cast(value); + Mesh::FacetIndex index = static_cast(value); if (index < numFacets) { segment.push_back(index); } @@ -1371,13 +1390,13 @@ PyObject* MeshPy::fillupHoles(PyObject* args) { unsigned long len {}; int level = 0; - float max_area = 0.0f; + float max_area = 0.0F; if (!PyArg_ParseTuple(args, "k|if", &len, &level, &max_area)) { return nullptr; } try { std::unique_ptr tria; - if (max_area > 0.0f) { + if (max_area > 0.0F) { tria = std::unique_ptr( new MeshCore::ConstraintDelaunayTriangulator(max_area)); } @@ -1415,8 +1434,8 @@ PyObject* MeshPy::fixIndices(PyObject* args) PyObject* MeshPy::fixCaps(PyObject* args) { - float fMaxAngle = Base::toRadians(150.0f); - float fSplitFactor = 0.25f; + float fMaxAngle = Base::toRadians(150.0F); + float fSplitFactor = 0.25F; if (!PyArg_ParseTuple(args, "|ff", &fMaxAngle, &fSplitFactor)) { return nullptr; } @@ -1556,7 +1575,7 @@ PyObject* MeshPy::mergeFacets(PyObject* args) PyObject* MeshPy::optimizeTopology(PyObject* args) { - float fMaxAngle = -1.0f; + float fMaxAngle = -1.0F; if (!PyArg_ParseTuple( args, "|f; specify the maximum allowed angle between the normals of two adjacent facets", @@ -1607,7 +1626,8 @@ PyObject* MeshPy::splitEdges(PyObject* args) PyObject* MeshPy::splitEdge(PyObject* args) { - unsigned long facet {}, neighbour {}; + unsigned long facet {}; + unsigned long neighbour {}; PyObject* vertex {}; if (!PyArg_ParseTuple(args, "kkO!", &facet, &neighbour, &Base::VectorPy::Type, &vertex)) { return nullptr; @@ -1683,7 +1703,8 @@ PyObject* MeshPy::splitFacet(PyObject* args) PyObject* MeshPy::swapEdge(PyObject* args) { - unsigned long facet {}, neighbour {}; + unsigned long facet {}; + unsigned long neighbour {}; if (!PyArg_ParseTuple(args, "kk", &facet, &neighbour)) { return nullptr; } @@ -1716,7 +1737,8 @@ PyObject* MeshPy::swapEdge(PyObject* args) PyObject* MeshPy::collapseEdge(PyObject* args) { - unsigned long facet {}, neighbour {}; + unsigned long facet {}; + unsigned long neighbour {}; if (!PyArg_ParseTuple(args, "kk", &facet, &neighbour)) { return nullptr; } @@ -1960,7 +1982,8 @@ PyObject* MeshPy::trim(PyObject* args) PyObject* MeshPy::trimByPlane(PyObject* args) { - PyObject *base {}, *norm {}; + PyObject* base {}; + PyObject* norm {}; if (!PyArg_ParseTuple(args, "O!O!", &Base::VectorPy::Type, @@ -2044,7 +2067,8 @@ PyObject* MeshPy::smooth(PyObject* args, PyObject* kwds) PyObject* MeshPy::decimate(PyObject* args) { - float fTol {}, fRed {}; + float fTol {}; + float fRed {}; if (PyArg_ParseTuple(args, "ff", &fTol, &fRed)) { PY_TRY { diff --git a/src/Mod/Mesh/Gui/DlgDecimating.cpp b/src/Mod/Mesh/Gui/DlgDecimating.cpp index 1cbf2d8f96..ce1178500f 100644 --- a/src/Mod/Mesh/Gui/DlgDecimating.cpp +++ b/src/Mod/Mesh/Gui/DlgDecimating.cpp @@ -61,9 +61,8 @@ int DlgDecimating::targetNumberOfTriangles() const if (ui->checkAbsoluteNumber->isChecked()) { return ui->spinBoxReduction->value(); } - else { - return numberOfTriangles * (1.0 - reduction()); - } + + return int(numberOfTriangles * (1.0 - reduction())); } void DlgDecimating::setNumberOfTriangles(int num) @@ -90,7 +89,7 @@ void DlgDecimating::onCheckAbsoluteNumberToggled(bool on) ui->sliderReduction, &QSlider::setValue); ui->spinBoxReduction->setRange(1, numberOfTriangles); - ui->spinBoxReduction->setValue(numberOfTriangles * (1.0 - reduction())); + ui->spinBoxReduction->setValue(int(numberOfTriangles * (1.0 - reduction()))); ui->spinBoxReduction->setSuffix(QString()); ui->checkAbsoluteNumber->setText( tr("Absolute number (Maximum: %1)").arg(numberOfTriangles)); @@ -159,8 +158,8 @@ bool TaskDecimating::accept() Gui::WaitCursor wc; Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Mesh Decimating")); - float tolerance = widget->tolerance(); - float reduction = widget->reduction(); + float tolerance = float(widget->tolerance()); + float reduction = float(widget->reduction()); bool absolute = widget->isAbsoluteNumber(); int targetSize = 0; if (absolute) { diff --git a/src/Mod/Mesh/Gui/DlgDecimating.h b/src/Mod/Mesh/Gui/DlgDecimating.h index 58efb56f42..838cec7705 100644 --- a/src/Mod/Mesh/Gui/DlgDecimating.h +++ b/src/Mod/Mesh/Gui/DlgDecimating.h @@ -51,6 +51,8 @@ private: private: int numberOfTriangles {0}; std::unique_ptr ui; + + Q_DISABLE_COPY_MOVE(DlgDecimating) }; /** diff --git a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp index 89046e0d55..0448d68461 100644 --- a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp +++ b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp @@ -90,7 +90,7 @@ public: bool enableFoldsCheck {false}; bool checkNonManfoldPoints {false}; bool strictlyDegenerated {true}; - float epsilonDegenerated {0.0f}; + float epsilonDegenerated {0.0F}; }; /* TRANSLATOR MeshGui::DlgEvaluateMeshImp */ @@ -129,7 +129,7 @@ DlgEvaluateMeshImp::DlgEvaluateMeshImp(QWidget* parent, Qt::WindowFlags fl) d->enableFoldsCheck = hGrp->GetBool("EnableFoldsCheck", false); d->strictlyDegenerated = hGrp->GetBool("StrictlyDegenerated", true); if (d->strictlyDegenerated) { - d->epsilonDegenerated = 0.0f; + d->epsilonDegenerated = 0.0F; } else { d->epsilonDegenerated = MeshCore::MeshDefinitions::_fMinPointDistanceP2; @@ -350,8 +350,7 @@ void DlgEvaluateMeshImp::addViewProvider(const char* name, removeViewProvider(name); if (d->view) { - ViewProviderMeshDefects* vp = - static_cast(Base::Type::createInstanceByName(name)); + auto vp = static_cast(Base::Type::createInstanceByName(name)); assert(vp->isDerivedFrom()); vp->attach(d->meshFeature); d->view->getViewer()->addViewProvider(vp); @@ -362,7 +361,7 @@ void DlgEvaluateMeshImp::addViewProvider(const char* name, void DlgEvaluateMeshImp::removeViewProvider(const char* name) { - std::map::iterator it = d->vp.find(name); + auto it = d->vp.find(name); if (it != d->vp.end()) { if (d->view) { d->view->getViewer()->removeViewProvider(it->second); @@ -499,8 +498,7 @@ void DlgEvaluateMeshImp::onRefreshButtonClicked() void DlgEvaluateMeshImp::onCheckOrientationButtonClicked() { - std::map::iterator it = - d->vp.find("MeshGui::ViewProviderMeshOrientation"); + auto it = d->vp.find("MeshGui::ViewProviderMeshOrientation"); if (it != d->vp.end()) { if (d->ui.checkOrientationButton->isChecked()) { it->second->show(); @@ -692,8 +690,7 @@ void DlgEvaluateMeshImp::onRepairNonmanifoldsButtonClicked() void DlgEvaluateMeshImp::onCheckIndicesButtonClicked() { - std::map::iterator it = - d->vp.find("MeshGui::ViewProviderMeshIndices"); + auto it = d->vp.find("MeshGui::ViewProviderMeshIndices"); if (it != d->vp.end()) { if (d->ui.checkIndicesButton->isChecked()) { it->second->show(); @@ -785,8 +782,7 @@ void DlgEvaluateMeshImp::onRepairIndicesButtonClicked() void DlgEvaluateMeshImp::onCheckDegenerationButtonClicked() { - std::map::iterator it = - d->vp.find("MeshGui::ViewProviderMeshDegenerations"); + auto it = d->vp.find("MeshGui::ViewProviderMeshDegenerations"); if (it != d->vp.end()) { if (d->ui.checkDegenerationButton->isChecked()) { it->second->show(); @@ -856,8 +852,7 @@ void DlgEvaluateMeshImp::onRepairDegeneratedButtonClicked() void DlgEvaluateMeshImp::onCheckDuplicatedFacesButtonClicked() { - std::map::iterator it = - d->vp.find("MeshGui::ViewProviderMeshDuplicatedFaces"); + auto it = d->vp.find("MeshGui::ViewProviderMeshDuplicatedFaces"); if (it != d->vp.end()) { if (d->ui.checkDuplicatedFacesButton->isChecked()) { it->second->show(); @@ -928,8 +923,7 @@ void DlgEvaluateMeshImp::onRepairDuplicatedFacesButtonClicked() void DlgEvaluateMeshImp::onCheckDuplicatedPointsButtonClicked() { - std::map::iterator it = - d->vp.find("MeshGui::ViewProviderMeshDuplicatedPoints"); + auto it = d->vp.find("MeshGui::ViewProviderMeshDuplicatedPoints"); if (it != d->vp.end()) { if (d->ui.checkDuplicatedPointsButton->isChecked()) { it->second->show(); @@ -998,8 +992,7 @@ void DlgEvaluateMeshImp::onRepairDuplicatedPointsButtonClicked() void DlgEvaluateMeshImp::onCheckSelfIntersectionButtonClicked() { - std::map::iterator it = - d->vp.find("MeshGui::ViewProviderMeshSelfIntersections"); + auto it = d->vp.find("MeshGui::ViewProviderMeshSelfIntersections"); if (it != d->vp.end()) { if (d->ui.checkSelfIntersectionButton->isChecked()) { it->second->show(); @@ -1077,8 +1070,7 @@ void DlgEvaluateMeshImp::onRepairSelfIntersectionButtonClicked() void DlgEvaluateMeshImp::onCheckFoldsButtonClicked() { - std::map::iterator it = - d->vp.find("MeshGui::ViewProviderMeshFolds"); + auto it = d->vp.find("MeshGui::ViewProviderMeshFolds"); if (it != d->vp.end()) { if (d->ui.checkFoldsButton->isChecked()) { it->second->show(); @@ -1309,7 +1301,7 @@ void DlgEvaluateMeshImp::onButtonBoxClicked(QAbstractButton* button) d->showFoldsFunction(d->enableFoldsCheck); d->strictlyDegenerated = dlg.isDegeneratedFacetsChecked(); if (d->strictlyDegenerated) { - d->epsilonDegenerated = 0.0f; + d->epsilonDegenerated = 0.0F; } else { d->epsilonDegenerated = MeshCore::MeshDefinitions::_fMinPointDistanceP2; @@ -1397,8 +1389,9 @@ DockEvaluateMeshImp::~DockEvaluateMeshImp() /** * Destroys the dock window this object is embedded into without destroying itself. */ -void DockEvaluateMeshImp::closeEvent(QCloseEvent*) +void DockEvaluateMeshImp::closeEvent(QCloseEvent* event) { + Q_UNUSED(event) // closes the dock window Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance(); pDockMgr->removeDockWindow(scrollArea); diff --git a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h index fb43bdf3f1..5fff87bb15 100644 --- a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h +++ b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h @@ -140,6 +140,8 @@ protected: private: class Private; Private* d; + + Q_DISABLE_COPY_MOVE(DlgEvaluateMeshImp) }; /** @@ -165,6 +167,8 @@ public: private: QScrollArea* scrollArea; static DockEvaluateMeshImp* _instance; + + Q_DISABLE_COPY_MOVE(DockEvaluateMeshImp) }; } // namespace MeshGui diff --git a/src/Mod/Mesh/Gui/DlgEvaluateSettings.h b/src/Mod/Mesh/Gui/DlgEvaluateSettings.h index 305d93d1b2..5c9f5ba801 100644 --- a/src/Mod/Mesh/Gui/DlgEvaluateSettings.h +++ b/src/Mod/Mesh/Gui/DlgEvaluateSettings.h @@ -53,6 +53,8 @@ public: private: Ui_DlgEvaluateSettings* ui; + + Q_DISABLE_COPY_MOVE(DlgEvaluateSettings) }; } // namespace MeshGui diff --git a/src/Mod/Mesh/Gui/DlgRegularSolidImp.h b/src/Mod/Mesh/Gui/DlgRegularSolidImp.h index 4473febef7..84eeadcee1 100644 --- a/src/Mod/Mesh/Gui/DlgRegularSolidImp.h +++ b/src/Mod/Mesh/Gui/DlgRegularSolidImp.h @@ -46,6 +46,8 @@ protected: private: std::unique_ptr ui; + + Q_DISABLE_COPY_MOVE(DlgRegularSolidImp) }; } // namespace MeshGui diff --git a/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.h b/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.h index 6851b65cbe..1b36f74c25 100644 --- a/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.h +++ b/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.h @@ -52,6 +52,8 @@ protected: private: Ui_DlgSettingsImportExport* ui; + + Q_DISABLE_COPY_MOVE(DlgSettingsImportExport) }; // end class DlgSettingsImportExport } // namespace MeshGui diff --git a/src/Mod/Mesh/Gui/DlgSettingsMeshView.h b/src/Mod/Mesh/Gui/DlgSettingsMeshView.h index c0b5a4c56d..41aab80940 100644 --- a/src/Mod/Mesh/Gui/DlgSettingsMeshView.h +++ b/src/Mod/Mesh/Gui/DlgSettingsMeshView.h @@ -54,6 +54,8 @@ protected: private: std::unique_ptr ui; + + Q_DISABLE_COPY_MOVE(DlgSettingsMeshView) }; } // namespace MeshGui diff --git a/src/Mod/Mesh/Gui/DlgSmoothing.cpp b/src/Mod/Mesh/Gui/DlgSmoothing.cpp index 70422e8ba2..2334948fbc 100644 --- a/src/Mod/Mesh/Gui/DlgSmoothing.cpp +++ b/src/Mod/Mesh/Gui/DlgSmoothing.cpp @@ -108,7 +108,7 @@ DlgSmoothing::Smooth DlgSmoothing::method() const if (ui->radioButtonTaubin->isChecked()) { return DlgSmoothing::Taubin; } - else if (ui->radioButtonLaplace->isChecked()) { + if (ui->radioButtonLaplace->isChecked()) { return DlgSmoothing::Laplace; } return DlgSmoothing::None; diff --git a/src/Mod/Mesh/Gui/DlgSmoothing.h b/src/Mod/Mesh/Gui/DlgSmoothing.h index 371173f60e..89919334f4 100644 --- a/src/Mod/Mesh/Gui/DlgSmoothing.h +++ b/src/Mod/Mesh/Gui/DlgSmoothing.h @@ -69,6 +69,8 @@ Q_SIGNALS: private: Ui_DlgSmoothing* ui; QButtonGroup* bg; + + Q_DISABLE_COPY_MOVE(DlgSmoothing) }; /** @@ -105,6 +107,8 @@ public: private: DlgSmoothing* widget; + + Q_DISABLE_COPY_MOVE(SmoothingDialog) }; /** diff --git a/src/Mod/Mesh/Gui/MeshEditor.cpp b/src/Mod/Mesh/Gui/MeshEditor.cpp index 4393961d42..63f014fff3 100644 --- a/src/Mod/Mesh/Gui/MeshEditor.cpp +++ b/src/Mod/Mesh/Gui/MeshEditor.cpp @@ -94,11 +94,11 @@ void ViewProviderFace::attach(App::DocumentObject* obj) SoGroup* markers = new SoGroup(); SoDrawStyle* pointStyle = new SoDrawStyle(); pointStyle->style = SoDrawStyle::POINTS; - pointStyle->pointSize = 8.0f; + pointStyle->pointSize = 8.0F; markers->addChild(pointStyle); SoBaseColor* markcol = new SoBaseColor; - markcol->rgb.setValue(1.0f, 1.0f, 0.0f); + markcol->rgb.setValue(1.0F, 1.0F, 0.0F); SoPointSet* marker = new SoPointSet(); markers->addChild(markcol); markers->addChild(pcCoords); @@ -121,7 +121,7 @@ void ViewProviderFace::attach(App::DocumentObject* obj) basecol->rgb.setValue(col.r, col.g, col.b); } else { - basecol->rgb.setValue(1.0f, 0.0f, 0.0f); + basecol->rgb.setValue(1.0F, 0.0F, 0.0F); } faces->addChild(basecol); @@ -524,8 +524,8 @@ void MeshFillHole::closeBridge() { // Do the hole-filling Gui::WaitCursor wc; - TBoundary::iterator it = std::find(myPolygon.begin(), myPolygon.end(), myVertex1); - TBoundary::iterator jt = std::find(myPolygon.begin(), myPolygon.end(), myVertex2); + auto it = std::find(myPolygon.begin(), myPolygon.end(), myVertex1); + auto jt = std::find(myPolygon.begin(), myPolygon.end(), myVertex2); if (it != myPolygon.end() && jt != myPolygon.end()) { // which iterator comes first if (jt < it) { @@ -533,7 +533,8 @@ void MeshFillHole::closeBridge() } // split the boundary into two loops and take the shorter one std::list bounds; - TBoundary loop1, loop2; + TBoundary loop1; + TBoundary loop2; loop1.insert(loop1.end(), myPolygon.begin(), it); loop1.insert(loop1.end(), jt, myPolygon.end()); loop2.insert(loop2.end(), it, jt); @@ -694,14 +695,14 @@ void MeshFillHole::fileHoleCallback(void* ud, SoEventCallback* n) } SoNode* node = self->getPickedPolygon(rp); if (node) { - std::map::iterator it = self->myPolygons.find(node); + auto it = self->myPolygons.find(node); if (it != self->myPolygons.end()) { // now check which vertex of the polygon is closest to the ray Mesh::PointIndex vertex_index {}; SbVec3f closestPoint; float minDist = self->findClosestPoint(rp.getLine(), it->second, vertex_index, closestPoint); - if (minDist < 1.0f) { + if (minDist < 1.0F) { if (self->myNumPoints == 0) { self->myVertex->point.set1Value(0, closestPoint); } @@ -731,7 +732,7 @@ void MeshFillHole::fileHoleCallback(void* ud, SoEventCallback* n) } SoNode* node = self->getPickedPolygon(rp); if (node) { - std::map::iterator it = self->myPolygons.find(node); + auto it = self->myPolygons.find(node); if (it != self->myPolygons.end()) { // now check which vertex of the polygon is closest to the ray Mesh::PointIndex vertex_index {}; @@ -740,7 +741,7 @@ void MeshFillHole::fileHoleCallback(void* ud, SoEventCallback* n) it->second, vertex_index, closestPoint); - if (minDist < 1.0f) { + if (minDist < 1.0F) { if (self->myNumPoints == 0) { self->myBoundaryRoot->addChild(node); self->myVertex->point.set1Value(0, closestPoint); diff --git a/src/Mod/Mesh/Gui/MeshEditor.h b/src/Mod/Mesh/Gui/MeshEditor.h index aa06a010e2..3ed56ee245 100644 --- a/src/Mod/Mesh/Gui/MeshEditor.h +++ b/src/Mod/Mesh/Gui/MeshEditor.h @@ -81,6 +81,8 @@ public: SoCoordinate3* pcCoords; SoFaceSet* pcFaces; SoFCMeshPickNode* pcMeshPick; + + FC_DISABLE_COPY_MOVE(ViewProviderFace) }; /** @@ -112,6 +114,8 @@ private: private: ViewProviderFace* faceView; + + Q_DISABLE_COPY_MOVE(MeshFaceAddition) }; class MeshGuiExport MeshHoleFiller @@ -179,6 +183,8 @@ private: TBoundary myPolygon; MeshHoleFiller& myHoleFiller; Connection myConnection; + + Q_DISABLE_COPY_MOVE(MeshFillHole) }; } // namespace MeshGui diff --git a/src/Mod/Mesh/Gui/MeshSelection.cpp b/src/Mod/Mesh/Gui/MeshSelection.cpp index 2c34abd3a6..e59ea05648 100644 --- a/src/Mod/Mesh/Gui/MeshSelection.cpp +++ b/src/Mod/Mesh/Gui/MeshSelection.cpp @@ -60,6 +60,7 @@ using namespace MeshGui; #define CROSS_HOT_X 7 #define CROSS_HOT_Y 7 +// NOLINTBEGIN // clang-format off unsigned char MeshSelection::cross_bitmap[] = { 0xc0, 0x03, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, @@ -73,6 +74,7 @@ unsigned char MeshSelection::cross_mask_bitmap[] = { 0xff, 0xff, 0xff, 0xff, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03}; // clang-format on +// NOLINTEND MeshSelection::MeshSelection() { @@ -205,8 +207,8 @@ void MeshSelection::prepareFreehandSelection(bool add, SoEventCallbackCB* cb) // set cross cursor Gui::FreehandSelection* freehand = new Gui::FreehandSelection(); freehand->setClosed(true); - freehand->setColor(1.0f, 0.0f, 0.0f); - freehand->setLineWidth(3.0f); + freehand->setColor(1.0F, 0.0F, 0.0F); + freehand->setLineWidth(3.0F); viewer->navigationStyle()->startSelection(freehand); auto setComponentCursor = [=]() { @@ -303,7 +305,8 @@ bool MeshSelection::deleteSelectionBorder() Mesh::Feature* mf = static_cast(view->getObject()); // mark the selected facet as visited - std::vector selection, remove; + std::vector selection; + std::vector remove; std::set borderPoints; MeshCore::MeshAlgorithm meshAlg(mf->Mesh.getValue().getKernel()); meshAlg.GetFacetsFlag(selection, MeshCore::MeshFacet::SELECTED); @@ -469,7 +472,8 @@ void MeshSelection::selectGLCallback(void* ud, SoEventCallback* n) polygon.push_back(polygon.front()); } - SbVec3f pnt, dir; + SbVec3f pnt; + SbVec3f dir; view->getNearPlane(pnt, dir); Base::Vector3f normal(dir[0], dir[1], dir[2]); @@ -491,7 +495,8 @@ void MeshSelection::selectGLCallback(void* ud, SoEventCallback* n) if (self->onlyVisibleTriangles) { const SbVec2s& sz = view->getSoRenderManager()->getViewportRegion().getWindowSize(); - short width {}, height {}; + short width {}; + short height {}; sz.getValue(width, height); std::vector pixelPoly = view->getPolygon(); SbBox2s rect; @@ -519,7 +524,7 @@ void MeshSelection::selectGLCallback(void* ud, SoEventCallback* n) MeshCore::MeshFacetIterator it_f(kernel); for (Mesh::FacetIndex face : faces) { it_f.Set(face); - if (it_f->GetNormal() * normal > 0.0f) { + if (it_f->GetNormal() * normal > 0.0F) { screen.push_back(face); } } diff --git a/src/Mod/Mesh/Gui/RemeshGmsh.h b/src/Mod/Mesh/Gui/RemeshGmsh.h index be1f9d8e17..d699b2df5e 100644 --- a/src/Mod/Mesh/Gui/RemeshGmsh.h +++ b/src/Mod/Mesh/Gui/RemeshGmsh.h @@ -82,6 +82,8 @@ private: private: class Private; std::unique_ptr d; + + Q_DISABLE_COPY_MOVE(GmshWidget) }; /** @@ -105,6 +107,8 @@ protected: private: class Private; std::unique_ptr d; + + Q_DISABLE_COPY_MOVE(RemeshGmsh) }; /** diff --git a/src/Mod/Mesh/Gui/RemoveComponents.h b/src/Mod/Mesh/Gui/RemoveComponents.h index 58635b5bc4..29f14879b0 100644 --- a/src/Mod/Mesh/Gui/RemoveComponents.h +++ b/src/Mod/Mesh/Gui/RemoveComponents.h @@ -73,6 +73,8 @@ private: private: Ui_RemoveComponents* ui; MeshSelection meshSel; + + Q_DISABLE_COPY_MOVE(RemoveComponents) }; /** @@ -93,6 +95,8 @@ private Q_SLOTS: private: RemoveComponents* widget; + + Q_DISABLE_COPY_MOVE(RemoveComponentsDialog) }; /** diff --git a/src/Mod/Mesh/Gui/Segmentation.h b/src/Mod/Mesh/Gui/Segmentation.h index 17c3c5235d..77b4aea1b3 100644 --- a/src/Mod/Mesh/Gui/Segmentation.h +++ b/src/Mod/Mesh/Gui/Segmentation.h @@ -57,6 +57,8 @@ protected: private: Ui_Segmentation* ui; Mesh::Feature* myMesh; + + Q_DISABLE_COPY_MOVE(Segmentation) }; /** diff --git a/src/Mod/Mesh/Gui/SegmentationBestFit.h b/src/Mod/Mesh/Gui/SegmentationBestFit.h index 2a552c70ca..72b1cddcb6 100644 --- a/src/Mod/Mesh/Gui/SegmentationBestFit.h +++ b/src/Mod/Mesh/Gui/SegmentationBestFit.h @@ -90,6 +90,8 @@ private: Mesh::Feature* myMesh; MeshSelection meshSel; std::vector spinBoxes; + + Q_DISABLE_COPY_MOVE(ParametersDialog) }; class MeshGuiExport SegmentationBestFit: public QWidget @@ -119,6 +121,8 @@ private: Ui_SegmentationBestFit* ui; Mesh::Feature* myMesh; MeshSelection meshSel; + + Q_DISABLE_COPY_MOVE(SegmentationBestFit) }; /** diff --git a/src/Mod/Mesh/Gui/Selection.h b/src/Mod/Mesh/Gui/Selection.h index 0e14d3f1db..6c3b18068a 100644 --- a/src/Mod/Mesh/Gui/Selection.h +++ b/src/Mod/Mesh/Gui/Selection.h @@ -56,6 +56,8 @@ private: private: MeshSelection meshSel; Ui_Selection* ui; + + Q_DISABLE_COPY_MOVE(Selection) }; } // namespace MeshGui diff --git a/src/Mod/Mesh/Gui/SoPolygon.cpp b/src/Mod/Mesh/Gui/SoPolygon.cpp index 572bd2a086..acc5701058 100644 --- a/src/Mod/Mesh/Gui/SoPolygon.cpp +++ b/src/Mod/Mesh/Gui/SoPolygon.cpp @@ -94,7 +94,7 @@ void SoPolygon::GLRender(SoGLRenderAction* action) */ void SoPolygon::drawPolygon(const SbVec3f* points, int32_t len) const { - glLineWidth(3.0f); + glLineWidth(3.0F); int32_t beg = startIndex.getValue(); int32_t cnt = numVertices.getValue(); int32_t end = beg + cnt; @@ -162,10 +162,10 @@ void SoPolygon::computeBBox(SoAction* action, SbBox3f& box, SbVec3f& center) } box.setBounds(minX, minY, minZ, maxX, maxY, maxZ); - center.setValue(0.5f * (minX + maxX), 0.5f * (minY + maxY), 0.5f * (minZ + maxZ)); + center.setValue(0.5F * (minX + maxX), 0.5F * (minY + maxY), 0.5F * (minZ + maxZ)); } else { box.setBounds(SbVec3f(0, 0, 0), SbVec3f(0, 0, 0)); - center.setValue(0.0f, 0.0f, 0.0f); + center.setValue(0.0F, 0.0F, 0.0F); } } diff --git a/src/Mod/Mesh/Gui/ThumbnailExtension.cpp b/src/Mod/Mesh/Gui/ThumbnailExtension.cpp index 6a678216d6..2c3aba2b1b 100644 --- a/src/Mod/Mesh/Gui/ThumbnailExtension.cpp +++ b/src/Mod/Mesh/Gui/ThumbnailExtension.cpp @@ -57,13 +57,13 @@ Mesh::Extension3MF::Resource ThumbnailExtension3MF::addMesh(const Mesh::MeshObje ViewProviderMeshBuilder().createMesh(mesh.getKernel(), coord, faces); - SbRotation rot(-0.35355f, -0.14644f, -0.35355f, -0.85355f); + SbRotation rot(-0.35355F, -0.14644F, -0.35355F, -0.85355F); cam->orientation.setValue(rot); SbViewportRegion vpr(256, 256); cam->viewAll(root, vpr); Gui::SoQtOffscreenRenderer renderer(vpr); - renderer.setBackgroundColor(SbColor4f(1.0f, 1.0f, 1.0f, 0.0f)); + renderer.setBackgroundColor(SbColor4f(1.0F, 1.0F, 1.0F, 0.0F)); QImage img; renderer.render(root); renderer.writeToImage(img); diff --git a/src/Mod/Mesh/Gui/ViewProvider.cpp b/src/Mod/Mesh/Gui/ViewProvider.cpp index d24dc4cc7b..a6bd2b286c 100644 --- a/src/Mod/Mesh/Gui/ViewProvider.cpp +++ b/src/Mod/Mesh/Gui/ViewProvider.cpp @@ -224,8 +224,8 @@ QIcon ViewProviderExport::getIcon() const // ------------------------------------------------------ -App::PropertyFloatConstraint::Constraints ViewProviderMesh::floatRange = {1.0f, 64.0f, 1.0f}; -App::PropertyFloatConstraint::Constraints ViewProviderMesh::angleRange = {0.0f, 180.0f, 1.0f}; +App::PropertyFloatConstraint::Constraints ViewProviderMesh::floatRange = {1.0F, 64.0F, 1.0F}; +App::PropertyFloatConstraint::Constraints ViewProviderMesh::angleRange = {0.0F, 180.0F, 1.0F}; App::PropertyIntegerConstraint::Constraints ViewProviderMesh::intPercent = {0, 100, 5}; const char* ViewProviderMesh::LightingEnums[] = {"One side", "Two side", nullptr}; @@ -357,7 +357,7 @@ void ViewProviderMesh::onChanged(const App::Property* prop) pcMatBinding->value = SoMaterialBinding::OVERALL; } if (prop == &LineTransparency) { - float trans = LineTransparency.getValue() / 100.0f; + float trans = LineTransparency.getValue() / 100.0F; pLineColor->transparency = trans; } else if (prop == &LineWidth) { @@ -406,12 +406,12 @@ void ViewProviderMesh::onChanged(const App::Property* prop) void ViewProviderMesh::setOpenEdgeColorFrom(const App::Color& c) { - float r = 1.0f - c.r; - r = r < 0.5f ? 0.0f : 1.0f; - float g = 1.0f - c.g; - g = g < 0.5f ? 0.0f : 1.0f; - float b = 1.0f - c.b; - b = b < 0.5f ? 0.0f : 1.0f; + float r = 1.0F - c.r; + r = r < 0.5F ? 0.0F : 1.0F; + float g = 1.0F - c.g; + g = g < 0.5F ? 0.0F : 1.0F; + float b = 1.0F - c.b; + b = b < 0.5F ? 0.0F : 1.0F; pOpenColor->rgb.setValue(r, g, b); } @@ -478,8 +478,8 @@ void ViewProviderMesh::attach(App::DocumentObject* pcFeat) // appear on top of the faces SoPolygonOffset* offset = new SoPolygonOffset(); offset->styles = SoPolygonOffset::FILLED; - offset->factor = 1.0f; - offset->units = 1.0f; + offset->factor = 1.0F; + offset->units = 1.0F; SoSeparator* pcWireSep = new SoSeparator(); pcWireSep->addChild(pcLineStyle); @@ -1297,17 +1297,17 @@ void ViewProviderMesh::selectGLCallback(void* ud, SoEventCallback* n) pos.getValue(pX, pY); const SbVec2s& sz = view->getSoRenderManager()->getViewportRegion().getViewportSizePixels(); float fRatio = view->getSoRenderManager()->getViewportRegion().getViewportAspectRatio(); - if (fRatio > 1.0f) { - pX = (pX - 0.5f) / fRatio + 0.5f; + if (fRatio > 1.0F) { + pX = (pX - 0.5F) / fRatio + 0.5F; pos.setValue(pX, pY); } - else if (fRatio < 1.0f) { - pY = (pY - 0.5f) * fRatio + 0.5f; + else if (fRatio < 1.0F) { + pY = (pY - 0.5F) * fRatio + 0.5F; pos.setValue(pX, pY); } - short x1 = (short)(pX * sz[0] + 0.5f); - short y1 = (short)(pY * sz[1] + 0.5f); + short x1 = (short)(pX * sz[0] + 0.5F); + short y1 = (short)(pY * sz[1] + 0.5F); SbVec2s loc = ev->getPosition(); short x2 = loc[0]; short y2 = loc[1]; @@ -1436,7 +1436,10 @@ void ViewProviderMesh::boxZoom(const SbBox2s& box, const SbViewportRegion& vp, S } // Get the new center in normalized pixel coordinates - short xmin {}, xmax {}, ymin {}, ymax {}; + short xmin {}; + short xmax {}; + short ymin {}; + short ymax {}; box.getBounds(xmin, ymin, xmax, ymax); const SbVec2f center((float)((xmin + xmax) / 2) / (float)std::max((int)(size[0] - 1), 1), (float)(size[1] - (ymin + ymax) / 2) @@ -1454,8 +1457,8 @@ void ViewProviderMesh::boxZoom(const SbBox2s& box, const SbViewportRegion& vp, S static_cast(cam)->height = height; } else if (cam->getTypeId() == SoPerspectiveCamera::getClassTypeId()) { - float height = static_cast(cam)->heightAngle.getValue() / 2.0f; - height = 2.0f * atan(tan(height) * scale); + float height = static_cast(cam)->heightAngle.getValue() / 2.0F; + height = 2.0F * atan(tan(height) * scale); static_cast(cam)->heightAngle = height; } } @@ -1544,7 +1547,7 @@ std::vector ViewProviderMesh::getVisibleFacets(const SbViewpor // Coin3d's off-screen renderer doesn't work out-of-the-box any more on most recent Linux // systems. So, use FreeCAD's offscreen renderer now. Gui::SoQtOffscreenRenderer renderer(vp); - renderer.setBackgroundColor(SbColor4f(0.0f, 0.0f, 0.0f)); + renderer.setBackgroundColor(SbColor4f(0.0F, 0.0F, 0.0F)); QImage img; renderer.render(root); @@ -2091,7 +2094,7 @@ void ViewProviderMesh::selectFacet(Mesh::FacetIndex facet) highlightSelection(); } else { - pcShapeMaterial->diffuseColor.set1Value(facet, 1.0f, 0.0f, 0.0f); + pcShapeMaterial->diffuseColor.set1Value(facet, 1.0F, 0.0F, 0.0F); } } @@ -2291,7 +2294,7 @@ void ViewProviderMesh::highlightSelection() cols[i].setValue(c.r, c.g, c.b); } for (Mesh::FacetIndex it : selection) { - cols[it].setValue(1.0f, 0.0f, 0.0f); + cols[it].setValue(1.0F, 0.0F, 0.0F); } pcShapeMaterial->diffuseColor.finishEditing(); } @@ -2494,7 +2497,7 @@ void ViewProviderIndexedFaceSet::attach(App::DocumentObject* pcFeat) int size = hGrp->GetInt("RenderTriangleLimit", -1); if (size > 0) { static_cast(pcMeshFaces)->renderTriangleLimit = - (unsigned int)(pow(10.0f, size)); + (unsigned int)(pow(10.0F, size)); } } @@ -2585,7 +2588,7 @@ void ViewProviderMeshObject::attach(App::DocumentObject* pcFeat) Gui::WindowParameter::getDefaultParameter()->GetGroup("Mod/Mesh"); int size = hGrp->GetInt("RenderTriangleLimit", -1); if (size > 0) { - pcMeshShape->renderTriangleLimit = (unsigned int)(pow(10.0f, size)); + pcMeshShape->renderTriangleLimit = (unsigned int)(pow(10.0F, size)); } } diff --git a/src/Mod/Mesh/Gui/ViewProvider.h b/src/Mod/Mesh/Gui/ViewProvider.h index 30bda1c157..54972993ff 100644 --- a/src/Mod/Mesh/Gui/ViewProvider.h +++ b/src/Mod/Mesh/Gui/ViewProvider.h @@ -111,6 +111,8 @@ public: } std::vector getDisplayModes() const override; const char* getDefaultDisplayMode() const override; + + FC_DISABLE_COPY_MOVE(ViewProviderExport) }; /** @@ -284,6 +286,8 @@ private: static App::PropertyFloatConstraint::Constraints angleRange; static App::PropertyIntegerConstraint::Constraints intPercent; static const char* LightingEnums[]; + + FC_DISABLE_COPY_MOVE(ViewProviderMesh) }; /** @@ -311,6 +315,8 @@ protected: private: SoCoordinate3* pcMeshCoord; SoIndexedFaceSet* pcMeshFaces; + + FC_DISABLE_COPY_MOVE(ViewProviderIndexedFaceSet) }; /** @@ -337,6 +343,8 @@ protected: private: SoFCMeshObjectNode* pcMeshNode; SoFCMeshObjectShape* pcMeshShape; + + FC_DISABLE_COPY_MOVE(ViewProviderMeshObject) }; } // namespace MeshGui diff --git a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp index ec0a778f1a..eb568e88e1 100644 --- a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp @@ -183,14 +183,14 @@ void ViewProviderMeshCurvature::init(const Mesh::PropertyCurvatureList* pCurvInf // histogram over all values std::map aHistogram; for (float aMinValue : aMinValues) { - int grp = (int)(10.0f * (aMinValue - fMin) / (fMax - fMin)); + int grp = (int)(10.0F * (aMinValue - fMin) / (fMax - fMin)); aHistogram[grp]++; } - float fRMin = -1.0f; + float fRMin = -1.0F; for (const auto& mIt : aHistogram) { - if ((float)mIt.second / (float)aMinValues.size() > 0.15f) { - fRMin = mIt.first * (fMax - fMin) / 10.0f + fMin; + if ((float)mIt.second / (float)aMinValues.size() > 0.15F) { + fRMin = mIt.first * (fMax - fMin) / 10.0F + fMin; break; } } @@ -201,15 +201,15 @@ void ViewProviderMeshCurvature::init(const Mesh::PropertyCurvatureList* pCurvInf // histogram over all values aHistogram.clear(); for (float aMaxValue : aMaxValues) { - int grp = (int)(10.0f * (aMaxValue - fMin) / (fMax - fMin)); + int grp = (int)(10.0F * (aMaxValue - fMin) / (fMax - fMin)); aHistogram[grp]++; } - float fRMax = 1.0f; + float fRMax = 1.0F; for (std::map::reverse_iterator rIt2 = aHistogram.rbegin(); rIt2 != aHistogram.rend(); ++rIt2) { - if ((float)rIt2->second / (float)aMaxValues.size() > 0.15f) { - fRMax = rIt2->first * (fMax - fMin) / 10.0f + fMin; + if ((float)rIt2->second / (float)aMaxValues.size() > 0.15F) { + fRMax = rIt2->first * (fMax - fMin) / 10.0F + fMin; break; } } @@ -609,9 +609,9 @@ ViewProviderMeshCurvature::curvatureInfo(bool detail, int index1, int index2, in const Mesh::CurvatureInfo& cVal1 = (*curv)[index1]; const Mesh::CurvatureInfo& cVal2 = (*curv)[index2]; const Mesh::CurvatureInfo& cVal3 = (*curv)[index3]; - float fVal1 = 0.0f; - float fVal2 = 0.0f; - float fVal3 = 0.0f; + float fVal1 = 0.0F; + float fVal2 = 0.0F; + float fVal3 = 0.0F; bool print = true; std::string mode = getActiveDisplayMode(); @@ -631,9 +631,9 @@ ViewProviderMeshCurvature::curvatureInfo(bool detail, int index1, int index2, in fVal3 = cVal3.fMaxCurvature * cVal3.fMinCurvature; } else if (mode == "Mean curvature") { - fVal1 = 0.5f * (cVal1.fMaxCurvature + cVal1.fMinCurvature); - fVal2 = 0.5f * (cVal2.fMaxCurvature + cVal2.fMinCurvature); - fVal3 = 0.5f * (cVal3.fMaxCurvature + cVal3.fMinCurvature); + fVal1 = 0.5F * (cVal1.fMaxCurvature + cVal1.fMinCurvature); + fVal2 = 0.5F * (cVal2.fMaxCurvature + cVal2.fMinCurvature); + fVal3 = 0.5F * (cVal3.fMaxCurvature + cVal3.fMinCurvature); } else if (mode == "Absolute curvature") { fVal1 = fabs(cVal1.fMaxCurvature) > fabs(cVal1.fMinCurvature) ? cVal1.fMaxCurvature diff --git a/src/Mod/Mesh/Gui/ViewProviderCurvature.h b/src/Mod/Mesh/Gui/ViewProviderCurvature.h index 483e8cf5dc..c30fba3667 100644 --- a/src/Mod/Mesh/Gui/ViewProviderCurvature.h +++ b/src/Mod/Mesh/Gui/ViewProviderCurvature.h @@ -126,6 +126,8 @@ private: private: static bool addflag; + + FC_DISABLE_COPY_MOVE(ViewProviderMeshCurvature) }; } // namespace MeshGui diff --git a/src/Mod/Mesh/Gui/ViewProviderDefects.cpp b/src/Mod/Mesh/Gui/ViewProviderDefects.cpp index 41f89a5381..a16646a1fa 100644 --- a/src/Mod/Mesh/Gui/ViewProviderDefects.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderDefects.cpp @@ -59,7 +59,7 @@ PROPERTY_SOURCE(MeshGui::ViewProviderMeshFolds, MeshGui::ViewProviderMeshDefects ViewProviderMeshDefects::ViewProviderMeshDefects() { - ADD_PROPERTY(LineWidth, (2.0f)); + ADD_PROPERTY(LineWidth, (2.0F)); pcCoords = new SoCoordinate3(); pcCoords->ref(); @@ -124,14 +124,14 @@ void ViewProviderMeshOrientation::attach(App::DocumentObject* pcFeat) // Draw faces SoSeparator* linesep = new SoSeparator; SoBaseColor* basecol = new SoBaseColor; - basecol->rgb.setValue(1.0f, 0.5f, 0.0f); + basecol->rgb.setValue(1.0F, 0.5F, 0.0F); linesep->addChild(basecol); linesep->addChild(pcCoords); linesep->addChild(pcFaces); // Draw markers SoBaseColor* markcol = new SoBaseColor; - markcol->rgb.setValue(1.0f, 1.0f, 0.0f); + markcol->rgb.setValue(1.0F, 1.0F, 0.0F); SoMarkerSet* marker = new SoMarkerSet; marker->markerIndex = Gui::Inventor::MarkerBitmaps::getMarkerIndex( "PLUS", @@ -160,7 +160,7 @@ void ViewProviderMeshOrientation::showDefects(const std::vector_aclPoints) { // move a bit in opposite normal direction to overlay the original faces - cP -= 0.001f * cF->GetNormal(); + cP -= 0.001F * cF->GetNormal(); pcCoords->point.set1Value(i++, cP.x, cP.y, cP.z); } pcFaces->numVertices.set1Value(j++, 3); @@ -195,7 +195,7 @@ void ViewProviderMeshNonManifolds::attach(App::DocumentObject* pcFeat) // Draw lines SoSeparator* linesep = new SoSeparator; SoBaseColor* basecol = new SoBaseColor; - basecol->rgb.setValue(1.0f, 0.0f, 0.0f); + basecol->rgb.setValue(1.0F, 0.0F, 0.0F); linesep->addChild(basecol); linesep->addChild(pcCoords); linesep->addChild(pcLines); @@ -203,7 +203,7 @@ void ViewProviderMeshNonManifolds::attach(App::DocumentObject* pcFeat) // Draw markers SoBaseColor* markcol = new SoBaseColor; - markcol->rgb.setValue(1.0f, 1.0f, 0.0f); + markcol->rgb.setValue(1.0F, 1.0F, 0.0F); SoMarkerSet* marker = new SoMarkerSet; marker->markerIndex = Gui::Inventor::MarkerBitmaps::getMarkerIndex( "PLUS", @@ -268,7 +268,7 @@ void ViewProviderMeshNonManifoldPoints::attach(App::DocumentObject* pcFeat) // Draw points SoSeparator* pointsep = new SoSeparator; SoBaseColor* basecol = new SoBaseColor; - basecol->rgb.setValue(1.0f, 0.5f, 0.0f); + basecol->rgb.setValue(1.0F, 0.5F, 0.0F); pointsep->addChild(basecol); pointsep->addChild(pcCoords); pointsep->addChild(pcPoints); @@ -276,7 +276,7 @@ void ViewProviderMeshNonManifoldPoints::attach(App::DocumentObject* pcFeat) // Draw markers SoBaseColor* markcol = new SoBaseColor; - markcol->rgb.setValue(1.0f, 1.0f, 0.0f); + markcol->rgb.setValue(1.0F, 1.0F, 0.0F); SoMarkerSet* marker = new SoMarkerSet; marker->markerIndex = Gui::Inventor::MarkerBitmaps::getMarkerIndex( "PLUS", @@ -338,7 +338,7 @@ void ViewProviderMeshDuplicatedFaces::attach(App::DocumentObject* pcFeat) // Draw lines SoSeparator* linesep = new SoSeparator; SoBaseColor* basecol = new SoBaseColor; - basecol->rgb.setValue(1.0f, 0.0f, 0.0f); + basecol->rgb.setValue(1.0F, 0.0F, 0.0F); linesep->addChild(basecol); linesep->addChild(pcCoords); linesep->addChild(pcFaces); @@ -346,7 +346,7 @@ void ViewProviderMeshDuplicatedFaces::attach(App::DocumentObject* pcFeat) // Draw markers SoBaseColor* markcol = new SoBaseColor; - markcol->rgb.setValue(1.0f, 1.0f, 0.0f); + markcol->rgb.setValue(1.0F, 1.0F, 0.0F); SoMarkerSet* marker = new SoMarkerSet; marker->markerIndex = Gui::Inventor::MarkerBitmaps::getMarkerIndex( "PLUS", @@ -373,7 +373,7 @@ void ViewProviderMeshDuplicatedFaces::showDefects(const std::vector_aclPoints) { // move a bit in normal direction to overlay the original faces - cP += 0.001f * cF->GetNormal(); + cP += 0.001F * cF->GetNormal(); pcCoords->point.set1Value(i++, cP.x, cP.y, cP.z); } pcFaces->numVertices.set1Value(j++, 3); @@ -408,7 +408,7 @@ void ViewProviderMeshDuplicatedPoints::attach(App::DocumentObject* pcFeat) // Draw points SoSeparator* pointsep = new SoSeparator; SoBaseColor* basecol = new SoBaseColor; - basecol->rgb.setValue(1.0f, 0.5f, 0.0f); + basecol->rgb.setValue(1.0F, 0.5F, 0.0F); pointsep->addChild(basecol); pointsep->addChild(pcCoords); pointsep->addChild(pcPoints); @@ -416,7 +416,7 @@ void ViewProviderMeshDuplicatedPoints::attach(App::DocumentObject* pcFeat) // Draw markers SoBaseColor* markcol = new SoBaseColor; - markcol->rgb.setValue(1.0f, 1.0f, 0.0f); + markcol->rgb.setValue(1.0F, 1.0F, 0.0F); SoMarkerSet* marker = new SoMarkerSet; marker->markerIndex = Gui::Inventor::MarkerBitmaps::getMarkerIndex( "PLUS", @@ -471,7 +471,7 @@ void ViewProviderMeshDegenerations::attach(App::DocumentObject* pcFeat) // Draw lines SoSeparator* linesep = new SoSeparator; SoBaseColor* basecol = new SoBaseColor; - basecol->rgb.setValue(1.0f, 0.5f, 0.0f); + basecol->rgb.setValue(1.0F, 0.5F, 0.0F); linesep->addChild(basecol); linesep->addChild(pcCoords); linesep->addChild(pcLines); @@ -479,7 +479,7 @@ void ViewProviderMeshDegenerations::attach(App::DocumentObject* pcFeat) // Draw markers SoBaseColor* markcol = new SoBaseColor; - markcol->rgb.setValue(1.0f, 1.0f, 0.0f); + markcol->rgb.setValue(1.0F, 1.0F, 0.0F); SoMarkerSet* marker = new SoMarkerSet; marker->markerIndex = Gui::Inventor::MarkerBitmaps::getMarkerIndex( "PLUS", @@ -511,7 +511,7 @@ void ViewProviderMeshDegenerations::showDefects(const std::vector_aclPoints[(j + 2) % 3] - cF->_aclPoints[j]; // adjust the neighbourhoods and point indices - if (cVec1 * cVec2 < 0.0f) { + if (cVec1 * cVec2 < 0.0F) { pcCoords->point.set1Value(i++, cF->_aclPoints[(j + 1) % 3].x, cF->_aclPoints[(j + 1) % 3].y, @@ -589,7 +589,7 @@ void ViewProviderMeshIndices::attach(App::DocumentObject* pcFeat) // Draw lines SoSeparator* linesep = new SoSeparator; SoBaseColor* basecol = new SoBaseColor; - basecol->rgb.setValue(1.0f, 0.5f, 0.0f); + basecol->rgb.setValue(1.0F, 0.5F, 0.0F); linesep->addChild(basecol); linesep->addChild(pcCoords); linesep->addChild(pcFaces); @@ -597,7 +597,7 @@ void ViewProviderMeshIndices::attach(App::DocumentObject* pcFeat) // Draw markers SoBaseColor* markcol = new SoBaseColor; - markcol->rgb.setValue(1.0f, 1.0f, 0.0f); + markcol->rgb.setValue(1.0F, 1.0F, 0.0F); SoMarkerSet* marker = new SoMarkerSet; marker->markerIndex = Gui::Inventor::MarkerBitmaps::getMarkerIndex( "PLUS", @@ -625,7 +625,7 @@ void ViewProviderMeshIndices::showDefects(const std::vector& cF.Set(ind); for (auto cP : cF->_aclPoints) { // move a bit in opposite normal direction to overlay the original faces - cP -= 0.001f * cF->GetNormal(); + cP -= 0.001F * cF->GetNormal(); pcCoords->point.set1Value(i++, cP.x, cP.y, cP.z); } pcFaces->numVertices.set1Value(j++, 3); @@ -661,7 +661,7 @@ void ViewProviderMeshSelfIntersections::attach(App::DocumentObject* pcFeat) // Draw lines SoSeparator* linesep = new SoSeparator; SoBaseColor* basecol = new SoBaseColor; - basecol->rgb.setValue(1.0f, 0.5f, 0.0f); + basecol->rgb.setValue(1.0F, 0.5F, 0.0F); linesep->addChild(basecol); linesep->addChild(pcCoords); linesep->addChild(pcLines); @@ -669,7 +669,7 @@ void ViewProviderMeshSelfIntersections::attach(App::DocumentObject* pcFeat) // Draw markers SoBaseColor* markcol = new SoBaseColor; - markcol->rgb.setValue(1.0f, 1.0f, 0.0f); + markcol->rgb.setValue(1.0F, 1.0F, 0.0F); SoMarkerSet* marker = new SoMarkerSet; marker->markerIndex = Gui::Inventor::MarkerBitmaps::getMarkerIndex( "PLUS", @@ -750,7 +750,7 @@ void ViewProviderMeshFolds::attach(App::DocumentObject* pcFeat) // Draw lines SoSeparator* linesep = new SoSeparator; SoBaseColor* basecol = new SoBaseColor; - basecol->rgb.setValue(1.0f, 0.0f, 0.0f); + basecol->rgb.setValue(1.0F, 0.0F, 0.0F); linesep->addChild(basecol); linesep->addChild(pcCoords); linesep->addChild(pcFaces); @@ -758,7 +758,7 @@ void ViewProviderMeshFolds::attach(App::DocumentObject* pcFeat) // Draw markers SoBaseColor* markcol = new SoBaseColor; - markcol->rgb.setValue(1.0f, 1.0f, 0.0f); + markcol->rgb.setValue(1.0F, 1.0F, 0.0F); SoMarkerSet* marker = new SoMarkerSet; marker->markerIndex = Gui::Inventor::MarkerBitmaps::getMarkerIndex( "PLUS", @@ -785,7 +785,7 @@ void ViewProviderMeshFolds::showDefects(const std::vector& i cF.Set(ind); for (auto cP : cF->_aclPoints) { // move a bit in normal direction to overlay the original faces - cP += 0.001f * cF->GetNormal(); + cP += 0.001F * cF->GetNormal(); pcCoords->point.set1Value(i++, cP.x, cP.y, cP.z); } pcFaces->numVertices.set1Value(j++, 3); diff --git a/src/Mod/Mesh/Gui/ViewProviderDefects.h b/src/Mod/Mesh/Gui/ViewProviderDefects.h index 8a06a0a5e5..69fd2cf1ba 100644 --- a/src/Mod/Mesh/Gui/ViewProviderDefects.h +++ b/src/Mod/Mesh/Gui/ViewProviderDefects.h @@ -65,6 +65,9 @@ protected: SoCoordinate3* pcCoords; SoDrawStyle* pcDrawStyle; // NOLINTEND + +private: + FC_DISABLE_COPY_MOVE(ViewProviderMeshDefects) }; /** The ViewProviderMeshOrientation class displays wrong oriented facets (i.e. flipped normals) in @@ -84,6 +87,7 @@ public: private: SoFaceSet* pcFaces; + FC_DISABLE_COPY_MOVE(ViewProviderMeshOrientation) }; /** The ViewProviderMeshNonManifolds class displays edges with more than two faces attached in red. @@ -102,6 +106,7 @@ public: private: SoLineSet* pcLines; + FC_DISABLE_COPY_MOVE(ViewProviderMeshNonManifolds) }; /** The ViewProviderMeshNonManifoldPoints class displays non-manifold vertexes in red. @@ -120,6 +125,7 @@ public: private: SoPointSet* pcPoints; + FC_DISABLE_COPY_MOVE(ViewProviderMeshNonManifoldPoints) }; /** The ViewProviderMeshDuplicatedFaces class displays duplicated faces in red. @@ -138,6 +144,7 @@ public: private: SoFaceSet* pcFaces; + FC_DISABLE_COPY_MOVE(ViewProviderMeshDuplicatedFaces) }; /** The ViewProviderMeshDegenerations class displays degenerated faces to a line or even a point in @@ -157,6 +164,7 @@ public: private: SoLineSet* pcLines; + FC_DISABLE_COPY_MOVE(ViewProviderMeshDegenerations) }; class MeshGuiExport ViewProviderMeshDuplicatedPoints: public ViewProviderMeshDefects @@ -172,6 +180,7 @@ public: private: SoPointSet* pcPoints; + FC_DISABLE_COPY_MOVE(ViewProviderMeshDuplicatedPoints) }; class MeshGuiExport ViewProviderMeshIndices: public ViewProviderMeshDefects @@ -187,6 +196,7 @@ public: private: SoFaceSet* pcFaces; + FC_DISABLE_COPY_MOVE(ViewProviderMeshIndices) }; /** The ViewProviderMeshSelfIntersections class displays lines of self-intersections. @@ -205,6 +215,7 @@ public: private: SoLineSet* pcLines; + FC_DISABLE_COPY_MOVE(ViewProviderMeshSelfIntersections) }; class MeshGuiExport ViewProviderMeshFolds: public ViewProviderMeshDefects @@ -220,6 +231,8 @@ public: private: SoFaceSet* pcFaces; + + FC_DISABLE_COPY_MOVE(ViewProviderMeshFolds) }; } // namespace MeshGui diff --git a/src/Mod/Mesh/Gui/ViewProviderMeshFaceSet.cpp b/src/Mod/Mesh/Gui/ViewProviderMeshFaceSet.cpp index 49a95431be..e503fea2ec 100644 --- a/src/Mod/Mesh/Gui/ViewProviderMeshFaceSet.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderMeshFaceSet.cpp @@ -91,9 +91,9 @@ void ViewProviderMeshFaceSet::attach(App::DocumentObject* pcFeat) Gui::WindowParameter::getDefaultParameter()->GetGroup("Mod/Mesh"); int size = hGrp->GetInt("RenderTriangleLimit", -1); if (size > 0) { - pcMeshShape->renderTriangleLimit = (unsigned int)(pow(10.0f, size)); + pcMeshShape->renderTriangleLimit = (unsigned int)(pow(10.0F, size)); static_cast(pcMeshFaces)->renderTriangleLimit = - (unsigned int)(pow(10.0f, size)); + (unsigned int)(pow(10.0F, size)); } } diff --git a/src/Mod/Mesh/Gui/ViewProviderMeshFaceSet.h b/src/Mod/Mesh/Gui/ViewProviderMeshFaceSet.h index dd6413cfb6..013fb24ecb 100644 --- a/src/Mod/Mesh/Gui/ViewProviderMeshFaceSet.h +++ b/src/Mod/Mesh/Gui/ViewProviderMeshFaceSet.h @@ -70,6 +70,8 @@ private: SoFCIndexedFaceSet* pcMeshFaces; SoFCMeshObjectNode* pcMeshNode; SoFCMeshObjectShape* pcMeshShape; + + FC_DISABLE_COPY_MOVE(ViewProviderMeshFaceSet) }; } // namespace MeshGui diff --git a/src/Mod/Mesh/Gui/ViewProviderTransform.h b/src/Mod/Mesh/Gui/ViewProviderTransform.h index 746fdcc716..d2ac7e6c42 100644 --- a/src/Mod/Mesh/Gui/ViewProviderTransform.h +++ b/src/Mod/Mesh/Gui/ViewProviderTransform.h @@ -72,6 +72,8 @@ public: private: SoTransformerManip* pcTransformerDragger; + + FC_DISABLE_COPY_MOVE(ViewProviderMeshTransform) }; } // namespace MeshGui diff --git a/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.cpp b/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.cpp index d1bcedb8c2..714fe832e1 100644 --- a/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.cpp @@ -135,11 +135,11 @@ void ViewProviderMeshTransformDemolding::calcNormalVector() void ViewProviderMeshTransformDemolding::calcMaterialIndex(const SbRotation& rot) { - SbVec3f Up(0, 0, 1), result; + SbVec3f Up(0, 0, 1); + SbVec3f result; int i = 0; - for (std::vector::const_iterator it = normalVector.begin(); it != normalVector.end(); - ++it, i++) { + for (auto it = normalVector.begin(); it != normalVector.end(); ++it, i++) { rot.multVec(*it, result); } } diff --git a/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.h b/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.h index f8c7dac8c0..f051f89638 100644 --- a/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.h +++ b/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.h @@ -88,6 +88,8 @@ private: SoMaterial* pcColorMat; std::vector normalVector; Base::Vector3f center; + + FC_DISABLE_COPY_MOVE(ViewProviderMeshTransformDemolding) }; } // namespace MeshGui