Image: modernize C++11

* remove redundant void-arg
* use nullptr
* replace deprecated headers
This commit is contained in:
wmayer
2022-01-26 17:55:10 +01:00
parent cdf755ec71
commit 213311524e
8 changed files with 14 additions and 14 deletions

View File

@@ -38,7 +38,7 @@ PROPERTY_SOURCE(Image::ImagePlane, App::GeoFeature)
ImagePlane::ImagePlane()
{
ADD_PROPERTY_TYPE( ImageFile,(0) , "ImagePlane",Prop_None,"File of the image");
ADD_PROPERTY_TYPE( ImageFile,(nullptr) , "ImagePlane",Prop_None,"File of the image");
ADD_PROPERTY_TYPE( XSize, (100), "ImagePlane",Prop_None,"Size of a pixel in X");
ADD_PROPERTY_TYPE( YSize, (100), "ImagePlane",Prop_None,"Size of a pixel in Y");
}

View File

@@ -38,7 +38,7 @@ class ImageExport ImagePlane : public App::GeoFeature
public:
/// Constructor
ImagePlane(void);
ImagePlane();
virtual ~ImagePlane();
App::PropertyFileIncluded ImageFile;
@@ -46,7 +46,7 @@ public:
App::PropertyLength YSize;
/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
virtual const char* getViewProviderName() const {
return "ImageGui::ViewProviderImagePlane";
}
};

View File

@@ -23,7 +23,7 @@
#include "ViewProviderImagePlane.h"
// use a different name to CreateCommand()
void CreateImageCommands(void);
void CreateImageCommands();
void loadImageResource()
{
@@ -42,7 +42,7 @@ PyMOD_INIT_FUNC(ImageGui)
{
if (!Gui::Application::Instance) {
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
PyMOD_Return(0);
PyMOD_Return(nullptr);
}
PyObject* mod = ImageGui::initModule();

View File

@@ -58,7 +58,7 @@ private:
Py::Object open(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();

View File

@@ -51,13 +51,13 @@ SET(ImageGui_SRCS
Command.cpp
ImageOrientationDialog.cpp
ImageOrientationDialog.h
OpenGLImageBox.cpp
OpenGLImageBox.h
ViewProviderImagePlane.cpp
ViewProviderImagePlane.h
Resources/Image.qrc
ImageView.cpp
ImageView.h
OpenGLImageBox.cpp
OpenGLImageBox.h
PreCompiled.cpp
PreCompiled.h
Workbench.cpp

View File

@@ -19,7 +19,7 @@
# include <QTextStream>
#endif
#include <time.h>
#include <ctime>
#if defined(FC_OS_WIN32)
#include <sys/timeb.h>
#endif
@@ -187,7 +187,7 @@ void CmdImageScaling::activated(int iMsg)
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#if HAVE_OPENCV2
DEF_STD_CMD(CmdImageCapturerTest);
DEF_STD_CMD(CmdImageCapturerTest)
CmdImageCapturerTest::CmdImageCapturerTest()
: Command("Image_CapturerTest")
@@ -226,7 +226,7 @@ void CmdImageCapturerTest::activated(int iMsg)
}
#endif
void CreateImageCommands(void)
void CreateImageCommands()
{
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();

View File

@@ -39,7 +39,7 @@ using namespace ImageGui;
TYPESYSTEM_SOURCE_ABSTRACT(ImageGui::ImageView, Gui::MDIView)
ImageView::ImageView(QWidget* parent)
: MDIView(0, parent), _ignoreCloseEvent(false)
: MDIView(nullptr, parent), _ignoreCloseEvent(false)
{
// Create an OpenGL widget for displaying images
// Since Qt5 there is a weird behaviour when creating a GLImageBox.

View File

@@ -74,7 +74,7 @@ ViewProviderImagePlane::~ViewProviderImagePlane()
void ViewProviderImagePlane::attach(App::DocumentObject *pcObj)
{
ViewProviderDocumentObject::attach(pcObj);
ViewProviderGeometryObject::attach(pcObj);
// NOTE: SoFCSelection node has beem removed because it led to
// problems using the image as a construction plane with the
@@ -114,7 +114,7 @@ void ViewProviderImagePlane::setDisplayMode(const char* ModeName)
ViewProviderGeometryObject::setDisplayMode(ModeName);
}
std::vector<std::string> ViewProviderImagePlane::getDisplayModes(void) const
std::vector<std::string> ViewProviderImagePlane::getDisplayModes() const
{
std::vector<std::string> StrList;
StrList.push_back("ImagePlane");