Reen: modernize C++11
* use nullptr
This commit is contained in:
@@ -153,7 +153,7 @@ private:
|
||||
Py::Object approxSurface(const Py::Tuple& args, const Py::Dict& kwds)
|
||||
{
|
||||
PyObject *o;
|
||||
PyObject *uvdirs = 0;
|
||||
PyObject *uvdirs = nullptr;
|
||||
// spline parameters
|
||||
int uDegree = 3;
|
||||
int vDegree = 3;
|
||||
@@ -172,7 +172,7 @@ private:
|
||||
|
||||
static char* kwds_approx[] = {"Points", "UDegree", "VDegree", "NbUPoles", "NbVPoles",
|
||||
"Smooth", "Weight", "Grad", "Bend", "Curv",
|
||||
"Iterations", "Correction", "PatchFactor","UVDirs", NULL};
|
||||
"Iterations", "Correction", "PatchFactor","UVDirs", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O|iiiiO!ddddiO!dO!",kwds_approx,
|
||||
&o,&uDegree,&vDegree,&uPoles,&vPoles,
|
||||
&PyBool_Type,&smooth,&weight,&grad,&bend,&curv,
|
||||
@@ -838,7 +838,7 @@ PyMOD_INIT_FUNC(ReverseEngineering)
|
||||
}
|
||||
catch(const Base::Exception& e) {
|
||||
PyErr_SetString(PyExc_ImportError, e.what());
|
||||
PyMOD_Return(0);
|
||||
PyMOD_Return(nullptr);
|
||||
}
|
||||
|
||||
PyObject* mod = Reen::initModule();
|
||||
|
||||
@@ -559,8 +559,8 @@ ParameterCorrection::ParameterCorrection(unsigned usUOrder, unsigned usVOrder,
|
||||
, _usVOrder(usVOrder)
|
||||
, _usUCtrlpoints(usUCtrlpoints)
|
||||
, _usVCtrlpoints(usVCtrlpoints)
|
||||
, _pvcPoints(0)
|
||||
, _pvcUVParam(0)
|
||||
, _pvcPoints(nullptr)
|
||||
, _pvcUVParam(nullptr)
|
||||
, _vCtrlPntsOfSurf(0,usUCtrlpoints-1,0,usVCtrlpoints-1)
|
||||
, _vUKnots(0,usUCtrlpoints-usUOrder+1)
|
||||
, _vVKnots(0,usVCtrlpoints-usVOrder+1)
|
||||
@@ -721,11 +721,11 @@ Handle(Geom_BSplineSurface) ParameterCorrection::CreateSurface(const TColgp_Arra
|
||||
bool bParaCor,
|
||||
double fSizeFactor)
|
||||
{
|
||||
if (_pvcPoints != NULL) {
|
||||
if (_pvcPoints != nullptr) {
|
||||
delete _pvcPoints;
|
||||
_pvcPoints = NULL;
|
||||
_pvcPoints = nullptr;
|
||||
delete _pvcUVParam;
|
||||
_pvcUVParam = NULL;
|
||||
_pvcUVParam = nullptr;
|
||||
}
|
||||
|
||||
_pvcPoints = new TColgp_Array1OfPnt(points.Lower(), points.Upper());
|
||||
@@ -733,9 +733,9 @@ Handle(Geom_BSplineSurface) ParameterCorrection::CreateSurface(const TColgp_Arra
|
||||
_pvcUVParam = new TColgp_Array1OfPnt2d(points.Lower(), points.Upper());
|
||||
|
||||
if (_usUCtrlpoints*_usVCtrlpoints > static_cast<unsigned>(_pvcPoints->Length()))
|
||||
return NULL; // LGS under-determined
|
||||
return nullptr; // LGS under-determined
|
||||
if (!DoInitialParameterCorrection(fSizeFactor))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
// Generate the approximation plane as a B-spline area
|
||||
if (iIter < 0) {
|
||||
@@ -783,8 +783,8 @@ BSplineParameterCorrection::BSplineParameterCorrection(unsigned usUOrder, unsign
|
||||
void BSplineParameterCorrection::Init()
|
||||
{
|
||||
// Initializations
|
||||
_pvcUVParam = NULL;
|
||||
_pvcPoints = NULL;
|
||||
_pvcUVParam = nullptr;
|
||||
_pvcPoints = nullptr;
|
||||
_clFirstMatrix.Init(0.0);
|
||||
_clSecondMatrix.Init(0.0);
|
||||
_clThirdMatrix.Init(0.0);
|
||||
|
||||
@@ -70,7 +70,7 @@ PyMOD_INIT_FUNC(ReverseEngineeringGui)
|
||||
{
|
||||
if (!Gui::Application::Instance) {
|
||||
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
|
||||
PyMOD_Return(0);
|
||||
PyMOD_Return(nullptr);
|
||||
}
|
||||
|
||||
// load dependent module
|
||||
@@ -79,7 +79,7 @@ PyMOD_INIT_FUNC(ReverseEngineeringGui)
|
||||
}
|
||||
catch(const Base::Exception& e) {
|
||||
PyErr_SetString(PyExc_ImportError, e.what());
|
||||
PyMOD_Return(0);
|
||||
PyMOD_Return(nullptr);
|
||||
}
|
||||
|
||||
PyObject* mod = ReverseEngineeringGui::initModule();
|
||||
|
||||
@@ -256,7 +256,7 @@ TaskFitBSplineSurface::TaskFitBSplineSurface(const App::DocumentObjectT& obj)
|
||||
widget = new FitBSplineSurfaceWidget(obj);
|
||||
taskbox = new Gui::TaskView::TaskBox(
|
||||
Gui::BitmapFactory().pixmap("actions/FitSurface"),
|
||||
widget->windowTitle(), true, 0);
|
||||
widget->windowTitle(), true, nullptr);
|
||||
taskbox->groupLayout()->addWidget(widget);
|
||||
Content.push_back(taskbox);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class FitBSplineSurfaceWidget : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FitBSplineSurfaceWidget(const App::DocumentObjectT&, QWidget* parent = 0);
|
||||
FitBSplineSurfaceWidget(const App::DocumentObjectT&, QWidget* parent = nullptr);
|
||||
~FitBSplineSurfaceWidget();
|
||||
|
||||
bool accept();
|
||||
|
||||
@@ -128,7 +128,7 @@ TaskPoisson::TaskPoisson(const App::DocumentObjectT& obj)
|
||||
widget = new PoissonWidget(obj);
|
||||
taskbox = new Gui::TaskView::TaskBox(
|
||||
Gui::BitmapFactory().pixmap("actions/FitSurface"),
|
||||
widget->windowTitle(), true, 0);
|
||||
widget->windowTitle(), true, nullptr);
|
||||
taskbox->groupLayout()->addWidget(widget);
|
||||
Content.push_back(taskbox);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class PoissonWidget : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PoissonWidget(const App::DocumentObjectT&, QWidget* parent = 0);
|
||||
PoissonWidget(const App::DocumentObjectT&, QWidget* parent = nullptr);
|
||||
~PoissonWidget();
|
||||
|
||||
bool accept();
|
||||
|
||||
@@ -256,7 +256,7 @@ TaskSegmentation::TaskSegmentation(Mesh::Feature* mesh)
|
||||
{
|
||||
widget = new Segmentation(mesh);
|
||||
taskbox = new Gui::TaskView::TaskBox(
|
||||
QPixmap(), widget->windowTitle(), false, 0);
|
||||
QPixmap(), widget->windowTitle(), false, nullptr);
|
||||
taskbox->groupLayout()->addWidget(widget);
|
||||
Content.push_back(taskbox);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class Segmentation : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Segmentation(Mesh::Feature* mesh, QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
|
||||
Segmentation(Mesh::Feature* mesh, QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
|
||||
~Segmentation();
|
||||
void accept();
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ TaskSegmentationManual::TaskSegmentationManual()
|
||||
{
|
||||
widget = new SegmentationManual();
|
||||
taskbox = new Gui::TaskView::TaskBox(
|
||||
QPixmap(), widget->windowTitle(), false, 0);
|
||||
QPixmap(), widget->windowTitle(), false, nullptr);
|
||||
taskbox->groupLayout()->addWidget(widget);
|
||||
Content.push_back(taskbox);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class SegmentationManual : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SegmentationManual(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
|
||||
SegmentationManual(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
|
||||
~SegmentationManual();
|
||||
void reject();
|
||||
void createSegment();
|
||||
|
||||
Reference in New Issue
Block a user