From 59e605e6b800c65f31605a17cbd4885e77bc56b6 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 26 Jan 2022 18:05:02 +0100 Subject: [PATCH] Mesh: modernize C++11 * remove redundant void-arg * use nullptr * replace deprecated headers --- src/Mod/Mesh/App/Core/MeshIO.h | 8 +- src/Mod/Mesh/App/Core/Visitor.h | 9 +- src/Mod/Mesh/App/FeatureMeshCurvature.cpp | 6 +- src/Mod/Mesh/App/FeatureMeshCurvature.h | 4 +- src/Mod/Mesh/App/FeatureMeshDefects.cpp | 24 +- src/Mod/Mesh/App/FeatureMeshDefects.h | 44 +-- src/Mod/Mesh/App/FeatureMeshExport.cpp | 6 +- src/Mod/Mesh/App/FeatureMeshExport.h | 4 +- src/Mod/Mesh/App/FeatureMeshImport.cpp | 6 +- src/Mod/Mesh/App/FeatureMeshImport.h | 4 +- src/Mod/Mesh/App/FeatureMeshSetOperations.cpp | 10 +- src/Mod/Mesh/App/FeatureMeshSetOperations.h | 2 +- src/Mod/Mesh/App/FeatureMeshSolid.cpp | 24 +- src/Mod/Mesh/App/FeatureMeshSolid.h | 12 +- src/Mod/Mesh/App/FeatureMeshTransform.cpp | 6 +- src/Mod/Mesh/App/FeatureMeshTransform.h | 4 +- .../App/FeatureMeshTransformDemolding.cpp | 6 +- .../Mesh/App/FeatureMeshTransformDemolding.h | 4 +- src/Mod/Mesh/App/MeshFeature.cpp | 10 +- src/Mod/Mesh/App/MeshFeature.h | 8 +- src/Mod/Mesh/App/MeshFeaturePyImp.cpp | 32 +- src/Mod/Mesh/App/MeshPoint.h | 4 +- src/Mod/Mesh/App/MeshPointPyImp.cpp | 28 +- src/Mod/Mesh/App/MeshProperties.cpp | 26 +- src/Mod/Mesh/App/MeshProperties.h | 34 +- src/Mod/Mesh/App/MeshPy.xml | 2 +- src/Mod/Mesh/App/MeshPyImp.cpp | 292 +++++++++--------- .../Mesh/App/WildMagic4/Wm4BandedMatrix.inl | 14 +- src/Mod/Mesh/App/WildMagic4/Wm4ContBox2.cpp | 2 +- src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull.cpp | 4 +- .../Mesh/App/WildMagic4/Wm4ConvexHull1.cpp | 2 +- .../Mesh/App/WildMagic4/Wm4ConvexHull2.cpp | 22 +- .../Mesh/App/WildMagic4/Wm4ConvexHull3.cpp | 26 +- src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull3.h | 2 +- .../Mesh/App/WildMagic4/Wm4DelPolygonEdge.cpp | 2 +- .../App/WildMagic4/Wm4DelPolyhedronFace.cpp | 2 +- .../Mesh/App/WildMagic4/Wm4DelTetrahedron.cpp | 12 +- .../Mesh/App/WildMagic4/Wm4DelTriangle.cpp | 12 +- src/Mod/Mesh/App/WildMagic4/Wm4Delaunay.cpp | 8 +- src/Mod/Mesh/App/WildMagic4/Wm4Delaunay1.cpp | 2 +- src/Mod/Mesh/App/WildMagic4/Wm4Delaunay2.cpp | 28 +- src/Mod/Mesh/App/WildMagic4/Wm4Delaunay3.cpp | 30 +- .../Mesh/App/WildMagic4/Wm4ETManifoldMesh.cpp | 22 +- .../Mesh/App/WildMagic4/Wm4ETManifoldMesh.h | 2 +- src/Mod/Mesh/App/WildMagic4/Wm4GMatrix.inl | 24 +- src/Mod/Mesh/App/WildMagic4/Wm4GVector.inl | 4 +- .../Mesh/App/WildMagic4/Wm4MeshSmoother.cpp | 20 +- src/Mod/Mesh/App/WildMagic4/Wm4Platforms.h | 2 +- .../Mesh/App/WildMagic4/Wm4Polynomial1.inl | 4 +- src/Mod/Mesh/App/WildMagic4/Wm4System.cpp | 44 +-- src/Mod/Mesh/App/WildMagic4/Wm4System.inl | 2 +- .../Mesh/App/WildMagic4/Wm4TriangulateEC.cpp | 4 +- .../Mesh/App/WildMagic4/Wm4VEManifoldMesh.cpp | 20 +- .../Mesh/App/WildMagic4/Wm4VEManifoldMesh.h | 2 +- src/Mod/Mesh/Gui/AppMeshGui.cpp | 6 +- src/Mod/Mesh/Gui/Command.cpp | 72 ++--- src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp | 20 +- src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h | 4 +- src/Mod/Mesh/Gui/DlgEvaluateSettings.h | 2 +- src/Mod/Mesh/Gui/DlgRegularSolidImp.cpp | 2 +- src/Mod/Mesh/Gui/DlgRegularSolidImp.h | 2 +- src/Mod/Mesh/Gui/DlgSettingsImportExportImp.h | 2 +- src/Mod/Mesh/Gui/DlgSmoothing.cpp | 4 +- src/Mod/Mesh/Gui/DlgSmoothing.h | 6 +- src/Mod/Mesh/Gui/MeshSelection.cpp | 14 +- src/Mod/Mesh/Gui/PropertyEditorMesh.cpp | 2 +- src/Mod/Mesh/Gui/RemeshGmsh.cpp | 2 +- src/Mod/Mesh/Gui/RemeshGmsh.h | 6 +- src/Mod/Mesh/Gui/RemoveComponents.cpp | 2 +- src/Mod/Mesh/Gui/RemoveComponents.h | 8 +- src/Mod/Mesh/Gui/Segmentation.cpp | 2 +- src/Mod/Mesh/Gui/Segmentation.h | 2 +- src/Mod/Mesh/Gui/SegmentationBestFit.cpp | 10 +- src/Mod/Mesh/Gui/SegmentationBestFit.h | 6 +- src/Mod/Mesh/Gui/Selection.h | 2 +- src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp | 20 +- src/Mod/Mesh/Gui/SoFCMeshObject.cpp | 28 +- src/Mod/Mesh/Gui/SoFCMeshObject.h | 16 +- src/Mod/Mesh/Gui/SoPolygon.cpp | 4 +- src/Mod/Mesh/Gui/ViewProvider.cpp | 42 +-- src/Mod/Mesh/Gui/ViewProvider.h | 12 +- src/Mod/Mesh/Gui/ViewProviderCurvature.cpp | 16 +- src/Mod/Mesh/Gui/ViewProviderCurvature.h | 10 +- src/Mod/Mesh/Gui/ViewProviderMeshPyImp.cpp | 16 +- src/Mod/Mesh/Gui/ViewProviderTransform.cpp | 2 +- src/Mod/Mesh/Gui/ViewProviderTransform.h | 2 +- .../Gui/ViewProviderTransformDemolding.cpp | 13 +- .../Mesh/Gui/ViewProviderTransformDemolding.h | 8 +- 88 files changed, 651 insertions(+), 651 deletions(-) diff --git a/src/Mod/Mesh/App/Core/MeshIO.h b/src/Mod/Mesh/App/Core/MeshIO.h index 4e2fc61f0c..d7ff5c42e1 100644 --- a/src/Mod/Mesh/App/Core/MeshIO.h +++ b/src/Mod/Mesh/App/Core/MeshIO.h @@ -92,10 +92,10 @@ class MeshExport MeshInput { public: MeshInput (MeshKernel &rclM) - : _rclMesh(rclM), _material(0){} + : _rclMesh(rclM), _material(nullptr){} MeshInput (MeshKernel &rclM, Material* m) : _rclMesh(rclM), _material(m){} - virtual ~MeshInput (void) { } + virtual ~MeshInput () { } const std::vector& GetGroupNames() const { return _groupNames; } @@ -150,10 +150,10 @@ class MeshExport MeshOutput { public: MeshOutput (const MeshKernel &rclM) - : _rclMesh(rclM), _material(0), apply_transform(false){} + : _rclMesh(rclM), _material(nullptr), apply_transform(false){} MeshOutput (const MeshKernel &rclM, const Material* m) : _rclMesh(rclM), _material(m), apply_transform(false){} - virtual ~MeshOutput (void) { } + virtual ~MeshOutput () { } void SetObjectName(const std::string& n) { objectName = n; } void SetGroups(const std::vector& g) { diff --git a/src/Mod/Mesh/App/Core/Visitor.h b/src/Mod/Mesh/App/Core/Visitor.h index 6c31c298e5..f410d9a56f 100644 --- a/src/Mod/Mesh/App/Core/Visitor.h +++ b/src/Mod/Mesh/App/Core/Visitor.h @@ -25,6 +25,7 @@ #define VISITOR_H #include "Definitions.h" +#include namespace MeshCore { @@ -42,9 +43,9 @@ class MeshExport MeshFacetVisitor { public: /// Construction - MeshFacetVisitor(void) { } + MeshFacetVisitor() { } /// Denstruction - virtual ~MeshFacetVisitor(void) { } + virtual ~MeshFacetVisitor() { } /** Needs to be implemented in sub-classes. * \a rclFacet is the currently visited facet with the index \a ulFInd, \a rclFrom * is the last visited facet and \a ulLevel indicates the ring number around the start facet. @@ -173,9 +174,9 @@ class MeshExport MeshPointVisitor { public: /// Construction - MeshPointVisitor(void) { } + MeshPointVisitor() { } /// Denstruction - virtual ~MeshPointVisitor(void) { } + virtual ~MeshPointVisitor() { } /** Needs to be implemented in sub-classes. * \a rclPoint is the currently visited point with the index \a ulPInd, \a rclFrom * is the last visited point and \a ulLevel indicates the ring number around the start point. diff --git a/src/Mod/Mesh/App/FeatureMeshCurvature.cpp b/src/Mod/Mesh/App/FeatureMeshCurvature.cpp index f7bc012058..6cd65cc75b 100644 --- a/src/Mod/Mesh/App/FeatureMeshCurvature.cpp +++ b/src/Mod/Mesh/App/FeatureMeshCurvature.cpp @@ -43,9 +43,9 @@ using namespace Mesh; PROPERTY_SOURCE(Mesh::Curvature, App::DocumentObject) -Curvature::Curvature(void) +Curvature::Curvature() { - ADD_PROPERTY(Source,(0)); + ADD_PROPERTY(Source,(nullptr)); ADD_PROPERTY(CurvInfo, (CurvatureInfo())); } @@ -58,7 +58,7 @@ short Curvature::mustExecute() const return 0; } -App::DocumentObjectExecReturn *Curvature::execute(void) +App::DocumentObjectExecReturn *Curvature::execute() { Mesh::Feature *pcFeat = dynamic_cast(Source.getValue()); if(!pcFeat || pcFeat->isError()) { diff --git a/src/Mod/Mesh/App/FeatureMeshCurvature.h b/src/Mod/Mesh/App/FeatureMeshCurvature.h index b82e337e75..bef9907d63 100644 --- a/src/Mod/Mesh/App/FeatureMeshCurvature.h +++ b/src/Mod/Mesh/App/FeatureMeshCurvature.h @@ -51,10 +51,10 @@ public: /** @name methods override Feature */ //@{ /// recalculate the Feature - App::DocumentObjectExecReturn *execute(void); + App::DocumentObjectExecReturn *execute(); short mustExecute() const; /// returns the type name of the ViewProvider - const char* getViewProviderName(void) const { + const char* getViewProviderName() const { return "MeshGui::ViewProviderMeshCurvature"; } //@} diff --git a/src/Mod/Mesh/App/FeatureMeshDefects.cpp b/src/Mod/Mesh/App/FeatureMeshDefects.cpp index ddd53d44db..eddb2a2638 100644 --- a/src/Mod/Mesh/App/FeatureMeshDefects.cpp +++ b/src/Mod/Mesh/App/FeatureMeshDefects.cpp @@ -44,7 +44,7 @@ PROPERTY_SOURCE(Mesh::FixDefects, Mesh::Feature) FixDefects::FixDefects() { - ADD_PROPERTY(Source ,(0)); + ADD_PROPERTY(Source ,(nullptr)); ADD_PROPERTY(Epsilon ,(0)); } @@ -59,7 +59,7 @@ short FixDefects::mustExecute() const return 0; } -App::DocumentObjectExecReturn *FixDefects::execute(void) +App::DocumentObjectExecReturn *FixDefects::execute() { return App::DocumentObject::StdReturn; } @@ -76,7 +76,7 @@ HarmonizeNormals::~HarmonizeNormals() { } -App::DocumentObjectExecReturn *HarmonizeNormals::execute(void) +App::DocumentObjectExecReturn *HarmonizeNormals::execute() { App::DocumentObject* link = Source.getValue(); if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); @@ -104,7 +104,7 @@ FlipNormals::~FlipNormals() { } -App::DocumentObjectExecReturn *FlipNormals::execute(void) +App::DocumentObjectExecReturn *FlipNormals::execute() { App::DocumentObject* link = Source.getValue(); if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); @@ -132,7 +132,7 @@ FixNonManifolds::~FixNonManifolds() { } -App::DocumentObjectExecReturn *FixNonManifolds::execute(void) +App::DocumentObjectExecReturn *FixNonManifolds::execute() { App::DocumentObject* link = Source.getValue(); if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); @@ -160,7 +160,7 @@ FixDuplicatedFaces::~FixDuplicatedFaces() { } -App::DocumentObjectExecReturn *FixDuplicatedFaces::execute(void) +App::DocumentObjectExecReturn *FixDuplicatedFaces::execute() { App::DocumentObject* link = Source.getValue(); if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); @@ -188,7 +188,7 @@ FixDuplicatedPoints::~FixDuplicatedPoints() { } -App::DocumentObjectExecReturn *FixDuplicatedPoints::execute(void) +App::DocumentObjectExecReturn *FixDuplicatedPoints::execute() { App::DocumentObject* link = Source.getValue(); if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); @@ -216,7 +216,7 @@ FixDegenerations::~FixDegenerations() { } -App::DocumentObjectExecReturn *FixDegenerations::execute(void) +App::DocumentObjectExecReturn *FixDegenerations::execute() { App::DocumentObject* link = Source.getValue(); if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); @@ -245,7 +245,7 @@ FixDeformations::~FixDeformations() { } -App::DocumentObjectExecReturn *FixDeformations::execute(void) +App::DocumentObjectExecReturn *FixDeformations::execute() { App::DocumentObject* link = Source.getValue(); if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); @@ -275,7 +275,7 @@ FixIndices::~FixIndices() { } -App::DocumentObjectExecReturn *FixIndices::execute(void) +App::DocumentObjectExecReturn *FixIndices::execute() { App::DocumentObject* link = Source.getValue(); if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); @@ -305,7 +305,7 @@ FillHoles::~FillHoles() { } -App::DocumentObjectExecReturn *FillHoles::execute(void) +App::DocumentObjectExecReturn *FillHoles::execute() { App::DocumentObject* link = Source.getValue(); if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); @@ -336,7 +336,7 @@ RemoveComponents::~RemoveComponents() { } -App::DocumentObjectExecReturn *RemoveComponents::execute(void) +App::DocumentObjectExecReturn *RemoveComponents::execute() { App::DocumentObject* link = Source.getValue(); if (!link) return new App::DocumentObjectExecReturn("No mesh linked"); diff --git a/src/Mod/Mesh/App/FeatureMeshDefects.h b/src/Mod/Mesh/App/FeatureMeshDefects.h index fa60550a9b..0c336127c9 100644 --- a/src/Mod/Mesh/App/FeatureMeshDefects.h +++ b/src/Mod/Mesh/App/FeatureMeshDefects.h @@ -41,7 +41,7 @@ class MeshExport FixDefects : public Mesh::Feature public: /// Constructor - FixDefects(void); + FixDefects(); virtual ~FixDefects(); /** @name Properties */ @@ -53,7 +53,7 @@ public: /** @name methods override Feature */ //@{ /// recalculate the Feature - virtual App::DocumentObjectExecReturn *execute(void); + virtual App::DocumentObjectExecReturn *execute(); short mustExecute() const; //@} @@ -71,13 +71,13 @@ class MeshExport HarmonizeNormals : public Mesh::FixDefects public: /// Constructor - HarmonizeNormals(void); + HarmonizeNormals(); virtual ~HarmonizeNormals(); /** @name methods override Feature */ //@{ /// recalculate the Feature - virtual App::DocumentObjectExecReturn *execute(void); + virtual App::DocumentObjectExecReturn *execute(); //@} }; @@ -91,13 +91,13 @@ class MeshExport FlipNormals : public Mesh::FixDefects public: /// Constructor - FlipNormals(void); + FlipNormals(); virtual ~FlipNormals(); /** @name methods override Feature */ //@{ /// recalculate the Feature - virtual App::DocumentObjectExecReturn *execute(void); + virtual App::DocumentObjectExecReturn *execute(); //@} }; @@ -111,13 +111,13 @@ class MeshExport FixNonManifolds : public Mesh::FixDefects public: /// Constructor - FixNonManifolds(void); + FixNonManifolds(); virtual ~FixNonManifolds(); /** @name methods override Feature */ //@{ /// recalculate the Feature - virtual App::DocumentObjectExecReturn *execute(void); + virtual App::DocumentObjectExecReturn *execute(); //@} }; @@ -131,13 +131,13 @@ class MeshExport FixDuplicatedFaces : public Mesh::FixDefects public: /// Constructor - FixDuplicatedFaces(void); + FixDuplicatedFaces(); virtual ~FixDuplicatedFaces(); /** @name methods override Feature */ //@{ /// recalculate the Feature - virtual App::DocumentObjectExecReturn *execute(void); + virtual App::DocumentObjectExecReturn *execute(); //@} }; @@ -151,13 +151,13 @@ class MeshExport FixDuplicatedPoints : public Mesh::FixDefects public: /// Constructor - FixDuplicatedPoints(void); + FixDuplicatedPoints(); virtual ~FixDuplicatedPoints(); /** @name methods override Feature */ //@{ /// recalculate the Feature - virtual App::DocumentObjectExecReturn *execute(void); + virtual App::DocumentObjectExecReturn *execute(); //@} }; @@ -171,13 +171,13 @@ class MeshExport FixDegenerations : public Mesh::FixDefects public: /// Constructor - FixDegenerations(void); + FixDegenerations(); virtual ~FixDegenerations(); /** @name methods override Feature */ //@{ /// recalculate the Feature - virtual App::DocumentObjectExecReturn *execute(void); + virtual App::DocumentObjectExecReturn *execute(); //@} }; @@ -191,7 +191,7 @@ class MeshExport FixDeformations : public Mesh::FixDefects public: /// Constructor - FixDeformations(void); + FixDeformations(); virtual ~FixDeformations(); /** @name Properties */ @@ -201,7 +201,7 @@ public: /** @name methods override Feature */ //@{ /// recalculate the Feature - virtual App::DocumentObjectExecReturn *execute(void); + virtual App::DocumentObjectExecReturn *execute(); //@} }; @@ -215,13 +215,13 @@ class MeshExport FixIndices : public Mesh::FixDefects public: /// Constructor - FixIndices(void); + FixIndices(); virtual ~FixIndices(); /** @name methods override Feature */ //@{ /// recalculate the Feature - virtual App::DocumentObjectExecReturn *execute(void); + virtual App::DocumentObjectExecReturn *execute(); //@} }; @@ -235,7 +235,7 @@ class MeshExport FillHoles : public Mesh::FixDefects public: /// Constructor - FillHoles(void); + FillHoles(); virtual ~FillHoles(); App::PropertyInteger FillupHolesOfLength; App::PropertyFloat MaxArea; @@ -243,7 +243,7 @@ public: /** @name methods override Feature */ //@{ /// recalculate the Feature - virtual App::DocumentObjectExecReturn *execute(void); + virtual App::DocumentObjectExecReturn *execute(); //@} }; @@ -257,14 +257,14 @@ class MeshExport RemoveComponents : public Mesh::FixDefects public: /// Constructor - RemoveComponents(void); + RemoveComponents(); virtual ~RemoveComponents(); App::PropertyInteger RemoveCompOfSize; /** @name methods override Feature */ //@{ /// recalculate the Feature - virtual App::DocumentObjectExecReturn *execute(void); + virtual App::DocumentObjectExecReturn *execute(); //@} }; diff --git a/src/Mod/Mesh/App/FeatureMeshExport.cpp b/src/Mod/Mesh/App/FeatureMeshExport.cpp index 548fcb63c1..512a13b13e 100644 --- a/src/Mod/Mesh/App/FeatureMeshExport.cpp +++ b/src/Mod/Mesh/App/FeatureMeshExport.cpp @@ -39,9 +39,9 @@ using namespace MeshCore; PROPERTY_SOURCE(Mesh::Export, App::DocumentObject) -Export::Export(void) +Export::Export() { - ADD_PROPERTY(Source ,(0)); + ADD_PROPERTY(Source ,(nullptr)); ADD_PROPERTY(FileName,("")); ADD_PROPERTY(Format ,("")); } @@ -59,7 +59,7 @@ short Export::mustExecute() const return 0; } -App::DocumentObjectExecReturn *Export::execute(void) +App::DocumentObjectExecReturn *Export::execute() { Mesh::Feature *pcFeat = dynamic_cast(Source.getValue()); if(!pcFeat || pcFeat->isError()) { diff --git a/src/Mod/Mesh/App/FeatureMeshExport.h b/src/Mod/Mesh/App/FeatureMeshExport.h index 0c5bf479c3..d18211d38b 100644 --- a/src/Mod/Mesh/App/FeatureMeshExport.h +++ b/src/Mod/Mesh/App/FeatureMeshExport.h @@ -48,14 +48,14 @@ public: App::PropertyLink Source; App::PropertyString FileName; App::PropertyString Format; - const char* getViewProviderName(void) const { + const char* getViewProviderName() const { return "MeshGui::ViewProviderExport"; } /** @name methods override feature */ //@{ /// recalculate the Feature - App::DocumentObjectExecReturn *execute(void); + App::DocumentObjectExecReturn *execute(); short mustExecute() const; //@} }; diff --git a/src/Mod/Mesh/App/FeatureMeshImport.cpp b/src/Mod/Mesh/App/FeatureMeshImport.cpp index a2c0b8e20e..8d50eaaa19 100644 --- a/src/Mod/Mesh/App/FeatureMeshImport.cpp +++ b/src/Mod/Mesh/App/FeatureMeshImport.cpp @@ -39,19 +39,19 @@ using namespace MeshCore; PROPERTY_SOURCE(Mesh::Import, Mesh::Feature) -Mesh::Import::Import(void) +Mesh::Import::Import() { ADD_PROPERTY(FileName,("")); } -short Mesh::Import::mustExecute(void) const +short Mesh::Import::mustExecute() const { if (FileName.isTouched()) return 1; return 0; } -App::DocumentObjectExecReturn *Mesh::Import::execute(void) +App::DocumentObjectExecReturn *Mesh::Import::execute() { std::unique_ptr apcKernel(new MeshObject()); apcKernel->load(FileName.getValue()); diff --git a/src/Mod/Mesh/App/FeatureMeshImport.h b/src/Mod/Mesh/App/FeatureMeshImport.h index 9ed4561e3d..4632ac4167 100644 --- a/src/Mod/Mesh/App/FeatureMeshImport.h +++ b/src/Mod/Mesh/App/FeatureMeshImport.h @@ -49,8 +49,8 @@ public: /** @name methods override Feature */ //@{ /// recalculate the Feature - App::DocumentObjectExecReturn *execute(void); - short mustExecute(void) const; + App::DocumentObjectExecReturn *execute(); + short mustExecute() const; //@} }; diff --git a/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp b/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp index 16ed3460b9..b1879beaa9 100644 --- a/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp +++ b/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp @@ -46,10 +46,10 @@ using namespace std; PROPERTY_SOURCE(Mesh::SetOperations, Mesh::Feature) -SetOperations::SetOperations(void) +SetOperations::SetOperations() { - ADD_PROPERTY(Source1 ,(0)); - ADD_PROPERTY(Source2 ,(0)); + ADD_PROPERTY(Source1 ,(nullptr)); + ADD_PROPERTY(Source2 ,(nullptr)); ADD_PROPERTY(OperationType, ("union")); } @@ -67,12 +67,12 @@ short SetOperations::mustExecute() const return 0; } -App::DocumentObjectExecReturn *SetOperations::execute(void) +App::DocumentObjectExecReturn *SetOperations::execute() { Mesh::Feature *mesh1 = dynamic_cast(Source1.getValue()); Mesh::Feature *mesh2 = dynamic_cast(Source2.getValue()); - if ((mesh1 != NULL) && (mesh2 != NULL)) { + if ((mesh1 != nullptr) && (mesh2 != nullptr)) { const MeshObject& meshKernel1 = mesh1->Mesh.getValue(); const MeshObject& meshKernel2 = mesh2->Mesh.getValue(); diff --git a/src/Mod/Mesh/App/FeatureMeshSetOperations.h b/src/Mod/Mesh/App/FeatureMeshSetOperations.h index 58aabe3fc3..2e0baa8042 100644 --- a/src/Mod/Mesh/App/FeatureMeshSetOperations.h +++ b/src/Mod/Mesh/App/FeatureMeshSetOperations.h @@ -54,7 +54,7 @@ public: /** @name methods override Feature */ //@{ /// recalculate the Feature - App::DocumentObjectExecReturn *execute(void); + App::DocumentObjectExecReturn *execute(); short mustExecute() const; //@} }; diff --git a/src/Mod/Mesh/App/FeatureMeshSolid.cpp b/src/Mod/Mesh/App/FeatureMeshSolid.cpp index d44549f127..0af36b856c 100644 --- a/src/Mod/Mesh/App/FeatureMeshSolid.cpp +++ b/src/Mod/Mesh/App/FeatureMeshSolid.cpp @@ -44,7 +44,7 @@ using namespace MeshCore; PROPERTY_SOURCE(Mesh::Sphere, Mesh::Feature) -Sphere::Sphere(void) +Sphere::Sphere() { ADD_PROPERTY(Radius ,(5.0)); ADD_PROPERTY(Sampling ,(50)); @@ -59,7 +59,7 @@ short Sphere::mustExecute() const return Feature::mustExecute(); } -App::DocumentObjectExecReturn *Sphere::execute(void) +App::DocumentObjectExecReturn *Sphere::execute() { std::unique_ptr mesh(MeshObject::createSphere((float)Radius.getValue(),Sampling.getValue())); if (mesh.get()) { @@ -88,7 +88,7 @@ void Sphere::handleChangedPropertyType(Base::XMLReader &reader, const char *Type PROPERTY_SOURCE(Mesh::Ellipsoid, Mesh::Feature) -Ellipsoid::Ellipsoid(void) +Ellipsoid::Ellipsoid() { ADD_PROPERTY(Radius1 ,(2.0)); ADD_PROPERTY(Radius2 ,(4.0)); @@ -107,7 +107,7 @@ short Ellipsoid::mustExecute() const return Feature::mustExecute(); } -App::DocumentObjectExecReturn *Ellipsoid::execute(void) +App::DocumentObjectExecReturn *Ellipsoid::execute() { std::unique_ptr mesh(MeshObject::createEllipsoid((float)Radius1.getValue(),(float)Radius2.getValue(),Sampling.getValue())); if (mesh.get()) { @@ -137,7 +137,7 @@ void Ellipsoid::handleChangedPropertyType(Base::XMLReader &reader, const char *T PROPERTY_SOURCE(Mesh::Cylinder, Mesh::Feature) -Cylinder::Cylinder(void) +Cylinder::Cylinder() { ADD_PROPERTY(Radius ,(2.0)); ADD_PROPERTY(Length ,(10.0)); @@ -161,7 +161,7 @@ short Cylinder::mustExecute() const return Feature::mustExecute(); } -App::DocumentObjectExecReturn *Cylinder::execute(void) +App::DocumentObjectExecReturn *Cylinder::execute() { std::unique_ptr mesh(MeshObject::createCylinder((float)Radius.getValue(),(float)Length.getValue(), Closed.getValue(),(float)EdgeLength.getValue(),Sampling.getValue())); @@ -192,7 +192,7 @@ void Cylinder::handleChangedPropertyType(Base::XMLReader &reader, const char *Ty PROPERTY_SOURCE(Mesh::Cone, Mesh::Feature) -Cone::Cone(void) +Cone::Cone() { ADD_PROPERTY(Radius1 ,(2.0)); ADD_PROPERTY(Radius2 ,(4.0)); @@ -219,7 +219,7 @@ short Cone::mustExecute() const return Feature::mustExecute(); } -App::DocumentObjectExecReturn *Cone::execute(void) +App::DocumentObjectExecReturn *Cone::execute() { std::unique_ptr mesh(MeshObject::createCone((float)Radius1.getValue(),(float)Radius2.getValue(),(float)Length.getValue(), Closed.getValue(),(float)EdgeLength.getValue(),Sampling.getValue())); @@ -250,7 +250,7 @@ void Cone::handleChangedPropertyType(Base::XMLReader &reader, const char *TypeNa PROPERTY_SOURCE(Mesh::Torus, Mesh::Feature) -Torus::Torus(void) +Torus::Torus() { ADD_PROPERTY(Radius1 ,(10.0)); ADD_PROPERTY(Radius2 ,(2.0)); @@ -269,7 +269,7 @@ short Torus::mustExecute() const return Feature::mustExecute(); } -App::DocumentObjectExecReturn *Torus::execute(void) +App::DocumentObjectExecReturn *Torus::execute() { std::unique_ptr mesh(MeshObject::createTorus((float)Radius1.getValue(),(float)Radius2.getValue(),Sampling.getValue())); if (mesh.get()) { @@ -299,7 +299,7 @@ void Torus::handleChangedPropertyType(Base::XMLReader &reader, const char *TypeN PROPERTY_SOURCE(Mesh::Cube, Mesh::Feature) -Cube::Cube(void) +Cube::Cube() { ADD_PROPERTY_TYPE(Length,(10.0f),"Cube",App::Prop_None,"The length of the cube"); ADD_PROPERTY_TYPE(Width ,(10.0f),"Cube",App::Prop_None,"The width of the cube"); @@ -318,7 +318,7 @@ short Cube::mustExecute() const return Feature::mustExecute(); } -App::DocumentObjectExecReturn *Cube::execute(void) +App::DocumentObjectExecReturn *Cube::execute() { std::unique_ptr mesh(MeshObject::createCube((float)Length.getValue(),(float)Width.getValue(),(float)Height.getValue())); if (mesh.get()) { diff --git a/src/Mod/Mesh/App/FeatureMeshSolid.h b/src/Mod/Mesh/App/FeatureMeshSolid.h index 60bea888c9..d1ed0b3847 100644 --- a/src/Mod/Mesh/App/FeatureMeshSolid.h +++ b/src/Mod/Mesh/App/FeatureMeshSolid.h @@ -48,7 +48,7 @@ public: /** @name methods override Feature */ //@{ /// recalculate the Feature - App::DocumentObjectExecReturn *execute(void); + App::DocumentObjectExecReturn *execute(); short mustExecute() const; void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop); //@} @@ -70,7 +70,7 @@ public: /** @name methods override Feature */ //@{ /// recalculate the Feature - App::DocumentObjectExecReturn *execute(void); + App::DocumentObjectExecReturn *execute(); short mustExecute() const; void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop); //@} @@ -94,7 +94,7 @@ public: /** @name methods override Feature */ //@{ /// recalculate the Feature - App::DocumentObjectExecReturn *execute(void); + App::DocumentObjectExecReturn *execute(); short mustExecute() const; void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop); //@} @@ -119,7 +119,7 @@ public: /** @name methods override Feature */ //@{ /// recalculate the Feature - App::DocumentObjectExecReturn *execute(void); + App::DocumentObjectExecReturn *execute(); short mustExecute() const; void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop); //@} @@ -141,7 +141,7 @@ public: /** @name methods override Feature */ //@{ /// recalculate the Feature - App::DocumentObjectExecReturn *execute(void); + App::DocumentObjectExecReturn *execute(); short mustExecute() const; void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop); //@} @@ -163,7 +163,7 @@ public: /** @name methods override Feature */ //@{ /// recalculate the Feature - App::DocumentObjectExecReturn *execute(void); + App::DocumentObjectExecReturn *execute(); short mustExecute() const; void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop); //@} diff --git a/src/Mod/Mesh/App/FeatureMeshTransform.cpp b/src/Mod/Mesh/App/FeatureMeshTransform.cpp index b956888c54..7c8debd743 100644 --- a/src/Mod/Mesh/App/FeatureMeshTransform.cpp +++ b/src/Mod/Mesh/App/FeatureMeshTransform.cpp @@ -41,13 +41,13 @@ using namespace MeshCore; PROPERTY_SOURCE(Mesh::Transform, Mesh::Feature) -Transform::Transform(void) +Transform::Transform() { - ADD_PROPERTY(Source ,(0)); + ADD_PROPERTY(Source ,(nullptr)); ADD_PROPERTY(Position,(Matrix4D())); } -App::DocumentObjectExecReturn *Transform::execute(void) +App::DocumentObjectExecReturn *Transform::execute() { /* Feature *pcFirst = dynamic_cast(Source.getValue()); diff --git a/src/Mod/Mesh/App/FeatureMeshTransform.h b/src/Mod/Mesh/App/FeatureMeshTransform.h index 92598dded3..b619244f24 100644 --- a/src/Mod/Mesh/App/FeatureMeshTransform.h +++ b/src/Mod/Mesh/App/FeatureMeshTransform.h @@ -52,9 +52,9 @@ public: /** @name methods override Feature */ //@{ /// recalculate the Feature - virtual App::DocumentObjectExecReturn *execute(void); + virtual App::DocumentObjectExecReturn *execute(); /// returns the type name of the ViewProvider - virtual const char* getViewProviderName(void) const { + virtual const char* getViewProviderName() const { return "MeshGui::ViewProviderMeshTransform"; } //@} diff --git a/src/Mod/Mesh/App/FeatureMeshTransformDemolding.cpp b/src/Mod/Mesh/App/FeatureMeshTransformDemolding.cpp index 0fa5798405..8f9ae08245 100644 --- a/src/Mod/Mesh/App/FeatureMeshTransformDemolding.cpp +++ b/src/Mod/Mesh/App/FeatureMeshTransformDemolding.cpp @@ -42,14 +42,14 @@ using namespace MeshCore; PROPERTY_SOURCE(Mesh::TransformDemolding, Mesh::Transform) -TransformDemolding::TransformDemolding(void) +TransformDemolding::TransformDemolding() { - ADD_PROPERTY(Source,(0)); + ADD_PROPERTY(Source,(nullptr)); ADD_PROPERTY(Rotation,(0.0)); ADD_PROPERTY(Axis,(0.0,0.0,1.0)); } -App::DocumentObjectExecReturn *TransformDemolding::execute(void) +App::DocumentObjectExecReturn *TransformDemolding::execute() {/* Feature *pcFirst = dynamic_cast(Source.getValue()); if(!pcFirst || pcFirst->isError()) diff --git a/src/Mod/Mesh/App/FeatureMeshTransformDemolding.h b/src/Mod/Mesh/App/FeatureMeshTransformDemolding.h index 02c4a8e38d..c56f83e1ef 100644 --- a/src/Mod/Mesh/App/FeatureMeshTransformDemolding.h +++ b/src/Mod/Mesh/App/FeatureMeshTransformDemolding.h @@ -51,9 +51,9 @@ public: /** @name methods override Feature */ //@{ /// recalculate the Feature - virtual App::DocumentObjectExecReturn *execute(void); + virtual App::DocumentObjectExecReturn *execute(); /// returns the type name of the ViewProvider - virtual const char* getViewProviderName(void) const { + virtual const char* getViewProviderName() const { return "MeshGui::ViewProviderMeshTransformDemolding"; } //@} diff --git a/src/Mod/Mesh/App/MeshFeature.cpp b/src/Mod/Mesh/App/MeshFeature.cpp index 8ef2dbacc5..2e9ded7909 100644 --- a/src/Mod/Mesh/App/MeshFeature.cpp +++ b/src/Mod/Mesh/App/MeshFeature.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include "Core/MeshIO.h" @@ -56,13 +56,13 @@ Feature::~Feature() { } -App::DocumentObjectExecReturn *Feature::execute(void) +App::DocumentObjectExecReturn *Feature::execute() { this->Mesh.touch(); return App::DocumentObject::StdReturn; } -PyObject *Feature::getPyObject(void) +PyObject *Feature::getPyObject() { if(PythonObject.is(Py::_None())){ // ref counter is set to 1 @@ -111,10 +111,10 @@ template class MeshExport FeatureCustomT; namespace App { /// @cond DOXERR PROPERTY_SOURCE_TEMPLATE(Mesh::FeaturePython, Mesh::Feature) -template<> const char* Mesh::FeaturePython::getViewProviderName(void) const { +template<> const char* Mesh::FeaturePython::getViewProviderName() const { return "MeshGui::ViewProviderPython"; } -template<> PyObject* Mesh::FeaturePython::getPyObject(void) { +template<> PyObject* Mesh::FeaturePython::getPyObject() { if (PythonObject.is(Py::_None())) { // ref counter is set to 1 PythonObject = Py::Object(new FeaturePythonPyT(this),true); diff --git a/src/Mod/Mesh/App/MeshFeature.h b/src/Mod/Mesh/App/MeshFeature.h index ca9d8c0abc..d9b2438dcd 100644 --- a/src/Mod/Mesh/App/MeshFeature.h +++ b/src/Mod/Mesh/App/MeshFeature.h @@ -57,7 +57,7 @@ class MeshExport Feature : public App::GeoFeature public: /// Constructor - Feature(void); + Feature(); virtual ~Feature(); /** @name Properties */ @@ -69,12 +69,12 @@ public: /** @name methods override Feature */ //@{ /// recalculate the Feature - virtual App::DocumentObjectExecReturn *execute(void); + virtual App::DocumentObjectExecReturn *execute(); virtual void onChanged(const App::Property* prop); //@} /// returns the type name of the ViewProvider - virtual const char* getViewProviderName(void) const { + virtual const char* getViewProviderName() const { return "MeshGui::ViewProviderMeshFaceSet"; } virtual const App::PropertyComplexGeoData* getPropertyOfGeometry() const { @@ -82,7 +82,7 @@ public: } /// handles the MeshPy object - virtual PyObject* getPyObject(void); + virtual PyObject* getPyObject(); }; typedef App::FeatureCustomT FeatureCustom; diff --git a/src/Mod/Mesh/App/MeshFeaturePyImp.cpp b/src/Mod/Mesh/App/MeshFeaturePyImp.cpp index cdb6f2c7eb..1035beeda1 100644 --- a/src/Mod/Mesh/App/MeshFeaturePyImp.cpp +++ b/src/Mod/Mesh/App/MeshFeaturePyImp.cpp @@ -37,7 +37,7 @@ using namespace Mesh; // returns a string which represent the object e.g. when printed in python -std::string MeshFeaturePy::representation(void) const +std::string MeshFeaturePy::representation() const { std::stringstream str; str << getFeaturePtr()->getTypeId().getName() << " object at " << getFeaturePtr(); @@ -58,7 +58,7 @@ PyObject* MeshFeaturePy::countFacets(PyObject * /*args*/) PyObject* MeshFeaturePy::harmonizeNormals(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PY_TRY { Mesh::MeshObject *mesh = getFeaturePtr()->Mesh.startEditing(); @@ -74,7 +74,7 @@ PyObject* MeshFeaturePy::smooth(PyObject *args) int iter=1; float d_max=FLOAT_MAX; if (!PyArg_ParseTuple(args, "|if", &iter,&d_max)) - return NULL; + return nullptr; PY_TRY { Mesh::Feature* obj = getFeaturePtr(); @@ -89,7 +89,7 @@ PyObject* MeshFeaturePy::smooth(PyObject *args) PyObject* MeshFeaturePy::removeNonManifolds(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; Mesh::Feature* obj = getFeaturePtr(); MeshObject* kernel = obj->Mesh.startEditing(); kernel->removeNonManifolds(); @@ -100,7 +100,7 @@ PyObject* MeshFeaturePy::removeNonManifolds(PyObject *args) PyObject* MeshFeaturePy::removeNonManifoldPoints(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; Mesh::Feature* obj = getFeaturePtr(); MeshObject* kernel = obj->Mesh.startEditing(); kernel->removeNonManifoldPoints(); @@ -111,7 +111,7 @@ PyObject* MeshFeaturePy::removeNonManifoldPoints(PyObject *args) PyObject* MeshFeaturePy::fixIndices(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PY_TRY { Mesh::Feature* obj = getFeaturePtr(); @@ -127,7 +127,7 @@ PyObject* MeshFeaturePy::fixDegenerations(PyObject *args) { float fEpsilon = MeshCore::MeshDefinitions::_fMinPointDistanceP2; if (!PyArg_ParseTuple(args, "|f", &fEpsilon)) - return NULL; + return nullptr; PY_TRY { Mesh::Feature* obj = getFeaturePtr(); @@ -142,7 +142,7 @@ PyObject* MeshFeaturePy::fixDegenerations(PyObject *args) PyObject* MeshFeaturePy::removeDuplicatedFacets(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PY_TRY { Mesh::Feature* obj = getFeaturePtr(); @@ -157,7 +157,7 @@ PyObject* MeshFeaturePy::removeDuplicatedFacets(PyObject *args) PyObject* MeshFeaturePy::removeDuplicatedPoints(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PY_TRY { Mesh::Feature* obj = getFeaturePtr(); @@ -172,7 +172,7 @@ PyObject* MeshFeaturePy::removeDuplicatedPoints(PyObject *args) PyObject* MeshFeaturePy::fixSelfIntersections(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; try { Mesh::Feature* obj = getFeaturePtr(); MeshObject* kernel = obj->Mesh.startEditing(); @@ -181,7 +181,7 @@ PyObject* MeshFeaturePy::fixSelfIntersections(PyObject *args) } catch (const Base::Exception& e) { PyErr_SetString(Base::BaseExceptionFreeCADError, e.what()); - return NULL; + return nullptr; } Py_Return; } @@ -189,7 +189,7 @@ PyObject* MeshFeaturePy::fixSelfIntersections(PyObject *args) PyObject* MeshFeaturePy::removeFoldsOnSurface(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; try { Mesh::Feature* obj = getFeaturePtr(); MeshObject* kernel = obj->Mesh.startEditing(); @@ -198,7 +198,7 @@ PyObject* MeshFeaturePy::removeFoldsOnSurface(PyObject *args) } catch (const Base::Exception& e) { PyErr_SetString(Base::BaseExceptionFreeCADError, e.what()); - return NULL; + return nullptr; } Py_Return; } @@ -206,7 +206,7 @@ PyObject* MeshFeaturePy::removeFoldsOnSurface(PyObject *args) PyObject* MeshFeaturePy::removeInvalidPoints(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; try { Mesh::Feature* obj = getFeaturePtr(); MeshObject* kernel = obj->Mesh.startEditing(); @@ -215,14 +215,14 @@ PyObject* MeshFeaturePy::removeInvalidPoints(PyObject *args) } catch (const Base::Exception& e) { PyErr_SetString(Base::BaseExceptionFreeCADError, e.what()); - return NULL; + return nullptr; } Py_Return; } PyObject *MeshFeaturePy::getCustomAttributes(const char* /*attr*/) const { - return 0; + return nullptr; } int MeshFeaturePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) diff --git a/src/Mod/Mesh/App/MeshPoint.h b/src/Mod/Mesh/App/MeshPoint.h index beaf2f6017..f45cb3a017 100644 --- a/src/Mod/Mesh/App/MeshPoint.h +++ b/src/Mod/Mesh/App/MeshPoint.h @@ -49,11 +49,11 @@ class MeshExport MeshPoint : public Vector3d public: /// simple constructor - MeshPoint(const Vector3d& vec = Vector3d(),MeshObject* obj = 0, unsigned int index = UINT_MAX) + MeshPoint(const Vector3d& vec = Vector3d(),MeshObject* obj = nullptr, unsigned int index = UINT_MAX) :Vector3d(vec),Index(index),Mesh(obj) {} - bool isBound(void) const {return Index != UINT_MAX;} + bool isBound() const {return Index != UINT_MAX;} unsigned int Index; Base::Reference Mesh; diff --git a/src/Mod/Mesh/App/MeshPointPyImp.cpp b/src/Mod/Mesh/App/MeshPointPyImp.cpp index 389e7b3821..4fad3ce1cc 100644 --- a/src/Mod/Mesh/App/MeshPointPyImp.cpp +++ b/src/Mod/Mesh/App/MeshPointPyImp.cpp @@ -36,7 +36,7 @@ using namespace Mesh; // returns a string which represents the object e.g. when printed in python -std::string MeshPointPy::representation(void) const +std::string MeshPointPy::representation() const { MeshPointPy::PointerType ptr = getMeshPointPtr(); Base::Vector3d vec = *ptr; @@ -80,9 +80,9 @@ int MeshPointPy::PyInit(PyObject* args, PyObject* /*kwds*/) PyObject* MeshPointPy::unbound(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; getMeshPointPtr()->Index = UINT_MAX; - getMeshPointPtr()->Mesh = 0; + getMeshPointPtr()->Mesh = nullptr; Py_Return; } @@ -90,11 +90,11 @@ PyObject* MeshPointPy::move(PyObject *args) { if (!getMeshPointPtr()->isBound()) { PyErr_SetString(PyExc_RuntimeError, "This object is not bounded to a mesh, so no topological operation is possible!"); - return 0; + return nullptr; } if (getMeshPointPtr()->Mesh->countPoints() <= getMeshPointPtr()->Index) { PyErr_SetString(PyExc_IndexError, "Index out of range"); - return 0; + return nullptr; } double x=0.0,y=0.0,z=0.0; @@ -114,7 +114,7 @@ PyObject* MeshPointPy::move(PyObject *args) } PyErr_SetString(PyExc_TypeError, "Tuple of three floats or Vector expected"); - return 0; + return nullptr; } while (false); @@ -122,17 +122,17 @@ PyObject* MeshPointPy::move(PyObject *args) Py_Return; } -Py::Long MeshPointPy::getIndex(void) const +Py::Long MeshPointPy::getIndex() const { return Py::Long((long) getMeshPointPtr()->Index); } -Py::Boolean MeshPointPy::getBound(void) const +Py::Boolean MeshPointPy::getBound() const { return Py::Boolean(getMeshPointPtr()->Index != UINT_MAX); } -Py::Object MeshPointPy::getNormal(void) const +Py::Object MeshPointPy::getNormal() const { if (!getMeshPointPtr()->isBound()) throw Py::RuntimeError("This object is not bound to a mesh, so no topological operation is possible!"); @@ -145,7 +145,7 @@ Py::Object MeshPointPy::getNormal(void) const return Py::Object(normal,true); } -Py::Object MeshPointPy::getVector(void) const +Py::Object MeshPointPy::getVector() const { MeshPointPy::PointerType ptr = static_cast(_pcTwinPointer); @@ -154,7 +154,7 @@ Py::Object MeshPointPy::getVector(void) const return Py::Object(vec,true); } -Py::Float MeshPointPy::getx(void) const +Py::Float MeshPointPy::getx() const { MeshPointPy::PointerType ptr = static_cast(_pcTwinPointer); double x = ptr->x; @@ -178,7 +178,7 @@ void MeshPointPy::setx(Py::Float arg) } } -Py::Float MeshPointPy::gety(void) const +Py::Float MeshPointPy::gety() const { MeshPointPy::PointerType ptr = static_cast(_pcTwinPointer); double y = ptr->y; @@ -202,7 +202,7 @@ void MeshPointPy::sety(Py::Float arg) } } -Py::Float MeshPointPy::getz(void) const +Py::Float MeshPointPy::getz() const { MeshPointPy::PointerType ptr = static_cast(_pcTwinPointer); double z = ptr->z; @@ -228,7 +228,7 @@ void MeshPointPy::setz(Py::Float arg) PyObject *MeshPointPy::getCustomAttributes(const char* /*attr*/) const { - return 0; + return nullptr; } int MeshPointPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) diff --git a/src/Mod/Mesh/App/MeshProperties.cpp b/src/Mod/Mesh/App/MeshProperties.cpp index 224a37a1f9..13dbb94511 100644 --- a/src/Mod/Mesh/App/MeshProperties.cpp +++ b/src/Mod/Mesh/App/MeshProperties.cpp @@ -63,7 +63,7 @@ void PropertyNormalList::setSize(int newSize) _lValueList.resize(newSize); } -int PropertyNormalList::getSize(void) const +int PropertyNormalList::getSize() const { return static_cast(_lValueList.size()); } @@ -91,7 +91,7 @@ void PropertyNormalList::setValues(const std::vector& values) hasSetValue(); } -PyObject *PropertyNormalList::getPyObject(void) +PyObject *PropertyNormalList::getPyObject() { PyObject* list = PyList_New(getSize()); @@ -174,7 +174,7 @@ void PropertyNormalList::RestoreDocFile(Base::Reader &reader) setValues(values); } -App::Property *PropertyNormalList::Copy(void) const +App::Property *PropertyNormalList::Copy() const { PropertyNormalList *p= new PropertyNormalList(); p->_lValueList = _lValueList; @@ -188,7 +188,7 @@ void PropertyNormalList::Paste(const App::Property &from) hasSetValue(); } -unsigned int PropertyNormalList::getMemSize (void) const +unsigned int PropertyNormalList::getMemSize () const { return static_cast(_lValueList.size() * sizeof(Base::Vector3f)); } @@ -382,7 +382,7 @@ void PropertyCurvatureList::RestoreDocFile(Base::Reader &reader) setValues(values); } -PyObject* PropertyCurvatureList::getPyObject(void) +PyObject* PropertyCurvatureList::getPyObject() { Py::List list; for (std::vector::const_iterator it = _lValueList.begin(); it != _lValueList.end(); ++it) { @@ -410,7 +410,7 @@ void PropertyCurvatureList::setPyObject(PyObject* /*value*/) throw Base::AttributeError(std::string("This attribute is read-only")); } -App::Property *PropertyCurvatureList::Copy(void) const +App::Property *PropertyCurvatureList::Copy() const { PropertyCurvatureList *p= new PropertyCurvatureList(); p->_lValueList = _lValueList; @@ -427,7 +427,7 @@ void PropertyCurvatureList::Paste(const App::Property &from) // ---------------------------------------------------------------------------- PropertyMeshKernel::PropertyMeshKernel() - : _meshObject(new MeshObject()), meshPyObject(0) + : _meshObject(new MeshObject()), meshPyObject(nullptr) { // Note: Normally this property is a member of a document object, i.e. the setValue() // method gets called in the constructor of a sublcass of DocumentObject, e.g. Mesh::Feature. @@ -440,7 +440,7 @@ PropertyMeshKernel::~PropertyMeshKernel() if (meshPyObject) { // Note: Do not call setInvalid() of the Python binding // because the mesh should still be accessible afterwards. - meshPyObject->parentProperty = 0; + meshPyObject->parentProperty = nullptr; Py_DECREF(meshPyObject); } } @@ -483,12 +483,12 @@ void PropertyMeshKernel::swapMesh(MeshCore::MeshKernel& mesh) hasSetValue(); } -const MeshObject& PropertyMeshKernel::getValue(void)const +const MeshObject& PropertyMeshKernel::getValue()const { return *_meshObject; } -const MeshObject* PropertyMeshKernel::getValuePtr(void)const +const MeshObject* PropertyMeshKernel::getValuePtr()const { return (MeshObject*)_meshObject; } @@ -503,7 +503,7 @@ Base::BoundBox3d PropertyMeshKernel::getBoundingBox() const return _meshObject->getBoundBox(); } -unsigned int PropertyMeshKernel::getMemSize (void) const +unsigned int PropertyMeshKernel::getMemSize () const { unsigned int size = 0; size += _meshObject->getMemSize(); @@ -538,7 +538,7 @@ void PropertyMeshKernel::setPointIndices(const std::vector& values); - const std::vector &getValues(void) const { + const std::vector &getValues() const { return _lValueList; } - virtual PyObject *getPyObject(void); + virtual PyObject *getPyObject(); virtual void setPyObject(PyObject *); virtual void Save (Base::Writer &writer) const; @@ -87,10 +87,10 @@ public: virtual void SaveDocFile (Base::Writer &writer) const; virtual void RestoreDocFile(Base::Reader &reader); - virtual App::Property *Copy(void) const; + virtual App::Property *Copy() const; virtual void Paste(const App::Property &from); - virtual unsigned int getMemSize (void) const; + virtual unsigned int getMemSize () const; void transformGeometry(const Base::Matrix4D &rclMat); @@ -125,8 +125,8 @@ public: PropertyCurvatureList(); ~PropertyCurvatureList(); - void setSize(int newSize){_lValueList.resize(newSize);} - int getSize(void) const {return _lValueList.size();} + void setSize(int newSize){_lValueList.resize(newSize);} + int getSize() const {return _lValueList.size();} std::vector getCurvature( int tMode) const; void setValue(const CurvatureInfo&); void setValues(const std::vector&); @@ -138,7 +138,7 @@ public: void set1Value (const int idx, const CurvatureInfo& value) { _lValueList[idx] = value; } - const std::vector &getValues(void) const { + const std::vector &getValues() const { return _lValueList; } void transformGeometry(const Base::Matrix4D &rclMat); @@ -151,14 +151,14 @@ public: /** @name Python interface */ //@{ - PyObject* getPyObject(void); + PyObject* getPyObject(); void setPyObject(PyObject *value); //@} - App::Property *Copy(void) const; + App::Property *Copy() const; void Paste(const App::Property &from); - virtual unsigned int getMemSize (void) const{return _lValueList.size() * sizeof(CurvatureInfo);} + virtual unsigned int getMemSize () const{return _lValueList.size() * sizeof(CurvatureInfo);} private: std::vector _lValueList; @@ -197,9 +197,9 @@ public: /** Returns a the attached mesh object by reference. It cannot be modified * from outside. */ - const MeshObject &getValue(void) const; - const MeshObject *getValuePtr(void) const; - virtual unsigned int getMemSize (void) const; + const MeshObject &getValue() const; + const MeshObject *getValuePtr() const; + virtual unsigned int getMemSize () const; //@} /** @name Getting basic geometric entities */ @@ -224,7 +224,7 @@ public: * create a copy. However, the Python wrapper is marked as \a immutable so * that the mesh object cannot be modified from outside. */ - PyObject* getPyObject(void); + PyObject* getPyObject(); /** This method copies the content, hence creates an new mesh object * to copy the data. The passed argument can be an instance of the Python * wrapper for the mesh object or simply a list of triangles, i.e. a list @@ -233,7 +233,7 @@ public: void setPyObject(PyObject *value); //@} - const char* getEditorName(void) const { + const char* getEditorName() const { return "MeshGui::PropertyMeshKernelItem"; } @@ -245,7 +245,7 @@ public: void SaveDocFile (Base::Writer &writer) const; void RestoreDocFile(Base::Reader &reader); - App::Property *Copy(void) const; + App::Property *Copy() const; void Paste(const App::Property &from); //@} diff --git a/src/Mod/Mesh/App/MeshPy.xml b/src/Mod/Mesh/App/MeshPy.xml index 9c85d17014..6ae3ecdf79 100644 --- a/src/Mod/Mesh/App/MeshPy.xml +++ b/src/Mod/Mesh/App/MeshPy.xml @@ -523,7 +523,7 @@ an empty dictionary if there is no intersection. getPlanarSegments(dev,[min faces=0]) -> list Get all planes of the mesh as segment. In the worst case each triangle can be regarded as single -plane if none of its neighbors are coplanar. +plane if none of its neighours is coplanar. diff --git a/src/Mod/Mesh/App/MeshPyImp.cpp b/src/Mod/Mesh/App/MeshPyImp.cpp index 3876f0ff91..a6c4f6f394 100644 --- a/src/Mod/Mesh/App/MeshPyImp.cpp +++ b/src/Mod/Mesh/App/MeshPyImp.cpp @@ -64,12 +64,12 @@ private: int MeshPy::PyInit(PyObject* args, PyObject*) { - PyObject *pcObj=0; - if (!PyArg_ParseTuple(args, "|O", &pcObj)) // convert args: Python->C - return -1; // NULL triggers exception + PyObject *pcObj=nullptr; + if (!PyArg_ParseTuple(args, "|O", &pcObj)) + return -1; try { - this->parentProperty = 0; + this->parentProperty = nullptr; // if no mesh is given if (!pcObj) return 0; if (PyObject_TypeCheck(pcObj, &(MeshPy::Type))) { @@ -77,13 +77,13 @@ int MeshPy::PyInit(PyObject* args, PyObject*) } else if (PyList_Check(pcObj)) { PyObject* ret = addFacets(args); - bool ok = (ret!=0); + bool ok = (ret!=nullptr); Py_XDECREF(ret); if (!ok) return -1; } else if (PyTuple_Check(pcObj)) { PyObject* ret = addFacets(args); - bool ok = (ret!=0); + bool ok = (ret!=nullptr); Py_XDECREF(ret); if (!ok) return -1; } @@ -112,7 +112,7 @@ int MeshPy::PyInit(PyObject* args, PyObject*) } // returns a string which represent the object e.g. when printed in python -std::string MeshPy::representation(void) const +std::string MeshPy::representation() const { // Note: As the return type is 'const char*' we cannot create a temporary char array neither on the stack because the array would be freed // when leaving the scope nor on the heap because we would have a memory leak. @@ -132,7 +132,7 @@ PyObject *MeshPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Pytho PyObject* MeshPy::copy(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; return new MeshPy(new MeshObject(*getMeshObjectPtr())); } @@ -140,7 +140,7 @@ PyObject* MeshPy::copy(PyObject *args) PyObject* MeshPy::read(PyObject *args, PyObject *kwds) { char* Name; - static char* keywords_path[] = {"Filename",NULL}; + static char* keywords_path[] = {"Filename",nullptr}; if (PyArg_ParseTupleAndKeywords(args, kwds, "et", keywords_path, "utf-8", &Name)) { getMeshObjectPtr()->load(Name); PyMem_Free(Name); @@ -171,7 +171,7 @@ PyObject* MeshPy::read(PyObject *args, PyObject *kwds) PyObject* input; char* Ext; - static char* keywords_stream[] = {"Stream","Format",NULL}; + static char* keywords_stream[] = {"Stream","Format",nullptr}; if (PyArg_ParseTupleAndKeywords(args, kwds, "Os",keywords_stream, &input, &Ext)) { std::string fmt(Ext); boost::to_upper(fmt); @@ -181,7 +181,7 @@ PyObject* MeshPy::read(PyObject *args, PyObject *kwds) // read mesh Base::PyStreambuf buf(input); - std::istream str(0); + std::istream str(nullptr); str.rdbuf(&buf); getMeshObjectPtr()->load(str, format); @@ -189,15 +189,15 @@ PyObject* MeshPy::read(PyObject *args, PyObject *kwds) } PyErr_SetString(PyExc_TypeError, "expect string or file object"); - return NULL; + return nullptr; } PyObject* MeshPy::write(PyObject *args, PyObject *kwds) { char* Name; - char* Ext=0; - char* ObjName=0; - PyObject* List=0; + char* Ext=nullptr; + char* ObjName=nullptr; + PyObject* List=nullptr; MeshCore::MeshIO::Format format = MeshCore::MeshIO::Undefined; std::map ext; @@ -224,7 +224,7 @@ PyObject* MeshPy::write(PyObject *args, PyObject *kwds) ext["ASY" ] = MeshCore::MeshIO::ASY; ext["3MF" ] = MeshCore::MeshIO::ThreeMF; - static char* keywords_path[] = {"Filename","Format","Name","Material",NULL}; + static char* keywords_path[] = {"Filename","Format","Name","Material",nullptr}; if (PyArg_ParseTupleAndKeywords(args, kwds, "et|ssO", keywords_path, "utf-8", &Name, &Ext, &ObjName, &List)) { if (Ext) { @@ -255,7 +255,7 @@ PyObject* MeshPy::write(PyObject *args, PyObject *kwds) getMeshObjectPtr()->save(Name, format, &mat, ObjName); } else { - getMeshObjectPtr()->save(Name, format, 0, ObjName); + getMeshObjectPtr()->save(Name, format, nullptr, ObjName); } PyMem_Free(Name); @@ -264,7 +264,7 @@ PyObject* MeshPy::write(PyObject *args, PyObject *kwds) PyErr_Clear(); - static char* keywords_stream[] = {"Stream","Format","Name","Material",NULL}; + static char* keywords_stream[] = {"Stream","Format","Name","Material",nullptr}; PyObject* input; if (PyArg_ParseTupleAndKeywords(args, kwds, "Os|sO", keywords_stream, &input, &Ext, &ObjName, &List)) { @@ -296,7 +296,7 @@ PyObject* MeshPy::write(PyObject *args, PyObject *kwds) // write mesh Base::PyStreambuf buf(input); - std::ostream str(0); + std::ostream str(nullptr); str.rdbuf(&buf); getMeshObjectPtr()->save(str, format, mat.get(), ObjName); @@ -304,14 +304,14 @@ PyObject* MeshPy::write(PyObject *args, PyObject *kwds) } PyErr_SetString(PyExc_TypeError, "expect string or file object"); - return NULL; + return nullptr; } PyObject* MeshPy::writeInventor(PyObject *args) { float creaseangle=0.0f; if (!PyArg_ParseTuple(args, "|f",&creaseangle)) - return NULL; + return nullptr; MeshObject* mesh = getMeshObjectPtr(); const MeshCore::MeshFacetArray& faces = mesh->getKernel().GetFacets(); @@ -346,7 +346,7 @@ PyObject* MeshPy::offset(PyObject *args) { float Float; if (!PyArg_ParseTuple(args, "f",&Float)) - return NULL; + return nullptr; PY_TRY { getMeshObjectPtr()->offsetSpecial2(Float); @@ -358,11 +358,11 @@ PyObject* MeshPy::offset(PyObject *args) PyObject* MeshPy::offsetSpecial(PyObject *args) { float Float,zmin,zmax; - if (!PyArg_ParseTuple(args, "fff",&Float,&zmin,&zmax)) - return NULL; + if (!PyArg_ParseTuple(args, "fff",&Float,&zmin,&zmax)) + return nullptr; PY_TRY { - getMeshObjectPtr()->offsetSpecial(Float,zmax,zmin); + getMeshObjectPtr()->offsetSpecial(Float,zmax,zmin); } PY_CATCH; Py_Return; @@ -374,7 +374,7 @@ PyObject* MeshPy::crossSections(PyObject *args) PyObject *poly=Py_False; float min_eps = 1.0e-2f; if (!PyArg_ParseTuple(args, "O|fO!", &obj, &min_eps, &PyBool_Type, &poly)) - return 0; + return nullptr; Py::Sequence list(obj); union PyType_Object pyType = {&(Base::VectorPy::Type)}; @@ -434,8 +434,8 @@ PyObject* MeshPy::unite(PyObject *args) { MeshPy *pcObject; PyObject *pcObj; - if (!PyArg_ParseTuple(args, "O!", &(MeshPy::Type), &pcObj)) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "O!", &(MeshPy::Type), &pcObj)) + return nullptr; pcObject = static_cast(pcObj); @@ -451,8 +451,8 @@ PyObject* MeshPy::intersect(PyObject *args) { MeshPy *pcObject; PyObject *pcObj; - if (!PyArg_ParseTuple(args, "O!", &(MeshPy::Type), &pcObj)) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "O!", &(MeshPy::Type), &pcObj)) + return nullptr; pcObject = static_cast(pcObj); @@ -468,8 +468,8 @@ PyObject* MeshPy::difference(PyObject *args) { MeshPy *pcObject; PyObject *pcObj; - if (!PyArg_ParseTuple(args, "O!", &(MeshPy::Type), &pcObj)) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "O!", &(MeshPy::Type), &pcObj)) + return nullptr; pcObject = static_cast(pcObj); @@ -485,8 +485,8 @@ PyObject* MeshPy::inner(PyObject *args) { MeshPy *pcObject; PyObject *pcObj; - if (!PyArg_ParseTuple(args, "O!", &(MeshPy::Type), &pcObj)) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "O!", &(MeshPy::Type), &pcObj)) + return nullptr; pcObject = static_cast(pcObj); @@ -502,8 +502,8 @@ PyObject* MeshPy::outer(PyObject *args) { MeshPy *pcObject; PyObject *pcObj; - if (!PyArg_ParseTuple(args, "O!", &(MeshPy::Type), &pcObj)) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "O!", &(MeshPy::Type), &pcObj)) + return nullptr; pcObject = static_cast(pcObj); @@ -544,16 +544,16 @@ PyObject* MeshPy::section(PyObject *args, PyObject *kwds) PyObject* MeshPy::coarsen(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented"); - return 0; + return nullptr; } PyObject* MeshPy::translate(PyObject *args) { float x,y,z; if (!PyArg_ParseTuple(args, "fff",&x,&y,&z)) - return NULL; + return nullptr; PY_TRY { Base::Matrix4D m; @@ -568,7 +568,7 @@ PyObject* MeshPy::rotate(PyObject *args) { double x,y,z; if (!PyArg_ParseTuple(args, "ddd",&x,&y,&z)) - return NULL; + return nullptr; PY_TRY { Base::Matrix4D m; @@ -585,7 +585,7 @@ PyObject* MeshPy::transform(PyObject *args) { PyObject *mat; if (!PyArg_ParseTuple(args, "O!",&(Base::MatrixPy::Type), &mat)) - return NULL; + return nullptr; PY_TRY { getMeshObjectPtr()->getKernel().Transform(static_cast(mat)->value()); @@ -597,7 +597,7 @@ PyObject* MeshPy::transform(PyObject *args) PyObject* MeshPy::transformToEigen(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; getMeshObjectPtr()->transformToEigenSystem(); Py_Return; } @@ -605,7 +605,7 @@ PyObject* MeshPy::transformToEigen(PyObject *args) PyObject* MeshPy::getEigenSystem(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; Base::Vector3d vec; Base::Matrix4D mat = getMeshObjectPtr()->getEigenSystem(vec); Py::Tuple t(2); @@ -649,7 +649,7 @@ PyObject* MeshPy::addFacet(PyObject *args) } PyErr_SetString(Base::BaseExceptionFreeCADError, "set 9 floats or three vectors or a facet"); - return 0; + return nullptr; } PyObject* MeshPy::addFacets(PyObject *args) @@ -696,7 +696,7 @@ PyObject* MeshPy::addFacets(PyObject *args) } else { PyErr_SetString(Base::BaseExceptionFreeCADError, "expect a sequence of floats or Vector"); - return NULL; + return nullptr; } facet.CalcNormal(); @@ -754,16 +754,16 @@ PyObject* MeshPy::addFacets(PyObject *args) PyErr_SetString(Base::BaseExceptionFreeCADError, "either expect\n" "-- [Vector] (3 of them define a facet)\n" "-- ([Vector],[(int,int,int)])"); - return NULL; + return nullptr; } PyObject* MeshPy::removeFacets(PyObject *args) { PyObject* list; if (!PyArg_ParseTuple(args, "O", &list)) - return 0; + return nullptr; - std::vector indices; + std::vector indices; Py::Sequence ary(list); for (Py::Sequence::iterator it = ary.begin(); it != ary.end(); ++it) { Py::Long f(*it); @@ -777,7 +777,7 @@ PyObject* MeshPy::removeFacets(PyObject *args) PyObject* MeshPy::getInternalFacets(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return 0; + return nullptr; const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel(); MeshCore::MeshEvalInternalFacets eval(kernel); @@ -796,7 +796,7 @@ PyObject* MeshPy::getInternalFacets(PyObject *args) PyObject* MeshPy::rebuildNeighbourHood(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return 0; + return nullptr; MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel(); kernel.RebuildNeighbours(); @@ -807,7 +807,7 @@ PyObject* MeshPy::addMesh(PyObject *args) { PyObject* mesh; if (!PyArg_ParseTuple(args, "O!",&(MeshPy::Type), &mesh)) - return NULL; + return nullptr; PY_TRY { getMeshObjectPtr()->addMesh(*static_cast(mesh)->getMeshObjectPtr()); @@ -821,7 +821,7 @@ PyObject* MeshPy::setPoint(PyObject *args) unsigned long index; PyObject* pnt; if (!PyArg_ParseTuple(args, "kO!",&index, &(Base::VectorPy::Type), &pnt)) - return NULL; + return nullptr; PY_TRY { getMeshObjectPtr()->setPoint(index, static_cast(pnt)->value()); @@ -833,7 +833,7 @@ PyObject* MeshPy::setPoint(PyObject *args) PyObject* MeshPy::getPointNormals(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PY_TRY { std::vector normals = getMeshObjectPtr()->getPointNormals(); @@ -870,7 +870,7 @@ PyObject* MeshPy::addSegment(PyObject *args) PyObject* MeshPy::countSegments(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return 0; + return nullptr; unsigned long count = getMeshObjectPtr()->countSegments(); return Py_BuildValue("k",count); @@ -880,12 +880,12 @@ PyObject* MeshPy::getSegment(PyObject *args) { unsigned long index; if (!PyArg_ParseTuple(args, "k", &index)) - return 0; + return nullptr; unsigned long count = getMeshObjectPtr()->countSegments(); if (index >= count) { PyErr_SetString(PyExc_IndexError, "index out of range"); - return 0; + return nullptr; } Py::List ary; @@ -900,7 +900,7 @@ PyObject* MeshPy::getSegment(PyObject *args) PyObject* MeshPy::getSeparateComponents(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; Py::List meshesList; std::vector > segs; @@ -915,7 +915,7 @@ PyObject* MeshPy::getSeparateComponents(PyObject *args) PyObject* MeshPy::getFacetSelection(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return 0; + return nullptr; Py::List ary; std::vector facets; @@ -930,7 +930,7 @@ PyObject* MeshPy::getFacetSelection(PyObject *args) PyObject* MeshPy::getPointSelection(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return 0; + return nullptr; Py::List ary; std::vector points; @@ -946,7 +946,7 @@ PyObject* MeshPy::meshFromSegment(PyObject *args) { PyObject* list; if (!PyArg_ParseTuple(args, "O", &list)) - return 0; + return nullptr; std::vector segment; Py::Sequence ary(list); @@ -963,7 +963,7 @@ PyObject* MeshPy::meshFromSegment(PyObject *args) PyObject* MeshPy::clear(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; getMeshObjectPtr()->clear(); Py_Return; } @@ -971,7 +971,7 @@ PyObject* MeshPy::clear(PyObject *args) PyObject* MeshPy::isSolid(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; bool ok = getMeshObjectPtr()->isSolid(); return Py_BuildValue("O", (ok ? Py_True : Py_False)); } @@ -979,7 +979,7 @@ PyObject* MeshPy::isSolid(PyObject *args) PyObject* MeshPy::hasNonManifolds(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; bool ok = getMeshObjectPtr()->hasNonManifolds(); return Py_BuildValue("O", (ok ? Py_True : Py_False)); } @@ -987,7 +987,7 @@ PyObject* MeshPy::hasNonManifolds(PyObject *args) PyObject* MeshPy::hasInvalidNeighbourhood(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; bool ok = getMeshObjectPtr()->hasInvalidNeighbourhood(); return Py_BuildValue("O", (ok ? Py_True : Py_False)); } @@ -995,7 +995,7 @@ PyObject* MeshPy::hasInvalidNeighbourhood(PyObject *args) PyObject* MeshPy::hasPointsOutOfRange(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; bool ok = getMeshObjectPtr()->hasPointsOutOfRange(); return Py_BuildValue("O", (ok ? Py_True : Py_False)); } @@ -1003,7 +1003,7 @@ PyObject* MeshPy::hasPointsOutOfRange(PyObject *args) PyObject* MeshPy::hasFacetsOutOfRange(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; bool ok = getMeshObjectPtr()->hasFacetsOutOfRange(); return Py_BuildValue("O", (ok ? Py_True : Py_False)); } @@ -1011,7 +1011,7 @@ PyObject* MeshPy::hasFacetsOutOfRange(PyObject *args) PyObject* MeshPy::hasCorruptedFacets(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; bool ok = getMeshObjectPtr()->hasFacetsOutOfRange(); return Py_BuildValue("O", (ok ? Py_True : Py_False)); } @@ -1019,7 +1019,7 @@ PyObject* MeshPy::hasCorruptedFacets(PyObject *args) PyObject* MeshPy::removeNonManifolds(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; getMeshObjectPtr()->removeNonManifolds(); Py_Return; } @@ -1027,7 +1027,7 @@ PyObject* MeshPy::removeNonManifolds(PyObject *args) PyObject* MeshPy::removeNonManifoldPoints(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; getMeshObjectPtr()->removeNonManifoldPoints(); Py_Return; } @@ -1035,7 +1035,7 @@ PyObject* MeshPy::removeNonManifoldPoints(PyObject *args) PyObject* MeshPy::hasSelfIntersections(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; bool ok = getMeshObjectPtr()->hasSelfIntersections(); return Py_BuildValue("O", (ok ? Py_True : Py_False)); } @@ -1043,7 +1043,7 @@ PyObject* MeshPy::hasSelfIntersections(PyObject *args) PyObject* MeshPy::getSelfIntersections(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; std::vector > selfIndices; std::vector > selfPoints; @@ -1069,13 +1069,13 @@ PyObject* MeshPy::getSelfIntersections(PyObject *args) PyObject* MeshPy::fixSelfIntersections(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; try { getMeshObjectPtr()->removeSelfIntersections(); } catch (const Base::Exception& e) { PyErr_SetString(Base::BaseExceptionFreeCADError, e.what()); - return NULL; + return nullptr; } Py_Return; } @@ -1083,13 +1083,13 @@ PyObject* MeshPy::fixSelfIntersections(PyObject *args) PyObject* MeshPy::removeFoldsOnSurface(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; try { getMeshObjectPtr()->removeFoldsOnSurface(); } catch (const Base::Exception& e) { PyErr_SetString(Base::BaseExceptionFreeCADError, e.what()); - return NULL; + return nullptr; } Py_Return; } @@ -1097,7 +1097,7 @@ PyObject* MeshPy::removeFoldsOnSurface(PyObject *args) PyObject* MeshPy::hasInvalidPoints(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; bool ok = getMeshObjectPtr()->hasInvalidPoints(); return Py_BuildValue("O", (ok ? Py_True : Py_False)); } @@ -1105,13 +1105,13 @@ PyObject* MeshPy::hasInvalidPoints(PyObject *args) PyObject* MeshPy::removeInvalidPoints(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; try { getMeshObjectPtr()->removeInvalidPoints(); } catch (const Base::Exception& e) { PyErr_SetString(Base::BaseExceptionFreeCADError, e.what()); - return NULL; + return nullptr; } Py_Return; } @@ -1143,7 +1143,7 @@ PyObject* MeshPy::removePointsOnEdge(PyObject *args, PyObject *kwds) PyObject* MeshPy::flipNormals(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PY_TRY { MeshPropertyLock lock(this->parentProperty); @@ -1156,7 +1156,7 @@ PyObject* MeshPy::flipNormals(PyObject *args) PyObject* MeshPy::hasNonUniformOrientedFacets(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; bool ok = getMeshObjectPtr()->countNonUniformOrientedFacets() > 0; return Py_BuildValue("O", (ok ? Py_True : Py_False)); } @@ -1164,7 +1164,7 @@ PyObject* MeshPy::hasNonUniformOrientedFacets(PyObject *args) PyObject* MeshPy::countNonUniformOrientedFacets(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; unsigned long count = getMeshObjectPtr()->countNonUniformOrientedFacets(); return Py_BuildValue("k", count); } @@ -1172,7 +1172,7 @@ PyObject* MeshPy::countNonUniformOrientedFacets(PyObject *args) PyObject* MeshPy::getNonUniformOrientedFacets(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel(); MeshCore::MeshEvalOrientation cMeshEval(kernel); @@ -1188,7 +1188,7 @@ PyObject* MeshPy::getNonUniformOrientedFacets(PyObject *args) PyObject* MeshPy::harmonizeNormals(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PY_TRY { MeshPropertyLock lock(this->parentProperty); @@ -1201,7 +1201,7 @@ PyObject* MeshPy::harmonizeNormals(PyObject *args) PyObject* MeshPy::countComponents(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; unsigned long count = getMeshObjectPtr()->countComponents(); return Py_BuildValue("k",count); @@ -1211,7 +1211,7 @@ PyObject* MeshPy::removeComponents(PyObject *args) { unsigned long count; if (!PyArg_ParseTuple(args, "k", &count)) - return NULL; + return nullptr; PY_TRY { if (count > 0) { @@ -1228,7 +1228,7 @@ PyObject* MeshPy::fillupHoles(PyObject *args) int level = 0; float max_area = 0.0f; if (!PyArg_ParseTuple(args, "k|if", &len,&level,&max_area)) - return NULL; + return nullptr; try { std::unique_ptr tria; if (max_area > 0.0f) { @@ -1246,7 +1246,7 @@ PyObject* MeshPy::fillupHoles(PyObject *args) } catch (const Base::Exception& e) { PyErr_SetString(Base::BaseExceptionFreeCADError, e.what()); - return NULL; + return nullptr; } Py_Return; @@ -1255,7 +1255,7 @@ PyObject* MeshPy::fillupHoles(PyObject *args) PyObject* MeshPy::fixIndices(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PY_TRY { getMeshObjectPtr()->validateIndices(); @@ -1269,7 +1269,7 @@ PyObject* MeshPy::fixCaps(PyObject *args) float fMaxAngle = Base::toRadians(150.0f); float fSplitFactor = 0.25f; if (!PyArg_ParseTuple(args, "|ff", &fMaxAngle, &fSplitFactor)) - return NULL; + return nullptr; PY_TRY { getMeshObjectPtr()->validateCaps(fMaxAngle, fSplitFactor); @@ -1283,7 +1283,7 @@ PyObject* MeshPy::fixDeformations(PyObject *args) float fMaxAngle; float fEpsilon = MeshCore::MeshDefinitions::_fMinPointDistanceP2; if (!PyArg_ParseTuple(args, "f|f", &fMaxAngle, &fEpsilon)) - return NULL; + return nullptr; PY_TRY { getMeshObjectPtr()->validateDeformations(fMaxAngle, fEpsilon); @@ -1296,7 +1296,7 @@ PyObject* MeshPy::fixDegenerations(PyObject *args) { float fEpsilon = MeshCore::MeshDefinitions::_fMinPointDistanceP2; if (!PyArg_ParseTuple(args, "|f", &fEpsilon)) - return NULL; + return nullptr; PY_TRY { getMeshObjectPtr()->validateDegenerations(fEpsilon); @@ -1308,7 +1308,7 @@ PyObject* MeshPy::fixDegenerations(PyObject *args) PyObject* MeshPy::removeDuplicatedPoints(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PY_TRY { getMeshObjectPtr()->removeDuplicatedPoints(); @@ -1320,7 +1320,7 @@ PyObject* MeshPy::removeDuplicatedPoints(PyObject *args) PyObject* MeshPy::removeDuplicatedFacets(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PY_TRY { getMeshObjectPtr()->removeDuplicatedFacets(); @@ -1332,7 +1332,7 @@ PyObject* MeshPy::removeDuplicatedFacets(PyObject *args) PyObject* MeshPy::refine(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PY_TRY { getMeshObjectPtr()->refine(); @@ -1345,7 +1345,7 @@ PyObject* MeshPy::removeNeedles(PyObject *args) { float length; if (!PyArg_ParseTuple(args, "f", &length)) - return NULL; + return nullptr; PY_TRY { getMeshObjectPtr()->removeNeedles(length); @@ -1357,7 +1357,7 @@ PyObject* MeshPy::removeNeedles(PyObject *args) PyObject* MeshPy::removeFullBoundaryFacets(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PY_TRY { getMeshObjectPtr()->removeFullBoundaryFacets(); @@ -1369,7 +1369,7 @@ PyObject* MeshPy::removeFullBoundaryFacets(PyObject *args) PyObject* MeshPy::mergeFacets(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PY_TRY { getMeshObjectPtr()->mergeFacets(); @@ -1382,7 +1382,7 @@ PyObject* MeshPy::optimizeTopology(PyObject *args) { float fMaxAngle=-1.0f; if (!PyArg_ParseTuple(args, "|f; specify the maximum allowed angle between the normals of two adjacent facets", &fMaxAngle)) - return NULL; + return nullptr; PY_TRY { MeshPropertyLock lock(this->parentProperty); @@ -1395,7 +1395,7 @@ PyObject* MeshPy::optimizeTopology(PyObject *args) PyObject* MeshPy::optimizeEdges(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PY_TRY { MeshPropertyLock lock(this->parentProperty); @@ -1408,7 +1408,7 @@ PyObject* MeshPy::optimizeEdges(PyObject *args) PyObject* MeshPy::splitEdges(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; PY_TRY { getMeshObjectPtr()->splitEdges(); @@ -1422,7 +1422,7 @@ PyObject* MeshPy::splitEdge(PyObject *args) unsigned long facet, neighbour; PyObject* vertex; if (!PyArg_ParseTuple(args, "kkO!", &facet, &neighbour, &Base::VectorPy::Type, &vertex)) - return NULL; + return nullptr; Base::VectorPy *pcObject = static_cast(vertex); Base::Vector3d* val = pcObject->getVectorPtr(); @@ -1432,18 +1432,18 @@ PyObject* MeshPy::splitEdge(PyObject *args) PY_TRY { if (facet >= kernel.CountFacets()) { PyErr_SetString(PyExc_IndexError, "Facet index out of range"); - return NULL; + return nullptr; } if (neighbour >= kernel.CountFacets()) { PyErr_SetString(PyExc_IndexError, "Facet index out of range"); - return NULL; + return nullptr; } const MeshCore::MeshFacet& rclF = kernel.GetFacets()[facet]; if (rclF._aulNeighbours[0] != neighbour && rclF._aulNeighbours[1] != neighbour && rclF._aulNeighbours[2] != neighbour) { PyErr_SetString(PyExc_IndexError, "No adjacent facets"); - return NULL; + return nullptr; } getMeshObjectPtr()->splitEdge(facet, neighbour, v); @@ -1459,7 +1459,7 @@ PyObject* MeshPy::splitFacet(PyObject *args) PyObject* vertex2; if (!PyArg_ParseTuple(args, "kO!O!", &facet, &Base::VectorPy::Type, &vertex1, &Base::VectorPy::Type, &vertex2)) - return NULL; + return nullptr; Base::VectorPy *pcObject = static_cast(vertex1); Base::Vector3d* val = pcObject->getVectorPtr(); @@ -1473,7 +1473,7 @@ PyObject* MeshPy::splitFacet(PyObject *args) PY_TRY { if (facet >= kernel.CountFacets()) { PyErr_SetString(PyExc_IndexError, "Facet index out of range"); - return NULL; + return nullptr; } getMeshObjectPtr()->splitFacet(facet, v1, v2); @@ -1486,24 +1486,24 @@ PyObject* MeshPy::swapEdge(PyObject *args) { unsigned long facet, neighbour; if (!PyArg_ParseTuple(args, "kk", &facet, &neighbour)) - return NULL; + return nullptr; const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel(); PY_TRY { if (facet >= kernel.CountFacets()) { PyErr_SetString(PyExc_IndexError, "Facet index out of range"); - return NULL; + return nullptr; } if (neighbour >= kernel.CountFacets()) { PyErr_SetString(PyExc_IndexError, "Facet index out of range"); - return NULL; + return nullptr; } const MeshCore::MeshFacet& rclF = kernel.GetFacets()[facet]; if (rclF._aulNeighbours[0] != neighbour && rclF._aulNeighbours[1] != neighbour && rclF._aulNeighbours[2] != neighbour) { PyErr_SetString(PyExc_IndexError, "No adjacent facets"); - return NULL; + return nullptr; } getMeshObjectPtr()->swapEdge(facet, neighbour); @@ -1516,24 +1516,24 @@ PyObject* MeshPy::collapseEdge(PyObject *args) { unsigned long facet, neighbour; if (!PyArg_ParseTuple(args, "kk", &facet, &neighbour)) - return NULL; + return nullptr; const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel(); PY_TRY { if (facet >= kernel.CountFacets()) { PyErr_SetString(PyExc_IndexError, "Facet index out of range"); - return NULL; + return nullptr; } if (neighbour >= kernel.CountFacets()) { PyErr_SetString(PyExc_IndexError, "Facet index out of range"); - return NULL; + return nullptr; } const MeshCore::MeshFacet& rclF = kernel.GetFacets()[facet]; if (rclF._aulNeighbours[0] != neighbour && rclF._aulNeighbours[1] != neighbour && rclF._aulNeighbours[2] != neighbour) { PyErr_SetString(PyExc_IndexError, "No adjacent facets"); - return NULL; + return nullptr; } getMeshObjectPtr()->collapseEdge(facet, neighbour); @@ -1546,12 +1546,12 @@ PyObject* MeshPy::collapseFacet(PyObject *args) { unsigned long facet; if (!PyArg_ParseTuple(args, "k", &facet)) - return NULL; + return nullptr; PY_TRY { if (facet >= getMeshObjectPtr()->countFacets()) { PyErr_SetString(PyExc_IndexError, "Facet index out of range"); - return NULL; + return nullptr; } getMeshObjectPtr()->collapseFacet(facet); @@ -1565,7 +1565,7 @@ PyObject* MeshPy::insertVertex(PyObject *args) unsigned long facet; PyObject* vertex; if (!PyArg_ParseTuple(args, "kO!", &facet, &Base::VectorPy::Type, &vertex)) - return NULL; + return nullptr; Base::VectorPy *pcObject = static_cast(vertex); Base::Vector3d* val = pcObject->getVectorPtr(); @@ -1574,7 +1574,7 @@ PyObject* MeshPy::insertVertex(PyObject *args) PY_TRY { if (facet >= getMeshObjectPtr()->countFacets()) { PyErr_SetString(PyExc_IndexError, "Facet index out of range"); - return NULL; + return nullptr; } getMeshObjectPtr()->insertVertex(facet, v); @@ -1588,7 +1588,7 @@ PyObject* MeshPy::snapVertex(PyObject *args) unsigned long facet; PyObject* vertex; if (!PyArg_ParseTuple(args, "kO!", &facet, &Base::VectorPy::Type, &vertex)) - return NULL; + return nullptr; Base::VectorPy *pcObject = static_cast(vertex); Base::Vector3d* val = pcObject->getVectorPtr(); @@ -1597,7 +1597,7 @@ PyObject* MeshPy::snapVertex(PyObject *args) PY_TRY { if (facet >= getMeshObjectPtr()->countFacets()) { PyErr_SetString(PyExc_IndexError, "Facet index out of range"); - return NULL; + return nullptr; } getMeshObjectPtr()->snapVertex(facet, v); @@ -1609,15 +1609,15 @@ PyObject* MeshPy::snapVertex(PyObject *args) PyObject* MeshPy::printInfo(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; return Py_BuildValue("s", getMeshObjectPtr()->topologyInfo().c_str()); } PyObject* MeshPy::collapseFacets(PyObject *args) { - PyObject *pcObj=0; - if (!PyArg_ParseTuple(args, "O", &pcObj)) // convert args: Python->C - return 0; // NULL triggers exception + PyObject *pcObj=nullptr; + if (!PyArg_ParseTuple(args, "O", &pcObj)) + return nullptr; // if no mesh is given try { @@ -1632,7 +1632,7 @@ PyObject* MeshPy::collapseFacets(PyObject *args) getMeshObjectPtr()->collapseFacets(facets); } catch (const Py::Exception&) { - return 0; + return nullptr; } Py_Return; @@ -1643,7 +1643,7 @@ PyObject* MeshPy::foraminate(PyObject *args) PyObject* pnt_p; PyObject* dir_p; if (!PyArg_ParseTuple(args, "OO", &pnt_p, &dir_p)) - return NULL; + return nullptr; try { Py::Tuple pnt_t(pnt_p); @@ -1673,7 +1673,7 @@ PyObject* MeshPy::foraminate(PyObject *args) return Py::new_reference_to(dict); } catch (const Py::Exception&) { - return 0; + return nullptr; } } @@ -1682,7 +1682,7 @@ PyObject* MeshPy::cut(PyObject *args) PyObject* poly; int mode; if (!PyArg_ParseTuple(args, "Oi", &poly, &mode)) - return NULL; + return nullptr; Py::Sequence list(poly); std::vector polygon; @@ -1716,7 +1716,7 @@ PyObject* MeshPy::trim(PyObject *args) PyObject* poly; int mode; if (!PyArg_ParseTuple(args, "Oi", &poly, &mode)) - return NULL; + return nullptr; Py::Sequence list(poly); std::vector polygon; @@ -1767,10 +1767,10 @@ PyObject* MeshPy::smooth(PyObject *args, PyObject *kwds) int iter=1; double lambda = 0; double micro = 0; - static char* keywords_smooth[] = {"Method","Iteration","Lambda","Micro",NULL}; + static char* keywords_smooth[] = {"Method","Iteration","Lambda","Micro",nullptr}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "|sidd",keywords_smooth, &method, &iter, &lambda, µ)) - return 0; + return nullptr; PY_TRY { MeshPropertyLock lock(this->parentProperty); @@ -1831,7 +1831,7 @@ PyObject* MeshPy::nearestFacetOnRay(PyObject *args) PyObject* pnt_p; PyObject* dir_p; if (!PyArg_ParseTuple(args, "OO", &pnt_p, &dir_p)) - return NULL; + return nullptr; try { Py::Tuple pnt_t(pnt_p); @@ -1885,7 +1885,7 @@ PyObject* MeshPy::nearestFacetOnRay(PyObject *args) return Py::new_reference_to(dict); } catch (const Py::Exception&) { - return 0; + return nullptr; } } @@ -1894,7 +1894,7 @@ PyObject* MeshPy::getPlanarSegments(PyObject *args) float dev; unsigned long minFacets=0; if (!PyArg_ParseTuple(args, "f|k",&dev,&minFacets)) - return NULL; + return nullptr; Mesh::MeshObject* mesh = getMeshObjectPtr(); std::vector segments = mesh->getSegmentsOfType @@ -1919,7 +1919,7 @@ PyObject* MeshPy::getSegmentsOfType(PyObject *args) float dev; unsigned long minFacets=0; if (!PyArg_ParseTuple(args, "sf|k",&type,&dev,&minFacets)) - return NULL; + return nullptr; Mesh::MeshObject::GeometryType geoType; if (strcmp(type, "Plane") == 0) { @@ -1957,7 +1957,7 @@ PyObject* MeshPy::getSegmentsByCurvature(PyObject *args) { PyObject* l; if (!PyArg_ParseTuple(args, "O",&l)) - return NULL; + return nullptr; const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel(); MeshCore::MeshSegmentAlgorithm finder(kernel); @@ -1996,7 +1996,7 @@ PyObject* MeshPy::getSegmentsByCurvature(PyObject *args) PyObject* MeshPy::getCurvaturePerVertex(PyObject* args) { if (!PyArg_ParseTuple(args, "")) - return NULL; + return nullptr; const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel(); MeshCore::MeshSegmentAlgorithm finder(kernel); @@ -2025,34 +2025,34 @@ PyObject* MeshPy::getCurvaturePerVertex(PyObject* args) return Py::new_reference_to(list); } -Py::Long MeshPy::getCountPoints(void) const +Py::Long MeshPy::getCountPoints() const { return Py::Long((long)getMeshObjectPtr()->countPoints()); } -Py::Long MeshPy::getCountEdges(void) const +Py::Long MeshPy::getCountEdges() const { return Py::Long((long)getMeshObjectPtr()->countEdges()); } -Py::Long MeshPy::getCountFacets(void) const +Py::Long MeshPy::getCountFacets() const { return Py::Long((long)getMeshObjectPtr()->countFacets()); } -Py::Float MeshPy::getArea(void) const +Py::Float MeshPy::getArea() const { return Py::Float(getMeshObjectPtr()->getSurface()); } -Py::Float MeshPy::getVolume(void) const +Py::Float MeshPy::getVolume() const { return Py::Float(getMeshObjectPtr()->getVolume()); } PyObject *MeshPy::getCustomAttributes(const char* /*attr*/) const { - return 0; + return nullptr; } int MeshPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) @@ -2060,7 +2060,7 @@ int MeshPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) return 0; } -Py::List MeshPy::getPoints(void) const +Py::List MeshPy::getPoints() const { Py::List PointList; unsigned int Index=0; @@ -2071,7 +2071,7 @@ Py::List MeshPy::getPoints(void) const return PointList; } -Py::List MeshPy::getFacets(void) const +Py::List MeshPy::getFacets() const { Py::List FacetList; MeshObject* mesh = getMeshObjectPtr(); @@ -2081,7 +2081,7 @@ Py::List MeshPy::getFacets(void) const return FacetList; } -Py::Tuple MeshPy::getTopology(void) const +Py::Tuple MeshPy::getTopology() const { std::vector Points; std::vector Facets; diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4BandedMatrix.inl b/src/Mod/Mesh/App/WildMagic4/Wm4BandedMatrix.inl index 6f450168f2..5ab01f24ea 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4BandedMatrix.inl +++ b/src/Mod/Mesh/App/WildMagic4/Wm4BandedMatrix.inl @@ -33,9 +33,9 @@ BandedMatrix::BandedMatrix (int iSize, int iLBands, int iUBands) template BandedMatrix::BandedMatrix (const BandedMatrix& rkM) { - m_afDBand = 0; - m_aafLBand = 0; - m_aafUBand = 0; + m_afDBand = nullptr; + m_aafLBand = nullptr; + m_aafUBand = nullptr; *this = rkM; } //---------------------------------------------------------------------------- @@ -276,7 +276,7 @@ void BandedMatrix::Allocate () } else { - m_aafLBand = 0; + m_aafLBand = nullptr; } if (m_iUBands > 0) @@ -285,7 +285,7 @@ void BandedMatrix::Allocate () } else { - m_aafUBand = 0; + m_aafUBand = nullptr; } int i; @@ -317,7 +317,7 @@ void BandedMatrix::Deallocate () } WM4_DELETE[] m_aafLBand; - m_aafLBand = 0; + m_aafLBand = nullptr; } if (m_aafUBand) @@ -328,7 +328,7 @@ void BandedMatrix::Deallocate () } WM4_DELETE[] m_aafUBand; - m_aafUBand = 0; + m_aafUBand = nullptr; } } //---------------------------------------------------------------------------- diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4ContBox2.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4ContBox2.cpp index 0c71ff686c..6cdf9d8ed6 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4ContBox2.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4ContBox2.cpp @@ -105,7 +105,7 @@ Box2 ContMinBox (int iQuantity, const Vector2* akPoint, Box2 kBox; // get the convex hull of the points - Vector2* akHPoint = 0; + Vector2* akHPoint = nullptr; if (bIsConvexPolygon) { akHPoint = (Vector2*)akPoint; diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull.cpp index 40956b731f..c7dab81cbe 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull.cpp @@ -22,7 +22,7 @@ ConvexHull::ConvexHull (int iVertexQuantity, Real fEpsilon, bool bOwner, m_iVertexQuantity = iVertexQuantity; m_iDimension = 0; m_iSimplexQuantity = 0; - m_aiIndex = 0; + m_aiIndex = nullptr; m_fEpsilon = fEpsilon; m_bOwner = bOwner; } @@ -100,7 +100,7 @@ bool ConvexHull::Load (FILE* pkIFile) return true; } - m_aiIndex = 0; + m_aiIndex = nullptr; return m_iDimension == 0; } //---------------------------------------------------------------------------- diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull1.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull1.cpp index f1039ad1f5..270ceeb477 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull1.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull1.cpp @@ -61,7 +61,7 @@ ConvexHull1::ConvexHull1 (const char* acFilename) : ConvexHull(0,(Real)0.0,false,Query::QT_REAL) { - m_afVertex = 0; + m_afVertex = nullptr; bool bLoaded = Load(acFilename); assert(bLoaded); (void)bLoaded; // avoid warning in Release build diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull2.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull2.cpp index 9198d4b6f4..e8764ed2db 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull2.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull2.cpp @@ -28,8 +28,8 @@ ConvexHull2::ConvexHull2 (int iVertexQuantity, Vector2* akVertex, { assert(akVertex); m_akVertex = akVertex; - m_akSVertex = 0; - m_pkQuery = 0; + m_akSVertex = nullptr; + m_pkQuery = nullptr; Mapper2 kMapper(m_iVertexQuantity,m_akVertex,m_fEpsilon); if (kMapper.GetDimension() == 0) @@ -180,7 +180,7 @@ ConvexHull1* ConvexHull2::GetConvexHull1 () const assert(m_iDimension == 1); if (m_iDimension != 1) { - return 0; + return nullptr; } Real* afProjection = WM4_NEW Real[m_iVertexQuantity]; @@ -198,7 +198,7 @@ template bool ConvexHull2::Update (Edge*& rpkHull, int i) { // Locate an edge visible to the input point (if possible). - Edge* pkVisible = 0; + Edge* pkVisible = nullptr; Edge* pkCurrent = rpkHull; do { @@ -277,9 +277,9 @@ ConvexHull2::ConvexHull2 (const char* acFilename) : ConvexHull(0,(Real)0.0,false,Query::QT_REAL) { - m_akVertex = 0; - m_akSVertex = 0; - m_pkQuery = 0; + m_akVertex = nullptr; + m_akSVertex = nullptr; + m_pkQuery = nullptr; bool bLoaded = Load(acFilename); assert(bLoaded); (void)bLoaded; // avoid warning in Release build @@ -392,8 +392,8 @@ ConvexHull2::Edge::Edge (int iV0, int iV1) { V[0] = iV0; V[1] = iV1; - A[0] = 0; - A[1] = 0; + A[0] = nullptr; + A[1] = nullptr; Sign = 0; Time = -1; } @@ -424,12 +424,12 @@ void ConvexHull2::Edge::DeleteSelf () { if (A[0]) { - A[0]->A[1] = 0; + A[0]->A[1] = nullptr; } if (A[1]) { - A[1]->A[0] = 0; + A[1]->A[0] = nullptr; } WM4_DELETE this; diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull3.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull3.cpp index cbd6b94061..ef5940c2c8 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull3.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull3.cpp @@ -31,8 +31,8 @@ ConvexHull3::ConvexHull3 (int iVertexQuantity, Vector3* akVertex, m_akVertex = akVertex; m_akPlaneDirection[0] = Vector3::ZERO; m_akPlaneDirection[1] = Vector3::ZERO; - m_akSVertex = 0; - m_pkQuery = 0; + m_akSVertex = nullptr; + m_pkQuery = nullptr; Mapper3 kMapper(m_iVertexQuantity,m_akVertex,m_fEpsilon); if (kMapper.GetDimension() == 0) @@ -219,7 +219,7 @@ ConvexHull1* ConvexHull3::GetConvexHull1 () const assert(m_iDimension == 1); if (m_iDimension != 1) { - return 0; + return nullptr; } Real* afProjection = WM4_NEW Real[m_iVertexQuantity]; @@ -239,7 +239,7 @@ ConvexHull2* ConvexHull3::GetConvexHull2 () const assert(m_iDimension == 2); if (m_iDimension != 2) { - return 0; + return nullptr; } Vector2* akProjection = WM4_NEW Vector2[m_iVertexQuantity]; @@ -258,7 +258,7 @@ template bool ConvexHull3::Update (int i) { // Locate a triangle visible to the input point (if possible). - Triangle* pkVisible = 0; + Triangle* pkVisible = nullptr; Triangle* pkTri; typename std::set::iterator pkIter; for (pkIter = m_kHull.begin(); pkIter != m_kHull.end(); pkIter++) @@ -404,9 +404,9 @@ ConvexHull3::ConvexHull3 (const char* acFilename) : ConvexHull(0,(Real)0.0,false,Query::QT_REAL) { - m_akVertex = 0; - m_akSVertex = 0; - m_pkQuery = 0; + m_akVertex = nullptr; + m_akSVertex = nullptr; + m_pkQuery = nullptr; bool bLoaded = Load(acFilename); assert(bLoaded); (void)bLoaded; // avoid warning in Release build @@ -532,9 +532,9 @@ ConvexHull3::Triangle::Triangle (int iV0, int iV1, int iV2) V[0] = iV0; V[1] = iV1; V[2] = iV2; - A[0] = 0; - A[1] = 0; - A[2] = 0; + A[0] = nullptr; + A[1] = nullptr; + A[2] = nullptr; Sign = 0; Time = -1; OnStack = false; @@ -566,12 +566,12 @@ template int ConvexHull3::Triangle::DetachFrom (int iAdj, Triangle* pkAdj) { assert(0 <= iAdj && iAdj < 3 && A[iAdj] == pkAdj); - A[iAdj] = 0; + A[iAdj] = nullptr; for (int i = 0; i < 3; i++) { if (pkAdj->A[i] == this) { - pkAdj->A[i] = 0; + pkAdj->A[i] = nullptr; return i; } } diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull3.h b/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull3.h index a5e37cd9ff..1dd4966588 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull3.h +++ b/src/Mod/Mesh/App/WildMagic4/Wm4ConvexHull3.h @@ -104,7 +104,7 @@ private: { public: TerminatorData (int iV0 = -1, int iV1 = -1, int iNullIndex = -1, - Triangle* pkTri = 0) + Triangle* pkTri = nullptr) { V[0] = iV0; V[1] = iV1; diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4DelPolygonEdge.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4DelPolygonEdge.cpp index 4b1e09a824..52626d5e3e 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4DelPolygonEdge.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4DelPolygonEdge.cpp @@ -33,7 +33,7 @@ DelPolygonEdge::DelPolygonEdge (int iV0, int iV1, int iNullIndex, template VEManifoldMesh::EPtr DelPolygonEdge::ECreator (int iV0, int iV1) { - return WM4_NEW DelPolygonEdge(iV0,iV1,0,0); + return WM4_NEW DelPolygonEdge(iV0,iV1,0,nullptr); } //---------------------------------------------------------------------------- diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4DelPolyhedronFace.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4DelPolyhedronFace.cpp index c1ee8f51ec..c4c452a370 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4DelPolyhedronFace.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4DelPolyhedronFace.cpp @@ -34,7 +34,7 @@ template ETManifoldMesh::TPtr DelPolyhedronFace::TCreator (int iV0, int iV1, int iV2) { - return WM4_NEW DelPolyhedronFace(iV0,iV1,iV2,0,0); + return WM4_NEW DelPolyhedronFace(iV0,iV1,iV2,0,nullptr); } //---------------------------------------------------------------------------- diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4DelTetrahedron.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4DelTetrahedron.cpp index 50d1cf5f9e..c134125c8d 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4DelTetrahedron.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4DelTetrahedron.cpp @@ -27,10 +27,10 @@ DelTetrahedron::DelTetrahedron (int iV0, int iV1, int iV2, int iV3) V[1] = iV1; V[2] = iV2; V[3] = iV3; - A[0] = 0; - A[1] = 0; - A[2] = 0; - A[3] = 0; + A[0] = nullptr; + A[1] = nullptr; + A[2] = nullptr; + A[3] = nullptr; Time = -1; IsComponent = false; OnStack = false; @@ -102,12 +102,12 @@ template int DelTetrahedron::DetachFrom (int iAdj, DelTetrahedron* pkAdj) { assert(0 <= iAdj && iAdj < 4 && A[iAdj] == pkAdj); - A[iAdj] = 0; + A[iAdj] = nullptr; for (int i = 0; i < 4; i++) { if (pkAdj->A[i] == this) { - pkAdj->A[i] = 0; + pkAdj->A[i] = nullptr; return i; } } diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4DelTriangle.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4DelTriangle.cpp index e34d91e0c4..23ad6b15c0 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4DelTriangle.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4DelTriangle.cpp @@ -26,9 +26,9 @@ DelTriangle::DelTriangle (int iV0, int iV1, int iV2) V[0] = iV0; V[1] = iV1; V[2] = iV2; - A[0] = 0; - A[1] = 0; - A[2] = 0; + A[0] = nullptr; + A[1] = nullptr; + A[2] = nullptr; Time = -1; IsComponent = false; OnStack = false; @@ -84,7 +84,7 @@ bool DelTriangle::IsInsertionComponent (int i, DelTriangle* pkAdj, { for (j = 0; j < 3; j++) { - if (A[j] != 0 && A[j] != pkAdj) + if (A[j] != nullptr && A[j] != pkAdj) { break; } @@ -105,12 +105,12 @@ template int DelTriangle::DetachFrom (int iAdj, DelTriangle* pkAdj) { assert(0 <= iAdj && iAdj < 3 && A[iAdj] == pkAdj); - A[iAdj] = 0; + A[iAdj] = nullptr; for (int i = 0; i < 3; i++) { if (pkAdj->A[i] == this) { - pkAdj->A[i] = 0; + pkAdj->A[i] = nullptr; return i; } } diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay.cpp index e0237e4453..fafc21a215 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay.cpp @@ -30,8 +30,8 @@ Delaunay::Delaunay (int iVertexQuantity, Real fEpsilon, bool bOwner, m_iVertexQuantity = iVertexQuantity; m_iDimension = 0; m_iSimplexQuantity = 0; - m_aiIndex = 0; - m_aiAdjacent = 0; + m_aiIndex = nullptr; + m_aiAdjacent = nullptr; m_fEpsilon = fEpsilon; m_bOwner = bOwner; } @@ -119,8 +119,8 @@ bool Delaunay::Load (FILE* pkIFile) return true; } - m_aiIndex = 0; - m_aiAdjacent = 0; + m_aiIndex = nullptr; + m_aiAdjacent = nullptr; return m_iDimension == 0; } //---------------------------------------------------------------------------- diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay1.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay1.cpp index 01036584a2..f61b92d08d 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay1.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay1.cpp @@ -210,7 +210,7 @@ Delaunay1::Delaunay1 (const char* acFilename) : Delaunay(0,(Real)0.0,false,Query::QT_REAL) { - m_afVertex = 0; + m_afVertex = nullptr; bool bLoaded = Load(acFilename); assert(bLoaded); (void)bLoaded; // avoid warning in Release build diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay2.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay2.cpp index 2bb599f185..b01ece1af7 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay2.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay2.cpp @@ -38,10 +38,10 @@ Delaunay2::Delaunay2 (int iVertexQuantity, Vector2* akVertex, assert(akVertex); m_akVertex = akVertex; m_iUniqueVertexQuantity = 0; - m_akSVertex = 0; - m_pkQuery = 0; + m_akSVertex = nullptr; + m_pkQuery = nullptr; m_iPathLast = -1; - m_aiPath = 0; + m_aiPath = nullptr; m_iLastEdgeV0 = -1; m_iLastEdgeV1 = -1; m_iLastEdgeOpposite = -1; @@ -184,7 +184,7 @@ Delaunay2::Delaunay2 (int iVertexQuantity, Vector2* akVertex, pkTri = *pkTIter; kPermute[pkTri] = i++; } - kPermute[0] = -1; + kPermute[nullptr] = -1; // Put Delaunay triangles into an array (vertices and adjacency info). m_iSimplexQuantity = (int)m_kTriangle.size(); @@ -263,7 +263,7 @@ Delaunay1* Delaunay2::GetDelaunay1 () const assert(m_iDimension == 1); if (m_iDimension != 1) { - return 0; + return nullptr; } Real* afProjection = WM4_NEW Real[m_iVertexQuantity]; @@ -287,7 +287,7 @@ bool Delaunay2::GetHull (int& riEQuantity, int*& raiIndex) } riEQuantity = 0; - raiIndex = 0; + raiIndex = nullptr; // Count the number of edges that are not shared by two triangles. int i, iAdjQuantity = 3*m_iSimplexQuantity; @@ -510,7 +510,7 @@ void Delaunay2::Update (int i) // Locate and remove the triangles forming the insertion polygon. std::stack*> kStack; - VEManifoldMesh kPolygon(0,DelPolygonEdge::ECreator); + VEManifoldMesh kPolygon(nullptr,DelPolygonEdge::ECreator); kStack.push(pkTri); pkTri->OnStack = true; int j, iV0, iV1; @@ -567,7 +567,7 @@ void Delaunay2::Update (int i) pkEdge = (DelPolygonEdge*)kPolygon.InsertEdge( iV0,iV1); pkEdge->NullIndex = -1; - pkEdge->Tri = 0; + pkEdge->Tri = nullptr; } } } @@ -661,7 +661,7 @@ DelTriangle* Delaunay2::GetContainingTriangle (int i) const } assert(false); - return 0; + return nullptr; } //---------------------------------------------------------------------------- template @@ -700,7 +700,7 @@ void Delaunay2::RemoveTriangles () { if (pkAdj->A[k] == pkTri) { - pkAdj->A[k] = 0; + pkAdj->A[k] = nullptr; break; } } @@ -729,10 +729,10 @@ Delaunay2::Delaunay2 (const char* acFilename) : Delaunay(0,(Real)0.0,false,Query::QT_REAL) { - m_akVertex = 0; - m_akSVertex = 0; - m_pkQuery = 0; - m_aiPath = 0; + m_akVertex = nullptr; + m_akSVertex = nullptr; + m_pkQuery = nullptr; + m_aiPath = nullptr; bool bLoaded = Load(acFilename); assert(bLoaded); (void)bLoaded; // avoid warning in Release build diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay3.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay3.cpp index 0d7f779faa..ed0506c754 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay3.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4Delaunay3.cpp @@ -49,10 +49,10 @@ Delaunay3::Delaunay3 (int iVertexQuantity, Vector3* akVertex, m_iUniqueVertexQuantity = 0; m_akPlaneDirection[0] = Vector3::ZERO; m_akPlaneDirection[1] = Vector3::ZERO; - m_akSVertex = 0; - m_pkQuery = 0; + m_akSVertex = nullptr; + m_pkQuery = nullptr; m_iPathLast = -1; - m_aiPath = 0; + m_aiPath = nullptr; m_iLastFaceV0 = -1; m_iLastFaceV1 = -1; m_iLastFaceV2 = -1; @@ -215,7 +215,7 @@ Delaunay3::Delaunay3 (int iVertexQuantity, Vector3* akVertex, pkTetra = *pkTIter; kPermute[pkTetra] = i++; } - kPermute[0] = -1; + kPermute[nullptr] = -1; // Put Delaunay tetrahedra into an array (vertices and adjacency info). m_iSimplexQuantity = (int)m_kTetrahedron.size(); @@ -296,7 +296,7 @@ Delaunay1* Delaunay3::GetDelaunay1 () const assert(m_iDimension == 1); if (m_iDimension != 1) { - return 0; + return nullptr; } Real* afProjection = WM4_NEW Real[m_iVertexQuantity]; @@ -329,7 +329,7 @@ Delaunay2* Delaunay3::GetDelaunay2 () const assert(m_iDimension == 2); if (m_iDimension != 2) { - return 0; + return nullptr; } Vector2* akProjection = WM4_NEW Vector2[m_iVertexQuantity]; @@ -354,7 +354,7 @@ bool Delaunay3::GetHull (int& riTQuantity, int*& raiIndex) const } riTQuantity = 0; - raiIndex = 0; + raiIndex = nullptr; // Count the number of triangles that are not shared by two tetrahedra. int i, iAdjQuantity = 4*m_iSimplexQuantity; @@ -618,7 +618,7 @@ void Delaunay3::Update (int i) // Locate and remove the tetrahedra forming the insertion polyhedron. std::stack*> kStack; - ETManifoldMesh kPolyhedron(0,DelPolyhedronFace::TCreator); + ETManifoldMesh kPolyhedron(nullptr,DelPolyhedronFace::TCreator); kStack.push(pkTetra); pkTetra->OnStack = true; int j, iV0, iV1, iV2; @@ -681,7 +681,7 @@ void Delaunay3::Update (int i) pkFace = (DelPolyhedronFace*) kPolyhedron.InsertTriangle(iV0,iV1,iV2); pkFace->NullIndex = -1; - pkFace->Tetra = 0; + pkFace->Tetra = nullptr; } } } @@ -799,7 +799,7 @@ DelTetrahedron* Delaunay3::GetContainingTetrahedron (int i) const } assert(false); - return 0; + return nullptr; } //---------------------------------------------------------------------------- template @@ -838,7 +838,7 @@ void Delaunay3::RemoveTetrahedra () { if (pkAdj->A[k] == pkTetra) { - pkAdj->A[k] = 0; + pkAdj->A[k] = nullptr; break; } } @@ -949,10 +949,10 @@ Delaunay3::Delaunay3 (const char* acFilename) : Delaunay(0,(Real)0.0,false,Query::QT_REAL) { - m_akVertex = 0; - m_akSVertex = 0; - m_pkQuery = 0; - m_aiPath = 0; + m_akVertex = nullptr; + m_akSVertex = nullptr; + m_pkQuery = nullptr; + m_aiPath = nullptr; bool bLoaded = Load(acFilename); assert(bLoaded); (void)bLoaded; // avoid warning in Release build diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4ETManifoldMesh.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4ETManifoldMesh.cpp index 1baf318a7c..1f630adca7 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4ETManifoldMesh.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4ETManifoldMesh.cpp @@ -59,7 +59,7 @@ ETManifoldMesh::TPtr ETManifoldMesh::InsertTriangle (int iV0, int iV1, if (pkTIter != m_kTMap.end()) { // triangle already exists - return 0; + return nullptr; } // add new triangle @@ -92,7 +92,7 @@ ETManifoldMesh::TPtr ETManifoldMesh::InsertTriangle (int iV0, int iV1, if (pkEdge->T[1]) { assert(false); // mesh must be manifold - return 0; + return nullptr; } pkEdge->T[1] = pkTriangle; @@ -137,11 +137,11 @@ bool ETManifoldMesh::RemoveTriangle (int iV0, int iV1, int iV2) { // one-triangle edges always have pointer in slot zero pkEdge->T[0] = pkEdge->T[1]; - pkEdge->T[1] = 0; + pkEdge->T[1] = nullptr; } else if (pkEdge->T[1] == pkTriangle) { - pkEdge->T[1] = 0; + pkEdge->T[1] = nullptr; } else { @@ -165,7 +165,7 @@ bool ETManifoldMesh::RemoveTriangle (int iV0, int iV1, int iV2) { if (pkAdjacent->T[j] == pkTriangle) { - pkAdjacent->T[j] = 0; + pkAdjacent->T[j] = nullptr; break; } } @@ -201,7 +201,7 @@ void ETManifoldMesh::Print (const char* acFilename) // assign unique indices to the edges std::map kEIndex; - kEIndex[0] = 0; + kEIndex[nullptr] = 0; int i = 1; EMapIterator pkEIter; for (pkEIter = m_kEMap.begin(); pkEIter != m_kEMap.end(); pkEIter++) @@ -214,7 +214,7 @@ void ETManifoldMesh::Print (const char* acFilename) // assign unique indices to the triangles std::map kTIndex; - kTIndex[0] = 0; + kTIndex[nullptr] = 0; i = 1; TMapIterator pkTIter; for (pkTIter = m_kTMap.begin(); pkTIter != m_kTMap.end(); pkTIter++) @@ -328,8 +328,8 @@ ETManifoldMesh::Edge::Edge (int iV0, int iV1) { V[0] = iV0; V[1] = iV1; - T[0] = 0; - T[1] = 0; + T[0] = nullptr; + T[1] = nullptr; } //---------------------------------------------------------------------------- ETManifoldMesh::Edge::~Edge () @@ -348,8 +348,8 @@ ETManifoldMesh::Triangle::Triangle (int iV0, int iV1, int iV2) for (int i = 0; i < 3; i++) { - E[i] = 0; - T[i] = 0; + E[i] = nullptr; + T[i] = nullptr; } } //---------------------------------------------------------------------------- diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4ETManifoldMesh.h b/src/Mod/Mesh/App/WildMagic4/Wm4ETManifoldMesh.h index 041170b360..1d0ff3ddd0 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4ETManifoldMesh.h +++ b/src/Mod/Mesh/App/WildMagic4/Wm4ETManifoldMesh.h @@ -81,7 +81,7 @@ public: // construction and destruction - ETManifoldMesh (ECreator oECreator = 0, TCreator oTCreator = 0); + ETManifoldMesh (ECreator oECreator = nullptr, TCreator oTCreator = nullptr); virtual ~ETManifoldMesh (); // member access diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4GMatrix.inl b/src/Mod/Mesh/App/WildMagic4/Wm4GMatrix.inl index 9e976b0172..896b440575 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4GMatrix.inl +++ b/src/Mod/Mesh/App/WildMagic4/Wm4GMatrix.inl @@ -20,16 +20,16 @@ namespace Wm4 template GMatrix::GMatrix (int iRows, int iCols) { - m_afData = 0; - m_aafEntry = 0; + m_afData = nullptr; + m_aafEntry = nullptr; SetSize(iRows,iCols); } //---------------------------------------------------------------------------- template GMatrix::GMatrix (int iRows, int iCols, const Real* afEntry) { - m_afData = 0; - m_aafEntry = 0; + m_afData = nullptr; + m_aafEntry = nullptr; SetMatrix(iRows,iCols,afEntry); } //---------------------------------------------------------------------------- @@ -47,8 +47,8 @@ GMatrix::GMatrix (const GMatrix& rkM) m_iRows = 0; m_iCols = 0; m_iQuantity = 0; - m_afData = 0; - m_aafEntry = 0; + m_afData = nullptr; + m_aafEntry = nullptr; *this = rkM; } //---------------------------------------------------------------------------- @@ -99,8 +99,8 @@ void GMatrix::SetSize (int iRows, int iCols) m_iRows = 0; m_iCols = 0; m_iQuantity = 0; - m_afData = 0; - m_aafEntry = 0; + m_afData = nullptr; + m_aafEntry = nullptr; } } //---------------------------------------------------------------------------- @@ -239,8 +239,8 @@ void GMatrix::SetMatrix (int iRows, int iCols, const Real* afData) m_iRows = 0; m_iCols = 0; m_iQuantity = 0; - m_afData = 0; - m_aafEntry = 0; + m_afData = nullptr; + m_aafEntry = nullptr; } } //---------------------------------------------------------------------------- @@ -311,8 +311,8 @@ GMatrix& GMatrix::operator= (const GMatrix& rkM) m_iRows = 0; m_iCols = 0; m_iQuantity = 0; - m_afData = 0; - m_aafEntry = 0; + m_afData = nullptr; + m_aafEntry = nullptr; } return *this; } diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4GVector.inl b/src/Mod/Mesh/App/WildMagic4/Wm4GVector.inl index 8b89b910b6..9cb24ee614 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4GVector.inl +++ b/src/Mod/Mesh/App/WildMagic4/Wm4GVector.inl @@ -29,7 +29,7 @@ GVector::GVector (int iSize) else { m_iSize = 0; - m_afTuple = 0; + m_afTuple = nullptr; } } //---------------------------------------------------------------------------- @@ -62,7 +62,7 @@ GVector::GVector (const GVector& rkV) } else { - m_afTuple = 0; + m_afTuple = nullptr; } } //---------------------------------------------------------------------------- diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4MeshSmoother.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4MeshSmoother.cpp index 009a68bcc3..9dcb32632a 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4MeshSmoother.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4MeshSmoother.cpp @@ -24,23 +24,23 @@ template MeshSmoother::MeshSmoother () { m_iVQuantity = 0; - m_akVertex = 0; + m_akVertex = nullptr; m_iTQuantity = 0; - m_aiIndex = 0; - m_akNormal = 0; - m_akMean = 0; - m_aiNeighborCount = 0; + m_aiIndex = nullptr; + m_akNormal = nullptr; + m_akMean = nullptr; + m_aiNeighborCount = nullptr; } //---------------------------------------------------------------------------- template MeshSmoother::MeshSmoother (int iVQuantity, Vector3* akVertex, int iTQuantity, const int* aiIndex) { - m_akVertex = 0; - m_akNormal = 0; - m_aiIndex = 0; - m_akMean = 0; - m_aiNeighborCount = 0; + m_akVertex = nullptr; + m_akNormal = nullptr; + m_aiIndex = nullptr; + m_akMean = nullptr; + m_aiNeighborCount = nullptr; Create(iVQuantity,akVertex,iTQuantity,aiIndex); } diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4Platforms.h b/src/Mod/Mesh/App/WildMagic4/Wm4Platforms.h index 3319684374..19ee26d10a 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4Platforms.h +++ b/src/Mod/Mesh/App/WildMagic4/Wm4Platforms.h @@ -124,7 +124,7 @@ typedef int64_t Integer64; //---------------------------------------------------------------------------- #else -#include +#include typedef int64_t Integer64; #endif diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4Polynomial1.inl b/src/Mod/Mesh/App/WildMagic4/Wm4Polynomial1.inl index 9b11f9eb8c..3509aba759 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4Polynomial1.inl +++ b/src/Mod/Mesh/App/WildMagic4/Wm4Polynomial1.inl @@ -29,7 +29,7 @@ Polynomial1::Polynomial1 (int iDegree) { // default creation m_iDegree = -1; - m_afCoeff = 0; + m_afCoeff = nullptr; } } //---------------------------------------------------------------------------- @@ -62,7 +62,7 @@ void Polynomial1::SetDegree (int iDegree) } else { - m_afCoeff = 0; + m_afCoeff = nullptr; } } //---------------------------------------------------------------------------- diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4System.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4System.cpp index 0f5fd76c5f..00e821e8fb 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4System.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4System.cpp @@ -40,7 +40,7 @@ static bool gs_bInitializedTime = false; char System::ms_acPath[SYSTEM_MAX_PATH]; char System::ms_acEnvVar[SYSTEM_MAX_ENVVAR]; -std::vector* System::ms_pkDirectories = 0; +std::vector* System::ms_pkDirectories = nullptr; char System::WM4_PATH[SYSTEM_MAX_ENVVAR]; //---------------------------------------------------------------------------- @@ -107,11 +107,11 @@ double System::GetTime () if (!gs_bInitializedTime) { gs_bInitializedTime = true; - gettimeofday(&gs_kInitial, 0); + gettimeofday(&gs_kInitial, nullptr); } struct timeval kCurrent; - gettimeofday(&kCurrent,0); + gettimeofday(&kCurrent,nullptr); struct timeval kDelta; timersub(&kCurrent,&gs_kInitial,&kDelta); @@ -149,7 +149,7 @@ bool System::Load (const char* acFilename, char*& racBuffer, int& riSize) if (stat(acFilename,&kStat) != 0) { // file does not exist - racBuffer = 0; + racBuffer = nullptr; riSize = 0; return false; } @@ -158,7 +158,7 @@ bool System::Load (const char* acFilename, char*& racBuffer, int& riSize) assert(pkFile); if (!pkFile) { - racBuffer = 0; + racBuffer = nullptr; riSize = 0; return false; } @@ -170,7 +170,7 @@ bool System::Load (const char* acFilename, char*& racBuffer, int& riSize) { assert(false); WM4_DELETE[] racBuffer; - racBuffer = 0; + racBuffer = nullptr; riSize = 0; return false; } @@ -627,12 +627,12 @@ const char* System::GetPath (const char* acDirectory, const char* acFilename) System::Strcat(ms_acPath,SYSTEM_MAX_PATH,acFilename); return ms_acPath; } - return 0; + return nullptr; } //---------------------------------------------------------------------------- void System::Initialize () { - assert(ms_pkDirectories == 0); + assert(ms_pkDirectories == nullptr); ms_pkDirectories = WM4_NEW std::vector; const char* acWm4Path = GetEnv("WM4_PATH"); @@ -649,7 +649,7 @@ void System::Initialize () void System::Terminate () { WM4_DELETE ms_pkDirectories; - ms_pkDirectories = 0; + ms_pkDirectories = nullptr; } //---------------------------------------------------------------------------- int System::GetDirectoryQuantity () @@ -673,7 +673,7 @@ const char* System::GetDirectory (int i) { return (*ms_pkDirectories)[i].c_str(); } - return 0; + return nullptr; } //---------------------------------------------------------------------------- bool System::InsertDirectory (const char* acDirectory) @@ -738,7 +738,7 @@ const char* System::GetPath (const char* acFilename, int eMode) (*ms_pkDirectories)[i].c_str(),acFilename); if (!acDecorated) { - return 0; + return nullptr; } FILE* pkFile; @@ -761,7 +761,7 @@ const char* System::GetPath (const char* acFilename, int eMode) return acDecorated; } } - return 0; + return nullptr; } //---------------------------------------------------------------------------- unsigned int System::MakeRGB (unsigned char ucR, unsigned char ucG, @@ -839,9 +839,9 @@ const char* System::GetEnv (const char* acEnvVarName) getenv_s(&uiRequiredSize,ms_acEnvVar,SYSTEM_MAX_ENVVAR,acEnvVarName); #else char* acEnvVar = getenv(acEnvVarName); - if (acEnvVar == 0) + if (acEnvVar == nullptr) { - return 0; + return nullptr; } System::Strcpy(ms_acEnvVar,SYSTEM_MAX_ENVVAR,getenv(acEnvVarName)); #endif @@ -865,7 +865,7 @@ void* System::Memcpy (void* pvDst, size_t uiDstSize, const void* pvSrc, if (!pvDst || uiDstSize == 0 || !pvSrc || uiSrcSize == 0) { // Be consistent with the behavior of memcpy_s. - return 0; + return nullptr; } if (uiSrcSize > uiDstSize) @@ -873,7 +873,7 @@ void* System::Memcpy (void* pvDst, size_t uiDstSize, const void* pvSrc, // The source memory is too large to copy to the destination. To // be consistent with memcpy_s, return null as an indication that the // copy failed. - return 0; + return nullptr; } memcpy(pvDst,pvSrc,uiSrcSize); return pvDst; @@ -916,7 +916,7 @@ char* System::Strcpy (char* acDst, size_t uiDstSize, const char* acSrc) if (!acDst || uiDstSize == 0 || !acSrc) { // Be consistent with the behavior of strcpy_s. - return 0; + return nullptr; } size_t uiSrcLen = strlen(acSrc); @@ -925,7 +925,7 @@ char* System::Strcpy (char* acDst, size_t uiDstSize, const char* acSrc) // The source string is too large to copy to the destination. To // be consistent with strcpy_s, return null as an indication that the // copy failed. - return 0; + return nullptr; } strncpy(acDst,acSrc,uiSrcLen); acDst[uiSrcLen] = 0; @@ -949,7 +949,7 @@ char* System::Strcat (char* acDst, size_t uiDstSize, const char* acSrc) if (!acDst || uiDstSize == 0 || !acSrc) { // Be consistent with the behavior of strcat_s. - return 0; + return nullptr; } size_t uiSrcLen = strlen(acSrc); @@ -960,7 +960,7 @@ char* System::Strcat (char* acDst, size_t uiDstSize, const char* acSrc) // The source string is too large to append to the destination. To // be consistent with strcat_s, return null as an indication that // the concatenation failed. - return 0; + return nullptr; } strncat(acDst,acSrc,uiSrcLen); acDst[uiSumLen] = 0; @@ -985,7 +985,7 @@ char* System::Strncpy (char* acDst, size_t uiDstSize, const char* acSrc, if (!acDst || uiDstSize == 0 || !acSrc || uiSrcSize == 0) { // Be consistent with the behavior of strncpy_s. - return 0; + return nullptr; } if (uiSrcSize + 1 > uiDstSize) @@ -993,7 +993,7 @@ char* System::Strncpy (char* acDst, size_t uiDstSize, const char* acSrc, // The source string is too large to copy to the destination. To // be consistent with strncpy_s, return null as an indication that // the copy failed. - return 0; + return nullptr; } strncpy(acDst,acSrc,uiSrcSize); return acDst; diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4System.inl b/src/Mod/Mesh/App/WildMagic4/Wm4System.inl index 1e79d597ed..d0c84501a8 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4System.inl +++ b/src/Mod/Mesh/App/WildMagic4/Wm4System.inl @@ -36,7 +36,7 @@ void Deallocate (T**& raatArray) { WM4_DELETE[] raatArray[0]; WM4_DELETE[] raatArray; - raatArray = 0; + raatArray = nullptr; } } //---------------------------------------------------------------------------- diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4TriangulateEC.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4TriangulateEC.cpp index d7ef489682..1aae4bcc04 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4TriangulateEC.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4TriangulateEC.cpp @@ -33,7 +33,7 @@ TriangulateEC::TriangulateEC (const Positions& rkPositions, // Triangulate the unindexed polygon. int iVQuantity = (int)rkPositions.size(); - const int* aiIndex = 0; + const int* aiIndex = nullptr; InitializeVertices(iVQuantity,aiIndex,rkTriangles); DoEarClipping(iVQuantity,aiIndex,rkTriangles); } @@ -984,7 +984,7 @@ void TriangulateEC::Delete (Tree*& rpkRoot) WM4_DELETE pkTree; } - rpkRoot = 0; + rpkRoot = nullptr; } } //---------------------------------------------------------------------------- diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4VEManifoldMesh.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4VEManifoldMesh.cpp index 0ddd7bfcf9..3d67a177aa 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4VEManifoldMesh.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4VEManifoldMesh.cpp @@ -57,7 +57,7 @@ VEManifoldMesh::EPtr VEManifoldMesh::InsertEdge (int iV0, int iV1) if (pkEIter != m_kEMap.end()) { // edge already exists - return 0; + return nullptr; } // add new edge @@ -89,7 +89,7 @@ VEManifoldMesh::EPtr VEManifoldMesh::InsertEdge (int iV0, int iV1) if (pkVertex->E[1]) { assert(false); // mesh must be manifold - return 0; + return nullptr; } pkVertex->E[1] = pkEdge; @@ -135,11 +135,11 @@ bool VEManifoldMesh::RemoveEdge (int iV0, int iV1) { // one-edge vertices always have pointer in slot zero pkVertex->E[0] = pkVertex->E[1]; - pkVertex->E[1] = 0; + pkVertex->E[1] = nullptr; } else if (pkVertex->E[1] == pkEdge) { - pkVertex->E[1] = 0; + pkVertex->E[1] = nullptr; } else { @@ -162,7 +162,7 @@ bool VEManifoldMesh::RemoveEdge (int iV0, int iV1) { if (pkAdjacent->E[j] == pkEdge) { - pkAdjacent->E[j] = 0; + pkAdjacent->E[j] = nullptr; break; } } @@ -198,7 +198,7 @@ void VEManifoldMesh::Print (const char* acFilename) // assign unique indices to the edges std::map kEIndex; - kEIndex[0] = 0; + kEIndex[nullptr] = 0; int i = 1; EMapIterator pkEIter; for (pkEIter = m_kEMap.begin(); pkEIter != m_kEMap.end(); pkEIter++) @@ -272,8 +272,8 @@ void VEManifoldMesh::Print (const char* acFilename) VEManifoldMesh::Vertex::Vertex (int iV) { V = iV; - E[0] = 0; - E[1] = 0; + E[0] = nullptr; + E[1] = nullptr; } //---------------------------------------------------------------------------- VEManifoldMesh::Vertex::~Vertex () @@ -288,8 +288,8 @@ VEManifoldMesh::Edge::Edge (int iV0, int iV1) { V[0] = iV0; V[1] = iV1; - E[0] = 0; - E[1] = 0; + E[0] = nullptr; + E[1] = nullptr; } //---------------------------------------------------------------------------- VEManifoldMesh::Edge::~Edge () diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4VEManifoldMesh.h b/src/Mod/Mesh/App/WildMagic4/Wm4VEManifoldMesh.h index 17fa6fecea..4618f8267a 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4VEManifoldMesh.h +++ b/src/Mod/Mesh/App/WildMagic4/Wm4VEManifoldMesh.h @@ -73,7 +73,7 @@ public: // construction and destruction - VEManifoldMesh (VCreator oVCreator = 0, ECreator oECreator = 0); + VEManifoldMesh (VCreator oVCreator = nullptr, ECreator oECreator = nullptr); virtual ~VEManifoldMesh (); // member access diff --git a/src/Mod/Mesh/Gui/AppMeshGui.cpp b/src/Mod/Mesh/Gui/AppMeshGui.cpp index 76d7d46064..dbd8f721fa 100644 --- a/src/Mod/Mesh/Gui/AppMeshGui.cpp +++ b/src/Mod/Mesh/Gui/AppMeshGui.cpp @@ -61,7 +61,7 @@ // use a different name to CreateCommand() -void CreateMeshCommands(void); +void CreateMeshCommands(); void loadMeshResource() { @@ -127,7 +127,7 @@ PyMOD_INIT_FUNC(MeshGui) { if (!Gui::Application::Instance) { PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application."); - PyMOD_Return(0); + PyMOD_Return(nullptr); } // load dependent module @@ -136,7 +136,7 @@ PyMOD_INIT_FUNC(MeshGui) } catch(const Base::Exception& e) { PyErr_SetString(PyExc_ImportError, e.what()); - PyMOD_Return(0); + PyMOD_Return(nullptr); } PyObject* mod = MeshGui::initModule(); Base::Console().Log("Loading GUI of Mesh module... done\n"); diff --git a/src/Mod/Mesh/Gui/Command.cpp b/src/Mod/Mesh/Gui/Command.cpp index 52f078b099..9bbd35519a 100644 --- a/src/Mod/Mesh/Gui/Command.cpp +++ b/src/Mod/Mesh/Gui/Command.cpp @@ -282,7 +282,7 @@ void CmdMeshUnion::activated(int) } } -bool CmdMeshUnion::isActive(void) +bool CmdMeshUnion::isActive() { return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 2; } @@ -353,7 +353,7 @@ void CmdMeshDifference::activated(int) } } -bool CmdMeshDifference::isActive(void) +bool CmdMeshDifference::isActive() { return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 2; } @@ -424,7 +424,7 @@ void CmdMeshIntersection::activated(int) } } -bool CmdMeshIntersection::isActive(void) +bool CmdMeshIntersection::isActive() { return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 2; } @@ -475,7 +475,7 @@ void CmdMeshImport::activated(int) } } -bool CmdMeshImport::isActive(void) +bool CmdMeshImport::isActive() { return (getActiveGuiDocument() ? true : false); } @@ -550,7 +550,7 @@ void CmdMeshExport::activated(int) } } -bool CmdMeshExport::isActive(void) +bool CmdMeshExport::isActive() { return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 1; } @@ -605,7 +605,7 @@ void CmdMeshFromGeometry::activated(int) } } -bool CmdMeshFromGeometry::isActive(void) +bool CmdMeshFromGeometry::isActive() { App::Document* doc = App::GetApplication().getActiveDocument(); if (!doc) return false; @@ -634,7 +634,7 @@ void CmdMeshFromPartShape::activated(int) doCommand(Doc,"import MeshPartGui, FreeCADGui\nFreeCADGui.runCommand('MeshPart_Mesher')\n"); } -bool CmdMeshFromPartShape::isActive(void) +bool CmdMeshFromPartShape::isActive() { return (hasActiveDocument() && !Gui::Control().activeDialog()); } @@ -676,7 +676,7 @@ void CmdMeshVertexCurvature::activated(int) updateActive(); } -bool CmdMeshVertexCurvature::isActive(void) +bool CmdMeshVertexCurvature::isActive() { // Check for the selected mesh feature (all Mesh types) return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) > 0; @@ -713,7 +713,7 @@ void CmdMeshVertexCurvatureInfo::activated(int) } } -bool CmdMeshVertexCurvatureInfo::isActive(void) +bool CmdMeshVertexCurvatureInfo::isActive() { App::Document* doc = App::GetApplication().getActiveDocument(); if (!doc || doc->countObjectsOfType(Mesh::Curvature::getClassTypeId()) == 0) @@ -769,7 +769,7 @@ void CmdMeshPolySegm::activated(int) } } -bool CmdMeshPolySegm::isActive(void) +bool CmdMeshPolySegm::isActive() { // Check for the selected mesh feature (all Mesh types) if (getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0) @@ -869,7 +869,7 @@ void CmdMeshAddFacet::activated(int) } } -bool CmdMeshAddFacet::isActive(void) +bool CmdMeshAddFacet::isActive() { // Check for the selected mesh feature (all Mesh types) if (getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) != 1) @@ -930,7 +930,7 @@ void CmdMeshPolyCut::activated(int) } } -bool CmdMeshPolyCut::isActive(void) +bool CmdMeshPolyCut::isActive() { // Check for the selected mesh feature (all Mesh types) if (getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0) @@ -991,7 +991,7 @@ void CmdMeshPolyTrim::activated(int) } } -bool CmdMeshPolyTrim::isActive(void) +bool CmdMeshPolyTrim::isActive() { // Check for the selected mesh feature (all Mesh types) if (getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0) @@ -1055,7 +1055,7 @@ void CmdMeshSectionByPlane::activated(int) doCommand(Doc,"import MeshPartGui, FreeCADGui\nFreeCADGui.runCommand('MeshPart_SectionByPlane')\n"); } -bool CmdMeshSectionByPlane::isActive(void) +bool CmdMeshSectionByPlane::isActive() { // Check for the selected mesh feature (all Mesh types) if (getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) != 1) @@ -1129,7 +1129,7 @@ void CmdMeshPolySplit::activated(int) } } -bool CmdMeshPolySplit::isActive(void) +bool CmdMeshPolySplit::isActive() { // Check for the selected mesh feature (all Mesh types) if (getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0) @@ -1179,7 +1179,7 @@ void CmdMeshEvaluation::activated(int) dlg->show(); } -bool CmdMeshEvaluation::isActive(void) +bool CmdMeshEvaluation::isActive() { App::Document* doc = App::GetApplication().getActiveDocument(); if (!doc || doc->countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0) @@ -1215,7 +1215,7 @@ void CmdMeshEvaluateFacet::activated(int) } } -bool CmdMeshEvaluateFacet::isActive(void) +bool CmdMeshEvaluateFacet::isActive() { App::Document* doc = App::GetApplication().getActiveDocument(); if (!doc || doc->countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0) @@ -1256,7 +1256,7 @@ void CmdMeshRemoveComponents::activated(int) Gui::Control().showDialog(dlg); } -bool CmdMeshRemoveComponents::isActive(void) +bool CmdMeshRemoveComponents::isActive() { // Check for the selected mesh feature (all Mesh types) App::Document* doc = getDocument(); @@ -1303,7 +1303,7 @@ void CmdMeshRemeshGmsh::activated(int) Gui::Control().showDialog(dlg); } -bool CmdMeshRemeshGmsh::isActive(void) +bool CmdMeshRemeshGmsh::isActive() { return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 1; } @@ -1337,7 +1337,7 @@ void CmdMeshRemoveCompByHand::activated(int) } } -bool CmdMeshRemoveCompByHand::isActive(void) +bool CmdMeshRemoveCompByHand::isActive() { App::Document* doc = App::GetApplication().getActiveDocument(); if (!doc || doc->countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0) @@ -1384,7 +1384,7 @@ void CmdMeshEvaluateSolid::activated(int) } } -bool CmdMeshEvaluateSolid::isActive(void) +bool CmdMeshEvaluateSolid::isActive() { // Check for the selected mesh feature (all Mesh types) return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 1; @@ -1443,7 +1443,7 @@ void CmdMeshSmoothing::activated(int) #endif } -bool CmdMeshSmoothing::isActive(void) +bool CmdMeshSmoothing::isActive() { #if 1 if (Gui::Control().activeDialog()) @@ -1474,7 +1474,7 @@ void CmdMeshDecimating::activated(int) Gui::Control().showDialog(new MeshGui::TaskDecimating()); } -bool CmdMeshDecimating::isActive(void) +bool CmdMeshDecimating::isActive() { #if 1 if (Gui::Control().activeDialog()) @@ -1512,7 +1512,7 @@ void CmdMeshHarmonizeNormals::activated(int) updateActive(); } -bool CmdMeshHarmonizeNormals::isActive(void) +bool CmdMeshHarmonizeNormals::isActive() { // Check for the selected mesh feature (all Mesh types) return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) > 0; @@ -1546,7 +1546,7 @@ void CmdMeshFlipNormals::activated(int) updateActive(); } -bool CmdMeshFlipNormals::isActive(void) +bool CmdMeshFlipNormals::isActive() { // Check for the selected mesh feature (all Mesh types) return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) > 0; @@ -1588,7 +1588,7 @@ void CmdMeshBoundingBox::activated(int) } } -bool CmdMeshBoundingBox::isActive(void) +bool CmdMeshBoundingBox::isActive() { // Check for the selected mesh feature (all Mesh types) return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 1; @@ -1612,14 +1612,14 @@ CmdMeshBuildRegularSolid::CmdMeshBuildRegularSolid() void CmdMeshBuildRegularSolid::activated(int) { - static QPointer dlg = 0; + static QPointer dlg = nullptr; if (!dlg) dlg = new MeshGui::DlgRegularSolidImp(Gui::getMainWindow()); dlg->setAttribute(Qt::WA_DeleteOnClose); dlg->show(); } -bool CmdMeshBuildRegularSolid::isActive(void) +bool CmdMeshBuildRegularSolid::isActive() { // Check for the selected mesh feature (all Mesh types) return hasActiveDocument(); @@ -1657,7 +1657,7 @@ void CmdMeshFillupHoles::activated(int) updateActive(); } -bool CmdMeshFillupHoles::isActive(void) +bool CmdMeshFillupHoles::isActive() { // Check for the selected mesh feature (all Mesh types) return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) > 0; @@ -1692,7 +1692,7 @@ void CmdMeshFillInteractiveHole::activated(int) } } -bool CmdMeshFillInteractiveHole::isActive(void) +bool CmdMeshFillInteractiveHole::isActive() { App::Document* doc = App::GetApplication().getActiveDocument(); if (!doc || doc->countObjectsOfType(Mesh::Feature::getClassTypeId()) == 0) @@ -1733,7 +1733,7 @@ void CmdMeshSegmentation::activated(int) Gui::Control().showDialog(dlg); } -bool CmdMeshSegmentation::isActive(void) +bool CmdMeshSegmentation::isActive() { if (Gui::Control().activeDialog()) return false; @@ -1769,7 +1769,7 @@ void CmdMeshSegmentationBestFit::activated(int) Gui::Control().showDialog(dlg); } -bool CmdMeshSegmentationBestFit::isActive(void) +bool CmdMeshSegmentationBestFit::isActive() { if (Gui::Control().activeDialog()) return false; @@ -1815,7 +1815,7 @@ void CmdMeshMerge::activated(int) commitCommand(); } -bool CmdMeshMerge::isActive(void) +bool CmdMeshMerge::isActive() { return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) >= 2; } @@ -1861,7 +1861,7 @@ void CmdMeshSplitComponents::activated(int) commitCommand(); } -bool CmdMeshSplitComponents::isActive(void) +bool CmdMeshSplitComponents::isActive() { return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) == 1; } @@ -1909,13 +1909,13 @@ void CmdMeshScale::activated(int) commitCommand(); } -bool CmdMeshScale::isActive(void) +bool CmdMeshScale::isActive() { return getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) > 0; } -void CreateMeshCommands(void) +void CreateMeshCommands() { Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager(); //rcCmdMgr.addCommand(new CmdMeshDemolding()); diff --git a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp index cdac9bd8e1..49a86ff3d1 100644 --- a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp +++ b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp @@ -73,8 +73,8 @@ class DlgEvaluateMeshImp::Private { public: Private() - : meshFeature(0) - , view(0) + : meshFeature(nullptr) + , view(nullptr) , enableFoldsCheck(false) , checkNonManfoldPoints(false) , strictlyDegenerated(true) @@ -213,7 +213,7 @@ void DlgEvaluateMeshImp::slotDeletedObject(const App::DocumentObject& Obj) // is it the current mesh object then clear everything if (&Obj == d->meshFeature) { removeViewProviders(); - d->meshFeature = 0; + d->meshFeature = nullptr; d->ui.meshNameButton->setCurrentIndex(0); cleanInformation(); d->self_intersections.clear(); @@ -253,7 +253,7 @@ void DlgEvaluateMeshImp::slotDeletedDocument(const App::Document& Doc) // try to attach to the active document this->detachDocument(); - d->view = 0; + d->view = nullptr; on_refreshButton_clicked(); } } @@ -316,7 +316,7 @@ void DlgEvaluateMeshImp::on_meshNameButton_activated(int i) { QString item = d->ui.meshNameButton->itemData(i).toString(); - d->meshFeature = 0; + d->meshFeature = nullptr; std::vector objs = getDocument()->getObjectsOfType(Mesh::Feature::getClassTypeId()); for (std::vector::iterator it = objs.begin(); it != objs.end(); ++it) { if (item == QLatin1String((*it)->getNameInDocument())) { @@ -1240,7 +1240,7 @@ void DlgEvaluateMeshImp::on_buttonBox_clicked(QAbstractButton* button) qApp->translate("QDockWidget", "Evaluate & Repair Mesh"); #endif -DockEvaluateMeshImp* DockEvaluateMeshImp::_instance=0; +DockEvaluateMeshImp* DockEvaluateMeshImp::_instance=nullptr; DockEvaluateMeshImp* DockEvaluateMeshImp::instance() { @@ -1255,16 +1255,16 @@ DockEvaluateMeshImp* DockEvaluateMeshImp::instance() void DockEvaluateMeshImp::destruct () { - if (_instance != 0) { + if (_instance != nullptr) { DockEvaluateMeshImp *pTmp = _instance; - _instance = 0; + _instance = nullptr; delete pTmp; } } bool DockEvaluateMeshImp::hasInstance() { - return _instance != 0; + return _instance != nullptr; } /** @@ -1296,7 +1296,7 @@ DockEvaluateMeshImp::DockEvaluateMeshImp( QWidget* parent, Qt::WindowFlags fl ) */ DockEvaluateMeshImp::~DockEvaluateMeshImp() { - _instance = 0; + _instance = nullptr; } /** diff --git a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h index fffd94e34e..b25547a1d9 100644 --- a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h +++ b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h @@ -70,7 +70,7 @@ class DlgEvaluateMeshImp : public QDialog, public App::DocumentObserver Q_OBJECT public: - DlgEvaluateMeshImp(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags()); + DlgEvaluateMeshImp(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~DlgEvaluateMeshImp(); void setMesh(Mesh::Feature*); @@ -148,7 +148,7 @@ class DockEvaluateMeshImp : public DlgEvaluateMeshImp Q_OBJECT protected: - DockEvaluateMeshImp( QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags() ); + DockEvaluateMeshImp( QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags() ); ~DockEvaluateMeshImp(); void closeEvent(QCloseEvent* e); diff --git a/src/Mod/Mesh/Gui/DlgEvaluateSettings.h b/src/Mod/Mesh/Gui/DlgEvaluateSettings.h index 4928cbdf17..639c1c5447 100644 --- a/src/Mod/Mesh/Gui/DlgEvaluateSettings.h +++ b/src/Mod/Mesh/Gui/DlgEvaluateSettings.h @@ -38,7 +38,7 @@ class DlgEvaluateSettings : public QDialog Q_OBJECT public: - DlgEvaluateSettings(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags()); + DlgEvaluateSettings(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~DlgEvaluateSettings(); void setNonmanifoldPointsChecked(bool); diff --git a/src/Mod/Mesh/Gui/DlgRegularSolidImp.cpp b/src/Mod/Mesh/Gui/DlgRegularSolidImp.cpp index d521324db4..bf8e62b622 100644 --- a/src/Mod/Mesh/Gui/DlgRegularSolidImp.cpp +++ b/src/Mod/Mesh/Gui/DlgRegularSolidImp.cpp @@ -24,7 +24,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include +# include # include # include # include diff --git a/src/Mod/Mesh/Gui/DlgRegularSolidImp.h b/src/Mod/Mesh/Gui/DlgRegularSolidImp.h index b67b5baba5..b5afea5685 100644 --- a/src/Mod/Mesh/Gui/DlgRegularSolidImp.h +++ b/src/Mod/Mesh/Gui/DlgRegularSolidImp.h @@ -34,7 +34,7 @@ class DlgRegularSolidImp : public QDialog Q_OBJECT public: - DlgRegularSolidImp(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags()); + DlgRegularSolidImp(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~DlgRegularSolidImp(); public Q_SLOTS: diff --git a/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.h b/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.h index 68b5f8e99c..b27e0077bc 100644 --- a/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.h +++ b/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.h @@ -41,7 +41,7 @@ class DlgSettingsImportExport : public Gui::Dialog::PreferencePage Q_OBJECT public: - DlgSettingsImportExport(QWidget* parent = 0); + DlgSettingsImportExport(QWidget* parent = nullptr); ~DlgSettingsImportExport(); protected: diff --git a/src/Mod/Mesh/Gui/DlgSmoothing.cpp b/src/Mod/Mesh/Gui/DlgSmoothing.cpp index 2241f93a39..d491c29cae 100644 --- a/src/Mod/Mesh/Gui/DlgSmoothing.cpp +++ b/src/Mod/Mesh/Gui/DlgSmoothing.cpp @@ -143,12 +143,12 @@ TaskSmoothing::TaskSmoothing() { widget = new DlgSmoothing(); Gui::TaskView::TaskBox* taskbox = new Gui::TaskView::TaskBox( - QPixmap(), widget->windowTitle(), false, 0); + QPixmap(), widget->windowTitle(), false, nullptr); taskbox->groupLayout()->addWidget(widget); Content.push_back(taskbox); selection = new Selection(); - selection->setObjects(Gui::Selection().getSelectionEx(0, Mesh::Feature::getClassTypeId())); + selection->setObjects(Gui::Selection().getSelectionEx(nullptr, Mesh::Feature::getClassTypeId())); Gui::Selection().clearSelection(); #if !defined (QSINT_ACTIONPANEL) Gui::TaskView::TaskGroup* tasksel = new Gui::TaskView::TaskGroup(); diff --git a/src/Mod/Mesh/Gui/DlgSmoothing.h b/src/Mod/Mesh/Gui/DlgSmoothing.h index 05e37c08bf..2b64d6e88e 100644 --- a/src/Mod/Mesh/Gui/DlgSmoothing.h +++ b/src/Mod/Mesh/Gui/DlgSmoothing.h @@ -48,7 +48,7 @@ public: Laplace }; - DlgSmoothing(QWidget* parent = 0); + DlgSmoothing(QWidget* parent = nullptr); ~DlgSmoothing(); int iterations() const; double lambdaStep() const; @@ -76,7 +76,7 @@ class MeshGuiExport SmoothingDialog : public QDialog Q_OBJECT public: - SmoothingDialog(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags()); + SmoothingDialog(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~SmoothingDialog(); int iterations() const @@ -110,7 +110,7 @@ public: virtual QDialogButtonBox::StandardButtons getStandardButtons() const { return QDialogButtonBox::Ok | QDialogButtonBox::Cancel; } - virtual bool isAllowedAlterDocument(void) const + virtual bool isAllowedAlterDocument() const { return true; } private: diff --git a/src/Mod/Mesh/Gui/MeshSelection.cpp b/src/Mod/Mesh/Gui/MeshSelection.cpp index 6f47b0dd86..2f7b3a7d09 100644 --- a/src/Mod/Mesh/Gui/MeshSelection.cpp +++ b/src/Mod/Mesh/Gui/MeshSelection.cpp @@ -81,9 +81,9 @@ MeshSelection::MeshSelection() , addToSelection(false) , addComponent(false) , removeComponent(false) - , activeCB(0) - , selectionCB(0) - , ivViewer(0) + , activeCB(nullptr) + , selectionCB(nullptr) + , ivViewer(nullptr) { setCallback(selectGLCallback); } @@ -163,14 +163,14 @@ Gui::View3DInventorViewer* MeshSelection::getViewer() const return ivViewer; Gui::Document* doc = Gui::Application::Instance->activeDocument(); - if (!doc) return 0; + if (!doc) return nullptr; Gui::MDIView* view = doc->getActiveView(); if (view && view->getTypeId().isDerivedFrom(Gui::View3DInventor::getClassTypeId())) { Gui::View3DInventorViewer* viewer = static_cast(view)->getViewer(); return viewer; } - return 0; + return nullptr; } void MeshSelection::startInteractiveCallback(Gui::View3DInventorViewer* viewer,SoEventCallbackCB *cb) @@ -188,7 +188,7 @@ void MeshSelection::stopInteractiveCallback(Gui::View3DInventorViewer* viewer) return; viewer->setEditing(false); viewer->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), this->activeCB, this); - this->activeCB = 0; + this->activeCB = nullptr; } void MeshSelection::prepareFreehandSelection(bool add,SoEventCallbackCB *cb) @@ -540,7 +540,7 @@ void MeshSelection::pickFaceCallback(void * ud, SoEventCallback * n) n->getAction()->setHandled(); if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) { const SoPickedPoint * point = n->getPickedPoint(); - if (point == NULL) { + if (point == nullptr) { Base::Console().Message("No facet picked.\n"); return; } diff --git a/src/Mod/Mesh/Gui/PropertyEditorMesh.cpp b/src/Mod/Mesh/Gui/PropertyEditorMesh.cpp index 1910ae7257..150405b5ad 100644 --- a/src/Mod/Mesh/Gui/PropertyEditorMesh.cpp +++ b/src/Mod/Mesh/Gui/PropertyEditorMesh.cpp @@ -93,7 +93,7 @@ QWidget* PropertyMeshKernelItem::createEditor(QWidget* parent, const QObject* re Q_UNUSED(parent); Q_UNUSED(receiver); Q_UNUSED(method); - return 0; + return nullptr; } void PropertyMeshKernelItem::setEditorData(QWidget *editor, const QVariant& data) const diff --git a/src/Mod/Mesh/Gui/RemeshGmsh.cpp b/src/Mod/Mesh/Gui/RemeshGmsh.cpp index e762b32dbd..63ee727f4c 100644 --- a/src/Mod/Mesh/Gui/RemeshGmsh.cpp +++ b/src/Mod/Mesh/Gui/RemeshGmsh.cpp @@ -392,7 +392,7 @@ TaskRemeshGmsh::TaskRemeshGmsh(Mesh::Feature* mesh) { widget = new RemeshGmsh(mesh); taskbox = new Gui::TaskView::TaskBox( - QPixmap(), widget->windowTitle(), false, 0); + QPixmap(), widget->windowTitle(), false, nullptr); taskbox->groupLayout()->addWidget(widget); Content.push_back(taskbox); } diff --git a/src/Mod/Mesh/Gui/RemeshGmsh.h b/src/Mod/Mesh/Gui/RemeshGmsh.h index 82fda38c69..c485c14df2 100644 --- a/src/Mod/Mesh/Gui/RemeshGmsh.h +++ b/src/Mod/Mesh/Gui/RemeshGmsh.h @@ -52,7 +52,7 @@ class MeshGuiExport GmshWidget : public QWidget Q_OBJECT public: - GmshWidget(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags()); + GmshWidget(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~GmshWidget(); void accept(); void reject(); @@ -90,7 +90,7 @@ class MeshGuiExport RemeshGmsh : public GmshWidget Q_OBJECT public: - RemeshGmsh(Mesh::Feature* mesh, QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags()); + RemeshGmsh(Mesh::Feature* mesh, QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~RemeshGmsh(); protected: @@ -118,7 +118,7 @@ public: virtual QDialogButtonBox::StandardButtons getStandardButtons() const { return QDialogButtonBox::Apply | QDialogButtonBox::Close; } - virtual bool isAllowedAlterDocument(void) const + virtual bool isAllowedAlterDocument() const { return true; } private: diff --git a/src/Mod/Mesh/Gui/RemoveComponents.cpp b/src/Mod/Mesh/Gui/RemoveComponents.cpp index 253af04952..81f29f2446 100644 --- a/src/Mod/Mesh/Gui/RemoveComponents.cpp +++ b/src/Mod/Mesh/Gui/RemoveComponents.cpp @@ -215,7 +215,7 @@ TaskRemoveComponents::TaskRemoveComponents() { widget = new RemoveComponents(); taskbox = new Gui::TaskView::TaskBox( - QPixmap(), widget->windowTitle(), false, 0); + QPixmap(), widget->windowTitle(), false, nullptr); taskbox->groupLayout()->addWidget(widget); Content.push_back(taskbox); } diff --git a/src/Mod/Mesh/Gui/RemoveComponents.h b/src/Mod/Mesh/Gui/RemoveComponents.h index fa085551f3..113caac297 100644 --- a/src/Mod/Mesh/Gui/RemoveComponents.h +++ b/src/Mod/Mesh/Gui/RemoveComponents.h @@ -42,7 +42,7 @@ class MeshGuiExport RemoveComponents : public QWidget Q_OBJECT public: - RemoveComponents(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags()); + RemoveComponents(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~RemoveComponents(); void reject(); void deleteSelection(); @@ -65,7 +65,7 @@ public Q_SLOTS: protected: void changeEvent(QEvent *e); -private: +private: Ui_RemoveComponents* ui; MeshSelection meshSel; }; @@ -78,7 +78,7 @@ class MeshGuiExport RemoveComponentsDialog : public QDialog Q_OBJECT public: - RemoveComponentsDialog(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags()); + RemoveComponentsDialog(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~RemoveComponentsDialog(); void reject(); @@ -106,7 +106,7 @@ public: virtual QDialogButtonBox::StandardButtons getStandardButtons() const { return QDialogButtonBox::Ok | QDialogButtonBox::Close; } - virtual bool isAllowedAlterDocument(void) const + virtual bool isAllowedAlterDocument() const { return true; } virtual void modifyStandardButtons(QDialogButtonBox*); diff --git a/src/Mod/Mesh/Gui/Segmentation.cpp b/src/Mod/Mesh/Gui/Segmentation.cpp index c2f28cf26e..95a6f27fdf 100644 --- a/src/Mod/Mesh/Gui/Segmentation.cpp +++ b/src/Mod/Mesh/Gui/Segmentation.cpp @@ -148,7 +148,7 @@ TaskSegmentation::TaskSegmentation(Mesh::Feature* mesh) { widget = new Segmentation(mesh); taskbox = new Gui::TaskView::TaskBox( - QPixmap(), widget->windowTitle(), false, 0); + QPixmap(), widget->windowTitle(), false, nullptr); taskbox->groupLayout()->addWidget(widget); Content.push_back(taskbox); } diff --git a/src/Mod/Mesh/Gui/Segmentation.h b/src/Mod/Mesh/Gui/Segmentation.h index 17a1d32f61..8e4a8f0c45 100644 --- a/src/Mod/Mesh/Gui/Segmentation.h +++ b/src/Mod/Mesh/Gui/Segmentation.h @@ -40,7 +40,7 @@ class Ui_Segmentation; class MeshGuiExport Segmentation : public QWidget { public: - Segmentation(Mesh::Feature* mesh, QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags()); + Segmentation(Mesh::Feature* mesh, QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~Segmentation(); void accept(); diff --git a/src/Mod/Mesh/Gui/SegmentationBestFit.cpp b/src/Mod/Mesh/Gui/SegmentationBestFit.cpp index efcddb8b65..324cbd7743 100644 --- a/src/Mod/Mesh/Gui/SegmentationBestFit.cpp +++ b/src/Mod/Mesh/Gui/SegmentationBestFit.cpp @@ -207,7 +207,7 @@ ParametersDialog::ParametersDialog(std::vector& val, FitParameter* fitPar int index = 0; QGridLayout *layout; layout = new QGridLayout(groupBox); - for (auto it : parameter) { + for (const auto& it : parameter) { QLabel* label = new QLabel(groupBox); label->setText(it.first); layout->addWidget(label, index, 0, 1, 1); @@ -346,7 +346,7 @@ void SegmentationBestFit::on_planeParameters_clicked() list.push_back(std::make_pair(axis + y, p[4])); list.push_back(std::make_pair(axis + z, p[5])); - static QPointer dialog = 0; + static QPointer dialog = nullptr; if (!dialog) dialog = new ParametersDialog(planeParameter, new PlaneFitParameter, @@ -374,7 +374,7 @@ void SegmentationBestFit::on_cylinderParameters_clicked() list.push_back(std::make_pair(axis + z, p[5])); list.push_back(std::make_pair(radius, p[6])); - static QPointer dialog = 0; + static QPointer dialog = nullptr; if (!dialog) dialog = new ParametersDialog(cylinderParameter, new CylinderFitParameter, @@ -398,7 +398,7 @@ void SegmentationBestFit::on_sphereParameters_clicked() list.push_back(std::make_pair(base + z, p[2])); list.push_back(std::make_pair(radius, p[3])); - static QPointer dialog = 0; + static QPointer dialog = nullptr; if (!dialog) dialog = new ParametersDialog(sphereParameter, new SphereFitParameter, @@ -504,7 +504,7 @@ TaskSegmentationBestFit::TaskSegmentationBestFit(Mesh::Feature* mesh) { widget = new SegmentationBestFit(mesh); taskbox = new Gui::TaskView::TaskBox( - QPixmap(), widget->windowTitle(), false, 0); + QPixmap(), widget->windowTitle(), false, nullptr); taskbox->groupLayout()->addWidget(widget); Content.push_back(taskbox); } diff --git a/src/Mod/Mesh/Gui/SegmentationBestFit.h b/src/Mod/Mesh/Gui/SegmentationBestFit.h index 24c44d09a1..471dc12b74 100644 --- a/src/Mod/Mesh/Gui/SegmentationBestFit.h +++ b/src/Mod/Mesh/Gui/SegmentationBestFit.h @@ -24,7 +24,7 @@ #ifndef MESHGUI_SEGMENTATIONBESTFIT_H #define MESHGUI_SEGMENTATIONBESTFIT_H -#include +#include #include #include #include @@ -57,7 +57,7 @@ class ParametersDialog : public QDialog public: ParametersDialog(std::vector&, FitParameter*, ParameterList, Mesh::Feature* mesh, - QWidget* parent=0); + QWidget* parent=nullptr); ~ParametersDialog(); void accept(); void reject(); @@ -82,7 +82,7 @@ class MeshGuiExport SegmentationBestFit : public QWidget Q_OBJECT public: - SegmentationBestFit(Mesh::Feature* mesh, QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags()); + SegmentationBestFit(Mesh::Feature* mesh, QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~SegmentationBestFit(); void accept(); diff --git a/src/Mod/Mesh/Gui/Selection.h b/src/Mod/Mesh/Gui/Selection.h index bb6952a50a..060bddc3e0 100644 --- a/src/Mod/Mesh/Gui/Selection.h +++ b/src/Mod/Mesh/Gui/Selection.h @@ -40,7 +40,7 @@ class Selection : public QWidget Q_OBJECT public: - Selection(QWidget* parent = 0); + Selection(QWidget* parent = nullptr); ~Selection(); void setObjects(const std::vector&); std::vector getObjects() const; diff --git a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp index 8b0f9a5e1a..308a3fb257 100644 --- a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp +++ b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp @@ -96,7 +96,7 @@ private: MeshRenderer::Private::Private() : vertices(GL_ARRAY_BUFFER) , indices(GL_ELEMENT_ARRAY_BUFFER) - , pcolors(0) + , pcolors(nullptr) , matbinding(SoMaterialBindingElement::OVERALL) , initialized(false) { @@ -168,12 +168,12 @@ void MeshRenderer::Private::renderGLArray(SoGLRenderAction *action, GLenum mode) indices.bind(); if (matbinding != SoMaterialBindingElement::OVERALL) - glInterleavedArrays(GL_C4F_N3F_V3F, 0, 0); + glInterleavedArrays(GL_C4F_N3F_V3F, 0, nullptr); else - glInterleavedArrays(GL_N3F_V3F, 0, 0); + glInterleavedArrays(GL_N3F_V3F, 0, nullptr); glDrawElements(mode, indices.size() / sizeof(uint32_t), - GL_UNSIGNED_INT, NULL); + GL_UNSIGNED_INT, nullptr); vertices.release(); indices.release(); @@ -429,7 +429,7 @@ bool MeshRenderer::matchMaterial(SoState* state) const // the buffer doesn't contain color information if (matbind == SoMaterialBindingElement::OVERALL) return true; - const SbColor * pcolors = 0; + const SbColor * pcolors = nullptr; SoGLLazyElement* gl = SoGLLazyElement::getInstance(state); if (gl) { pcolors = gl->getDiffusePointer(); @@ -489,7 +489,7 @@ void SoFCIndexedFaceSet::initClass() SoFCIndexedFaceSet::SoFCIndexedFaceSet() : renderTriangleLimit(UINT_MAX) - , selectBuf(0) + , selectBuf(nullptr) { SO_NODE_CONSTRUCTOR(SoFCIndexedFaceSet); SO_NODE_ADD_FIELD(updateGLArray, (false)); @@ -639,7 +639,7 @@ void SoFCIndexedFaceSet::drawCoords(const SoGLCoordinateElement * const vertexli const SoTextureCoordinateBundle * const /*texcoords*/, const int32_t * /*texindices*/) { - const SbVec3f * coords3d = 0; + const SbVec3f * coords3d = nullptr; coords3d = vertexlist->getArrayPtr3(); int mod = numindices/(4*this->renderTriangleLimit)+1; @@ -716,8 +716,8 @@ void SoFCIndexedFaceSet::generateGLArrays(SoGLRenderAction * action) const SoCoordinateElement * coords; const SbVec3f * normals; const int32_t * cindices; - const SbColor * pcolors = 0; - const float * transp = 0; + const SbColor * pcolors = nullptr; + const float * transp = nullptr; int numindices, numcolors = 0, numtransp = 0; const int32_t * nindices; const int32_t * tindices; @@ -1013,7 +1013,7 @@ void SoFCIndexedFaceSet::stopSelection(SoAction * action) } delete [] selectBuf; - selectBuf = 0; + selectBuf = nullptr; std::sort(hit.begin(),hit.end()); Gui::SoGLSelectAction *doaction = static_cast(action); diff --git a/src/Mod/Mesh/Gui/SoFCMeshObject.cpp b/src/Mod/Mesh/Gui/SoFCMeshObject.cpp index a7928a7cab..385bce7882 100644 --- a/src/Mod/Mesh/Gui/SoFCMeshObject.cpp +++ b/src/Mod/Mesh/Gui/SoFCMeshObject.cpp @@ -89,7 +89,7 @@ private: class SoOutputStream : public std::ostream { public: - SoOutputStream(SoOutput* o) : std::ostream(0), buf(o) + SoOutputStream(SoOutput* o) : std::ostream(nullptr), buf(o) { this->rdbuf(&buf); } @@ -153,7 +153,7 @@ private: class SoInputStream : public std::istream { public: - SoInputStream(SoInput* o) : std::istream(0), buf(o) + SoInputStream(SoInput* o) : std::istream(nullptr), buf(o) { this->rdbuf(&buf); } @@ -296,7 +296,7 @@ void SoFCMeshObjectElement::initClass() void SoFCMeshObjectElement::init(SoState * state) { inherited::init(state); - this->mesh = 0; + this->mesh = nullptr; } SoFCMeshObjectElement::~SoFCMeshObjectElement() @@ -334,11 +334,11 @@ SO_NODE_SOURCE(SoFCMeshPickNode) /*! Constructor. */ -SoFCMeshPickNode::SoFCMeshPickNode(void) : meshGrid(0) +SoFCMeshPickNode::SoFCMeshPickNode() : meshGrid(nullptr) { SO_NODE_CONSTRUCTOR(SoFCMeshPickNode); - SO_NODE_ADD_FIELD(mesh, (0)); + SO_NODE_ADD_FIELD(mesh, (nullptr)); } /*! @@ -350,7 +350,7 @@ SoFCMeshPickNode::~SoFCMeshPickNode() } // Doc from superclass. -void SoFCMeshPickNode::initClass(void) +void SoFCMeshPickNode::initClass() { SO_NODE_INIT_CLASS(SoFCMeshPickNode, SoNode, "Node"); } @@ -406,7 +406,7 @@ SO_NODE_SOURCE(SoFCMeshGridNode) /*! Constructor. */ -SoFCMeshGridNode::SoFCMeshGridNode(void) +SoFCMeshGridNode::SoFCMeshGridNode() { SO_NODE_CONSTRUCTOR(SoFCMeshGridNode); @@ -423,7 +423,7 @@ SoFCMeshGridNode::~SoFCMeshGridNode() } // Doc from superclass. -void SoFCMeshGridNode::initClass(void) +void SoFCMeshGridNode::initClass() { SO_NODE_INIT_CLASS(SoFCMeshGridNode, SoNode, "Node"); } @@ -493,11 +493,11 @@ SO_NODE_SOURCE(SoFCMeshObjectNode) /*! Constructor. */ -SoFCMeshObjectNode::SoFCMeshObjectNode(void) +SoFCMeshObjectNode::SoFCMeshObjectNode() { SO_NODE_CONSTRUCTOR(SoFCMeshObjectNode); - SO_NODE_ADD_FIELD(mesh, (0)); + SO_NODE_ADD_FIELD(mesh, (nullptr)); } /*! @@ -508,7 +508,7 @@ SoFCMeshObjectNode::~SoFCMeshObjectNode() } // Doc from superclass. -void SoFCMeshObjectNode::initClass(void) +void SoFCMeshObjectNode::initClass() { SO_NODE_INIT_CLASS(SoFCMeshObjectNode, SoNode, "Node"); @@ -592,7 +592,7 @@ void SoFCMeshObjectShape::initClass() SoFCMeshObjectShape::SoFCMeshObjectShape() : renderTriangleLimit(UINT_MAX) - , selectBuf(0) + , selectBuf(nullptr) , updateGLArray(false) { SO_NODE_CONSTRUCTOR(SoFCMeshObjectShape); @@ -1051,7 +1051,7 @@ void SoFCMeshObjectShape::stopSelection(SoAction * action, const Mesh::MeshObjec } delete [] selectBuf; - selectBuf = 0; + selectBuf = nullptr; std::sort(hit.begin(),hit.end()); Gui::SoGLSelectAction *doaction = static_cast(action); @@ -1295,7 +1295,7 @@ void SoFCMeshSegmentShape::GLRender(SoGLRenderAction *action) if (mbind != OVERALL) drawFaces(mesh, &mb, mbind, needNormals, ccw); else - drawFaces(mesh, 0, mbind, needNormals, ccw); + drawFaces(mesh, nullptr, mbind, needNormals, ccw); } else { drawPoints(mesh, needNormals, ccw); diff --git a/src/Mod/Mesh/Gui/SoFCMeshObject.h b/src/Mod/Mesh/Gui/SoFCMeshObject.h index 5c1130d474..09314dcfd1 100644 --- a/src/Mod/Mesh/Gui/SoFCMeshObject.h +++ b/src/Mod/Mesh/Gui/SoFCMeshObject.h @@ -48,7 +48,7 @@ class MeshGuiExport SoSFMeshObject : public SoSField { SO_SFIELD_HEADER(SoSFMeshObject, Base::Reference, Base::Reference); public: - static void initClass(void); + static void initClass(); private: SoSFMeshObject(const SoSFMeshObject&); @@ -62,7 +62,7 @@ class MeshGuiExport SoFCMeshObjectElement : public SoReplacedElement { SO_ELEMENT_HEADER(SoFCMeshObjectElement); public: - static void initClass(void); + static void initClass(); virtual void init(SoState * state); static void set(SoState * const state, SoNode * const node, const Mesh::MeshObject * const mesh); @@ -83,8 +83,8 @@ class MeshGuiExport SoFCMeshPickNode : public SoNode { SO_NODE_HEADER(SoFCMeshPickNode); public: - static void initClass(void); - SoFCMeshPickNode(void); + static void initClass(); + SoFCMeshPickNode(); void notify(SoNotList *); SoSFMeshObject mesh; @@ -107,8 +107,8 @@ class MeshGuiExport SoFCMeshGridNode : public SoNode { SO_NODE_HEADER(SoFCMeshGridNode); public: - static void initClass(void); - SoFCMeshGridNode(void); + static void initClass(); + SoFCMeshGridNode(); void GLRender(SoGLRenderAction * action); SoSFVec3f minGrid; @@ -127,8 +127,8 @@ class MeshGuiExport SoFCMeshObjectNode : public SoNode { SO_NODE_HEADER(SoFCMeshObjectNode); public: - static void initClass(void); - SoFCMeshObjectNode(void); + static void initClass(); + SoFCMeshObjectNode(); SoSFMeshObject mesh; diff --git a/src/Mod/Mesh/Gui/SoPolygon.cpp b/src/Mod/Mesh/Gui/SoPolygon.cpp index 52de0adeb9..42d6ea9b50 100644 --- a/src/Mod/Mesh/Gui/SoPolygon.cpp +++ b/src/Mod/Mesh/Gui/SoPolygon.cpp @@ -32,7 +32,7 @@ # else # include # endif -# include +# include # include # include # include @@ -48,7 +48,7 @@ #endif # include -# include +# include #include "SoPolygon.h" diff --git a/src/Mod/Mesh/Gui/ViewProvider.cpp b/src/Mod/Mesh/Gui/ViewProvider.cpp index 8c233a9ea1..63b6bfa7a5 100644 --- a/src/Mod/Mesh/Gui/ViewProvider.cpp +++ b/src/Mod/Mesh/Gui/ViewProvider.cpp @@ -24,7 +24,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include +# include # include # include # include @@ -118,8 +118,8 @@ using MeshCore::MeshFacet; void ViewProviderMeshBuilder::buildNodes(const App::Property* prop, std::vector& nodes) const { - SoCoordinate3 *pcPointsCoord=0; - SoIndexedFaceSet *pcFaces=0; + SoCoordinate3 *pcPointsCoord=nullptr; + SoIndexedFaceSet *pcFaces=nullptr; if (nodes.empty()) { pcPointsCoord = new SoCoordinate3(); @@ -177,7 +177,7 @@ ViewProviderExport::~ViewProviderExport() { } -std::vector ViewProviderExport::getDisplayModes(void) const +std::vector ViewProviderExport::getDisplayModes() const { std::vector mode; mode.push_back(""); @@ -230,11 +230,11 @@ 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::PropertyIntegerConstraint::Constraints ViewProviderMesh::intPercent = {0,100,1}; -const char* ViewProviderMesh::LightingEnums[]= {"One side","Two side",NULL}; +const char* ViewProviderMesh::LightingEnums[]= {"One side","Two side",nullptr}; PROPERTY_SOURCE(MeshGui::ViewProviderMesh, Gui::ViewProviderGeometryObject) -ViewProviderMesh::ViewProviderMesh() : pcOpenEdge(0) +ViewProviderMesh::ViewProviderMesh() : pcOpenEdge(nullptr) { static const char *osgroup = "Object Style"; @@ -405,12 +405,12 @@ void ViewProviderMesh::setOpenEdgeColorFrom(const App::Color& c) SoShape* ViewProviderMesh::getShapeNode() const { - return 0; + return nullptr; } SoNode* ViewProviderMesh::getCoordNode() const { - return 0; + return nullptr; } /** @@ -547,7 +547,7 @@ App::PropertyColorList* ViewProviderMesh::getColorProperty() const } } - return 0; // no such property found + return nullptr; // no such property found } void ViewProviderMesh::tryColorPerVertexOrFace(bool on) @@ -625,7 +625,7 @@ void ViewProviderMesh::setDisplayMode(const char* ModeName) ViewProviderGeometryObject::setDisplayMode(ModeName); } -std::vector ViewProviderMesh::getDisplayModes(void) const +std::vector ViewProviderMesh::getDisplayModes() const { std::vector StrList; @@ -1259,7 +1259,7 @@ std::vector ViewProviderMesh::getFacetsOfRegion(const SbViewpo void ViewProviderMesh::panCamera(SoCamera * cam, float aspectratio, const SbPlane & panplane, const SbVec2f & currpos, const SbVec2f & prevpos) { - if (cam == NULL) return; // can happen for empty scenegraph + if (cam == nullptr) return; // can happen for empty scenegraph if (currpos == prevpos) return; // useless invocation @@ -1593,7 +1593,7 @@ void ViewProviderMesh::faceInfoCallback(void * ud, SoEventCallback * n) } else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) { const SoPickedPoint * point = n->getPickedPoint(); - if (point == NULL) { + if (point == nullptr) { Base::Console().Message("No facet picked.\n"); return; } @@ -1619,7 +1619,7 @@ void ViewProviderMesh::faceInfoCallback(void * ud, SoEventCallback * n) const SoFaceDetail* faceDetail = static_cast(detail); Mesh::FacetIndex uFacet = faceDetail->getFaceIndex(); that->faceInfo(uFacet); - Gui::GLFlagWindow* flags = 0; + Gui::GLFlagWindow* flags = nullptr; std::list glItems = view->getGraphicsItemsOfType(Gui::GLFlagWindow::getClassTypeId()); if (glItems.empty()) { flags = new Gui::GLFlagWindow(view); @@ -1667,7 +1667,7 @@ void ViewProviderMesh::fillHoleCallback(void * ud, SoEventCallback * n) } else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) { const SoPickedPoint * point = n->getPickedPoint(); - if (point == NULL) { + if (point == nullptr) { Base::Console().Message("No facet picked.\n"); return; } @@ -1734,7 +1734,7 @@ void ViewProviderMesh::markPartCallback(void * ud, SoEventCallback * n) } else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) { const SoPickedPoint * point = n->getPickedPoint(); - if (point == NULL) { + if (point == nullptr) { Base::Console().Message("No facet picked.\n"); return; } @@ -2250,8 +2250,8 @@ PROPERTY_SOURCE(MeshGui::ViewProviderIndexedFaceSet, MeshGui::ViewProviderMesh) ViewProviderIndexedFaceSet::ViewProviderIndexedFaceSet() { - pcMeshCoord = 0; - pcMeshFaces = 0; + pcMeshCoord = nullptr; + pcMeshFaces = nullptr; } ViewProviderIndexedFaceSet::~ViewProviderIndexedFaceSet() @@ -2294,7 +2294,7 @@ void ViewProviderIndexedFaceSet::showOpenEdges(bool show) if (pcOpenEdge) { // remove the node and destroy the data pcRoot->removeChild(pcOpenEdge); - pcOpenEdge = 0; + pcOpenEdge = nullptr; } if (show) { @@ -2341,8 +2341,8 @@ PROPERTY_SOURCE(MeshGui::ViewProviderMeshObject, MeshGui::ViewProviderMesh) ViewProviderMeshObject::ViewProviderMeshObject() { - pcMeshNode = 0; - pcMeshShape = 0; + pcMeshNode = nullptr; + pcMeshShape = nullptr; } ViewProviderMeshObject::~ViewProviderMeshObject() @@ -2381,7 +2381,7 @@ void ViewProviderMeshObject::showOpenEdges(bool show) if (pcOpenEdge) { // remove the node and destroy the data pcRoot->removeChild(pcOpenEdge); - pcOpenEdge = 0; + pcOpenEdge = nullptr; } if (show) { diff --git a/src/Mod/Mesh/Gui/ViewProvider.h b/src/Mod/Mesh/Gui/ViewProvider.h index 7a0d87b22b..9f0e4ea47f 100644 --- a/src/Mod/Mesh/Gui/ViewProvider.h +++ b/src/Mod/Mesh/Gui/ViewProvider.h @@ -97,8 +97,8 @@ public: virtual ~ViewProviderExport(); virtual QIcon getIcon() const; - SoSeparator* getRoot(void) const {return nullptr;} - std::vector getDisplayModes(void) const; + SoSeparator* getRoot() const {return nullptr;} + std::vector getDisplayModes() const; const char* getDefaultDisplayMode() const; }; @@ -127,22 +127,22 @@ public: virtual void attach(App::DocumentObject *); virtual void updateData(const App::Property*); - virtual bool useNewSelectionModel(void) const {return false;} + virtual bool useNewSelectionModel() const {return false;} Gui::SoFCSelection* getHighlightNode() const { return pcHighlight; } virtual QIcon getIcon() const; /// Sets the correct display mode virtual void setDisplayMode(const char* ModeName); /// returns a list of all possible modes - virtual std::vector getDisplayModes(void) const; + virtual std::vector getDisplayModes() const; bool exportToVrml(const char* filename, const MeshCore::Material&, bool binary=false) const; - void exportMesh(const char* filename, const char* fmt=0) const; + void exportMesh(const char* filename, const char* fmt=nullptr) const; void setupContextMenu(QMenu*, QObject*, const char*); /// Get the python wrapper for that ViewProvider PyObject* getPyObject(); /** @name Editing */ //@{ - bool doubleClicked(void){ return false; } + bool doubleClicked(){ return false; } bool isFacetSelected(Mesh::FacetIndex facet); void selectComponent(Mesh::FacetIndex facet); void deselectComponent(Mesh::FacetIndex facet); diff --git a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp index 73bafb8578..1fdceddf8d 100644 --- a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp @@ -155,13 +155,13 @@ void ViewProviderMeshCurvature::onChanged(const App::Property* prop) ViewProviderDocumentObject::onChanged(prop); } -void ViewProviderMeshCurvature::hide(void) +void ViewProviderMeshCurvature::hide() { inherited::hide(); pcColorStyle->style = SoDrawStyle::INVISIBLE; } -void ViewProviderMeshCurvature::show(void) +void ViewProviderMeshCurvature::show() { inherited::show(); pcColorStyle->style = SoDrawStyle::FILLED; @@ -317,14 +317,14 @@ void ViewProviderMeshCurvature::updateData(const App::Property* prop) } } -SoSeparator* ViewProviderMeshCurvature::getFrontRoot(void) const +SoSeparator* ViewProviderMeshCurvature::getFrontRoot() const { return pcColorRoot; } void ViewProviderMeshCurvature::setVertexCurvatureMode(int mode) { - Mesh::PropertyCurvatureList* pCurvInfo=0; + Mesh::PropertyCurvatureList* pCurvInfo=nullptr; std::map Map; pcObject->getPropertyMap(Map); for( std::map::iterator it = Map.begin(); it != Map.end(); ++it ) { @@ -389,7 +389,7 @@ const char* ViewProviderMeshCurvature::getDefaultDisplayMode() const return "Absolute curvature"; } -std::vector ViewProviderMeshCurvature::getDisplayModes(void) const +std::vector ViewProviderMeshCurvature::getDisplayModes() const { std::vector StrList = inherited::getDisplayModes(); @@ -436,7 +436,7 @@ public: std::vector groups = doc->getObjectsOfType (App::DocumentObjectGroup::getClassTypeId()); - App::DocumentObjectGroup* group = 0; + App::DocumentObjectGroup* group = nullptr; std::string internalname = "CurvatureGroup"; for (std::vector::iterator it = groups.begin(); it != groups.end(); ++it) { if (internalname == (*it)->getNameInDocument()) { @@ -503,7 +503,7 @@ void ViewProviderMeshCurvature::curvatureInfoCallback(void * ud, SoEventCallback } else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::UP) { const SoPickedPoint * point = n->getPickedPoint(); - if (point == NULL) { + if (point == nullptr) { Base::Console().Message("No facet picked.\n"); return; } @@ -541,7 +541,7 @@ void ViewProviderMeshCurvature::curvatureInfoCallback(void * ud, SoEventCallback } else if (ev->getTypeId().isDerivedFrom(SoLocation2Event::getClassTypeId())) { const SoPickedPoint * point = n->getPickedPoint(); - if (point == NULL) + if (point == nullptr) return; n->setHandled(); diff --git a/src/Mod/Mesh/Gui/ViewProviderCurvature.h b/src/Mod/Mesh/Gui/ViewProviderCurvature.h index 0b9b8d749c..39ede7a4c1 100644 --- a/src/Mod/Mesh/Gui/ViewProviderCurvature.h +++ b/src/Mod/Mesh/Gui/ViewProviderCurvature.h @@ -70,13 +70,13 @@ public: /// Extracts the mesh data from the feature \a pcFeature and creates an Inventor node \a SoNode with these data. void attach(App::DocumentObject* pcFeature); - virtual bool useNewSelectionModel(void) const {return false;} + virtual bool useNewSelectionModel() const {return false;} /// Sets the viewing mode void setDisplayMode(const char* ModeName); /// get the default display mode virtual const char* getDefaultDisplayMode() const; /// Returns a list of all possible modes - std::vector getDisplayModes(void) const; + std::vector getDisplayModes() const; /// Updates the mesh feature representation void updateData(const App::Property*); /// Returns a pixmap for the associated feature type @@ -84,11 +84,11 @@ public: /// Once the color bar settinhs has been changed this method gets called to update the feature's representation void OnChange(Base::Subject &rCaller,int rcReason); /// Returns a color bar - SoSeparator* getFrontRoot(void) const; + SoSeparator* getFrontRoot() const; /// Hide the object in the view - virtual void hide(void); + virtual void hide(); /// Show the object in the view - virtual void show(void); + virtual void show(); public: static void curvatureInfoCallback(void * ud, SoEventCallback * n); diff --git a/src/Mod/Mesh/Gui/ViewProviderMeshPyImp.cpp b/src/Mod/Mesh/Gui/ViewProviderMeshPyImp.cpp index 543c1f6953..d05a86dd66 100644 --- a/src/Mod/Mesh/Gui/ViewProviderMeshPyImp.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderMeshPyImp.cpp @@ -36,7 +36,7 @@ using namespace MeshGui; // returns a string which represents the object e.g. when printed in python -std::string ViewProviderMeshPy::representation(void) const +std::string ViewProviderMeshPy::representation() const { std::stringstream str; str << ""; @@ -48,7 +48,7 @@ PyObject* ViewProviderMeshPy::setSelection(PyObject *args) { PyObject* obj; if (!PyArg_ParseTuple(args, "O", &obj)) - return 0; + return nullptr; Py::Sequence list(obj); std::vector selection; @@ -68,7 +68,7 @@ PyObject* ViewProviderMeshPy::addSelection(PyObject *args) { PyObject* obj; if (!PyArg_ParseTuple(args, "O", &obj)) - return 0; + return nullptr; Py::Sequence list(obj); std::vector selection; @@ -88,7 +88,7 @@ PyObject* ViewProviderMeshPy::removeSelection(PyObject *args) { PyObject* obj; if (!PyArg_ParseTuple(args, "O", &obj)) - return 0; + return nullptr; Py::Sequence list(obj); std::vector selection; @@ -107,7 +107,7 @@ PyObject* ViewProviderMeshPy::removeSelection(PyObject *args) PyObject* ViewProviderMeshPy::invertSelection(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return 0; + return nullptr; ViewProviderMesh* vp = getViewProviderMeshPtr(); vp->invertSelection(); @@ -117,7 +117,7 @@ PyObject* ViewProviderMeshPy::invertSelection(PyObject *args) PyObject* ViewProviderMeshPy::clearSelection(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return 0; + return nullptr; ViewProviderMesh* vp = getViewProviderMeshPtr(); vp->clearSelection(); @@ -128,7 +128,7 @@ PyObject* ViewProviderMeshPy::highlightSegments(PyObject *args) { PyObject* list; if (!PyArg_ParseTuple(args, "O", &list)) - return 0; + return nullptr; App::PropertyColorList colors; colors.setPyObject(list); @@ -140,7 +140,7 @@ PyObject* ViewProviderMeshPy::highlightSegments(PyObject *args) PyObject *ViewProviderMeshPy::getCustomAttributes(const char* /*attr*/) const { - return 0; + return nullptr; } int ViewProviderMeshPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) diff --git a/src/Mod/Mesh/Gui/ViewProviderTransform.cpp b/src/Mod/Mesh/Gui/ViewProviderTransform.cpp index e17238488d..eb40fab8ea 100644 --- a/src/Mod/Mesh/Gui/ViewProviderTransform.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderTransform.cpp @@ -106,7 +106,7 @@ const char* ViewProviderMeshTransform::getDefaultDisplayMode() const return "Transform"; } -std::vector ViewProviderMeshTransform::getDisplayModes(void) const +std::vector ViewProviderMeshTransform::getDisplayModes() const { std::vector StrList = ViewProviderMesh::getDisplayModes(); StrList.push_back("Transform"); diff --git a/src/Mod/Mesh/Gui/ViewProviderTransform.h b/src/Mod/Mesh/Gui/ViewProviderTransform.h index 2888bd0911..13a6f0ddf6 100644 --- a/src/Mod/Mesh/Gui/ViewProviderTransform.h +++ b/src/Mod/Mesh/Gui/ViewProviderTransform.h @@ -65,7 +65,7 @@ public: /// get the default display mode virtual const char* getDefaultDisplayMode() const; /// returns a list of all possible modes - virtual std::vector getDisplayModes(void) const; + virtual std::vector getDisplayModes() const; /// Update the Mesh representation virtual void updateData(const App::Property*); diff --git a/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.cpp b/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.cpp index cc35bc510d..bba5b7bde0 100644 --- a/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.cpp @@ -65,8 +65,8 @@ ViewProviderMeshTransformDemolding::ViewProviderMeshTransformDemolding() { pcTrackballDragger = new SoTrackballDragger; pcTrackballDragger->ref(); - pcTransformDrag = 0; - pcColorMat = 0; + pcTransformDrag = nullptr; + pcColorMat = nullptr; } ViewProviderMeshTransformDemolding::~ViewProviderMeshTransformDemolding() @@ -131,7 +131,7 @@ void ViewProviderMeshTransformDemolding::attach(App::DocumentObject *pcFeat) //SbVector3f Center = boxAction->getCenter(); } -void ViewProviderMeshTransformDemolding::calcNormalVector(void) +void ViewProviderMeshTransformDemolding::calcNormalVector() { const MeshKernel& cMesh = static_cast(pcObject)->Mesh.getValue().getKernel(); @@ -165,7 +165,6 @@ void ViewProviderMeshTransformDemolding::calcMaterialIndex(const SbRotation &rot else { // pcMeshFaces->materialIndex .set1Value(i, 0 ); } - } } @@ -179,7 +178,7 @@ void ViewProviderMeshTransformDemolding::sDragEndCallback(void *This, SoDragger static_cast(This)->DragEndCallback(); } -void ViewProviderMeshTransformDemolding::DragEndCallback(void) +void ViewProviderMeshTransformDemolding::DragEndCallback() { SbRotation rot = pcTrackballDragger->rotation.getValue(); calcMaterialIndex(rot); @@ -188,7 +187,7 @@ void ViewProviderMeshTransformDemolding::DragEndCallback(void) } -void ViewProviderMeshTransformDemolding::valueChangedCallback(void) +void ViewProviderMeshTransformDemolding::valueChangedCallback() { //Base::Console().Log("Value change Callback\n"); //setTransformation(pcTrackballDragger->getMotionMatrix()); @@ -218,7 +217,7 @@ const char* ViewProviderMeshTransformDemolding::getDefaultDisplayMode() const return "Demold"; } -std::vector ViewProviderMeshTransformDemolding::getDisplayModes(void) const +std::vector ViewProviderMeshTransformDemolding::getDisplayModes() const { std::vector StrList = ViewProviderMesh::getDisplayModes(); StrList.push_back("Demold"); diff --git a/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.h b/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.h index 84f75881e6..f18be3b769 100644 --- a/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.h +++ b/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.h @@ -70,17 +70,17 @@ public: /// get the default display mode virtual const char* getDefaultDisplayMode() const; /// returns a list of all possible modes - virtual std::vector getDisplayModes(void) const; + virtual std::vector getDisplayModes() const; protected: void calcMaterialIndex(const SbRotation &rot); - void calcNormalVector(void); + void calcNormalVector(); static void sValueChangedCallback(void *, SoDragger *); - void valueChangedCallback(void); + void valueChangedCallback(); static void sDragEndCallback(void *, SoDragger *); - void DragEndCallback(void); + void DragEndCallback(); SoTrackballDragger *pcTrackballDragger; SoTransform *pcTransformDrag;