MeshPart: modernize C++11

* use nullptr
This commit is contained in:
wmayer
2022-03-23 19:08:33 +01:00
parent ec4d8a7500
commit 8c7213e847
12 changed files with 27 additions and 27 deletions

View File

@@ -41,7 +41,7 @@ PyMOD_INIT_FUNC(MeshPart)
}
catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
PyMOD_Return(0);
PyMOD_Return(nullptr);
}
PyObject* mod = MeshPart::initModule();
Base::Console().Log("Loading MeshPart module... done\n");

View File

@@ -254,7 +254,7 @@ private:
}
Py::Object projectShapeOnMesh(const Py::Tuple& args, const Py::Dict& kwds)
{
static char* kwds_maxdist[] = {"Shape", "Mesh", "MaxDistance", NULL};
static char* kwds_maxdist[] = {"Shape", "Mesh", "MaxDistance", nullptr};
PyObject *s, *m;
double maxDist;
if (PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(),
@@ -284,7 +284,7 @@ private:
return list;
}
static char* kwds_dir[] = {"Shape", "Mesh", "Direction", NULL};
static char* kwds_dir[] = {"Shape", "Mesh", "Direction", nullptr};
PyErr_Clear();
PyObject *v;
if (PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(),
@@ -316,7 +316,7 @@ private:
return list;
}
static char* kwds_poly[] = {"Polygons", "Mesh", "Direction", NULL};
static char* kwds_poly[] = {"Polygons", "Mesh", "Direction", nullptr};
PyErr_Clear();
PyObject *seq;
if (PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(),
@@ -479,13 +479,13 @@ private:
PyObject *shape;
static char* kwds_lindeflection[] = {"Shape", "LinearDeflection", "AngularDeflection",
"Relative", "Segments", "GroupColors", NULL};
"Relative", "Segments", "GroupColors", nullptr};
PyErr_Clear();
double lindeflection=0;
double angdeflection=0.5;
PyObject* relative = Py_False;
PyObject* segment = Py_False;
PyObject* groupColors = 0;
PyObject* groupColors = nullptr;
if (PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!d|dO!O!O", kwds_lindeflection,
&(Part::TopoShapePy::Type), &shape, &lindeflection,
&angdeflection, &(PyBool_Type), &relative,
@@ -516,7 +516,7 @@ private:
return Py::asObject(new Mesh::MeshPy(mesher.createMesh()));
}
static char* kwds_maxLength[] = {"Shape", "MaxLength",NULL};
static char* kwds_maxLength[] = {"Shape", "MaxLength",nullptr};
PyErr_Clear();
double maxLength=0;
if (PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!d", kwds_maxLength,
@@ -528,7 +528,7 @@ private:
return Py::asObject(new Mesh::MeshPy(mesher.createMesh()));
}
static char* kwds_maxArea[] = {"Shape", "MaxArea",NULL};
static char* kwds_maxArea[] = {"Shape", "MaxArea",nullptr};
PyErr_Clear();
double maxArea=0;
if (PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!d", kwds_maxArea,
@@ -540,7 +540,7 @@ private:
return Py::asObject(new Mesh::MeshPy(mesher.createMesh()));
}
static char* kwds_localLen[] = {"Shape", "LocalLength",NULL};
static char* kwds_localLen[] = {"Shape", "LocalLength",nullptr};
PyErr_Clear();
double localLen=0;
if (PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!d", kwds_localLen,
@@ -552,7 +552,7 @@ private:
return Py::asObject(new Mesh::MeshPy(mesher.createMesh()));
}
static char* kwds_deflection[] = {"Shape", "Deflection",NULL};
static char* kwds_deflection[] = {"Shape", "Deflection",nullptr};
PyErr_Clear();
double deflection=0;
if (PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!d", kwds_deflection,
@@ -564,7 +564,7 @@ private:
return Py::asObject(new Mesh::MeshPy(mesher.createMesh()));
}
static char* kwds_minmaxLen[] = {"Shape", "MinLength","MaxLength",NULL};
static char* kwds_minmaxLen[] = {"Shape", "MinLength","MaxLength",nullptr};
PyErr_Clear();
double minLen=0, maxLen=0;
if (PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!dd", kwds_minmaxLen,
@@ -576,7 +576,7 @@ private:
return Py::asObject(new Mesh::MeshPy(mesher.createMesh()));
}
static char* kwds_fineness[] = {"Shape", "Fineness", "SecondOrder", "Optimize", "AllowQuad", "MinLength", "MaxLength", NULL};
static char* kwds_fineness[] = {"Shape", "Fineness", "SecondOrder", "Optimize", "AllowQuad", "MinLength", "MaxLength", nullptr};
PyErr_Clear();
int fineness=0, secondOrder=0, optimize=1, allowquad=0;
if (PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!i|iiidd", kwds_fineness,
@@ -597,7 +597,7 @@ private:
}
static char* kwds_user[] = {"Shape", "GrowthRate", "SegPerEdge", "SegPerRadius", "SecondOrder",
"Optimize", "AllowQuad", "MinLength", "MaxLength", NULL };
"Optimize", "AllowQuad", "MinLength", "MaxLength", nullptr };
PyErr_Clear();
double growthRate=0, nbSegPerEdge=0, nbSegPerRadius=0;
if (PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|dddiiidd", kwds_user,

View File

@@ -81,7 +81,7 @@
using namespace MeshPart;
SMESH_Gen* Mesher::_mesh_gen = 0;
SMESH_Gen* Mesher::_mesh_gen = nullptr;
MeshingOutput::MeshingOutput()

View File

@@ -70,7 +70,7 @@ PyMOD_INIT_FUNC(MeshPartGui)
{
if (!Gui::Application::Instance) {
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
PyMOD_Return(0);
PyMOD_Return(nullptr);
}
PyObject* mod = MeshPartGui::initModule();

View File

@@ -586,7 +586,7 @@ TaskCrossSections::TaskCrossSections(const Base::BoundBox3d& bb)
widget = new CrossSections(bb);
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("Mesh_CrossSections"),
widget->windowTitle(), true, 0);
widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
}

