Inspection: modernize C++11
* use nullptr
This commit is contained in:
@@ -715,8 +715,8 @@ Feature::Feature()
|
||||
{
|
||||
ADD_PROPERTY(SearchRadius,(0.05));
|
||||
ADD_PROPERTY(Thickness,(0.0));
|
||||
ADD_PROPERTY(Actual,(0));
|
||||
ADD_PROPERTY(Nominals,(0));
|
||||
ADD_PROPERTY(Actual,(nullptr));
|
||||
ADD_PROPERTY(Nominals,(nullptr));
|
||||
ADD_PROPERTY(Distances,(0.0));
|
||||
}
|
||||
|
||||
@@ -745,7 +745,7 @@ App::DocumentObjectExecReturn* Feature::execute(void)
|
||||
if (!pcActual)
|
||||
throw Base::ValueError("No actual geometry to inspect specified");
|
||||
|
||||
InspectActualGeometry* actual = 0;
|
||||
InspectActualGeometry* actual = nullptr;
|
||||
if (pcActual->getTypeId().isDerivedFrom(Mesh::Feature::getClassTypeId())) {
|
||||
Mesh::Feature* mesh = static_cast<Mesh::Feature*>(pcActual);
|
||||
actual = new InspectActualMesh(mesh->Mesh.getValue());
|
||||
@@ -767,7 +767,7 @@ App::DocumentObjectExecReturn* Feature::execute(void)
|
||||
std::vector<InspectNominalGeometry*> inspectNominal;
|
||||
const std::vector<App::DocumentObject*>& nominals = Nominals.getValues();
|
||||
for (std::vector<App::DocumentObject*>::const_iterator it = nominals.begin(); it != nominals.end(); ++it) {
|
||||
InspectNominalGeometry* nominal = 0;
|
||||
InspectNominalGeometry* nominal = nullptr;
|
||||
if ((*it)->getTypeId().isDerivedFrom(Mesh::Feature::getClassTypeId())) {
|
||||
Mesh::Feature* mesh = static_cast<Mesh::Feature*>(*it);
|
||||
nominal = new InspectNominalMesh(mesh->Mesh.getValue(), this->SearchRadius.getValue());
|
||||
@@ -910,7 +910,7 @@ App::DocumentObjectExecReturn* Feature::execute(void)
|
||||
for (std::vector<InspectNominalGeometry*>::iterator it = inspectNominal.begin(); it != inspectNominal.end(); ++it)
|
||||
delete *it;
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
@@ -62,7 +62,7 @@ PyMOD_INIT_FUNC(InspectionGui)
|
||||
{
|
||||
if (!Gui::Application::Instance) {
|
||||
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
|
||||
PyMOD_Return(0);
|
||||
PyMOD_Return(nullptr);
|
||||
}
|
||||
|
||||
// instantiating the commands
|
||||
|
||||
@@ -394,7 +394,7 @@ namespace InspectionGui {
|
||||
class ViewProviderProxyObject : public QObject
|
||||
{
|
||||
public:
|
||||
ViewProviderProxyObject(QWidget* w) : QObject(0), widget(w) {}
|
||||
ViewProviderProxyObject(QWidget* w) : QObject(nullptr), widget(w) {}
|
||||
~ViewProviderProxyObject() {}
|
||||
void customEvent(QEvent *)
|
||||
{
|
||||
@@ -424,7 +424,7 @@ public:
|
||||
flag->setPalette(p);
|
||||
flag->setText(text);
|
||||
flag->setOrigin(point->getPoint());
|
||||
Gui::GLFlagWindow* flags = 0;
|
||||
Gui::GLFlagWindow* flags = nullptr;
|
||||
std::list<Gui::GLGraphicsItem*> glItems = view->getGraphicsItemsOfType(Gui::GLFlagWindow::getClassTypeId());
|
||||
if (glItems.empty()) {
|
||||
flags = new Gui::GLFlagWindow(view);
|
||||
@@ -479,7 +479,7 @@ void ViewProviderInspection::inspectCallback(void * ud, SoEventCallback * n)
|
||||
}
|
||||
else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::UP) {
|
||||
const SoPickedPoint * point = n->getPickedPoint();
|
||||
if (point == NULL) {
|
||||
if (point == nullptr) {
|
||||
Base::Console().Message("No point picked.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -45,12 +45,12 @@ class SingleSelectionItem : public QTreeWidgetItem
|
||||
{
|
||||
public:
|
||||
SingleSelectionItem (QTreeWidget* parent)
|
||||
: QTreeWidgetItem(parent), _compItem(0)
|
||||
: QTreeWidgetItem(parent), _compItem(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
SingleSelectionItem (QTreeWidgetItem* parent)
|
||||
: QTreeWidgetItem (parent), _compItem(0)
|
||||
: QTreeWidgetItem (parent), _compItem(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ void VisualInspection::onActivateItem(QTreeWidgetItem* item)
|
||||
|
||||
void VisualInspection::accept()
|
||||
{
|
||||
onActivateItem(0);
|
||||
onActivateItem(nullptr);
|
||||
if (buttonOk->isEnabled()) {
|
||||
QDialog::accept();
|
||||
saveSettings();
|
||||
|
||||
@@ -36,7 +36,7 @@ class VisualInspection : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
VisualInspection(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
|
||||
VisualInspection(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
|
||||
~ VisualInspection();
|
||||
|
||||
void accept();
|
||||
|
||||
Reference in New Issue
Block a user