Points: modernize C++: use equals default

This commit is contained in:
wmayer
2023-08-22 11:06:53 +02:00
committed by wwmayer
parent a3057e946b
commit 43ec243292
18 changed files with 23 additions and 144 deletions

View File

@@ -59,8 +59,6 @@ public:
initialize("This module is the Points module."); // register with Python
}
~Module() override {}
private:
std::tuple<bool, bool, float> readE57Settings() const
{

View File

@@ -259,23 +259,13 @@ PointKernel::const_point_iterator::const_point_iterator
}
PointKernel::const_point_iterator::const_point_iterator
(const PointKernel::const_point_iterator& fi)
: _kernel(fi._kernel), _point(fi._point), _p_it(fi._p_it)
{
}
(const PointKernel::const_point_iterator& fi) = default;
//PointKernel::const_point_iterator::~const_point_iterator()
//{
//}
PointKernel::const_point_iterator::~const_point_iterator() = default;
PointKernel::const_point_iterator&
PointKernel::const_point_iterator::operator=(const PointKernel::const_point_iterator& pi)
{
this->_kernel = pi._kernel;
this->_point = pi._point;
this->_p_it = pi._p_it;
return *this;
}
PointKernel::const_point_iterator::operator=
(const PointKernel::const_point_iterator& pi) = default;
void PointKernel::const_point_iterator::dereference()
{

View File

@@ -52,17 +52,13 @@ public:
using difference_type = std::vector<value_type>::difference_type;
using size_type = std::vector<value_type>::size_type;
PointKernel()
{
}
PointKernel() = default;
explicit PointKernel(size_type size)
{
resize(size);
}
PointKernel(const PointKernel&);
~PointKernel() override
{
}
~PointKernel() override = default;
void operator = (const PointKernel&);
@@ -153,7 +149,7 @@ public:
const_point_iterator(const PointKernel*, std::vector<kernel_type>::const_iterator index);
const_point_iterator(const const_point_iterator& pi);
//~const_point_iterator();
~const_point_iterator();
const_point_iterator& operator=(const const_point_iterator& fi);
const value_type& operator*();

View File

@@ -124,9 +124,7 @@ Reader::Reader()
height = 0;
}
Reader::~Reader()
{
}
Reader::~Reader() = default;
void Reader::clear()
{
@@ -192,13 +190,7 @@ int Reader::getHeight() const
// ----------------------------------------------------------------------------
AscReader::AscReader()
{
}
AscReader::~AscReader()
{
}
AscReader::AscReader() = default;
void AscReader::read(const std::string& filename)
{
@@ -252,8 +244,7 @@ public:
_end = data.size();
_cur = 0;
}
~DataStreambuf() override {
}
~DataStreambuf() override = default;
protected:
int_type uflow() override {
@@ -503,13 +494,7 @@ lzfDecompress (const void *const in_data, unsigned int in_len,
}
}
PlyReader::PlyReader()
{
}
PlyReader::~PlyReader()
{
}
PlyReader::PlyReader() = default;
void PlyReader::read(const std::string& filename)
{
@@ -948,13 +933,7 @@ void PlyReader::readBinary(bool swapByteOrder,
// ----------------------------------------------------------------------------
PcdReader::PcdReader()
{
}
PcdReader::~PcdReader()
{
}
PcdReader::PcdReader() = default;
void PcdReader::read(const std::string& filename)
{
@@ -1754,10 +1733,6 @@ E57Reader::E57Reader(const bool& Color, const bool& State, const float& Distance
minDistance = Distance;
}
E57Reader::~E57Reader()
{
}
void E57Reader::read(const std::string& filename)
{
try {
@@ -1784,9 +1759,7 @@ Writer::Writer(const PointKernel& p) : points(p)
height = 1;
}
Writer::~Writer()
{
}
Writer::~Writer() = default;
void Writer::setIntensities(const std::vector<float>& i)
{
@@ -1824,10 +1797,6 @@ AscWriter::AscWriter(const PointKernel& p) : Writer(p)
{
}
AscWriter::~AscWriter()
{
}
void AscWriter::write(const std::string& filename)
{
if (placement.isIdentity()) {
@@ -1846,10 +1815,6 @@ PlyWriter::PlyWriter(const PointKernel& p) : Writer(p)
{
}
PlyWriter::~PlyWriter()
{
}
void PlyWriter::write(const std::string& filename)
{
std::list<std::string> properties;
@@ -2005,10 +1970,6 @@ PcdWriter::PcdWriter(const PointKernel& p) : Writer(p)
{
}
PcdWriter::~PcdWriter()
{
}
void PcdWriter::write(const std::string& filename)
{
std::list<std::string> fields;

View File

@@ -77,7 +77,6 @@ class AscReader : public Reader
{
public:
AscReader();
~AscReader() override;
void read(const std::string& filename) override;
};
@@ -85,7 +84,6 @@ class PlyReader : public Reader
{
public:
PlyReader();
~PlyReader() override;
void read(const std::string& filename) override;
private:
@@ -103,7 +101,6 @@ class PcdReader : public Reader
{
public:
PcdReader();
~PcdReader() override;
void read(const std::string& filename) override;
private:
@@ -120,7 +117,6 @@ class E57Reader : public Reader
{
public:
E57Reader(const bool& Color, const bool& State, const float& Distance);
~E57Reader() override;
void read(const std::string& filename) override;
protected:
bool useColor, checkState;
@@ -154,7 +150,6 @@ class AscWriter : public Writer
{
public:
explicit AscWriter(const PointKernel&);
~AscWriter() override;
void write(const std::string& filename) override;
};
@@ -162,7 +157,6 @@ class PlyWriter : public Writer
{
public:
explicit PlyWriter(const PointKernel&);
~PlyWriter() override;
void write(const std::string& filename) override;
};
@@ -170,7 +164,6 @@ class PcdWriter : public Writer
{
public:
explicit PcdWriter(const PointKernel&);
~PcdWriter() override;
void write(const std::string& filename) override;
};

View File

@@ -42,10 +42,6 @@ Feature::Feature()
ADD_PROPERTY(Points, (PointKernel()));
}
Feature::~Feature()
{
}
short Feature::mustExecute() const
{
return 0;

View File

@@ -55,7 +55,6 @@ class PointsExport Feature : public App::GeoFeature
public:
/// Constructor
Feature();
~Feature() override;
/** @name methods override Feature */
//@{

View File

@@ -62,7 +62,7 @@ public:
/// Construction
PointsGrid (const PointKernel &rclM, unsigned long ulX, unsigned long ulY, unsigned long ulZ);
/// Destruction
virtual ~PointsGrid () { }
virtual ~PointsGrid () = default;
//@}
public:

View File

@@ -51,15 +51,7 @@ TYPESYSTEM_SOURCE(Points::PropertyGreyValueList, App::PropertyLists)
TYPESYSTEM_SOURCE(Points::PropertyNormalList, App::PropertyLists)
TYPESYSTEM_SOURCE(Points::PropertyCurvatureList , App::PropertyLists)
PropertyGreyValueList::PropertyGreyValueList()
{
}
PropertyGreyValueList::~PropertyGreyValueList()
{
}
PropertyGreyValueList::PropertyGreyValueList() = default;
void PropertyGreyValueList::setSize(int newSize)
{
@@ -221,15 +213,7 @@ void PropertyGreyValueList::removeIndices( const std::vector<unsigned long>& uIn
setValues(remainValue);
}
PropertyNormalList::PropertyNormalList()
{
}
PropertyNormalList::~PropertyNormalList()
{
}
PropertyNormalList::PropertyNormalList() = default;
void PropertyNormalList::setSize(int newSize)
{
@@ -433,15 +417,7 @@ void PropertyNormalList::removeIndices( const std::vector<unsigned long>& uIndic
setValues(remainValue);
}
PropertyCurvatureList::PropertyCurvatureList()
{
}
PropertyCurvatureList::~PropertyCurvatureList()
{
}
PropertyCurvatureList::PropertyCurvatureList() = default;
void PropertyCurvatureList::setValue(const CurvatureInfo& lValue)
{

View File

@@ -43,12 +43,7 @@ class PointsExport PropertyGreyValue : public App::PropertyFloat
TYPESYSTEM_HEADER_WITH_OVERRIDE();
public:
PropertyGreyValue()
{
}
~PropertyGreyValue() override
{
}
PropertyGreyValue() = default;
};
class PointsExport PropertyGreyValueList: public App::PropertyLists
@@ -57,7 +52,6 @@ class PointsExport PropertyGreyValueList: public App::PropertyLists
public:
PropertyGreyValueList();
~PropertyGreyValueList() override;
void setSize(int newSize) override;
int getSize() const override;
@@ -108,7 +102,6 @@ class PointsExport PropertyNormalList: public App::PropertyLists
public:
PropertyNormalList();
~PropertyNormalList() override;
void setSize(int newSize) override;
int getSize() const override;
@@ -178,7 +171,6 @@ public:
public:
PropertyCurvatureList();
~PropertyCurvatureList() override;
void setSize(int newSize) override {
_lValueList.resize(newSize);

View File

@@ -45,10 +45,6 @@ PropertyPointKernel::PropertyPointKernel()
}
PropertyPointKernel::~PropertyPointKernel()
{
}
void PropertyPointKernel::setValue(const PointKernel& m)
{
aboutToSetValue();

View File

@@ -37,7 +37,6 @@ class PointsExport PropertyPointKernel : public App::PropertyComplexGeoData
public:
PropertyPointKernel();
~PropertyPointKernel() override;
/** @name Getter/setter */
//@{

View File

@@ -70,10 +70,6 @@ Structured::Structured()
//Height.setStatus(App::Property::ReadOnly, true);
}
Structured::~Structured()
{
}
App::DocumentObjectExecReturn *Structured::execute()
{
std::size_t size = Height.getValue() * Width.getValue();

View File

@@ -41,7 +41,6 @@ class PointsExport Structured : public Feature
public:
/// Constructor
Structured();
~Structured() override;
App::PropertyInteger Width; /**< The width of the structured cloud. */
App::PropertyInteger Height; /**< The height of the structured cloud. */

View File

@@ -52,10 +52,6 @@ public:
{
initialize("This module is the PointsGui module."); // register with Python
}
~Module() override {}
private:
};
PyObject* initModule()

View File

@@ -39,11 +39,7 @@ DlgPointsReadImp::DlgPointsReadImp(const char *FileName, QWidget* parent, Qt::W
/*
* Destroys the object and frees any allocated resources
*/
DlgPointsReadImp::~DlgPointsReadImp()
{
// no need to delete child widgets, Qt does it all for us
}
DlgPointsReadImp::~DlgPointsReadImp() = default;
#include "moc_DlgPointsReadImp.cpp"

View File

@@ -59,8 +59,8 @@ namespace PointsGui {
class ViewProviderPointsBuilder : public Gui::ViewProviderBuilder
{
public:
ViewProviderPointsBuilder(){}
~ViewProviderPointsBuilder() override{}
ViewProviderPointsBuilder() = default;
~ViewProviderPointsBuilder() override = default;
void buildNodes(const App::Property*, std::vector<SoNode*>&) const override;
void createPoints(const App::Property*, SoCoordinate3*, SoPointSet*) const;
void createPoints(const App::Property*, SoCoordinate3*, SoIndexedPointSet*) const;

View File

@@ -38,13 +38,9 @@ using namespace PointsGui;
/// @namespace PointsGui @class Workbench
TYPESYSTEM_SOURCE(PointsGui::Workbench, Gui::StdWorkbench)
Workbench::Workbench()
{
}
Workbench::Workbench() = default;
Workbench::~Workbench()
{
}
Workbench::~Workbench() = default;
Gui::ToolBarItem* Workbench::setupToolBars() const
{