View File

@@ -44,7 +44,7 @@ class CrossSections : public QDialog
enum Plane { XY, XZ, YZ };
public:
CrossSections(const Base::BoundBox3d& bb, QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
CrossSections(const Base::BoundBox3d& bb, QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
~CrossSections();
void accept();
void apply();

View File

@@ -246,9 +246,9 @@ public:
, cosAngle(0.7071) // 45 degree
, approximate(true)
, curve(new ViewProviderCurveOnMesh)
, mesh(0)
, grid(0)
, viewer(0)
, mesh(nullptr)
, grid(nullptr)
, viewer(nullptr)
, editcursor(QPixmap(cursor_curveonmesh), 7, 7)
{
}
@@ -450,7 +450,7 @@ void CurveOnMeshHandler::disableCallback()
view3d->removeViewProvider(d_ptr->curve);
view3d->removeEventCallback(SoEvent::getClassTypeId(), Private::vertexCallback, this);
}
d_ptr->viewer = 0;
d_ptr->viewer = nullptr;
}
std::vector<SbVec3f> CurveOnMeshHandler::getVertexes() const

View File

@@ -68,7 +68,7 @@ class CurveOnMeshHandler : public QObject
Q_OBJECT
public:
CurveOnMeshHandler(QObject* parent = 0);
CurveOnMeshHandler(QObject* parent = nullptr);
~CurveOnMeshHandler();
void enableApproximation(bool);
void setParameters(int maxDegree, GeomAbs_Shape cont, double tol3d, double angle);

View File

@@ -101,7 +101,7 @@ TaskCurveOnMesh::TaskCurveOnMesh(Gui::View3DInventor* view)
widget = new CurveOnMeshWidget(view);
taskbox = new Gui::TaskView::TaskBox(
QPixmap(),
widget->windowTitle(), true, 0);
widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
}

View File

@@ -42,7 +42,7 @@ class CurveOnMeshWidget : public QWidget
Q_OBJECT
public:
CurveOnMeshWidget(Gui::View3DInventor* view, QWidget* parent=0);
CurveOnMeshWidget(Gui::View3DInventor* view, QWidget* parent=nullptr);
~CurveOnMeshWidget();
void reject();

View File

@@ -608,7 +608,7 @@ TaskTessellation::TaskTessellation()
widget = new Tessellation();
Gui::TaskView::TaskBox* taskbox = new Gui::TaskView::TaskBox(
QPixmap()/*Gui::BitmapFactory().pixmap("MeshPart_Mesher")*/,
widget->windowTitle(), true, 0);
widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
}

View File

@@ -47,7 +47,7 @@ class Mesh2ShapeGmsh : public MeshGui::GmshWidget
Q_OBJECT
public:
Mesh2ShapeGmsh(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
Mesh2ShapeGmsh(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
~Mesh2ShapeGmsh();
void process(App::Document* doc, const std::list<App::SubObjectT>&);
@@ -77,7 +77,7 @@ class Tessellation : public QWidget
};
public:
Tessellation(QWidget* parent = 0);
Tessellation(QWidget* parent = nullptr);
~Tessellation();
bool accept();