From 7ae9fc0d671e52afd55d4ed0339de68b3f45ed67 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 23 Mar 2022 19:17:40 +0100 Subject: [PATCH] Fem: modernize C++11 * use nullptr --- src/Mod/Fem/App/AppFem.cpp | 2 +- src/Mod/Fem/App/AppFemPy.cpp | 12 +- src/Mod/Fem/App/FemConstraint.cpp | 2 +- src/Mod/Fem/App/FemConstraintBearing.cpp | 4 +- .../Fem/App/FemConstraintFluidBoundary.cpp | 20 +-- src/Mod/Fem/App/FemConstraintForce.cpp | 4 +- src/Mod/Fem/App/FemConstraintGear.cpp | 2 +- src/Mod/Fem/App/FemConstraintHeatflux.cpp | 2 +- src/Mod/Fem/App/FemConstraintTemperature.cpp | 2 +- src/Mod/Fem/App/FemConstraintTransform.cpp | 6 +- src/Mod/Fem/App/FemMesh.cpp | 4 +- src/Mod/Fem/App/FemMeshPyImp.cpp | 156 +++++++++--------- src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp | 2 +- src/Mod/Fem/App/FemMeshShapeObject.cpp | 2 +- src/Mod/Fem/App/FemPostFilter.cpp | 8 +- src/Mod/Fem/App/FemPostFunction.cpp | 2 +- src/Mod/Fem/App/FemPostObject.cpp | 2 +- src/Mod/Fem/App/FemPostPipeline.cpp | 14 +- src/Mod/Fem/App/FemPostPipelinePyImp.cpp | 14 +- src/Mod/Fem/App/FemResultObject.cpp | 2 +- src/Mod/Fem/App/FemSetObject.cpp | 2 +- src/Mod/Fem/App/FemVTKTools.cpp | 6 +- src/Mod/Fem/App/FemVTKTools.h | 4 +- src/Mod/Fem/App/HypothesisPy.cpp | 4 +- src/Mod/Fem/App/PropertyPostDataObject.cpp | 2 +- src/Mod/Fem/Gui/ActiveAnalysisObserver.cpp | 20 +-- src/Mod/Fem/Gui/AppFemGui.cpp | 2 +- src/Mod/Fem/Gui/AppFemGuiPy.cpp | 4 +- src/Mod/Fem/Gui/Command.cpp | 2 +- src/Mod/Fem/Gui/DlgSettingsFemCcxImp.h | 2 +- src/Mod/Fem/Gui/DlgSettingsFemElmerImp.h | 2 +- .../Fem/Gui/DlgSettingsFemExportAbaqusImp.h | 2 +- src/Mod/Fem/Gui/DlgSettingsFemGeneralImp.h | 2 +- src/Mod/Fem/Gui/DlgSettingsFemGmshImp.h | 2 +- src/Mod/Fem/Gui/DlgSettingsFemInOutVtkImp.h | 2 +- src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.h | 2 +- src/Mod/Fem/Gui/DlgSettingsFemMystranImp.h | 2 +- src/Mod/Fem/Gui/DlgSettingsFemZ88Imp.h | 2 +- src/Mod/Fem/Gui/FemSelectionGate.h | 2 +- src/Mod/Fem/Gui/PropertyFemMeshItem.cpp | 2 +- src/Mod/Fem/Gui/TaskAnalysisInfo.h | 2 +- src/Mod/Fem/Gui/TaskCreateNodeSet.h | 2 +- src/Mod/Fem/Gui/TaskDlgMeshShapeNetgen.cpp | 2 +- src/Mod/Fem/Gui/TaskDriver.h | 2 +- src/Mod/Fem/Gui/TaskFemConstraint.cpp | 6 +- src/Mod/Fem/Gui/TaskFemConstraint.h | 2 +- src/Mod/Fem/Gui/TaskFemConstraintBearing.h | 2 +- src/Mod/Fem/Gui/TaskFemConstraintContact.h | 2 +- .../Fem/Gui/TaskFemConstraintDisplacement.h | 2 +- src/Mod/Fem/Gui/TaskFemConstraintFixed.h | 2 +- .../Gui/TaskFemConstraintFluidBoundary.cpp | 34 ++-- .../Fem/Gui/TaskFemConstraintFluidBoundary.h | 2 +- src/Mod/Fem/Gui/TaskFemConstraintForce.h | 2 +- src/Mod/Fem/Gui/TaskFemConstraintGear.cpp | 2 +- src/Mod/Fem/Gui/TaskFemConstraintGear.h | 2 +- src/Mod/Fem/Gui/TaskFemConstraintHeatflux.h | 2 +- .../Gui/TaskFemConstraintInitialTemperature.h | 2 +- .../Fem/Gui/TaskFemConstraintPlaneRotation.h | 2 +- src/Mod/Fem/Gui/TaskFemConstraintPressure.h | 2 +- src/Mod/Fem/Gui/TaskFemConstraintPulley.h | 2 +- src/Mod/Fem/Gui/TaskFemConstraintSpring.h | 2 +- .../Fem/Gui/TaskFemConstraintTemperature.h | 2 +- src/Mod/Fem/Gui/TaskFemConstraintTransform.h | 2 +- src/Mod/Fem/Gui/TaskObjectName.h | 2 +- src/Mod/Fem/Gui/TaskPostBoxes.cpp | 18 +- src/Mod/Fem/Gui/TaskPostBoxes.h | 18 +- src/Mod/Fem/Gui/TaskTetParameter.h | 2 +- src/Mod/Fem/Gui/ViewProviderFemConstraint.cpp | 38 ++--- .../Gui/ViewProviderFemConstraintBearing.cpp | 6 +- .../Gui/ViewProviderFemConstraintContact.cpp | 4 +- .../ViewProviderFemConstraintDisplacement.cpp | 4 +- .../Gui/ViewProviderFemConstraintFixed.cpp | 6 +- ...ViewProviderFemConstraintFluidBoundary.cpp | 6 +- .../Gui/ViewProviderFemConstraintForce.cpp | 6 +- .../Fem/Gui/ViewProviderFemConstraintGear.cpp | 6 +- .../Gui/ViewProviderFemConstraintHeatflux.cpp | 4 +- ...roviderFemConstraintInitialTemperature.cpp | 4 +- ...ViewProviderFemConstraintPlaneRotation.cpp | 4 +- .../Gui/ViewProviderFemConstraintPressure.cpp | 4 +- .../Gui/ViewProviderFemConstraintPulley.cpp | 6 +- .../Gui/ViewProviderFemConstraintSpring.cpp | 4 +- .../ViewProviderFemConstraintTemperature.cpp | 4 +- .../ViewProviderFemConstraintTransform.cpp | 4 +- src/Mod/Fem/Gui/ViewProviderFemMesh.cpp | 12 +- src/Mod/Fem/Gui/ViewProviderFemMeshPyImp.cpp | 14 +- .../Fem/Gui/ViewProviderFemPostFunction.cpp | 2 +- src/Mod/Fem/Gui/ViewProviderFemPostFunction.h | 4 +- src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp | 8 +- 88 files changed, 301 insertions(+), 301 deletions(-) diff --git a/src/Mod/Fem/App/AppFem.cpp b/src/Mod/Fem/App/AppFem.cpp index c6ed257708..9d4ed26626 100644 --- a/src/Mod/Fem/App/AppFem.cpp +++ b/src/Mod/Fem/App/AppFem.cpp @@ -81,7 +81,7 @@ PyMOD_INIT_FUNC(Fem) } catch(const Base::Exception& e) { PyErr_SetString(PyExc_ImportError, e.what()); - PyMOD_Return(0); + PyMOD_Return(nullptr); } PyObject* femModule = Fem::initModule(); Base::Console().Log("Loading Fem module... done\n"); diff --git a/src/Mod/Fem/App/AppFemPy.cpp b/src/Mod/Fem/App/AppFemPy.cpp index f245b5351a..7779ac4767 100644 --- a/src/Mod/Fem/App/AppFemPy.cpp +++ b/src/Mod/Fem/App/AppFemPy.cpp @@ -152,14 +152,14 @@ private: Py::Object insert(const Py::Tuple& args) { char* Name; - const char* DocName = 0; + const char* DocName = nullptr; if (!PyArg_ParseTuple(args.ptr(), "et|s","utf-8",&Name,&DocName)) throw Py::Exception(); std::string EncodedName = std::string(Name); PyMem_Free(Name); - App::Document *pcDoc = 0; + App::Document *pcDoc = nullptr; if (DocName) pcDoc = App::GetApplication().getDocument(DocName); else @@ -245,8 +245,8 @@ private: #ifdef FC_USE_VTK Py::Object readResult(const Py::Tuple& args) { - char* fileName = NULL; - char* objName = NULL; + char* fileName = nullptr; + char* objName = nullptr; if (!PyArg_ParseTuple(args.ptr(), "et|et","utf-8", &fileName, "utf-8", &objName)) throw Py::Exception(); @@ -269,8 +269,8 @@ private: Py::Object writeResult(const Py::Tuple& args) { - char* fileName = NULL; - PyObject *pcObj = NULL; + char* fileName = nullptr; + PyObject *pcObj = nullptr; if (!PyArg_ParseTuple(args.ptr(), "et|O!","utf-8", &fileName, &(App::DocumentObjectPy::Type), &pcObj)) throw Py::Exception(); diff --git a/src/Mod/Fem/App/FemConstraint.cpp b/src/Mod/Fem/App/FemConstraint.cpp index 75dfc989f0..21513c9b99 100644 --- a/src/Mod/Fem/App/FemConstraint.cpp +++ b/src/Mod/Fem/App/FemConstraint.cpp @@ -86,7 +86,7 @@ PROPERTY_SOURCE(Fem::Constraint, App::DocumentObject) Constraint::Constraint() { - ADD_PROPERTY_TYPE(References,(0,0),"Constraint",(App::PropertyType)(App::Prop_None),"Elements where the constraint is applied"); + ADD_PROPERTY_TYPE(References,(nullptr,nullptr),"Constraint",(App::PropertyType)(App::Prop_None),"Elements where the constraint is applied"); ADD_PROPERTY_TYPE(NormalDirection,(Base::Vector3d(0,0,1)),"Constraint",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),"Normal direction pointing outside of solid"); ADD_PROPERTY_TYPE(Scale,(1),"Base",App::PropertyType(App::Prop_Output),"Scale used for drawing constraints"); //OvG: Add scale parameter inherited by all derived constraints diff --git a/src/Mod/Fem/App/FemConstraintBearing.cpp b/src/Mod/Fem/App/FemConstraintBearing.cpp index 79fb24763f..57dcf89b41 100644 --- a/src/Mod/Fem/App/FemConstraintBearing.cpp +++ b/src/Mod/Fem/App/FemConstraintBearing.cpp @@ -45,7 +45,7 @@ PROPERTY_SOURCE(Fem::ConstraintBearing, Fem::Constraint) ConstraintBearing::ConstraintBearing() { - ADD_PROPERTY_TYPE(Location,(0),"ConstraintBearing",(App::PropertyType)(App::Prop_None), + ADD_PROPERTY_TYPE(Location,(nullptr),"ConstraintBearing",(App::PropertyType)(App::Prop_None), "Element giving axial location of constraint"); ADD_PROPERTY(Dist,(0.0)); ADD_PROPERTY(AxialFree,(0)); @@ -80,7 +80,7 @@ void ConstraintBearing::onChanged(const App::Property* prop) Height.setValue(height); // Update base point base = base + axis * height/2; - if (Location.getValue() != NULL) { + if (Location.getValue() != nullptr) { base = getBasePoint(base, axis, Location, Dist.getValue()); } BasePoint.setValue(base); diff --git a/src/Mod/Fem/App/FemConstraintFluidBoundary.cpp b/src/Mod/Fem/App/FemConstraintFluidBoundary.cpp index a34dc50772..dd323516bb 100644 --- a/src/Mod/Fem/App/FemConstraintFluidBoundary.cpp +++ b/src/Mod/Fem/App/FemConstraintFluidBoundary.cpp @@ -47,20 +47,20 @@ PROPERTY_SOURCE(Fem::ConstraintFluidBoundary, Fem::Constraint) // also defined in TaskFemConstraintFluidBoundary.cpp and FoamCaseBuilder/BasicBuilder.py, update simultaneously // the second (index 1) item is the default enum, as index 0 causes compiling error -static const char* BoundaryTypes[] = {"inlet","wall","outlet","interface","freestream", NULL}; -static const char* WallSubtypes[] = {"unspecific", "fixed", "slip", "partialSlip", "moving", NULL}; -static const char* InletSubtypes[] = {"unspecific","totalPressure","uniformVelocity","volumetricFlowRate","massFlowRate", NULL}; -static const char* OutletSubtypes[] = {"unspecific","totalPressure","staticPressure","uniformVelocity", "outFlow", NULL}; -static const char* InterfaceSubtypes[] = {"unspecific","symmetry","wedge","cyclic","empty", NULL}; -static const char* FreestreamSubtypes[] = {"unspecific", "freestream",NULL}; +static const char* BoundaryTypes[] = {"inlet","wall","outlet","interface","freestream", nullptr}; +static const char* WallSubtypes[] = {"unspecific", "fixed", "slip", "partialSlip", "moving", nullptr}; +static const char* InletSubtypes[] = {"unspecific","totalPressure","uniformVelocity","volumetricFlowRate","massFlowRate", nullptr}; +static const char* OutletSubtypes[] = {"unspecific","totalPressure","staticPressure","uniformVelocity", "outFlow", nullptr}; +static const char* InterfaceSubtypes[] = {"unspecific","symmetry","wedge","cyclic","empty", nullptr}; +static const char* FreestreamSubtypes[] = {"unspecific", "freestream",nullptr}; // see Ansys fluet manual: Turbulence Specification method, if not specified, solver will guess a value based e.g. 0.05 for inlet length geometry", -static const char* TurbulenceSpecifications[] = {"intensity&DissipationRate", "intensity&LengthScale","intensity&ViscosityRatio","intensity&HydraulicDiameter",NULL}; +static const char* TurbulenceSpecifications[] = {"intensity&DissipationRate", "intensity&LengthScale","intensity&ViscosityRatio","intensity&HydraulicDiameter",nullptr}; /* only used in TaskFemConstraintFluidBoundary.cpp */ // activate the heat transfer and radiation model in Solver object explorer // also defined in FoamCaseBuilder/HeatTransferBuilder.py, update simultaneously, heatFlux is not a standard OpenFOAM patch type -static const char* ThermalBoundaryTypes[] = {"fixedValue","zeroGradient", "fixedGradient", "mixed", "heatFlux", "HTC","coupled", NULL}; +static const char* ThermalBoundaryTypes[] = {"fixedValue","zeroGradient", "fixedGradient", "mixed", "heatFlux", "HTC","coupled", nullptr}; /* only used in TaskFemConstraintFluidBoundary.cpp static const char* ThermalBoundaryHelpTexts[] = {"fixed Temperature [K]", "no heat transfer ()", "fixed value heat flux [K/m]", "mixed fixedGradient and fixedValue", "fixed heat flux [W/m2]", "Heat transfer coeff [W/(M2)/K]", "conjugate heat transfer with solid", NULL}; @@ -78,7 +78,7 @@ ConstraintFluidBoundary::ConstraintFluidBoundary() ADD_PROPERTY_TYPE(BoundaryValue,(0.0),"FluidBoundary",(App::PropertyType)(App::Prop_None), "Scaler value for the specific value subtype, like pressure, velocity magnitude"); /// Direction should be allowed to edit in property editor, if no edge is available in CAD model - ADD_PROPERTY_TYPE(Direction,(0),"FluidBoundary",(App::PropertyType)(App::Prop_None), + ADD_PROPERTY_TYPE(Direction,(nullptr),"FluidBoundary",(App::PropertyType)(App::Prop_None), "Vector direction of BoundaryValue"); ADD_PROPERTY_TYPE(Reversed,(0),"FluidBoundary",(App::PropertyType)(App::Prop_ReadOnly|App::Prop_Output), "To distinguish inlet (flow outward from solid) or outlet boundary condition"); @@ -182,7 +182,7 @@ void ConstraintFluidBoundary::onChanged(const App::Property* prop) } } else if (prop == &NormalDirection) { // Set a default direction if no direction reference has been given - if (Direction.getValue() == NULL) { + if (Direction.getValue() == nullptr) { Base::Vector3d direction = NormalDirection.getValue(); if (Reversed.getValue()) direction = -direction; diff --git a/src/Mod/Fem/App/FemConstraintForce.cpp b/src/Mod/Fem/App/FemConstraintForce.cpp index 45397cdc6e..77ef50d9de 100644 --- a/src/Mod/Fem/App/FemConstraintForce.cpp +++ b/src/Mod/Fem/App/FemConstraintForce.cpp @@ -46,7 +46,7 @@ PROPERTY_SOURCE(Fem::ConstraintForce, Fem::Constraint) ConstraintForce::ConstraintForce() { ADD_PROPERTY(Force,(0.0)); - ADD_PROPERTY_TYPE(Direction,(0),"ConstraintForce",(App::PropertyType)(App::Prop_None), + ADD_PROPERTY_TYPE(Direction,(nullptr),"ConstraintForce",(App::PropertyType)(App::Prop_None), "Element giving direction of constraint"); ADD_PROPERTY(Reversed,(0)); ADD_PROPERTY_TYPE(Points,(Base::Vector3d()),"ConstraintForce",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), @@ -99,7 +99,7 @@ void ConstraintForce::onChanged(const App::Property* prop) } } else if (prop == &NormalDirection) { // Set a default direction if no direction reference has been given - if (Direction.getValue() == NULL) { + if (Direction.getValue() == nullptr) { Base::Vector3d direction = NormalDirection.getValue(); if (Reversed.getValue()) direction = -direction; diff --git a/src/Mod/Fem/App/FemConstraintGear.cpp b/src/Mod/Fem/App/FemConstraintGear.cpp index 39a59847c6..10c1559323 100644 --- a/src/Mod/Fem/App/FemConstraintGear.cpp +++ b/src/Mod/Fem/App/FemConstraintGear.cpp @@ -48,7 +48,7 @@ ConstraintGear::ConstraintGear() ADD_PROPERTY(Diameter,(100.0)); ADD_PROPERTY(Force,(1000.0)); ADD_PROPERTY(ForceAngle,(0.0)); - ADD_PROPERTY_TYPE(Direction,(0),"ConstraintGear",(App::PropertyType)(App::Prop_None), + ADD_PROPERTY_TYPE(Direction,(nullptr),"ConstraintGear",(App::PropertyType)(App::Prop_None), "Element giving direction of gear force"); ADD_PROPERTY(Reversed,(0)); ADD_PROPERTY_TYPE(DirectionVector,(Base::Vector3d(1,1,1).Normalize()),"ConstraintGear",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), diff --git a/src/Mod/Fem/App/FemConstraintHeatflux.cpp b/src/Mod/Fem/App/FemConstraintHeatflux.cpp index 9485b97907..c9e7847664 100644 --- a/src/Mod/Fem/App/FemConstraintHeatflux.cpp +++ b/src/Mod/Fem/App/FemConstraintHeatflux.cpp @@ -41,7 +41,7 @@ using namespace Fem; PROPERTY_SOURCE(Fem::ConstraintHeatflux, Fem::Constraint) -static const char* ConstraintTypes[] = {"DFlux","Convection", NULL}; +static const char* ConstraintTypes[] = {"DFlux","Convection", nullptr}; ConstraintHeatflux::ConstraintHeatflux() { diff --git a/src/Mod/Fem/App/FemConstraintTemperature.cpp b/src/Mod/Fem/App/FemConstraintTemperature.cpp index 363a34b07f..ff3afc7360 100644 --- a/src/Mod/Fem/App/FemConstraintTemperature.cpp +++ b/src/Mod/Fem/App/FemConstraintTemperature.cpp @@ -42,7 +42,7 @@ using namespace Fem; PROPERTY_SOURCE(Fem::ConstraintTemperature, Fem::Constraint) -static const char* ConstraintTypes[] = {"CFlux","Temperature", NULL}; +static const char* ConstraintTypes[] = {"CFlux","Temperature", nullptr}; ConstraintTemperature::ConstraintTemperature() { diff --git a/src/Mod/Fem/App/FemConstraintTransform.cpp b/src/Mod/Fem/App/FemConstraintTransform.cpp index 4f2e2c172c..dc7d06b2f1 100644 --- a/src/Mod/Fem/App/FemConstraintTransform.cpp +++ b/src/Mod/Fem/App/FemConstraintTransform.cpp @@ -40,7 +40,7 @@ using namespace Fem; PROPERTY_SOURCE(Fem::ConstraintTransform, Fem::Constraint) -static const char* TransformTypes[] = {"Cylindrical","Rectangular", NULL}; +static const char* TransformTypes[] = {"Cylindrical","Rectangular", nullptr}; ConstraintTransform::ConstraintTransform() { @@ -50,8 +50,8 @@ ConstraintTransform::ConstraintTransform() ADD_PROPERTY_TYPE(TransformType,(1),"ConstraintTransform",(App::PropertyType)(App::Prop_None), "Type of transform, rectangular or cylindrical"); TransformType.setEnums(TransformTypes); - ADD_PROPERTY_TYPE(RefDispl,(0,0),"ConstraintTransform",(App::PropertyType)(App::Prop_None),"Elements where the constraint is applied"); - ADD_PROPERTY_TYPE(NameDispl,(0),"ConstraintTransform",(App::PropertyType)(App::Prop_None),"Elements where the constraint is applied"); + ADD_PROPERTY_TYPE(RefDispl,(nullptr,nullptr),"ConstraintTransform",(App::PropertyType)(App::Prop_None),"Elements where the constraint is applied"); + ADD_PROPERTY_TYPE(NameDispl,(nullptr),"ConstraintTransform",(App::PropertyType)(App::Prop_None),"Elements where the constraint is applied"); ADD_PROPERTY_TYPE(BasePoint,(Base::Vector3d(0,0,0)),"ConstraintTransform",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), "Base point of cylindrical surface"); ADD_PROPERTY_TYPE(Axis,(Base::Vector3d(0,1,0)),"ConstraintTransform",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output), diff --git a/src/Mod/Fem/App/FemMesh.cpp b/src/Mod/Fem/App/FemMesh.cpp index 6a02fd272b..840d96ca23 100644 --- a/src/Mod/Fem/App/FemMesh.cpp +++ b/src/Mod/Fem/App/FemMesh.cpp @@ -96,7 +96,7 @@ using namespace boost; static int StatCount = 0; #endif -SMESH_Gen* FemMesh::_mesh_gen = 0; +SMESH_Gen* FemMesh::_mesh_gen = nullptr; TYPESYSTEM_SOURCE(Fem::FemMesh , Base::Persistence) @@ -2526,7 +2526,7 @@ Data::Segment* FemMesh::getSubElement(const char* /*Type*/, unsigned long /*n*/) //str << Type << n; //std::string temp = str.str(); //return new ShapeSegment(getSubShape(temp.c_str())); - return 0; + return nullptr; } struct Fem::FemMesh::FemMeshInfo FemMesh::getInfo(void) const{ diff --git a/src/Mod/Fem/App/FemMeshPyImp.cpp b/src/Mod/Fem/App/FemMeshPyImp.cpp index 7905dde3a3..9073f4efb0 100644 --- a/src/Mod/Fem/App/FemMeshPyImp.cpp +++ b/src/Mod/Fem/App/FemMeshPyImp.cpp @@ -78,7 +78,7 @@ PyObject *FemMeshPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Py // constructor method int FemMeshPy::PyInit(PyObject* args, PyObject* /*kwd*/) { - PyObject *pcObj=0; + PyObject *pcObj=nullptr; if (!PyArg_ParseTuple(args, "|O", &pcObj)) return -1; @@ -116,7 +116,7 @@ PyObject* FemMeshPy::setShape(PyObject *args) { PyObject *pcObj; if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapePy::Type), &pcObj)) - return 0; + return nullptr; try { TopoDS_Shape shape = static_cast(pcObj)->getTopoShapePtr()->getShape(); @@ -124,7 +124,7 @@ PyObject* FemMeshPy::setShape(PyObject *args) } catch (const std::exception& e) { PyErr_SetString(Base::PyExc_FC_GeneralError, e.what()); - return 0; + return nullptr; } Py_Return; } @@ -132,14 +132,14 @@ PyObject* FemMeshPy::setShape(PyObject *args) PyObject* FemMeshPy::addHypothesis(PyObject *args) { PyObject* hyp; - PyObject* shp=0; + PyObject* shp=nullptr; // Since we have not a common base class for the Python binding of the // hypotheses classes we cannot pass a certain Python type if (!PyArg_ParseTuple(args, "O|O!",&hyp, &(Part::TopoShapePy::Type), &shp)) - return 0; + return nullptr; TopoDS_Shape shape; - if (shp == 0) + if (shp == nullptr) shape = getFemMeshPtr()->getSMesh()->GetShapeToMesh(); else shape = static_cast(shp)->getTopoShapePtr()->getShape(); @@ -151,11 +151,11 @@ PyObject* FemMeshPy::addHypothesis(PyObject *args) getFemMeshPtr()->addHypothesis(shape, thesis); } catch (const Py::Exception&) { - return 0; + return nullptr; } catch (const std::exception& e) { PyErr_SetString(Base::PyExc_FC_GeneralError, e.what()); - return 0; + return nullptr; } Py_Return; } @@ -163,14 +163,14 @@ PyObject* FemMeshPy::addHypothesis(PyObject *args) PyObject* FemMeshPy::setStandardHypotheses(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return 0; + return nullptr; try { getFemMeshPtr()->setStandardHypotheses(); } catch (const std::exception& e) { PyErr_SetString(Base::PyExc_FC_GeneralError, e.what()); - return 0; + return nullptr; } Py_Return; } @@ -178,14 +178,14 @@ PyObject* FemMeshPy::setStandardHypotheses(PyObject *args) PyObject* FemMeshPy::compute(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return 0; + return nullptr; try { getFemMeshPtr()->compute(); } catch (const std::exception& e) { PyErr_SetString(Base::PyExc_FC_GeneralError, e.what()); - return 0; + return nullptr; } Py_Return; } @@ -205,7 +205,7 @@ PyObject* FemMeshPy::addNode(PyObject *args) } catch (const std::exception& e) { PyErr_SetString(Base::PyExc_FC_GeneralError, e.what()); - return 0; + return nullptr; } } PyErr_Clear(); @@ -221,13 +221,13 @@ PyObject* FemMeshPy::addNode(PyObject *args) } catch (const std::exception& e) { PyErr_SetString(Base::PyExc_FC_GeneralError, e.what()); - return 0; + return nullptr; } } PyErr_SetString(PyExc_TypeError, "addNode() accepts:\n" "-- addNode(x,y,z)\n" "-- addNode(x,y,z,ElemId)\n"); - return 0; + return nullptr; } PyObject* FemMeshPy::addEdge(PyObject *args) @@ -249,7 +249,7 @@ PyObject* FemMeshPy::addEdge(PyObject *args) } catch (const std::exception& e) { PyErr_SetString(Base::PyExc_FC_GeneralError, e.what()); - return 0; + return nullptr; } } PyErr_Clear(); @@ -268,7 +268,7 @@ PyObject* FemMeshPy::addEdge(PyObject *args) Nodes.push_back(node); } - SMDS_MeshEdge* edge=0; + SMDS_MeshEdge* edge=nullptr; if(ElementId != -1) { switch(Nodes.size()){ case 2: @@ -306,7 +306,7 @@ PyObject* FemMeshPy::addEdge(PyObject *args) PyErr_SetString(PyExc_TypeError, "addEdge accepts:\n" "-- int,int\n" "-- [2|3],[int]\n"); - return 0; + return nullptr; } PyObject* FemMeshPy::addFace(PyObject *args) @@ -331,7 +331,7 @@ PyObject* FemMeshPy::addFace(PyObject *args) } catch (const std::exception& e) { PyErr_SetString(Base::PyExc_FC_GeneralError, e.what()); - return 0; + return nullptr; } } PyErr_Clear(); @@ -350,7 +350,7 @@ PyObject* FemMeshPy::addFace(PyObject *args) Nodes.push_back(node); } - SMDS_MeshFace* face=0; + SMDS_MeshFace* face=nullptr; if(ElementId != -1) { switch(Nodes.size()){ case 3: @@ -409,14 +409,14 @@ PyObject* FemMeshPy::addFace(PyObject *args) PyErr_SetString(PyExc_TypeError, "addFace accepts:\n" "-- int,int,int\n" "-- [3|4|6|8 int],[int]\n"); - return 0; + return nullptr; } PyObject* FemMeshPy::addQuad(PyObject *args) { int n1,n2,n3,n4; if (!PyArg_ParseTuple(args, "iiii",&n1,&n2,&n3,&n4)) - return 0; + return nullptr; try { SMESH_Mesh* mesh = getFemMeshPtr()->getSMesh(); @@ -434,7 +434,7 @@ PyObject* FemMeshPy::addQuad(PyObject *args) } catch (const std::exception& e) { PyErr_SetString(Base::PyExc_FC_GeneralError, e.what()); - return 0; + return nullptr; } } @@ -460,7 +460,7 @@ PyObject* FemMeshPy::addVolume(PyObject *args) } catch (const std::exception& e) { PyErr_SetString(Base::PyExc_FC_GeneralError, e.what()); - return 0; + return nullptr; } } PyErr_Clear(); @@ -479,7 +479,7 @@ PyObject* FemMeshPy::addVolume(PyObject *args) Nodes.push_back(node); } - SMDS_MeshVolume* vol=0; + SMDS_MeshVolume* vol=nullptr; if(ElementId != -1) { switch(Nodes.size()){ case 4: @@ -576,13 +576,13 @@ PyObject* FemMeshPy::addVolume(PyObject *args) PyErr_SetString(PyExc_TypeError, "addVolume accepts:\n" "-- int,int,int,int\n" "-- [4|5|6|8|10|13|15|20 int],[int]\n"); - return 0; + return nullptr; } PyObject* FemMeshPy::copy(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return 0; + return nullptr; const FemMesh& mesh = *getFemMeshPtr(); return new FemMeshPy(new FemMesh(mesh)); @@ -592,7 +592,7 @@ PyObject* FemMeshPy::read(PyObject *args) { char* Name; if (!PyArg_ParseTuple(args, "et","utf-8",&Name)) - return 0; + return nullptr; std::string EncodedName = std::string(Name); PyMem_Free(Name); @@ -601,7 +601,7 @@ PyObject* FemMeshPy::read(PyObject *args) } catch (const std::exception& e) { PyErr_SetString(Base::PyExc_FC_GeneralError, e.what()); - return 0; + return nullptr; } Py_Return; } @@ -610,7 +610,7 @@ PyObject* FemMeshPy::write(PyObject *args) { char* Name; if (!PyArg_ParseTuple(args, "et","utf-8",&Name)) - return 0; + return nullptr; std::string EncodedName = std::string(Name); PyMem_Free(Name); @@ -619,7 +619,7 @@ PyObject* FemMeshPy::write(PyObject *args) } catch (const std::exception& e) { PyErr_SetString(Base::PyExc_FC_GeneralError, e.what()); - return 0; + return nullptr; } Py_Return; } @@ -630,7 +630,7 @@ PyObject* FemMeshPy::writeABAQUS(PyObject *args) int elemParam; PyObject* groupParam; if (!PyArg_ParseTuple(args, "etiO!","utf-8",&Name,&elemParam,&PyBool_Type,&groupParam)) - return 0; + return nullptr; std::string EncodedName = std::string(Name); PyMem_Free(Name); bool grpParam = PyObject_IsTrue(groupParam) ? true : false; @@ -640,7 +640,7 @@ PyObject* FemMeshPy::writeABAQUS(PyObject *args) } catch (const std::exception& e) { PyErr_SetString(Base::PyExc_FC_GeneralError, e.what()); - return 0; + return nullptr; } Py_Return; } @@ -649,7 +649,7 @@ PyObject* FemMeshPy::setTransform(PyObject *args) { PyObject* ptr; if (!PyArg_ParseTuple(args, "O!", &(Base::PlacementPy::Type), &ptr)) - return 0; + return nullptr; Base::Placement* placement = static_cast(ptr)->getPlacementPtr(); Base::Matrix4D mat = placement->toMatrix(); @@ -662,13 +662,13 @@ PyObject* FemMeshPy::getFacesByFace(PyObject *args) { PyObject *pW; if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeFacePy::Type), &pW)) - return 0; + return nullptr; try { const TopoDS_Shape& sh = static_cast(pW)->getTopoShapePtr()->getShape(); if (sh.IsNull()) { PyErr_SetString(PyExc_ValueError, "Face is empty"); - return 0; + return nullptr; } const TopoDS_Face& fc = TopoDS::Face(sh); @@ -683,7 +683,7 @@ PyObject* FemMeshPy::getFacesByFace(PyObject *args) } catch (Standard_Failure& e) { PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString()); - return 0; + return nullptr; } } @@ -692,13 +692,13 @@ PyObject* FemMeshPy::getEdgesByEdge(PyObject *args) { PyObject *pW; if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeEdgePy::Type), &pW)) - return 0; + return nullptr; try { const TopoDS_Shape& sh = static_cast(pW)->getTopoShapePtr()->getShape(); if (sh.IsNull()) { PyErr_SetString(PyExc_ValueError, "Edge is empty"); - return 0; + return nullptr; } const TopoDS_Edge& fc = TopoDS::Edge(sh); @@ -713,7 +713,7 @@ PyObject* FemMeshPy::getEdgesByEdge(PyObject *args) } catch (Standard_Failure& e) { PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString()); - return 0; + return nullptr; } } @@ -721,13 +721,13 @@ PyObject* FemMeshPy::getVolumesByFace(PyObject *args) { PyObject *pW; if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeFacePy::Type), &pW)) - return 0; + return nullptr; try { const TopoDS_Shape& sh = static_cast(pW)->getTopoShapePtr()->getShape(); if (sh.IsNull()) { PyErr_SetString(PyExc_ValueError, "Face is empty"); - return 0; + return nullptr; } const TopoDS_Face& fc = TopoDS::Face(sh); @@ -745,7 +745,7 @@ PyObject* FemMeshPy::getVolumesByFace(PyObject *args) } catch (Standard_Failure& e) { PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString()); - return 0; + return nullptr; } } @@ -753,13 +753,13 @@ PyObject* FemMeshPy::getccxVolumesByFace(PyObject *args) { PyObject *pW; if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeFacePy::Type), &pW)) - return 0; + return nullptr; try { const TopoDS_Shape& sh = static_cast(pW)->getTopoShapePtr()->getShape(); if (sh.IsNull()) { PyErr_SetString(PyExc_ValueError, "Face is empty"); - return 0; + return nullptr; } const TopoDS_Face& fc = TopoDS::Face(sh); @@ -777,7 +777,7 @@ PyObject* FemMeshPy::getccxVolumesByFace(PyObject *args) } catch (Standard_Failure& e) { PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString()); - return 0; + return nullptr; } } @@ -785,7 +785,7 @@ PyObject* FemMeshPy::getNodeById(PyObject *args) { int id; if (!PyArg_ParseTuple(args, "i", &id)) - return 0; + return nullptr; Base::Matrix4D Mtrx = getFemMeshPtr()->getTransform(); const SMDS_MeshNode* aNode = getFemMeshPtr()->getSMesh()->GetMeshDS()->FindNode(id); @@ -796,7 +796,7 @@ PyObject* FemMeshPy::getNodeById(PyObject *args) return new Base::VectorPy( vec ); }else{ PyErr_SetString(PyExc_ValueError, "No valid node ID"); - return 0; + return nullptr; } } @@ -804,14 +804,14 @@ PyObject* FemMeshPy::getNodesBySolid(PyObject *args) { PyObject *pW; if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeSolidPy::Type), &pW)) - return 0; + return nullptr; try { const TopoDS_Shape& sh = static_cast(pW)->getTopoShapePtr()->getShape(); const TopoDS_Solid& fc = TopoDS::Solid(sh); if (sh.IsNull()) { PyErr_SetString(PyExc_ValueError, "Solid is empty"); - return 0; + return nullptr; } Py::List ret; std::set resultSet = getFemMeshPtr()->getNodesBySolid(fc); @@ -823,7 +823,7 @@ PyObject* FemMeshPy::getNodesBySolid(PyObject *args) } catch (Standard_Failure& e) { PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString()); - return 0; + return nullptr; } } @@ -831,14 +831,14 @@ PyObject* FemMeshPy::getNodesByFace(PyObject *args) { PyObject *pW; if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeFacePy::Type), &pW)) - return 0; + return nullptr; try { const TopoDS_Shape& sh = static_cast(pW)->getTopoShapePtr()->getShape(); const TopoDS_Face& fc = TopoDS::Face(sh); if (sh.IsNull()) { PyErr_SetString(PyExc_ValueError, "Face is empty"); - return 0; + return nullptr; } Py::List ret; std::set resultSet = getFemMeshPtr()->getNodesByFace(fc); @@ -850,7 +850,7 @@ PyObject* FemMeshPy::getNodesByFace(PyObject *args) } catch (Standard_Failure& e) { PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString()); - return 0; + return nullptr; } } @@ -858,14 +858,14 @@ PyObject* FemMeshPy::getNodesByEdge(PyObject *args) { PyObject *pW; if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeEdgePy::Type), &pW)) - return 0; + return nullptr; try { const TopoDS_Shape& sh = static_cast(pW)->getTopoShapePtr()->getShape(); const TopoDS_Edge& fc = TopoDS::Edge(sh); if (sh.IsNull()) { PyErr_SetString(PyExc_ValueError, "Edge is empty"); - return 0; + return nullptr; } Py::List ret; std::set resultSet = getFemMeshPtr()->getNodesByEdge(fc); @@ -877,7 +877,7 @@ PyObject* FemMeshPy::getNodesByEdge(PyObject *args) } catch (Standard_Failure& e) { PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString()); - return 0; + return nullptr; } } @@ -885,14 +885,14 @@ PyObject* FemMeshPy::getNodesByVertex(PyObject *args) { PyObject *pW; if (!PyArg_ParseTuple(args, "O!", &(Part::TopoShapeVertexPy::Type), &pW)) - return 0; + return nullptr; try { const TopoDS_Shape& sh = static_cast(pW)->getTopoShapePtr()->getShape(); const TopoDS_Vertex& fc = TopoDS::Vertex(sh); if (sh.IsNull()) { PyErr_SetString(PyExc_ValueError, "Vertex is empty"); - return 0; + return nullptr; } Py::List ret; std::set resultSet = getFemMeshPtr()->getNodesByVertex(fc); @@ -904,7 +904,7 @@ PyObject* FemMeshPy::getNodesByVertex(PyObject *args) } catch (Standard_Failure& e) { PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString()); - return 0; + return nullptr; } } @@ -912,7 +912,7 @@ PyObject* FemMeshPy::getElementNodes(PyObject *args) { int id; if (!PyArg_ParseTuple(args, "i", &id)) - return 0; + return nullptr; try { std::list resultSet = getFemMeshPtr()->getElementNodes(id); @@ -925,7 +925,7 @@ PyObject* FemMeshPy::getElementNodes(PyObject *args) } catch (Standard_Failure& e) { PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString()); - return 0; + return nullptr; } } @@ -933,12 +933,12 @@ PyObject* FemMeshPy::getGroupName(PyObject *args) { int id; if (!PyArg_ParseTuple(args, "i", &id)) - return 0; + return nullptr; SMESH_Group* group = getFemMeshPtr()->getSMesh()->GetGroup(id); if (!group) { PyErr_SetString(PyExc_ValueError, "No group for given id"); - return 0; + return nullptr; } return PyUnicode_FromString(group->GetName()); } @@ -947,12 +947,12 @@ PyObject* FemMeshPy::getGroupElementType(PyObject *args) { int id; if (!PyArg_ParseTuple(args, "i", &id)) - return 0; + return nullptr; SMESH_Group* group = getFemMeshPtr()->getSMesh()->GetGroup(id); if (!group) { PyErr_SetString(PyExc_ValueError, "No group for given id"); - return 0; + return nullptr; } SMDSAbs_ElementType aElementType = group->GetGroupDS()->GetType(); const char* typeString = ""; @@ -973,12 +973,12 @@ PyObject* FemMeshPy::getGroupElements(PyObject *args) { int id; if (!PyArg_ParseTuple(args, "i", &id)) - return 0; + return nullptr; SMESH_Group* group = getFemMeshPtr()->getSMesh()->GetGroup(id); if (!group) { PyErr_SetString(PyExc_ValueError, "No group for given id"); - return 0; + return nullptr; } std::set ids; @@ -1008,7 +1008,7 @@ PyObject* FemMeshPy::addGroup(PyObject *args) char* typeString; int theId = -1; if (!PyArg_ParseTuple(args, "etet|i","utf-8", &Name, "utf-8", &typeString, &theId)) - return 0; + return nullptr; std::string EncodedName = std::string(Name); PyMem_Free(Name); @@ -1023,7 +1023,7 @@ PyObject* FemMeshPy::addGroup(PyObject *args) } catch (Standard_Failure& e) { PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString()); - return 0; + return nullptr; } std::cout << "Added Group: Name: \'" << EncodedName << "\' Type: \'" << EncodedTypeString << "\' id: " << retId << std::endl; @@ -1042,7 +1042,7 @@ PyObject* FemMeshPy::addGroupElements(PyObject *args) if (!PyArg_ParseTuple(args, "iO!", &id, &PyList_Type, &pList)) { PyErr_SetString(PyExc_TypeError, "AddGroupElements: 2nd Parameter must be a list."); - return 0; + return nullptr; } std::set ids; @@ -1052,7 +1052,7 @@ PyObject* FemMeshPy::addGroupElements(PyObject *args) pItem = PyList_GetItem(pList, i); if(!PyLong_Check(pItem)) { PyErr_SetString(PyExc_TypeError, "AddGroupElements: List items must be integers."); - return 0; + return nullptr; } ids.insert(PyLong_AsSsize_t(pItem)); // Py_ssize_t transparently handles maximum array lengths on 32bit and 64bit machines @@ -1070,7 +1070,7 @@ PyObject* FemMeshPy::addGroupElements(PyObject *args) } catch (Standard_Failure& e) { PyErr_SetString(Base::PyExc_FC_CADKernelError, e.GetMessageString()); - return 0; + return nullptr; } Py_Return; @@ -1080,7 +1080,7 @@ PyObject* FemMeshPy::removeGroup(PyObject *args) { int theId; if (!PyArg_ParseTuple(args, "i", &theId)) - return 0; + return nullptr; return PyBool_FromLong((long)(getFemMeshPtr()->removeGroup(theId))); } @@ -1089,7 +1089,7 @@ PyObject* FemMeshPy::getElementType(PyObject *args) { int id; if (!PyArg_ParseTuple(args, "i", &id)) - return 0; + return nullptr; // An element ... SMDSAbs_ElementType aElementType = getFemMeshPtr()->getSMesh()->GetElementType(id, true); @@ -1107,7 +1107,7 @@ PyObject* FemMeshPy::getElementType(PyObject *args) case SMDSAbs_Ball : typeString = "Ball"; break; default: { PyErr_SetString(PyExc_ValueError, "No node or element for given id"); - return 0; + return nullptr; } } @@ -1118,7 +1118,7 @@ PyObject* FemMeshPy::getIdByElementType(PyObject *args) { char* str; if (!PyArg_ParseTuple(args, "s", &str)) - return 0; + return nullptr; SMDSAbs_ElementType aElementType = SMDSAbs_All; if (strcmp(str, "Node") == 0) { @@ -1352,7 +1352,7 @@ Py::Object FemMeshPy::getVolume(void) const PyObject *FemMeshPy::getCustomAttributes(const char* /*attr*/) const { - return 0; + return nullptr; } int FemMeshPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) diff --git a/src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp b/src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp index 97b4d3be4b..b0eb876df4 100644 --- a/src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp +++ b/src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp @@ -53,7 +53,7 @@ using namespace App; PROPERTY_SOURCE(Fem::FemMeshShapeNetgenObject, Fem::FemMeshShapeObject) -const char* FinenessEnums[]= {"VeryCoarse","Coarse","Moderate","Fine","VeryFine","UserDefined",NULL}; +const char* FinenessEnums[]= {"VeryCoarse","Coarse","Moderate","Fine","VeryFine","UserDefined",nullptr}; FemMeshShapeNetgenObject::FemMeshShapeNetgenObject() { diff --git a/src/Mod/Fem/App/FemMeshShapeObject.cpp b/src/Mod/Fem/App/FemMeshShapeObject.cpp index fffd2bffbc..d81f0229c1 100644 --- a/src/Mod/Fem/App/FemMeshShapeObject.cpp +++ b/src/Mod/Fem/App/FemMeshShapeObject.cpp @@ -78,7 +78,7 @@ PROPERTY_SOURCE(Fem::FemMeshShapeObject, Fem::FemMeshObject) FemMeshShapeObject::FemMeshShapeObject() { - ADD_PROPERTY_TYPE(Shape,(0), "FEM Mesh",Prop_None,"Geometry object, the mesh is made from. The geometry object has to have a Shape."); + ADD_PROPERTY_TYPE(Shape,(nullptr), "FEM Mesh",Prop_None,"Geometry object, the mesh is made from. The geometry object has to have a Shape."); } FemMeshShapeObject::~FemMeshShapeObject() diff --git a/src/Mod/Fem/App/FemPostFilter.cpp b/src/Mod/Fem/App/FemPostFilter.cpp index 5453497448..abfb9074de 100644 --- a/src/Mod/Fem/App/FemPostFilter.cpp +++ b/src/Mod/Fem/App/FemPostFilter.cpp @@ -42,7 +42,7 @@ PROPERTY_SOURCE(Fem::FemPostFilter, Fem::FemPostObject) FemPostFilter::FemPostFilter() { - ADD_PROPERTY(Input,(0)); + ADD_PROPERTY(Input,(nullptr)); } FemPostFilter::~FemPostFilter() @@ -105,7 +105,7 @@ vtkDataObject* FemPostFilter::getInputData() { } } - return NULL; + return nullptr; } @@ -113,7 +113,7 @@ PROPERTY_SOURCE(Fem::FemPostClipFilter, Fem::FemPostFilter) FemPostClipFilter::FemPostClipFilter(void) : FemPostFilter() { - ADD_PROPERTY_TYPE(Function, (0), "Clip", App::Prop_None, "The function object which defines the clip regions"); + ADD_PROPERTY_TYPE(Function, (nullptr), "Clip", App::Prop_None, "The function object which defines the clip regions"); ADD_PROPERTY_TYPE(InsideOut, (false), "Clip", App::Prop_None, "Invert the clip direction"); ADD_PROPERTY_TYPE(CutCells, (false), "Clip", App::Prop_None, "Decides if cells are cuttet and interpolated or if the cells are kept as a whole"); @@ -579,7 +579,7 @@ PROPERTY_SOURCE(Fem::FemPostCutFilter, Fem::FemPostFilter) FemPostCutFilter::FemPostCutFilter(void) : FemPostFilter() { - ADD_PROPERTY_TYPE(Function, (0), "Cut", App::Prop_None, "The function object which defines the clip cut function"); + ADD_PROPERTY_TYPE(Function, (nullptr), "Cut", App::Prop_None, "The function object which defines the clip cut function"); FilterPipeline clip; m_cutter = vtkSmartPointer::New(); diff --git a/src/Mod/Fem/App/FemPostFunction.cpp b/src/Mod/Fem/App/FemPostFunction.cpp index 3a6b927c0a..6b1034402c 100644 --- a/src/Mod/Fem/App/FemPostFunction.cpp +++ b/src/Mod/Fem/App/FemPostFunction.cpp @@ -36,7 +36,7 @@ PROPERTY_SOURCE(Fem::FemPostFunctionProvider, App::DocumentObject) FemPostFunctionProvider::FemPostFunctionProvider(void): DocumentObject() { - ADD_PROPERTY(Functions, (0)); + ADD_PROPERTY(Functions, (nullptr)); } FemPostFunctionProvider::~FemPostFunctionProvider() { diff --git a/src/Mod/Fem/App/FemPostObject.cpp b/src/Mod/Fem/App/FemPostObject.cpp index c6e9a3c4b5..ecbeb02ab8 100644 --- a/src/Mod/Fem/App/FemPostObject.cpp +++ b/src/Mod/Fem/App/FemPostObject.cpp @@ -42,7 +42,7 @@ PROPERTY_SOURCE(Fem::FemPostObject, App::GeoFeature) FemPostObject::FemPostObject() { - ADD_PROPERTY(Data,(0)); + ADD_PROPERTY(Data,(nullptr)); } FemPostObject::~FemPostObject() diff --git a/src/Mod/Fem/App/FemPostPipeline.cpp b/src/Mod/Fem/App/FemPostPipeline.cpp index ef27281289..925cf97808 100644 --- a/src/Mod/Fem/App/FemPostPipeline.cpp +++ b/src/Mod/Fem/App/FemPostPipeline.cpp @@ -54,12 +54,12 @@ using namespace Fem; using namespace App; PROPERTY_SOURCE(Fem::FemPostPipeline, Fem::FemPostObject) -const char* FemPostPipeline::ModeEnums[]= {"Serial","Parallel",NULL}; +const char* FemPostPipeline::ModeEnums[]= {"Serial","Parallel",nullptr}; FemPostPipeline::FemPostPipeline() { - ADD_PROPERTY_TYPE(Filter, (0), "Pipeline", App::Prop_None, "The filter used in this pipeline"); - ADD_PROPERTY_TYPE(Functions, (0), "Pipeline", App::Prop_Hidden, "The function provider which groups all pipeline functions"); + ADD_PROPERTY_TYPE(Filter, (nullptr), "Pipeline", App::Prop_None, "The filter used in this pipeline"); + ADD_PROPERTY_TYPE(Functions, (nullptr), "Pipeline", App::Prop_Hidden, "The function provider which groups all pipeline functions"); ADD_PROPERTY_TYPE(Mode,(long(0)), "Pipeline", App::Prop_None, "Selects the pipeline data transition mode. In serial, every filter" "gets the output of the previous one as input. In parallel, every" "filter gets the pipeline source as input."); @@ -200,8 +200,8 @@ void FemPostPipeline::onChanged(const Property* prop) //if we have no input the filters are responsible of grabbing the pipeline data themself else { //the first filter must always grab the data - if(filter->Input.getValue() != NULL) - filter->Input.setValue(NULL); + if(filter->Input.getValue() != nullptr) + filter->Input.setValue(nullptr); //all the others need to be connected to the previous filter or grab the data, dependent on mode ++it; @@ -213,8 +213,8 @@ void FemPostPipeline::onChanged(const Property* prop) nextFilter->Input.setValue(filter); } else { //Parallel mode - if( nextFilter->Input.getValue() != NULL) - nextFilter->Input.setValue(NULL); + if( nextFilter->Input.getValue() != nullptr) + nextFilter->Input.setValue(nullptr); } filter = nextFilter; diff --git a/src/Mod/Fem/App/FemPostPipelinePyImp.cpp b/src/Mod/Fem/App/FemPostPipelinePyImp.cpp index f3196d62f7..f85ede2353 100644 --- a/src/Mod/Fem/App/FemPostPipelinePyImp.cpp +++ b/src/Mod/Fem/App/FemPostPipelinePyImp.cpp @@ -45,19 +45,19 @@ PyObject* FemPostPipelinePy::read(PyObject *args) PyMem_Free(Name); Py_Return; } - return 0; + return nullptr; } PyObject* FemPostPipelinePy::load(PyObject *args) { PyObject* py; if (!PyArg_ParseTuple(args, "O!", &(App::DocumentObjectPy::Type), &py)) - return 0; + return nullptr; App::DocumentObject* obj = static_cast(py)->getDocumentObjectPtr(); if (!obj->getTypeId().isDerivedFrom(FemResultObject::getClassTypeId())) { PyErr_SetString(PyExc_TypeError, "object is not a result object"); - return 0; + return nullptr; } getFemPostPipelinePtr()->load(static_cast(obj)); @@ -67,7 +67,7 @@ PyObject* FemPostPipelinePy::load(PyObject *args) PyObject* FemPostPipelinePy::getLastPostObject(PyObject *args) { if (!PyArg_ParseTuple(args, "")) - return 0; + return nullptr; App::DocumentObject* obj = getFemPostPipelinePtr()->getLastPostObject(); if (obj) @@ -79,12 +79,12 @@ PyObject* FemPostPipelinePy::holdsPostObject(PyObject *args) { PyObject* py; if (!PyArg_ParseTuple(args, "O!", &(App::DocumentObjectPy::Type), &py)) - return 0; + return nullptr; App::DocumentObject* obj = static_cast(py)->getDocumentObjectPtr(); if (!obj->getTypeId().isDerivedFrom(FemPostObject::getClassTypeId())) { PyErr_SetString(PyExc_TypeError, "object is not a post-processing object"); - return 0; + return nullptr; } bool ok = getFemPostPipelinePtr()->holdsPostObject(static_cast(obj)); @@ -93,7 +93,7 @@ PyObject* FemPostPipelinePy::holdsPostObject(PyObject *args) PyObject *FemPostPipelinePy::getCustomAttributes(const char* /*attr*/) const { - return 0; + return nullptr; } int FemPostPipelinePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) diff --git a/src/Mod/Fem/App/FemResultObject.cpp b/src/Mod/Fem/App/FemResultObject.cpp index e1750b7311..2c4af8b60c 100644 --- a/src/Mod/Fem/App/FemResultObject.cpp +++ b/src/Mod/Fem/App/FemResultObject.cpp @@ -38,7 +38,7 @@ PROPERTY_SOURCE(Fem::FemResultObject, App::DocumentObject) FemResultObject::FemResultObject() { - ADD_PROPERTY_TYPE(Mesh,(0), "General",Prop_None,"Link to the corresponding mesh"); + ADD_PROPERTY_TYPE(Mesh,(nullptr), "General",Prop_None,"Link to the corresponding mesh"); ADD_PROPERTY_TYPE(NodeNumbers,(0), "NodeData",Prop_None,"Numbers of the result nodes"); ADD_PROPERTY_TYPE(Stats,(0), "Data",Prop_None,"Statistics of the results"); ADD_PROPERTY_TYPE(Time,(0), "Data",Prop_None,"Time of analysis increment"); diff --git a/src/Mod/Fem/App/FemSetObject.cpp b/src/Mod/Fem/App/FemSetObject.cpp index 2ed41d1005..040ad89c49 100644 --- a/src/Mod/Fem/App/FemSetObject.cpp +++ b/src/Mod/Fem/App/FemSetObject.cpp @@ -38,7 +38,7 @@ PROPERTY_SOURCE(Fem::FemSetObject, App::DocumentObject) FemSetObject::FemSetObject() { - ADD_PROPERTY_TYPE(FemMesh,(0), "MeshSet link",Prop_None,"MeshSet the set belongs to"); + ADD_PROPERTY_TYPE(FemMesh,(nullptr), "MeshSet link",Prop_None,"MeshSet the set belongs to"); } FemSetObject::~FemSetObject() diff --git a/src/Mod/Fem/App/FemVTKTools.cpp b/src/Mod/Fem/App/FemVTKTools.cpp index 30cfbfdf97..5c969433f4 100644 --- a/src/Mod/Fem/App/FemVTKTools.cpp +++ b/src/Mod/Fem/App/FemVTKTools.cpp @@ -527,7 +527,7 @@ App::DocumentObject* getObjectByType(const Base::Type type) return static_cast(*it); // return the first of that type } } - return NULL; + return nullptr; } App::DocumentObject* createObjectByType(const Base::Type type) @@ -583,7 +583,7 @@ App::DocumentObject* FemVTKTools::readResult(const char* filename, App::Document App::DocumentObject* obj = pcDoc->getActiveObject(); vtkSmartPointer dataset = ds; - App::DocumentObject* result = NULL; + App::DocumentObject* result = nullptr; if (res) { @@ -595,7 +595,7 @@ App::DocumentObject* FemVTKTools::readResult(const char* filename, App::Document else { Base::Console().Message("the active object is not the correct type, do nothing\n"); - return NULL; + return nullptr; } } diff --git a/src/Mod/Fem/App/FemVTKTools.h b/src/Mod/Fem/App/FemVTKTools.h index d9bed761f2..e22c844790 100644 --- a/src/Mod/Fem/App/FemVTKTools.h +++ b/src/Mod/Fem/App/FemVTKTools.h @@ -63,10 +63,10 @@ namespace Fem static void writeVTKMesh(const char* Filename, const FemMesh* mesh); // FemResult (activeObject or created if res= NULL) read from vtkUnstructuredGrid dataset file - static App::DocumentObject* readResult(const char* Filename, App::DocumentObject* res = NULL); + static App::DocumentObject* readResult(const char* Filename, App::DocumentObject* res = nullptr); // write FemResult (activeObject if res= NULL) to vtkUnstructuredGrid dataset file - static void writeResult(const char* filename, const App::DocumentObject* res = NULL); + static void writeResult(const char* filename, const App::DocumentObject* res = nullptr); }; } diff --git a/src/Mod/Fem/App/HypothesisPy.cpp b/src/Mod/Fem/App/HypothesisPy.cpp index 9dfb45ee34..04b19c6268 100755 --- a/src/Mod/Fem/App/HypothesisPy.cpp +++ b/src/Mod/Fem/App/HypothesisPy.cpp @@ -221,7 +221,7 @@ PyObject *SMESH_HypothesisPy::PyMake(struct _typeobject * /*type*/, PyObject int hypId; PyObject* obj; if (!PyArg_ParseTuple(args, "iO!",&hypId,&(FemMeshPy::Type),&obj)) - return 0; + return nullptr; FemMesh* mesh = static_cast(obj)->getFemMeshPtr(); #if SMESH_VERSION_MAJOR >= 9 return new T(hypId, mesh->getGenerator()); @@ -294,7 +294,7 @@ StdMeshers_AutomaticLengthPy::StdMeshers_AutomaticLengthPy(int /*hypId*/, SMESH_ } #else StdMeshers_AutomaticLengthPy::StdMeshers_AutomaticLengthPy(int /*hypId*/, int /*studyId*/, SMESH_Gen* /*gen*/) - : SMESH_HypothesisPyBase(0) + : SMESH_HypothesisPyBase(nullptr) { } #endif diff --git a/src/Mod/Fem/App/PropertyPostDataObject.cpp b/src/Mod/Fem/App/PropertyPostDataObject.cpp index 954e46cfbb..c45134faf7 100644 --- a/src/Mod/Fem/App/PropertyPostDataObject.cpp +++ b/src/Mod/Fem/App/PropertyPostDataObject.cpp @@ -75,7 +75,7 @@ void PropertyPostDataObject::setValue(const vtkSmartPointer& ds) m_dataObject->DeepCopy(ds); } else - m_dataObject = NULL; + m_dataObject = nullptr; hasSetValue(); } diff --git a/src/Mod/Fem/Gui/ActiveAnalysisObserver.cpp b/src/Mod/Fem/Gui/ActiveAnalysisObserver.cpp index d1382ba49d..2c018ed947 100644 --- a/src/Mod/Fem/Gui/ActiveAnalysisObserver.cpp +++ b/src/Mod/Fem/Gui/ActiveAnalysisObserver.cpp @@ -31,7 +31,7 @@ using namespace FemGui; -ActiveAnalysisObserver* ActiveAnalysisObserver::inst = 0; +ActiveAnalysisObserver* ActiveAnalysisObserver::inst = nullptr; ActiveAnalysisObserver* ActiveAnalysisObserver::instance() { @@ -41,7 +41,7 @@ ActiveAnalysisObserver* ActiveAnalysisObserver::instance() } ActiveAnalysisObserver::ActiveAnalysisObserver() - : activeObject(0), activeView(0), activeDocument(0) + : activeObject(nullptr), activeView(nullptr), activeDocument(nullptr) { } @@ -59,8 +59,8 @@ void ActiveAnalysisObserver::setActiveObject(Fem::FemAnalysis* fem) attachDocument(doc); } else { - activeObject = 0; - activeView = 0; + activeObject = nullptr; + activeView = nullptr; } } @@ -71,7 +71,7 @@ Fem::FemAnalysis* ActiveAnalysisObserver::getActiveObject() const bool ActiveAnalysisObserver::hasActiveObject() const { - return activeObject != 0; + return activeObject != nullptr; } void ActiveAnalysisObserver::highlightActiveObject(const Gui::HighlightMode& mode, bool on) @@ -84,9 +84,9 @@ void ActiveAnalysisObserver::slotDeletedDocument(const App::Document& Doc) { App::Document* d = getDocument(); if (d == &Doc) { - activeObject = 0; - activeDocument = 0; - activeView = 0; + activeObject = nullptr; + activeDocument = nullptr; + activeView = nullptr; detachDocument(); } } @@ -94,7 +94,7 @@ void ActiveAnalysisObserver::slotDeletedDocument(const App::Document& Doc) void ActiveAnalysisObserver::slotDeletedObject(const App::DocumentObject& Obj) { if (activeObject == &Obj) { - activeObject = 0; - activeView = 0; + activeObject = nullptr; + activeView = nullptr; } } diff --git a/src/Mod/Fem/Gui/AppFemGui.cpp b/src/Mod/Fem/Gui/AppFemGui.cpp index 2717f1218b..d1d1f8eb23 100644 --- a/src/Mod/Fem/Gui/AppFemGui.cpp +++ b/src/Mod/Fem/Gui/AppFemGui.cpp @@ -95,7 +95,7 @@ PyMOD_INIT_FUNC(FemGui) { if (!Gui::Application::Instance) { PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application."); - PyMOD_Return(0); + PyMOD_Return(nullptr); } PyObject* mod = FemGui::initModule(); diff --git a/src/Mod/Fem/Gui/AppFemGuiPy.cpp b/src/Mod/Fem/Gui/AppFemGuiPy.cpp index 94f1bb223a..fd9f3276e1 100755 --- a/src/Mod/Fem/Gui/AppFemGuiPy.cpp +++ b/src/Mod/Fem/Gui/AppFemGuiPy.cpp @@ -77,10 +77,10 @@ private: { if (FemGui::ActiveAnalysisObserver::instance()->hasActiveObject()) { FemGui::ActiveAnalysisObserver::instance()->highlightActiveObject(Gui::HighlightMode::Blue, false); - FemGui::ActiveAnalysisObserver::instance()->setActiveObject(0); + FemGui::ActiveAnalysisObserver::instance()->setActiveObject(nullptr); } - PyObject* object = 0; + PyObject* object = nullptr; if (PyArg_ParseTuple(args.ptr(), "|O!", &(App::DocumentObjectPy::Type), &object) && object) { App::DocumentObject* obj = static_cast(object)->getDocumentObjectPtr(); if (!obj || !obj->getTypeId().isDerivedFrom(Fem::FemAnalysis::getClassTypeId())) { diff --git a/src/Mod/Fem/Gui/Command.cpp b/src/Mod/Fem/Gui/Command.cpp index 66d5cfa290..3ec187b098 100644 --- a/src/Mod/Fem/Gui/Command.cpp +++ b/src/Mod/Fem/Gui/Command.cpp @@ -1518,7 +1518,7 @@ void CmdFemPostFunctions::activated(int iMsg) this->updateActive(); //most of the times functions are added inside of a filter, make sure this still works - if(Gui::Application::Instance->activeDocument()->getInEdit() == NULL) + if(Gui::Application::Instance->activeDocument()->getInEdit() == nullptr) doCommand(Gui,"Gui.activeDocument().setEdit('%s')",FeatName.c_str()); } else { diff --git a/src/Mod/Fem/Gui/DlgSettingsFemCcxImp.h b/src/Mod/Fem/Gui/DlgSettingsFemCcxImp.h index fb85c1cb84..0ef22f5594 100644 --- a/src/Mod/Fem/Gui/DlgSettingsFemCcxImp.h +++ b/src/Mod/Fem/Gui/DlgSettingsFemCcxImp.h @@ -37,7 +37,7 @@ class DlgSettingsFemCcxImp : public Gui::Dialog::PreferencePage Q_OBJECT public: - DlgSettingsFemCcxImp( QWidget* parent = 0 ); + DlgSettingsFemCcxImp( QWidget* parent = nullptr ); ~DlgSettingsFemCcxImp(); protected: diff --git a/src/Mod/Fem/Gui/DlgSettingsFemElmerImp.h b/src/Mod/Fem/Gui/DlgSettingsFemElmerImp.h index cdb52b6c77..746c37e9c0 100644 --- a/src/Mod/Fem/Gui/DlgSettingsFemElmerImp.h +++ b/src/Mod/Fem/Gui/DlgSettingsFemElmerImp.h @@ -36,7 +36,7 @@ class DlgSettingsFemElmerImp : public Gui::Dialog::PreferencePage Q_OBJECT public: - DlgSettingsFemElmerImp( QWidget* parent = 0 ); + DlgSettingsFemElmerImp( QWidget* parent = nullptr ); ~DlgSettingsFemElmerImp(); protected: diff --git a/src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusImp.h b/src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusImp.h index 2dbc784ae4..3b8f2a971f 100644 --- a/src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusImp.h +++ b/src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusImp.h @@ -36,7 +36,7 @@ class DlgSettingsFemExportAbaqusImp : public Gui::Dialog::PreferencePage Q_OBJECT public: - DlgSettingsFemExportAbaqusImp( QWidget* parent = 0 ); + DlgSettingsFemExportAbaqusImp( QWidget* parent = nullptr ); ~DlgSettingsFemExportAbaqusImp(); protected: diff --git a/src/Mod/Fem/Gui/DlgSettingsFemGeneralImp.h b/src/Mod/Fem/Gui/DlgSettingsFemGeneralImp.h index 06f86c6ad6..c0fdb0b3cd 100644 --- a/src/Mod/Fem/Gui/DlgSettingsFemGeneralImp.h +++ b/src/Mod/Fem/Gui/DlgSettingsFemGeneralImp.h @@ -36,7 +36,7 @@ class DlgSettingsFemGeneralImp : public Gui::Dialog::PreferencePage Q_OBJECT public: - DlgSettingsFemGeneralImp( QWidget* parent = 0 ); + DlgSettingsFemGeneralImp( QWidget* parent = nullptr ); ~DlgSettingsFemGeneralImp(); protected: diff --git a/src/Mod/Fem/Gui/DlgSettingsFemGmshImp.h b/src/Mod/Fem/Gui/DlgSettingsFemGmshImp.h index d5b7ab56df..cc453e70e7 100644 --- a/src/Mod/Fem/Gui/DlgSettingsFemGmshImp.h +++ b/src/Mod/Fem/Gui/DlgSettingsFemGmshImp.h @@ -36,7 +36,7 @@ class DlgSettingsFemGmshImp : public Gui::Dialog::PreferencePage Q_OBJECT public: - DlgSettingsFemGmshImp( QWidget* parent = 0 ); + DlgSettingsFemGmshImp( QWidget* parent = nullptr ); ~DlgSettingsFemGmshImp(); protected: diff --git a/src/Mod/Fem/Gui/DlgSettingsFemInOutVtkImp.h b/src/Mod/Fem/Gui/DlgSettingsFemInOutVtkImp.h index 92533971d2..7dd612966f 100644 --- a/src/Mod/Fem/Gui/DlgSettingsFemInOutVtkImp.h +++ b/src/Mod/Fem/Gui/DlgSettingsFemInOutVtkImp.h @@ -36,7 +36,7 @@ class DlgSettingsFemInOutVtkImp : public Gui::Dialog::PreferencePage Q_OBJECT public: - DlgSettingsFemInOutVtkImp( QWidget* parent = 0 ); + DlgSettingsFemInOutVtkImp( QWidget* parent = nullptr ); ~DlgSettingsFemInOutVtkImp(); protected: diff --git a/src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.h b/src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.h index e33e4ba88d..39e78a9484 100644 --- a/src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.h +++ b/src/Mod/Fem/Gui/DlgSettingsFemMaterialImp.h @@ -37,7 +37,7 @@ class DlgSettingsFemMaterialImp : public Gui::Dialog::PreferencePage Q_OBJECT public: - DlgSettingsFemMaterialImp( QWidget* parent = 0 ); + DlgSettingsFemMaterialImp( QWidget* parent = nullptr ); ~DlgSettingsFemMaterialImp(); protected: diff --git a/src/Mod/Fem/Gui/DlgSettingsFemMystranImp.h b/src/Mod/Fem/Gui/DlgSettingsFemMystranImp.h index 902fa74bf7..8938be99e2 100644 --- a/src/Mod/Fem/Gui/DlgSettingsFemMystranImp.h +++ b/src/Mod/Fem/Gui/DlgSettingsFemMystranImp.h @@ -37,7 +37,7 @@ class DlgSettingsFemMystranImp : public Gui::Dialog::PreferencePage Q_OBJECT public: - DlgSettingsFemMystranImp( QWidget* parent = 0 ); + DlgSettingsFemMystranImp( QWidget* parent = nullptr ); ~DlgSettingsFemMystranImp(); protected: diff --git a/src/Mod/Fem/Gui/DlgSettingsFemZ88Imp.h b/src/Mod/Fem/Gui/DlgSettingsFemZ88Imp.h index b82bbe8898..94861feb16 100644 --- a/src/Mod/Fem/Gui/DlgSettingsFemZ88Imp.h +++ b/src/Mod/Fem/Gui/DlgSettingsFemZ88Imp.h @@ -37,7 +37,7 @@ class DlgSettingsFemZ88Imp : public Gui::Dialog::PreferencePage Q_OBJECT public: - DlgSettingsFemZ88Imp( QWidget* parent = 0 ); + DlgSettingsFemZ88Imp( QWidget* parent = nullptr ); ~DlgSettingsFemZ88Imp(); protected: diff --git a/src/Mod/Fem/Gui/FemSelectionGate.h b/src/Mod/Fem/Gui/FemSelectionGate.h index 5d509630d1..5c5e26e200 100644 --- a/src/Mod/Fem/Gui/FemSelectionGate.h +++ b/src/Mod/Fem/Gui/FemSelectionGate.h @@ -38,7 +38,7 @@ class FemSelectionGate : public Gui::SelectionFilterGate }; FemSelectionGate(ElemType type) - : Gui::SelectionFilterGate((Gui::SelectionFilter*)0),Type(type) + : Gui::SelectionFilterGate((Gui::SelectionFilter*)nullptr),Type(type) { }; diff --git a/src/Mod/Fem/Gui/PropertyFemMeshItem.cpp b/src/Mod/Fem/Gui/PropertyFemMeshItem.cpp index c1de6d3c6b..89421eba10 100644 --- a/src/Mod/Fem/Gui/PropertyFemMeshItem.cpp +++ b/src/Mod/Fem/Gui/PropertyFemMeshItem.cpp @@ -123,7 +123,7 @@ QWidget* PropertyFemMeshItem::createEditor(QWidget* parent, const QObject* recei Q_UNUSED(parent); Q_UNUSED(receiver); Q_UNUSED(method); - return 0; + return nullptr; } void PropertyFemMeshItem::setEditorData(QWidget *editor, const QVariant& data) const diff --git a/src/Mod/Fem/Gui/TaskAnalysisInfo.h b/src/Mod/Fem/Gui/TaskAnalysisInfo.h index 758e316c06..24f30e9f83 100644 --- a/src/Mod/Fem/Gui/TaskAnalysisInfo.h +++ b/src/Mod/Fem/Gui/TaskAnalysisInfo.h @@ -56,7 +56,7 @@ class TaskAnalysisInfo : public Gui::TaskView::TaskBox Q_OBJECT public: - TaskAnalysisInfo(Fem::FemAnalysis *pcObject,QWidget *parent = 0); + TaskAnalysisInfo(Fem::FemAnalysis *pcObject,QWidget *parent = nullptr); ~TaskAnalysisInfo(); private Q_SLOTS: diff --git a/src/Mod/Fem/Gui/TaskCreateNodeSet.h b/src/Mod/Fem/Gui/TaskCreateNodeSet.h index 0b5f3d7ecf..67527103a7 100644 --- a/src/Mod/Fem/Gui/TaskCreateNodeSet.h +++ b/src/Mod/Fem/Gui/TaskCreateNodeSet.h @@ -52,7 +52,7 @@ class TaskCreateNodeSet : public Gui::TaskView::TaskBox, public Gui::SelectionOb Q_OBJECT public: - TaskCreateNodeSet(Fem::FemSetNodesObject *pcObject,QWidget *parent = 0); + TaskCreateNodeSet(Fem::FemSetNodesObject *pcObject,QWidget *parent = nullptr); ~TaskCreateNodeSet(); std::set tempSet; diff --git a/src/Mod/Fem/Gui/TaskDlgMeshShapeNetgen.cpp b/src/Mod/Fem/Gui/TaskDlgMeshShapeNetgen.cpp index e53a02af6f..7f4d1ad2b1 100644 --- a/src/Mod/Fem/Gui/TaskDlgMeshShapeNetgen.cpp +++ b/src/Mod/Fem/Gui/TaskDlgMeshShapeNetgen.cpp @@ -52,7 +52,7 @@ using namespace FemGui; //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ TaskDlgMeshShapeNetgen::TaskDlgMeshShapeNetgen(FemGui::ViewProviderFemMeshShapeNetgen *obj) - : TaskDialog(), param(0), ViewProviderFemMeshShapeNetgen(obj) + : TaskDialog(), param(nullptr), ViewProviderFemMeshShapeNetgen(obj) { FemMeshShapeNetgenObject = dynamic_cast(obj->getObject()); if (FemMeshShapeNetgenObject) { diff --git a/src/Mod/Fem/Gui/TaskDriver.h b/src/Mod/Fem/Gui/TaskDriver.h index c624a92801..46c3eae1f1 100644 --- a/src/Mod/Fem/Gui/TaskDriver.h +++ b/src/Mod/Fem/Gui/TaskDriver.h @@ -54,7 +54,7 @@ class TaskDriver : public Gui::TaskView::TaskBox Q_OBJECT public: - TaskDriver(Fem::FemAnalysis *pcObject,QWidget *parent = 0); + TaskDriver(Fem::FemAnalysis *pcObject,QWidget *parent = nullptr); ~TaskDriver(); diff --git a/src/Mod/Fem/Gui/TaskFemConstraint.cpp b/src/Mod/Fem/Gui/TaskFemConstraint.cpp index 62f51d1550..5382b0d5f9 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraint.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraint.cpp @@ -81,7 +81,7 @@ TaskFemConstraint::TaskFemConstraint(ViewProviderFemConstraint *ConstraintView,Q selectionMode = selref; // Setup the dialog inside the Shaft Wizard dialog - if ((ConstraintView->wizardWidget != NULL) && (ConstraintView->wizardSubLayout != NULL)) { + if ((ConstraintView->wizardWidget != nullptr) && (ConstraintView->wizardSubLayout != nullptr)) { // Hide the shaft wizard table widget to make more space ConstraintView->wizardSubLayout->itemAt(0)->widget()->hide(); QGridLayout* buttons = ConstraintView->wizardSubLayout->findChild(); @@ -105,7 +105,7 @@ TaskFemConstraint::TaskFemConstraint(ViewProviderFemConstraint *ConstraintView,Q void TaskFemConstraint::keyPressEvent(QKeyEvent *ke) { - if ((ConstraintView->wizardWidget != NULL) && (ConstraintView->wizardSubLayout != NULL)) + if ((ConstraintView->wizardWidget != nullptr) && (ConstraintView->wizardSubLayout != nullptr)) // Prevent from closing this dialog AND the shaft wizard dialog // TODO: This should trigger an update in the shaft wizard but its difficult to access a python dialog from here... if (ke->key() == Qt::Key_Return) @@ -196,7 +196,7 @@ void TaskFemConstraint::onButtonWizOk() void TaskFemConstraint::onButtonWizCancel() { Fem::Constraint* pcConstraint = static_cast(ConstraintView->getObject()); - if (pcConstraint != NULL) + if (pcConstraint != nullptr) pcConstraint->getDocument()->removeObject(pcConstraint->getNameInDocument()); onButtonWizOk(); } diff --git a/src/Mod/Fem/Gui/TaskFemConstraint.h b/src/Mod/Fem/Gui/TaskFemConstraint.h index ca7cb01460..c117090fb2 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraint.h +++ b/src/Mod/Fem/Gui/TaskFemConstraint.h @@ -44,7 +44,7 @@ class TaskFemConstraint : public Gui::TaskView::TaskBox, public Gui::SelectionOb Q_OBJECT public: - TaskFemConstraint(ViewProviderFemConstraint *ConstraintView,QWidget *parent = 0,const char* pixmapname = ""); + TaskFemConstraint(ViewProviderFemConstraint *ConstraintView,QWidget *parent = nullptr,const char* pixmapname = ""); virtual ~TaskFemConstraint() {} virtual const std::string getReferences(void) const {return std::string();} diff --git a/src/Mod/Fem/Gui/TaskFemConstraintBearing.h b/src/Mod/Fem/Gui/TaskFemConstraintBearing.h index 6bab66a656..f1be4708e2 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintBearing.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintBearing.h @@ -47,7 +47,7 @@ class TaskFemConstraintBearing : public TaskFemConstraint Q_OBJECT public: - TaskFemConstraintBearing(ViewProviderFemConstraint *ConstraintView, QWidget *parent = 0, + TaskFemConstraintBearing(ViewProviderFemConstraint *ConstraintView, QWidget *parent = nullptr, const char* pixmapname = "FEM_ConstraintBearing"); virtual ~TaskFemConstraintBearing(); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintContact.h b/src/Mod/Fem/Gui/TaskFemConstraintContact.h index df3032604e..74d6be5916 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintContact.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintContact.h @@ -40,7 +40,7 @@ class TaskFemConstraintContact : public TaskFemConstraint Q_OBJECT public: - TaskFemConstraintContact(ViewProviderFemConstraintContact *ConstraintView,QWidget *parent = 0); + TaskFemConstraintContact(ViewProviderFemConstraintContact *ConstraintView,QWidget *parent = nullptr); ~TaskFemConstraintContact(); const std::string getReferences() const; double get_Slope()const; diff --git a/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.h b/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.h index dc682adfc8..87a54fca67 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.h @@ -49,7 +49,7 @@ class TaskFemConstraintDisplacement : public TaskFemConstraintOnBoundary Q_OBJECT public: - TaskFemConstraintDisplacement(ViewProviderFemConstraintDisplacement *ConstraintView, QWidget *parent = 0); + TaskFemConstraintDisplacement(ViewProviderFemConstraintDisplacement *ConstraintView, QWidget *parent = nullptr); ~TaskFemConstraintDisplacement(); const std::string getReferences() const; double get_spinxDisplacement()const; diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFixed.h b/src/Mod/Fem/Gui/TaskFemConstraintFixed.h index 265acfe0d0..64ff73060c 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFixed.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintFixed.h @@ -38,7 +38,7 @@ class TaskFemConstraintFixed : public TaskFemConstraintOnBoundary Q_OBJECT public: - TaskFemConstraintFixed(ViewProviderFemConstraintFixed *ConstraintView,QWidget *parent = 0); + TaskFemConstraintFixed(ViewProviderFemConstraintFixed *ConstraintView,QWidget *parent = nullptr); ~TaskFemConstraintFixed(); const std::string getReferences() const; diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp index 303777de22..080975943c 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp @@ -57,11 +57,11 @@ using namespace Fem; //also defined in FemConstrainFluidBoundary and foamcasebuilder/basicbuilder.py, please update simultaneously //the second (index 1) is the default enum, as index 0 causes compiling error //static const char* BoundaryTypes[] = {"inlet","wall","outlet","freestream", "interface", NULL}; -static const char* WallSubtypes[] = { "unspecific", "fixed", "slip", "partialSlip", "moving", "rough", NULL }; -static const char* InletSubtypes[] = { "unspecific","totalPressure","uniformVelocity","volumetricFlowRate","massFlowRate",NULL }; -static const char* OutletSubtypes[] = { "unspecific","totalPressure","staticPressure","uniformVelocity", "outFlow", NULL }; -static const char* InterfaceSubtypes[] = { "unspecific","symmetry","wedge","cyclic","empty", "coupled", NULL }; -static const char* FreestreamSubtypes[] = { "unspecific", "freestream",NULL }; +static const char* WallSubtypes[] = { "unspecific", "fixed", "slip", "partialSlip", "moving", "rough", nullptr }; +static const char* InletSubtypes[] = { "unspecific","totalPressure","uniformVelocity","volumetricFlowRate","massFlowRate",nullptr }; +static const char* OutletSubtypes[] = { "unspecific","totalPressure","staticPressure","uniformVelocity", "outFlow", nullptr }; +static const char* InterfaceSubtypes[] = { "unspecific","symmetry","wedge","cyclic","empty", "coupled", nullptr }; +static const char* FreestreamSubtypes[] = { "unspecific", "freestream",nullptr }; static const char* InterfaceSubtypeHelpTexts[] = { "invalid,select other valid interface subtype", @@ -69,7 +69,7 @@ static const char* InterfaceSubtypeHelpTexts[] = { "axis symmetric front and back surfaces", "periodic boundary in pair, treated as physical connected", "front and back for single layer 2D mesh, also axis-sym axis line", - "exchange boundary vale with external program, need extra manual setup like file name", NULL }; + "exchange boundary vale with external program, need extra manual setup like file name", nullptr }; // defined in file FemConstraintFluidBoundary: // see Ansys fluet manual: Turbulence Specification method @@ -79,11 +79,11 @@ static const char* TurbulenceSpecificationHelpTexts[] = { "explicitly specific intensity k [SI unit] and dissipation rate epsilon [] / omega []", "intensity (0.05 ~ 0.15) and characteristic length scale of max eddy [m]", "intensity (0.05 ~ 0.15) and turbulent viscosity ratio", - "for fully developed internal flow, Turbulence intensity (0-1.0) 0.05 typical", NULL }; + "for fully developed internal flow, Turbulence intensity (0-1.0) 0.05 typical", nullptr }; //static const char* ThermalBoundaryTypes[] = {"fixedValue","zeroGradient", "fixedGradient", "mixed", "heatFlux", "HTC","coupled", NULL}; static const char* ThermalBoundaryHelpTexts[] = { "fixed Temperature [K]", "no heat transfer on boundary", "fixed value gradient [K/m]", - "mixed fixedGradient and fixedValue", "fixed heat flux [W/m2]", "Heat transfer coeff [W/(M2)/K]", "conjugate heat transfer with solid", NULL }; + "mixed fixedGradient and fixedValue", "fixed heat flux [W/m2]", "Heat transfer coeff [W/(M2)/K]", "conjugate heat transfer with solid", nullptr }; // enable & disable quantityUI once valueType is selected // internal function not declared in header file @@ -171,7 +171,7 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo // Get the feature data Fem::ConstraintFluidBoundary* pcConstraint = static_cast(ConstraintView->getObject()); - Fem::FemAnalysis* pcAnalysis = NULL; + Fem::FemAnalysis* pcAnalysis = nullptr; if (FemGui::ActiveAnalysisObserver::instance()->hasActiveObject()) { pcAnalysis = FemGui::ActiveAnalysisObserver::instance()->getActiveObject(); } @@ -183,7 +183,7 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo } } - Fem::FemMeshObject* pcMesh = NULL; + Fem::FemMeshObject* pcMesh = nullptr; if (pcAnalysis) { std::vector fem = pcAnalysis->Group.getValues(); for (std::vector::iterator it = fem.begin(); it != fem.end(); ++it) { @@ -195,7 +195,7 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo Base::Console().Log("FemAnalysis object is not activated or no FemAnalysis in the active document, mesh dimension is unknown\n"); dimension = -1; // unknown dimension of mesh } - if (pcMesh != NULL) { + if (pcMesh != nullptr) { App::Property* prop = pcMesh->getPropertyByName("Shape"); // PropertyLink if (prop && prop->getTypeId().isDerivedFrom(App::PropertyLink::getClassTypeId())) { App::PropertyLink* pcLink = static_cast(prop); @@ -215,7 +215,7 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo } } - pcSolver = NULL; // this is an private object of type Fem::FemSolverObject* + pcSolver = nullptr; // this is an private object of type Fem::FemSolverObject* if (pcAnalysis) { std::vector fem = pcAnalysis->Group.getValues(); for (std::vector::iterator it = fem.begin(); it != fem.end(); ++it) { @@ -224,9 +224,9 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo } } - pHeatTransferring = NULL; - pTurbulenceModel = NULL; - if (pcSolver != NULL) { + pHeatTransferring = nullptr; + pTurbulenceModel = nullptr; + if (pcSolver != nullptr) { //if only it is CFD solver, otherwise exit by SIGSEGV error, detect getPropertyByName() != NULL if (pcSolver->getPropertyByName("HeatTransferring")) { pHeatTransferring = static_cast(pcSolver->getPropertyByName("HeatTransferring")); @@ -925,8 +925,8 @@ bool TaskDlgFemConstraintFluidBoundary::accept() const Fem::FemSolverObject* pcSolver = boundary->getFemSolver(); if (pcSolver) { - App::PropertyBool* pHeatTransferring = NULL; - App::PropertyEnumeration* pTurbulenceModel = NULL; + App::PropertyBool* pHeatTransferring = nullptr; + App::PropertyEnumeration* pTurbulenceModel = nullptr; pHeatTransferring = static_cast(pcSolver->getPropertyByName("HeatTransferring")); pTurbulenceModel = static_cast(pcSolver->getPropertyByName("TurbulenceModel")); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h index dc4136839e..cc68776536 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h @@ -49,7 +49,7 @@ class TaskFemConstraintFluidBoundary : public TaskFemConstraintOnBoundary Q_OBJECT public: - TaskFemConstraintFluidBoundary(ViewProviderFemConstraintFluidBoundary *ConstraintView,QWidget *parent = 0); + TaskFemConstraintFluidBoundary(ViewProviderFemConstraintFluidBoundary *ConstraintView,QWidget *parent = nullptr); virtual ~TaskFemConstraintFluidBoundary(); const Fem::FemSolverObject* getFemSolver(void) const; diff --git a/src/Mod/Fem/Gui/TaskFemConstraintForce.h b/src/Mod/Fem/Gui/TaskFemConstraintForce.h index 19ee348708..54bc234557 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintForce.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintForce.h @@ -48,7 +48,7 @@ class TaskFemConstraintForce : public TaskFemConstraintOnBoundary Q_OBJECT public: - TaskFemConstraintForce(ViewProviderFemConstraintForce *ConstraintView,QWidget *parent = 0); + TaskFemConstraintForce(ViewProviderFemConstraintForce *ConstraintView,QWidget *parent = nullptr); virtual ~TaskFemConstraintForce(); double getForce(void) const; const std::string getReferences() const; diff --git a/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp b/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp index 206cb57373..c36e523bb4 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp @@ -271,7 +271,7 @@ TaskDlgFemConstraintGear::TaskDlgFemConstraintGear(ViewProviderFemConstraintGear { this->ConstraintView = ConstraintView; assert(ConstraintView); - this->parameter = new TaskFemConstraintGear(ConstraintView, 0, "FEM_ConstraintGear"); + this->parameter = new TaskFemConstraintGear(ConstraintView, nullptr, "FEM_ConstraintGear"); Content.push_back(parameter); } diff --git a/src/Mod/Fem/Gui/TaskFemConstraintGear.h b/src/Mod/Fem/Gui/TaskFemConstraintGear.h index 1022c1d730..e217ee212a 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintGear.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintGear.h @@ -34,7 +34,7 @@ class TaskFemConstraintGear : public TaskFemConstraintBearing Q_OBJECT public: - TaskFemConstraintGear(ViewProviderFemConstraint *ConstraintView,QWidget *parent = 0, + TaskFemConstraintGear(ViewProviderFemConstraint *ConstraintView,QWidget *parent = nullptr, const char* pixmapname = "FEM_ConstraintGear"); double getDiameter(void) const; diff --git a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.h b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.h index 188c52999e..0d778d9bc3 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.h @@ -40,7 +40,7 @@ class TaskFemConstraintHeatflux : public TaskFemConstraintOnBoundary Q_OBJECT public: - TaskFemConstraintHeatflux(ViewProviderFemConstraintHeatflux *ConstraintView,QWidget *parent = 0); + TaskFemConstraintHeatflux(ViewProviderFemConstraintHeatflux *ConstraintView,QWidget *parent = nullptr); virtual ~TaskFemConstraintHeatflux(); double getAmbientTemp(void) const; /*double getFaceTemp(void) const;*/ diff --git a/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.h b/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.h index 6509dd6fb3..48be1de492 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.h @@ -40,7 +40,7 @@ class TaskFemConstraintInitialTemperature : public TaskFemConstraint Q_OBJECT public: - TaskFemConstraintInitialTemperature(ViewProviderFemConstraintInitialTemperature *ConstraintView,QWidget *parent = 0); + TaskFemConstraintInitialTemperature(ViewProviderFemConstraintInitialTemperature *ConstraintView,QWidget *parent = nullptr); ~TaskFemConstraintInitialTemperature(); double get_temperature()const; diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.h b/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.h index 09c171e859..fd5613de36 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.h @@ -40,7 +40,7 @@ class TaskFemConstraintPlaneRotation : public TaskFemConstraint Q_OBJECT public: - TaskFemConstraintPlaneRotation(ViewProviderFemConstraintPlaneRotation *ConstraintView,QWidget *parent = 0); + TaskFemConstraintPlaneRotation(ViewProviderFemConstraintPlaneRotation *ConstraintView,QWidget *parent = nullptr); ~TaskFemConstraintPlaneRotation(); const std::string getReferences() const; diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPressure.h b/src/Mod/Fem/Gui/TaskFemConstraintPressure.h index ef3fb5cc9e..2c57c2b229 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintPressure.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintPressure.h @@ -40,7 +40,7 @@ class TaskFemConstraintPressure : public TaskFemConstraintOnBoundary Q_OBJECT public: - TaskFemConstraintPressure(ViewProviderFemConstraintPressure *ConstraintView,QWidget *parent = 0); + TaskFemConstraintPressure(ViewProviderFemConstraintPressure *ConstraintView,QWidget *parent = nullptr); ~TaskFemConstraintPressure(); const std::string getReferences() const; double get_Pressure()const; diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPulley.h b/src/Mod/Fem/Gui/TaskFemConstraintPulley.h index 2c7cf86c97..b61777044c 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintPulley.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintPulley.h @@ -34,7 +34,7 @@ class TaskFemConstraintPulley : public TaskFemConstraintGear Q_OBJECT public: - TaskFemConstraintPulley(ViewProviderFemConstraintPulley *ConstraintView,QWidget *parent = 0); + TaskFemConstraintPulley(ViewProviderFemConstraintPulley *ConstraintView,QWidget *parent = nullptr); double getOtherDiameter(void) const; double getCenterDistance(void) const; diff --git a/src/Mod/Fem/Gui/TaskFemConstraintSpring.h b/src/Mod/Fem/Gui/TaskFemConstraintSpring.h index b9a8845a49..7bc210e281 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintSpring.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintSpring.h @@ -38,7 +38,7 @@ class TaskFemConstraintSpring : public TaskFemConstraintOnBoundary Q_OBJECT public: - TaskFemConstraintSpring(ViewProviderFemConstraintSpring *ConstraintView,QWidget *parent = 0); + TaskFemConstraintSpring(ViewProviderFemConstraintSpring *ConstraintView,QWidget *parent = nullptr); ~TaskFemConstraintSpring(); const std::string getReferences() const; double get_normalStiffness()const; diff --git a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.h b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.h index 5f8473eb79..ae18573b3d 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.h @@ -43,7 +43,7 @@ class TaskFemConstraintTemperature : public TaskFemConstraintOnBoundary Q_OBJECT public: - TaskFemConstraintTemperature(ViewProviderFemConstraintTemperature *ConstraintView,QWidget *parent = 0); + TaskFemConstraintTemperature(ViewProviderFemConstraintTemperature *ConstraintView,QWidget *parent = nullptr); ~TaskFemConstraintTemperature(); const std::string getReferences() const; double get_temperature()const; diff --git a/src/Mod/Fem/Gui/TaskFemConstraintTransform.h b/src/Mod/Fem/Gui/TaskFemConstraintTransform.h index f4abd35574..9289924ab5 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintTransform.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintTransform.h @@ -41,7 +41,7 @@ class TaskFemConstraintTransform : public TaskFemConstraint Q_OBJECT public: - TaskFemConstraintTransform(ViewProviderFemConstraintTransform *ConstraintView,QWidget *parent = 0); + TaskFemConstraintTransform(ViewProviderFemConstraintTransform *ConstraintView,QWidget *parent = nullptr); ~TaskFemConstraintTransform(); const std::string getReferences() const; double get_X_rot()const; diff --git a/src/Mod/Fem/Gui/TaskObjectName.h b/src/Mod/Fem/Gui/TaskObjectName.h index 9b00ad79e8..e5a1c6850f 100644 --- a/src/Mod/Fem/Gui/TaskObjectName.h +++ b/src/Mod/Fem/Gui/TaskObjectName.h @@ -48,7 +48,7 @@ class TaskObjectName : public Gui::TaskView::TaskBox Q_OBJECT public: - TaskObjectName(App::DocumentObject *pcObject,QWidget *parent = 0); + TaskObjectName(App::DocumentObject *pcObject,QWidget *parent = nullptr); ~TaskObjectName(); diff --git a/src/Mod/Fem/Gui/TaskPostBoxes.cpp b/src/Mod/Fem/Gui/TaskPostBoxes.cpp index 461c92c4e5..5942239b38 100644 --- a/src/Mod/Fem/Gui/TaskPostBoxes.cpp +++ b/src/Mod/Fem/Gui/TaskPostBoxes.cpp @@ -277,7 +277,7 @@ bool TaskDlgPost::accept() (*it)->applyPythonCode(); } catch (const Base::Exception& e) { - QMessageBox::warning(NULL, tr("Input error"), QString::fromLatin1(e.what())); + QMessageBox::warning(nullptr, tr("Input error"), QString::fromLatin1(e.what())); return false; } @@ -431,7 +431,7 @@ TaskPostClip::TaskPostClip(ViewProviderDocumentObject* view, App::PropertyLink* assert(function); Q_UNUSED(function) - fwidget = NULL; + fwidget = nullptr; //we load the views widget proxy = new QWidget(this); @@ -509,14 +509,14 @@ void TaskPostClip::on_FunctionBox_currentIndexChanged(int idx) { if(idx>=0) static_cast(getObject())->Function.setValue(funcs[idx]); else - static_cast(getObject())->Function.setValue(NULL); + static_cast(getObject())->Function.setValue(nullptr); } } //load the correct view Fem::FemPostFunction* fobj = static_cast( static_cast(getObject())->Function.getValue()); - Gui::ViewProvider* view = NULL; + Gui::ViewProvider* view = nullptr; if(fobj) view = Gui::Application::Instance->activeDocument()->getViewProvider(fobj); @@ -704,7 +704,7 @@ void TaskPostDataAlongLine::pointCallback(void * ud, SoEventCallback * n) if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) { const SoPickedPoint * point = n->getPickedPoint(); - if (point == NULL) { + if (point == nullptr) { Base::Console().Message("No point picked.\n"); return; } @@ -880,7 +880,7 @@ void TaskPostDataAtPoint::pointCallback(void * ud, SoEventCallback * n) if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) { const SoPickedPoint * point = n->getPickedPoint(); - if (point == NULL) { + if (point == nullptr) { Base::Console().Message("No point picked.\n"); return; } @@ -1183,7 +1183,7 @@ TaskPostCut::TaskPostCut(ViewProviderDocumentObject* view, App::PropertyLink* fu assert(function); Q_UNUSED(function) - fwidget = NULL; + fwidget = nullptr; //we load the views widget proxy = new QWidget(this); @@ -1257,14 +1257,14 @@ void TaskPostCut::on_FunctionBox_currentIndexChanged(int idx) { if(idx>=0) static_cast(getObject())->Function.setValue(funcs[idx]); else - static_cast(getObject())->Function.setValue(NULL); + static_cast(getObject())->Function.setValue(nullptr); } } //load the correct view Fem::FemPostFunction* fobj = static_cast( static_cast(getObject())->Function.getValue()); - Gui::ViewProvider* view = NULL; + Gui::ViewProvider* view = nullptr; if(fobj) view = Gui::Application::Instance->activeDocument()->getViewProvider(fobj); diff --git a/src/Mod/Fem/Gui/TaskPostBoxes.h b/src/Mod/Fem/Gui/TaskPostBoxes.h index d9cac91a40..df0b0d3758 100644 --- a/src/Mod/Fem/Gui/TaskPostBoxes.h +++ b/src/Mod/Fem/Gui/TaskPostBoxes.h @@ -133,7 +133,7 @@ class TaskPostBox : public Gui::TaskView::TaskBox { Q_OBJECT public: - TaskPostBox(Gui::ViewProviderDocumentObject* view, const QPixmap &icon, const QString &title, QWidget *parent = 0); + TaskPostBox(Gui::ViewProviderDocumentObject* view, const QPixmap &icon, const QString &title, QWidget *parent = nullptr); ~TaskPostBox(); virtual void applyPythonCode() = 0; @@ -197,7 +197,7 @@ class TaskPostDisplay : public TaskPostBox Q_OBJECT public: - TaskPostDisplay(Gui::ViewProviderDocumentObject* view, QWidget *parent = 0); + TaskPostDisplay(Gui::ViewProviderDocumentObject* view, QWidget *parent = nullptr); ~TaskPostDisplay(); virtual void applyPythonCode(); @@ -219,7 +219,7 @@ class TaskPostFunction : public TaskPostBox { Q_OBJECT public: - TaskPostFunction(Gui::ViewProviderDocumentObject* view, QWidget* parent = 0); + TaskPostFunction(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr); virtual ~TaskPostFunction(); virtual void applyPythonCode(); @@ -230,7 +230,7 @@ class TaskPostClip : public TaskPostBox { Q_OBJECT public: - TaskPostClip(Gui::ViewProviderDocumentObject* view, App::PropertyLink* function, QWidget* parent = 0); + TaskPostClip(Gui::ViewProviderDocumentObject* view, App::PropertyLink* function, QWidget* parent = nullptr); virtual ~TaskPostClip(); virtual void applyPythonCode(); @@ -255,7 +255,7 @@ class TaskPostDataAlongLine: public TaskPostBox { Q_OBJECT public: - TaskPostDataAlongLine(Gui::ViewProviderDocumentObject* view, QWidget* parent = 0); + TaskPostDataAlongLine(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr); virtual ~TaskPostDataAlongLine(); virtual void applyPythonCode(); @@ -285,7 +285,7 @@ class TaskPostDataAtPoint: public TaskPostBox { Q_OBJECT public: - TaskPostDataAtPoint(Gui::ViewProviderDocumentObject* view, QWidget* parent = 0); + TaskPostDataAtPoint(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr); virtual ~TaskPostDataAtPoint(); virtual void applyPythonCode(); @@ -309,7 +309,7 @@ class TaskPostScalarClip : public TaskPostBox { Q_OBJECT public: - TaskPostScalarClip(Gui::ViewProviderDocumentObject* view, QWidget* parent = 0); + TaskPostScalarClip(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr); virtual ~TaskPostScalarClip(); virtual void applyPythonCode(); @@ -330,7 +330,7 @@ class TaskPostWarpVector : public TaskPostBox { Q_OBJECT public: - TaskPostWarpVector(Gui::ViewProviderDocumentObject* view, QWidget* parent = 0); + TaskPostWarpVector(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr); virtual ~TaskPostWarpVector(); virtual void applyPythonCode(); @@ -354,7 +354,7 @@ class TaskPostCut : public TaskPostBox { Q_OBJECT public: - TaskPostCut(Gui::ViewProviderDocumentObject* view, App::PropertyLink* function, QWidget* parent = 0); + TaskPostCut(Gui::ViewProviderDocumentObject* view, App::PropertyLink* function, QWidget* parent = nullptr); virtual ~TaskPostCut(); virtual void applyPythonCode(); diff --git a/src/Mod/Fem/Gui/TaskTetParameter.h b/src/Mod/Fem/Gui/TaskTetParameter.h index 5191e784b3..40150aa5ac 100644 --- a/src/Mod/Fem/Gui/TaskTetParameter.h +++ b/src/Mod/Fem/Gui/TaskTetParameter.h @@ -55,7 +55,7 @@ class TaskTetParameter : public Gui::TaskView::TaskBox Q_OBJECT public: - TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidget *parent = 0); + TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidget *parent = nullptr); ~TaskTetParameter(); void setInfo(void); diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraint.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraint.cpp index ffdc33782d..b155a90330 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraint.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraint.cpp @@ -90,9 +90,9 @@ ViewProviderFemConstraint::ViewProviderFemConstraint() FontSize.touch(); FaceColor.touch(); - wizardWidget = NULL; - wizardSubLayout = NULL; - constraintDialog = NULL; + wizardWidget = nullptr; + wizardSubLayout = nullptr; + constraintDialog = nullptr; } ViewProviderFemConstraint::~ViewProviderFemConstraint() @@ -197,11 +197,11 @@ void ViewProviderFemConstraint::unsetEdit(int ModNum) // clear the selection (convenience) Gui::Selection().clearSelection(); - if ((wizardWidget != NULL) && (wizardSubLayout != NULL) && (constraintDialog != NULL)) { - wizardWidget = NULL; - wizardSubLayout = NULL; + if ((wizardWidget != nullptr) && (wizardSubLayout != nullptr) && (constraintDialog != nullptr)) { + wizardWidget = nullptr; + wizardSubLayout = nullptr; delete constraintDialog; - constraintDialog = NULL; + constraintDialog = nullptr; // Notify the Shaft Wizard that we have finished editing // See WizardShaft.py on why we do it this way @@ -489,34 +489,34 @@ QObject* ViewProviderFemConstraint::findChildByName(const QObject* parent, const return *o; if (!(*o)->children().empty()) { QObject* result = findChildByName(*o, name); - if (result != NULL) + if (result != nullptr) return result; } } - return NULL; + return nullptr; } void ViewProviderFemConstraint::checkForWizard() { - wizardWidget= NULL; - wizardSubLayout = NULL; + wizardWidget= nullptr; + wizardSubLayout = nullptr; Gui::MainWindow* mw = Gui::getMainWindow(); - if (mw == NULL) return; + if (mw == nullptr) return; QDockWidget* dw = mw->findChild(QString::fromLatin1("Combo View")); - if (dw == NULL) return; + if (dw == nullptr) return; QWidget* cw = dw->findChild(QString::fromLatin1("Combo View")); - if (cw == NULL) return; + if (cw == nullptr) return; QTabWidget* tw = cw->findChild(QString::fromLatin1("combiTab")); - if (tw == NULL) return; + if (tw == nullptr) return; QStackedWidget* sw = tw->findChild(QString::fromLatin1("qt_tabwidget_stackedwidget")); - if (sw == NULL) return; + if (sw == nullptr) return; QScrollArea* sa = sw->findChild(); - if (sa== NULL) return; + if (sa== nullptr) return; QWidget* wd = sa->widget(); // This is the reason why we cannot use findChildByName() right away!!! - if (wd == NULL) return; + if (wd == nullptr) return; QObject* wiz = findChildByName(wd, QString::fromLatin1("ShaftWizard")); - if (wiz != NULL) { + if (wiz != nullptr) { wizardWidget = static_cast(wiz); wizardSubLayout = wiz->findChild(QString::fromLatin1("ShaftWizardLayout")); } diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintBearing.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintBearing.cpp index 16d36031e1..66cbcf935d 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintBearing.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintBearing.cpp @@ -67,11 +67,11 @@ bool ViewProviderFemConstraintBearing::setEdit(int ModNum) Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgFemConstraintBearing *constrDlg = qobject_cast(dlg); if (constrDlg && constrDlg->getConstraintView() != this) - constrDlg = 0; // another constraint left open its task panel + constrDlg = nullptr; // another constraint left open its task panel if (dlg && !constrDlg) { // This case will occur in the ShaftWizard application checkForWizard(); - if ((wizardWidget == NULL) || (wizardSubLayout == NULL)) { + if ((wizardWidget == nullptr) || (wizardSubLayout == nullptr)) { // No shaft wizard is running QMessageBox msgBox; msgBox.setText(QObject::tr("A dialog is already open in the task panel")); @@ -83,7 +83,7 @@ bool ViewProviderFemConstraintBearing::setEdit(int ModNum) Gui::Control().reject(); else return false; - } else if (constraintDialog != NULL) { + } else if (constraintDialog != nullptr) { // Another FemConstraint* dialog is already open inside the Shaft Wizard // Ignore the request to open another dialog return false; diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintContact.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintContact.cpp index e18800257b..f8f531bfc5 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintContact.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintContact.cpp @@ -73,9 +73,9 @@ bool ViewProviderFemConstraintContact::setEdit(int ModNum) Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgFemConstraintContact *constrDlg = qobject_cast(dlg); if (constrDlg && constrDlg->getConstraintView() != this) - constrDlg = 0; // another constraint left open its task panel + constrDlg = nullptr; // another constraint left open its task panel if (dlg && !constrDlg) { - if (constraintDialog != NULL) { + if (constraintDialog != nullptr) { // Ignore the request to open another dialog return false; } else { diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintDisplacement.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintDisplacement.cpp index 94ca552bdf..2ae3628eb9 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintDisplacement.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintDisplacement.cpp @@ -66,9 +66,9 @@ bool ViewProviderFemConstraintDisplacement::setEdit(int ModNum) Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgFemConstraintDisplacement *constrDlg = qobject_cast(dlg); if (constrDlg && constrDlg->getConstraintView() != this) - constrDlg = 0; // another constraint left open its task panel + constrDlg = nullptr; // another constraint left open its task panel if (dlg && !constrDlg) { - if (constraintDialog != NULL) { + if (constraintDialog != nullptr) { // Ignore the request to open another dialog return false; } else { diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintFixed.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintFixed.cpp index 77fdaf5ea4..e27ed50a9a 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintFixed.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintFixed.cpp @@ -67,11 +67,11 @@ bool ViewProviderFemConstraintFixed::setEdit(int ModNum) Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgFemConstraintFixed *constrDlg = qobject_cast(dlg); if (constrDlg && constrDlg->getConstraintView() != this) - constrDlg = 0; // another constraint left open its task panel + constrDlg = nullptr; // another constraint left open its task panel if (dlg && !constrDlg) { // This case will occur in the ShaftWizard application checkForWizard(); - if ((wizardWidget == NULL) || (wizardSubLayout == NULL)) { + if ((wizardWidget == nullptr) || (wizardSubLayout == nullptr)) { // No shaft wizard is running QMessageBox msgBox; msgBox.setText(QObject::tr("A dialog is already open in the task panel")); @@ -83,7 +83,7 @@ bool ViewProviderFemConstraintFixed::setEdit(int ModNum) Gui::Control().reject(); else return false; - } else if (constraintDialog != NULL) { + } else if (constraintDialog != nullptr) { // Another FemConstraint* dialog is already open inside the Shaft Wizard // Ignore the request to open another dialog return false; diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintFluidBoundary.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintFluidBoundary.cpp index 9b4a0e038a..6ded08293f 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintFluidBoundary.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintFluidBoundary.cpp @@ -65,11 +65,11 @@ bool ViewProviderFemConstraintFluidBoundary::setEdit(int ModNum) Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgFemConstraintFluidBoundary *constrDlg = qobject_cast(dlg); if (constrDlg && constrDlg->getConstraintView() != this) - constrDlg = 0; // another constraint left open its task panel + constrDlg = nullptr; // another constraint left open its task panel if (dlg && !constrDlg) { // This case will occur in the ShaftWizard application checkForWizard(); - if ((wizardWidget == NULL) || (wizardSubLayout == NULL)) { + if ((wizardWidget == nullptr) || (wizardSubLayout == nullptr)) { // No shaft wizard is running QMessageBox msgBox; msgBox.setText(QObject::tr("A dialog is already open in the task panel")); @@ -81,7 +81,7 @@ bool ViewProviderFemConstraintFluidBoundary::setEdit(int ModNum) Gui::Control().reject(); else return false; - } else if (constraintDialog != NULL) { + } else if (constraintDialog != nullptr) { // Another FemConstraint* dialog is already open inside the Shaft Wizard // Ignore the request to open another dialog return false; diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintForce.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintForce.cpp index 002b9705b6..6d8490171e 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintForce.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintForce.cpp @@ -66,11 +66,11 @@ bool ViewProviderFemConstraintForce::setEdit(int ModNum) Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgFemConstraintForce *constrDlg = qobject_cast(dlg); if (constrDlg && constrDlg->getConstraintView() != this) - constrDlg = 0; // another constraint left open its task panel + constrDlg = nullptr; // another constraint left open its task panel if (dlg && !constrDlg) { // This case will occur in the ShaftWizard application checkForWizard(); - if ((wizardWidget == NULL) || (wizardSubLayout == NULL)) { + if ((wizardWidget == nullptr) || (wizardSubLayout == nullptr)) { // No shaft wizard is running QMessageBox msgBox; msgBox.setText(QObject::tr("A dialog is already open in the task panel")); @@ -82,7 +82,7 @@ bool ViewProviderFemConstraintForce::setEdit(int ModNum) Gui::Control().reject(); else return false; - } else if (constraintDialog != NULL) { + } else if (constraintDialog != nullptr) { // Another FemConstraint* dialog is already open inside the Shaft Wizard // Ignore the request to open another dialog return false; diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintGear.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintGear.cpp index 62d644f1f1..4028c382a8 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintGear.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintGear.cpp @@ -66,11 +66,11 @@ bool ViewProviderFemConstraintGear::setEdit(int ModNum) Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgFemConstraintGear *constrDlg = qobject_cast(dlg); if (constrDlg && constrDlg->getConstraintView() != this) - constrDlg = 0; // another constraint left open its task panel + constrDlg = nullptr; // another constraint left open its task panel if (dlg && !constrDlg) { // This case will occur in the ShaftWizard application checkForWizard(); - if ((wizardWidget == NULL) || (wizardSubLayout == NULL)) { + if ((wizardWidget == nullptr) || (wizardSubLayout == nullptr)) { // No shaft wizard is running QMessageBox msgBox; msgBox.setText(QObject::tr("A dialog is already open in the task panel")); @@ -82,7 +82,7 @@ bool ViewProviderFemConstraintGear::setEdit(int ModNum) Gui::Control().reject(); else return false; - } else if (constraintDialog != NULL) { + } else if (constraintDialog != nullptr) { // Another FemConstraint* dialog is already open inside the Shaft Wizard // Ignore the request to open another dialog return false; diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintHeatflux.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintHeatflux.cpp index b053b4cfd6..6faf2de8dc 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintHeatflux.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintHeatflux.cpp @@ -72,9 +72,9 @@ bool ViewProviderFemConstraintHeatflux::setEdit(int ModNum) Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgFemConstraintHeatflux *constrDlg = qobject_cast(dlg); if (constrDlg && constrDlg->getConstraintView() != this) - constrDlg = 0; // another constraint left open its task panel + constrDlg = nullptr; // another constraint left open its task panel if (dlg && !constrDlg) { - if (constraintDialog != NULL) { + if (constraintDialog != nullptr) { // Ignore the request to open another dialog return false; } else { diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintInitialTemperature.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintInitialTemperature.cpp index ac99049b39..55e2b4ccd3 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintInitialTemperature.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintInitialTemperature.cpp @@ -72,9 +72,9 @@ bool ViewProviderFemConstraintInitialTemperature::setEdit(int ModNum) Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgFemConstraintInitialTemperature *constrDlg = qobject_cast(dlg); if (constrDlg && constrDlg->getConstraintView() != this) - constrDlg = 0; // another constraint left open its task panel + constrDlg = nullptr; // another constraint left open its task panel if (dlg && !constrDlg) { - if (constraintDialog != NULL) { + if (constraintDialog != nullptr) { // Ignore the request to open another dialog return false; } else { diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintPlaneRotation.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintPlaneRotation.cpp index e98a78c90d..28d19726d4 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintPlaneRotation.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintPlaneRotation.cpp @@ -74,9 +74,9 @@ bool ViewProviderFemConstraintPlaneRotation::setEdit(int ModNum) Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgFemConstraintPlaneRotation *constrDlg = qobject_cast(dlg); if (constrDlg && constrDlg->getConstraintView() != this) - constrDlg = 0; // another constraint left open its task panel + constrDlg = nullptr; // another constraint left open its task panel if (dlg && !constrDlg) { - if (constraintDialog != NULL) { + if (constraintDialog != nullptr) { // Ignore the request to open another dialog return false; } else { diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintPressure.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintPressure.cpp index 0df5133189..b6ab0d21ce 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintPressure.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintPressure.cpp @@ -64,9 +64,9 @@ bool ViewProviderFemConstraintPressure::setEdit(int ModNum) Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgFemConstraintPressure *constrDlg = qobject_cast(dlg); if (constrDlg && constrDlg->getConstraintView() != this) - constrDlg = 0; // another constraint left open its task panel + constrDlg = nullptr; // another constraint left open its task panel if (dlg && !constrDlg) { - if (constraintDialog != NULL) { + if (constraintDialog != nullptr) { // Ignore the request to open another dialog return false; } else { diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintPulley.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintPulley.cpp index d9c30481f9..88449e460f 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintPulley.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintPulley.cpp @@ -65,11 +65,11 @@ bool ViewProviderFemConstraintPulley::setEdit(int ModNum) Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgFemConstraintPulley *constrDlg = qobject_cast(dlg); if (constrDlg && constrDlg->getConstraintView() != this) - constrDlg = 0; // another constraint left open its task panel + constrDlg = nullptr; // another constraint left open its task panel if (dlg && !constrDlg) { // This case will occur in the ShaftWizard application checkForWizard(); - if ((wizardWidget == NULL) || (wizardSubLayout == NULL)) { + if ((wizardWidget == nullptr) || (wizardSubLayout == nullptr)) { // No shaft wizard is running QMessageBox msgBox; msgBox.setText(QObject::tr("A dialog is already open in the task panel")); @@ -81,7 +81,7 @@ bool ViewProviderFemConstraintPulley::setEdit(int ModNum) Gui::Control().reject(); else return false; - } else if (constraintDialog != NULL) { + } else if (constraintDialog != nullptr) { // Another FemConstraint* dialog is already open inside the Shaft Wizard // Ignore the request to open another dialog return false; diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintSpring.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintSpring.cpp index 82877b43e6..dc9fe64542 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintSpring.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintSpring.cpp @@ -64,9 +64,9 @@ bool ViewProviderFemConstraintSpring::setEdit(int ModNum) Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgFemConstraintSpring *constrDlg = qobject_cast(dlg); // check this out too if (constrDlg && constrDlg->getConstraintView() != this) - constrDlg = 0; // another constraint left open its task panel + constrDlg = nullptr; // another constraint left open its task panel if (dlg && !constrDlg) { - if (constraintDialog != NULL) { + if (constraintDialog != nullptr) { // Ignore the request to open another dialog return false; } else { diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintTemperature.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintTemperature.cpp index 23c970f036..1262b511ba 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintTemperature.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintTemperature.cpp @@ -73,9 +73,9 @@ bool ViewProviderFemConstraintTemperature::setEdit(int ModNum) Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgFemConstraintTemperature *constrDlg = qobject_cast(dlg); if (constrDlg && constrDlg->getConstraintView() != this) - constrDlg = 0; // another constraint left open its task panel + constrDlg = nullptr; // another constraint left open its task panel if (dlg && !constrDlg) { - if (constraintDialog != NULL) { + if (constraintDialog != nullptr) { // Ignore the request to open another dialog return false; } else { diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintTransform.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintTransform.cpp index f01378a41b..53a169addf 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintTransform.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintTransform.cpp @@ -81,9 +81,9 @@ bool ViewProviderFemConstraintTransform::setEdit(int ModNum) Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgFemConstraintTransform *constrDlg = qobject_cast(dlg); if (constrDlg && constrDlg->getConstraintView() != this) - constrDlg = 0; // another constraint left open its task panel + constrDlg = nullptr; // another constraint left open its task panel if (dlg && !constrDlg) { - if (constraintDialog != NULL) { + if (constraintDialog != nullptr) { // Ignore the request to open another dialog return false; } else { diff --git a/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp b/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp index f01feb68c3..3952ab2f2f 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp @@ -72,8 +72,8 @@ struct FemFace } Base::Vector3d set(short size,const SMDS_MeshElement* element,unsigned short id, short faceNo, - const SMDS_MeshNode* n1,const SMDS_MeshNode* n2,const SMDS_MeshNode* n3,const SMDS_MeshNode* n4=0, - const SMDS_MeshNode* n5=0,const SMDS_MeshNode* n6=0,const SMDS_MeshNode* n7=0,const SMDS_MeshNode* n8=0); + const SMDS_MeshNode* n1,const SMDS_MeshNode* n2,const SMDS_MeshNode* n3,const SMDS_MeshNode* n4=nullptr, + const SMDS_MeshNode* n5=nullptr,const SMDS_MeshNode* n6=nullptr,const SMDS_MeshNode* n7=nullptr,const SMDS_MeshNode* n8=nullptr); bool isSameFace (FemFace &face); }; @@ -435,7 +435,7 @@ SoDetail* ViewProviderFemMesh::getDetail(const char* subelement) const element = element.substr(0,pos); } - SoDetail* detail = 0; + SoDetail* detail = nullptr; if (index < 0) return detail; if (element == "Elem") { @@ -668,9 +668,9 @@ void ViewProviderFemMesh::resetColorByElementId(void) void ViewProviderFEMMeshBuilder::buildNodes(const App::Property* prop, std::vector& nodes) const { - SoCoordinate3 *pcPointsCoord=0; - SoIndexedFaceSet *pcFaces=0; - SoIndexedLineSet *pcLines=0; + SoCoordinate3 *pcPointsCoord=nullptr; + SoIndexedFaceSet *pcFaces=nullptr; + SoIndexedLineSet *pcLines=nullptr; if (nodes.empty()) { pcPointsCoord = new SoCoordinate3(); diff --git a/src/Mod/Fem/Gui/ViewProviderFemMeshPyImp.cpp b/src/Mod/Fem/Gui/ViewProviderFemMeshPyImp.cpp index 0069a4c737..d7df64e361 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemMeshPyImp.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemMeshPyImp.cpp @@ -30,7 +30,7 @@ PyObject* ViewProviderFemMeshPy::applyDisplacement(PyObject* args) { double factor; if (!PyArg_ParseTuple(args, "d", &factor)) - return 0; + return nullptr; this->getViewProviderFemMeshPtr()->applyDisplacementToNodes(factor); @@ -96,7 +96,7 @@ PyObject* ViewProviderFemMeshPy::setNodeColorByScalars(PyObject* args) } else { PyErr_SetString(PyExc_TypeError, "PyArg_ParseTuple failed. Invalid arguments used with setNodeByScalars"); - return 0; + return nullptr; } Py_Return; } @@ -105,7 +105,7 @@ PyObject* ViewProviderFemMeshPy::setNodeColorByScalars(PyObject* args) PyObject* ViewProviderFemMeshPy::resetNodeColor(PyObject* args) { if (!PyArg_ParseTuple(args, "")) - return 0; + return nullptr; this->getViewProviderFemMeshPtr()->resetColorByNodeId(); Py_Return; } @@ -135,7 +135,7 @@ PyObject* ViewProviderFemMeshPy::setNodeDisplacementByVectors(PyObject* args) } else { PyErr_SetString(PyExc_TypeError, "PyArg_ParseTuple failed. Invalid arguments used with setNodeDisplacementByVectors"); - return 0; + return nullptr; } Py_Return; } @@ -144,7 +144,7 @@ PyObject* ViewProviderFemMeshPy::setNodeDisplacementByVectors(PyObject* args) PyObject* ViewProviderFemMeshPy::resetNodeDisplacement(PyObject* args) { if (!PyArg_ParseTuple(args, "")) - return 0; + return nullptr; this->getViewProviderFemMeshPtr()->resetDisplacementByNodeId(); Py_Return; } @@ -276,7 +276,7 @@ void ViewProviderFemMeshPy::setHighlightedNodes(Py::List arg) PyObject* ViewProviderFemMeshPy::resetHighlightedNodes(PyObject* args) { if (!PyArg_ParseTuple(args, "")) - return 0; + return nullptr; this->getViewProviderFemMeshPtr()->resetHighlightNodes(); Py_Return; } @@ -320,7 +320,7 @@ Py::List ViewProviderFemMeshPy::getVisibleElementFaces(void) const PyObject* ViewProviderFemMeshPy::getCustomAttributes(const char* /*attr*/) const { - return 0; + return nullptr; } diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp index 3cc8c3f81a..28a7b5448f 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp @@ -272,7 +272,7 @@ bool ViewProviderFemPostFunction::setEdit(int ModNum) { Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgPost *postDlg = qobject_cast(dlg); if (postDlg && postDlg->getView() != this) - postDlg = 0; // another pad left open its task panel + postDlg = nullptr; // another pad left open its task panel if (dlg && !postDlg) { QMessageBox msgBox; msgBox.setText(QObject::tr("A dialog is already open in the task panel")); diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.h b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.h index 525eee8705..9761c6cab7 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.h +++ b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.h @@ -48,7 +48,7 @@ class FemGuiExport FunctionWidget : public QWidget { Q_OBJECT public: - FunctionWidget() : m_block(false), m_view(0), m_object(0) {} + FunctionWidget() : m_block(false), m_view(nullptr), m_object(nullptr) {} virtual ~FunctionWidget() {} virtual void applyPythonCode() = 0; @@ -111,7 +111,7 @@ public: //creates the widget used in the task dalogs, either for the function itself or for //the filter using it - virtual FunctionWidget* createControlWidget() {return NULL;} + virtual FunctionWidget* createControlWidget() {return nullptr;} protected: virtual bool setEdit(int ModNum); diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp index e3ef4c5ac7..5fb2be183e 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp @@ -317,11 +317,11 @@ void ViewProviderFemPostObject::update3D() { vtkPointData *pntData; vtkPoints *points; - vtkDataArray *normals = NULL; - vtkDataArray *tcoords = NULL; + vtkDataArray *normals = nullptr; + vtkDataArray *tcoords = nullptr; vtkCellArray *cells; vtkIdType npts = 0; - vtkIdTypePtr indx = 0; + vtkIdTypePtr indx = nullptr; points = pd->GetPoints(); pntData = pd->GetPointData(); @@ -581,7 +581,7 @@ bool ViewProviderFemPostObject::setEdit(int ModNum) { Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog(); TaskDlgPost *postDlg = qobject_cast(dlg); if (postDlg && postDlg->getView() != this) - postDlg = 0; // another pad left open its task panel + postDlg = nullptr; // another pad left open its task panel if (dlg && !postDlg) { QMessageBox msgBox; msgBox.setText(QObject::tr("A dialog is already open in the task panel"));