Points: modernize C++11

* remove redundant void-arg
* use nullptr
This commit is contained in:
wmayer
2022-01-26 17:53:41 +01:00
parent 4b788d0413
commit 4398ae54dd
19 changed files with 118 additions and 117 deletions

View File

@@ -115,7 +115,7 @@ private:
App::Document* pcDoc = App::GetApplication().newDocument("Unnamed");
Points::Feature* pcFeature = 0;
Points::Feature* pcFeature = nullptr;
if (reader->hasProperties()) {
// Scattered or structured points?
if (reader->isStructured()) {
@@ -234,7 +234,7 @@ private:
pcDoc = App::GetApplication().newDocument(DocName);
}
Points::Feature* pcFeature = 0;
Points::Feature* pcFeature = nullptr;
if (reader->hasProperties()) {
// Scattered or structured points?
if (reader->isStructured()) {

View File

@@ -56,7 +56,7 @@ PointKernel::PointKernel(const PointKernel& pts)
}
std::vector<const char*> PointKernel::getElementTypes(void) const
std::vector<const char*> PointKernel::getElementTypes() const
{
std::vector<const char*> temp;
//temp.push_back("Segment");
@@ -79,7 +79,7 @@ Data::Segment* PointKernel::getSubElement(const char* /*Type*/, unsigned long /*
// return 0;
//}
return 0;
return nullptr;
}
void PointKernel::transformGeometry(const Base::Matrix4D &rclMat)
@@ -99,7 +99,7 @@ void PointKernel::transformGeometry(const Base::Matrix4D &rclMat)
#endif
}
Base::BoundBox3d PointKernel::getBoundBox(void)const
Base::BoundBox3d PointKernel::getBoundBox()const
{
Base::BoundBox3d bnd;
@@ -131,12 +131,12 @@ void PointKernel::operator = (const PointKernel& Kernel)
}
}
unsigned int PointKernel::getMemSize (void) const
unsigned int PointKernel::getMemSize () const
{
return _Points.size() * sizeof(value_type);
}
PointKernel::size_type PointKernel::countValid(void) const
PointKernel::size_type PointKernel::countValid() const
{
size_type num = 0;
for (const_point_iterator it = begin(); it != end(); ++it) {

View File

@@ -52,7 +52,7 @@ public:
typedef std::vector<value_type>::difference_type difference_type;
typedef std::vector<value_type>::size_type size_type;
PointKernel(void)
PointKernel()
{
}
PointKernel(size_type size)
@@ -72,14 +72,14 @@ public:
* List of different subelement types
* its NOT a list of the subelements itself
*/
virtual std::vector<const char*> getElementTypes(void) const;
virtual std::vector<const char*> getElementTypes() const;
virtual unsigned long countSubElements(const char* Type) const;
/// get the subelement by type and number
virtual Data::Segment* getSubElement(const char* Type, unsigned long) const;
//@}
inline void setTransform(const Base::Matrix4D& rclTrf){_Mtrx = rclTrf;}
inline Base::Matrix4D getTransform(void) const{return _Mtrx;}
inline Base::Matrix4D getTransform() const{return _Mtrx;}
std::vector<value_type>& getBasicPoints()
{ return this->_Points; }
const std::vector<value_type>& getBasicPoints() const
@@ -93,12 +93,12 @@ public:
std::vector<Base::Vector3d> &Normals,
float Accuracy, uint16_t flags=0) const;
virtual void transformGeometry(const Base::Matrix4D &rclMat);
virtual Base::BoundBox3d getBoundBox(void)const;
virtual Base::BoundBox3d getBoundBox()const;
/** @name I/O */
//@{
// Implemented from Persistence
unsigned int getMemSize (void) const;
unsigned int getMemSize () const;
void Save (Base::Writer &writer) const;
void SaveDocFile (Base::Writer &writer) const;
void Restore(Base::XMLReader &reader);
@@ -115,8 +115,8 @@ private:
public:
/// number of points stored
size_type size(void) const {return this->_Points.size();}
size_type countValid(void) const;
size_type size() const {return this->_Points.size();}
size_type countValid() const;
std::vector<value_type> getValidPoints() const;
void resize(size_type n){_Points.resize(n);}
void reserve(size_type n){_Points.reserve(n);}
@@ -124,7 +124,7 @@ public:
_Points.erase(_Points.begin()+first,_Points.begin()+last);
}
void clear(void){_Points.clear();}
void clear(){_Points.clear();}
/// get the points

View File

@@ -980,7 +980,7 @@ void PcdReader::read(const std::string& filename)
std::vector<char> uncompressed(u);
if (lzfDecompress(&compressed[0], c, &uncompressed[0], u) == u) {
DataStreambuf ibuf(uncompressed);
std::istream istr(0);
std::istream istr(nullptr);
istr.rdbuf(&ibuf);
readBinary(true, istr, types, sizes, data);
}

View File

@@ -59,7 +59,7 @@ short Feature::mustExecute() const
return 0;
}
App::DocumentObjectExecReturn *Feature::execute(void)
App::DocumentObjectExecReturn *Feature::execute()
{
this->Points.touch();
return App::DocumentObject::StdReturn;
@@ -110,7 +110,7 @@ template class PointsExport FeatureCustomT<Points::Feature>;
namespace App {
/// @cond DOXERR
PROPERTY_SOURCE_TEMPLATE(Points::FeaturePython, Points::Feature)
template<> const char* Points::FeaturePython::getViewProviderName(void) const {
template<> const char* Points::FeaturePython::getViewProviderName() const {
return "PointsGui::ViewProviderPython";
}
/// @endcond

View File

@@ -55,8 +55,8 @@ class PointsExport Feature : public App::GeoFeature
public:
/// Constructor
Feature(void);
virtual ~Feature(void);
Feature();
virtual ~Feature();
/** @name methods override Feature */
//@{
@@ -64,9 +64,9 @@ public:
void RestoreDocFile(Base::Reader &reader);
short mustExecute() const;
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
virtual const char* getViewProviderName() const {
return "PointsGui::ViewProviderScattered";
}

View File

@@ -43,8 +43,8 @@ PointsGrid::PointsGrid (const PointKernel &rclM)
RebuildGrid();
}
PointsGrid::PointsGrid (void)
: _pclPoints(NULL),
PointsGrid::PointsGrid ()
: _pclPoints(nullptr),
_ulCtElements(0),
_ulCtGridsX(POINTS_CT_GRID), _ulCtGridsY(POINTS_CT_GRID), _ulCtGridsZ(POINTS_CT_GRID),
_fGridLenX(0.0f), _fGridLenY(0.0f), _fGridLenZ(0.0f),
@@ -93,10 +93,10 @@ void PointsGrid::Attach (const PointKernel &rclM)
RebuildGrid();
}
void PointsGrid::Clear (void)
void PointsGrid::Clear ()
{
_aulGrid.clear();
_pclPoints = NULL;
_pclPoints = nullptr;
}
void PointsGrid::Rebuild (unsigned long ulX, unsigned long ulY, unsigned long ulZ)
@@ -122,9 +122,9 @@ void PointsGrid::Rebuild (int iCtGridPerAxis)
RebuildGrid();
}
void PointsGrid::InitGrid (void)
void PointsGrid::InitGrid ()
{
assert(_pclPoints != NULL);
assert(_pclPoints != nullptr);
unsigned long i, j;
@@ -645,9 +645,9 @@ void PointsGrid::Validate (const PointKernel &rclPoints)
RebuildGrid();
}
void PointsGrid::Validate (void)
void PointsGrid::Validate ()
{
if (_pclPoints == NULL)
if (_pclPoints == nullptr)
return;
if (_pclPoints->size() != _ulCtElements)
@@ -677,7 +677,7 @@ bool PointsGrid::Verify() const
return true;
}
void PointsGrid::RebuildGrid (void)
void PointsGrid::RebuildGrid ()
{
_ulCtElements = _pclPoints->size();
@@ -817,8 +817,9 @@ bool PointsGridIterator::NextOnRay (std::vector<unsigned long> &raulElements)
GridElement pos(_ulX, _ulY, _ulZ); _cSearchPositions.insert(pos);
raulElements.insert(raulElements.end(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].begin(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].end());
}
else
_bValidRay = false; // Beam escaped
else {
_bValidRay = false; // ray exited
}
return _bValidRay;
}

View File

@@ -54,7 +54,7 @@ public:
/// Construction
PointsGrid (const PointKernel &rclM);
/// Construction
PointsGrid (void);
PointsGrid ();
/// Construction
PointsGrid (const PointKernel &rclM, int iCtGridPerAxis);
/// Construction
@@ -62,7 +62,7 @@ public:
/// Construction
PointsGrid (const PointKernel &rclM, unsigned long ulX, unsigned long ulY, unsigned long ulZ);
/// Destruction
virtual ~PointsGrid (void) { }
virtual ~PointsGrid () { }
//@}
public:
@@ -101,7 +101,7 @@ public:
/** Returns the bounding box of a given grid element. */
inline Base::BoundBox3d GetBoundBox (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const;
/** Returns the bounding box of the whole. */
inline Base::BoundBox3d GetBoundBox (void) const;
inline Base::BoundBox3d GetBoundBox () const;
//@}
/** Returns the number of elements in a given grid. */
unsigned long GetCtElements(unsigned long ulX, unsigned long ulY, unsigned long ulZ) const
@@ -111,7 +111,7 @@ public:
/** Validates the grid structure and rebuilds it if needed. */
virtual void Validate (const PointKernel &rclM);
/** Validates the grid structure and rebuilds it if needed. */
virtual void Validate (void);
virtual void Validate ();
/** Verifies the grid structure and returns false if inconsistencies are found. */
virtual bool Verify() const;
/** Returns the indices of the grid this point lies in. If the point is outside the grid then the indices of
@@ -124,17 +124,17 @@ protected:
/** Checks if this is a valid grid position. */
inline bool CheckPos (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const;
/** Initializes the size of the internal structure. */
virtual void InitGrid (void);
virtual void InitGrid ();
/** Deletes the grid structure. */
virtual void Clear (void);
virtual void Clear ();
/** Calculates the grid length dependent on maximum number of grids. */
virtual void CalculateGridLength (unsigned long ulCtGrid, unsigned long ulMaxGrids);
/** Calculates the grid length dependent on the number of grids per axis. */
virtual void CalculateGridLength (int iCtGridPerAxis);
/** Rebuilds the grid structure. */
virtual void RebuildGrid (void);
virtual void RebuildGrid ();
/** Returns the number of stored elements. */
unsigned long HasElements (void) const
unsigned long HasElements () const
{ return _pclPoints->size(); }
/** Get the indices of all elements lying in the grids around a given grid with distance \a ulDistance. */
void GetHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ, unsigned long ulDistance, std::set<unsigned long> &raclInd) const;
@@ -177,7 +177,7 @@ public:
/// Construction
PointsGridIterator (const PointsGrid &rclG);
/** Returns the bounding box of the current grid element. */
Base::BoundBox3d GetBoundBox (void) const
Base::BoundBox3d GetBoundBox () const
{ return _rclGrid.GetBoundBox(_ulX, _ulY, _ulZ); }
/** Returns indices of the elements in the current grid. */
void GetElements (std::vector<unsigned long> &raulElements) const
@@ -187,13 +187,13 @@ public:
/** @name Iteration */
//@{
/** Sets the iterator to the first element*/
void Init (void)
void Init ()
{ _ulX = _ulY = _ulZ = 0; }
/** Checks if the iterator has not yet reached the end position. */
bool More (void) const
bool More () const
{ return (_ulZ < _rclGrid._ulCtGridsZ); }
/** Go to the next grid. */
void Next (void)
void Next ()
{
if (++_ulX >= (_rclGrid._ulCtGridsX)) _ulX = 0; else return;
if (++_ulY >= (_rclGrid._ulCtGridsY)) { _ulY = 0; _ulZ++; } else return;
@@ -254,7 +254,7 @@ inline Base::BoundBox3d PointsGrid::GetBoundBox (unsigned long ulX, unsigned lo
return Base::BoundBox3d(fX, fY, fZ, fX + _fGridLenX, fY + _fGridLenY, fZ + _fGridLenZ);
}
inline Base::BoundBox3d PointsGrid::GetBoundBox (void) const
inline Base::BoundBox3d PointsGrid::GetBoundBox () const
{
return Base::BoundBox3d(_fMinX, _fMinY, _fMinZ, _fMinX + (_fGridLenX * double(_ulCtGridsX)),
_fMinY + (_fGridLenY * double(_ulCtGridsY)), _fMinZ + (_fGridLenZ * double(_ulCtGridsZ)));

View File

@@ -36,7 +36,7 @@
using namespace Points;
// returns a string which represents the object e.g. when printed in python
std::string PointsPy::representation(void) const
std::string PointsPy::representation() const
{
return std::string("<PointKernel object>");
}
@@ -50,7 +50,7 @@ PyObject *PointsPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Pyt
// constructor method
int PointsPy::PyInit(PyObject* args, PyObject* /*kwd*/)
{
PyObject *pcObj=0;
PyObject *pcObj=nullptr;
if (!PyArg_ParseTuple(args, "|O", &pcObj)) // convert args: Python->C
return -1; // NULL triggers exception
@@ -81,7 +81,7 @@ int PointsPy::PyInit(PyObject* args, PyObject* /*kwd*/)
PyObject* PointsPy::copy(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
PointKernel* kernel = new PointKernel();
// assign data
@@ -93,7 +93,7 @@ PyObject* PointsPy::read(PyObject * args)
{
const char* Name;
if (!PyArg_ParseTuple(args, "s",&Name))
return NULL;
return nullptr;
PY_TRY {
getPointKernelPtr()->load(Name);
@@ -106,7 +106,7 @@ PyObject* PointsPy::write(PyObject * args)
{
const char* Name;
if (!PyArg_ParseTuple(args, "s",&Name))
return NULL;
return nullptr;
PY_TRY {
getPointKernelPtr()->save(Name);
@@ -118,7 +118,7 @@ PyObject* PointsPy::write(PyObject * args)
PyObject* PointsPy::writeInventor(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
std::stringstream result;
Base::InventorBuilder builder(result);
@@ -137,7 +137,7 @@ PyObject* PointsPy::addPoints(PyObject * args)
{
PyObject *obj;
if (!PyArg_ParseTuple(args, "O", &obj))
return 0;
return nullptr;
try {
Py::Sequence list(obj);
@@ -163,7 +163,7 @@ PyObject* PointsPy::addPoints(PyObject * args)
PyErr_SetString(Base::BaseExceptionFreeCADError, "either expect\n"
"-- [Vector,...] \n"
"-- [(x,y,z),...]");
return 0;
return nullptr;
}
Py_Return;
@@ -173,7 +173,7 @@ PyObject* PointsPy::fromSegment(PyObject * args)
{
PyObject *obj;
if (!PyArg_ParseTuple(args, "O", &obj))
return 0;
return nullptr;
try {
const PointKernel* points = getPointKernelPtr();
@@ -191,14 +191,14 @@ PyObject* PointsPy::fromSegment(PyObject * args)
}
catch (const Py::Exception&) {
PyErr_SetString(Base::BaseExceptionFreeCADError, "expect a list of int");
return 0;
return nullptr;
}
}
PyObject* PointsPy::fromValid(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
try {
const PointKernel* points = getPointKernelPtr();
@@ -213,16 +213,16 @@ PyObject* PointsPy::fromValid(PyObject * args)
}
catch (const Py::Exception&) {
PyErr_SetString(Base::BaseExceptionFreeCADError, "expect a list of int");
return 0;
return nullptr;
}
}
Py::Long PointsPy::getCountPoints(void) const
Py::Long PointsPy::getCountPoints() const
{
return Py::Long((long)getPointKernelPtr()->size());
}
Py::List PointsPy::getPoints(void) const
Py::List PointsPy::getPoints() const
{
Py::List PointList;
const PointKernel* points = getPointKernelPtr();
@@ -234,7 +234,7 @@ Py::List PointsPy::getPoints(void) const
PyObject *PointsPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int PointsPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -68,7 +68,7 @@ void PropertyGreyValueList::setSize(int newSize)
_lValueList.resize(newSize);
}
int PropertyGreyValueList::getSize(void) const
int PropertyGreyValueList::getSize() const
{
return static_cast<int>(_lValueList.size());
}
@@ -88,7 +88,7 @@ void PropertyGreyValueList::setValues(const std::vector<float>& values)
hasSetValue();
}
PyObject *PropertyGreyValueList::getPyObject(void)
PyObject *PropertyGreyValueList::getPyObject()
{
PyObject* list = PyList_New(getSize());
for (int i = 0;i<getSize(); i++)
@@ -175,7 +175,7 @@ void PropertyGreyValueList::RestoreDocFile(Base::Reader &reader)
setValues(values);
}
App::Property *PropertyGreyValueList::Copy(void) const
App::Property *PropertyGreyValueList::Copy() const
{
PropertyGreyValueList *p= new PropertyGreyValueList();
p->_lValueList = _lValueList;
@@ -189,7 +189,7 @@ void PropertyGreyValueList::Paste(const App::Property &from)
hasSetValue();
}
unsigned int PropertyGreyValueList::getMemSize (void) const
unsigned int PropertyGreyValueList::getMemSize () const
{
return static_cast<unsigned int>(_lValueList.size() * sizeof(float));
}
@@ -238,7 +238,7 @@ void PropertyNormalList::setSize(int newSize)
_lValueList.resize(newSize);
}
int PropertyNormalList::getSize(void) const
int PropertyNormalList::getSize() const
{
return static_cast<int>(_lValueList.size());
}
@@ -266,7 +266,7 @@ void PropertyNormalList::setValues(const std::vector<Base::Vector3f>& values)
hasSetValue();
}
PyObject *PropertyNormalList::getPyObject(void)
PyObject *PropertyNormalList::getPyObject()
{
PyObject* list = PyList_New(getSize());
@@ -349,7 +349,7 @@ void PropertyNormalList::RestoreDocFile(Base::Reader &reader)
setValues(values);
}
App::Property *PropertyNormalList::Copy(void) const
App::Property *PropertyNormalList::Copy() const
{
PropertyNormalList *p= new PropertyNormalList();
p->_lValueList = _lValueList;
@@ -363,7 +363,7 @@ void PropertyNormalList::Paste(const App::Property &from)
hasSetValue();
}
unsigned int PropertyNormalList::getMemSize (void) const
unsigned int PropertyNormalList::getMemSize () const
{
return static_cast<unsigned int>(_lValueList.size() * sizeof(Base::Vector3f));
}
@@ -565,7 +565,7 @@ void PropertyCurvatureList::removeIndices( const std::vector<unsigned long>& uIn
setValues(remainValue);
}
PyObject *PropertyCurvatureList::getPyObject(void)
PyObject *PropertyCurvatureList::getPyObject()
{
throw Py::NotImplementedError("Not yet implemented");
}
@@ -621,7 +621,7 @@ void PropertyCurvatureList::RestoreDocFile(Base::Reader &reader)
setValues(values);
}
App::Property *PropertyCurvatureList::Copy(void) const
App::Property *PropertyCurvatureList::Copy() const
{
PropertyCurvatureList* prop = new PropertyCurvatureList();
prop->_lValueList = this->_lValueList;
@@ -636,7 +636,7 @@ void PropertyCurvatureList::Paste(const App::Property &from)
hasSetValue();
}
unsigned int PropertyCurvatureList::getMemSize (void) const
unsigned int PropertyCurvatureList::getMemSize () const
{
return sizeof(CurvatureInfo) * this->_lValueList.size();
}

View File

@@ -47,7 +47,7 @@ class PointsExport PropertyGreyValue : public App::PropertyFloat
TYPESYSTEM_HEADER();
public:
PropertyGreyValue(void)
PropertyGreyValue()
{
}
virtual ~PropertyGreyValue()
@@ -64,7 +64,7 @@ public:
virtual ~PropertyGreyValueList();
virtual void setSize(int newSize);
virtual int getSize(void) const;
virtual int getSize() const;
/** Sets the property
*/
@@ -80,11 +80,11 @@ public:
}
void setValues (const std::vector<float>& values);
const std::vector<float> &getValues(void) const {
const std::vector<float> &getValues() const {
return _lValueList;
}
virtual PyObject *getPyObject(void);
virtual PyObject *getPyObject();
virtual void setPyObject(PyObject *);
virtual void Save (Base::Writer &writer) const;
@@ -93,9 +93,9 @@ public:
virtual void SaveDocFile (Base::Writer &writer) const;
virtual void RestoreDocFile(Base::Reader &reader);
virtual App::Property *Copy(void) const;
virtual App::Property *Copy() const;
virtual void Paste(const App::Property &from);
virtual unsigned int getMemSize (void) const;
virtual unsigned int getMemSize () const;
/** @name Modify */
//@{
@@ -115,7 +115,7 @@ public:
~PropertyNormalList();
virtual void setSize(int newSize);
virtual int getSize(void) const;
virtual int getSize() const;
void setValue(const Base::Vector3f&);
void setValue(float x, float y, float z);
@@ -130,11 +130,11 @@ public:
void setValues (const std::vector<Base::Vector3f>& values);
const std::vector<Base::Vector3f> &getValues(void) const {
const std::vector<Base::Vector3f> &getValues() const {
return _lValueList;
}
virtual PyObject *getPyObject(void);
virtual PyObject *getPyObject();
virtual void setPyObject(PyObject *);
virtual void Save (Base::Writer &writer) const;
@@ -143,10 +143,10 @@ public:
virtual void SaveDocFile (Base::Writer &writer) const;
virtual void RestoreDocFile(Base::Reader &reader);
virtual App::Property *Copy(void) const;
virtual App::Property *Copy() const;
virtual void Paste(const App::Property &from);
virtual unsigned int getMemSize (void) const;
virtual unsigned int getMemSize () const;
/** @name Modify */
//@{
@@ -187,7 +187,7 @@ public:
void setSize(int newSize) {
_lValueList.resize(newSize);
}
int getSize(void) const {
int getSize() const {
return _lValueList.size();
}
void setValue(const CurvatureInfo&);
@@ -201,11 +201,11 @@ public:
void set1Value (const int idx, const CurvatureInfo& value) {
_lValueList[idx] = value;
}
const std::vector<CurvatureInfo> &getValues(void) const {
const std::vector<CurvatureInfo> &getValues() const {
return _lValueList;
}
virtual PyObject *getPyObject(void);
virtual PyObject *getPyObject();
virtual void setPyObject(PyObject *);
/** @name Save/restore */
@@ -220,10 +220,10 @@ public:
/** @name Undo/Redo */
//@{
/// returns a new copy of the property (mainly for Undo/Redo and transactions)
App::Property *Copy(void) const;
App::Property *Copy() const;
/// paste the value from the property (mainly for Undo/Redo and transactions)
void Paste(const App::Property &from);
unsigned int getMemSize (void) const;
unsigned int getMemSize () const;
//@}
/** @name Modify */

View File

@@ -58,7 +58,7 @@ void PropertyPointKernel::setValue(const PointKernel& m)
hasSetValue();
}
const PointKernel& PropertyPointKernel::getValue(void) const
const PointKernel& PropertyPointKernel::getValue() const
{
return *_cPoints;
}
@@ -73,7 +73,7 @@ Base::BoundBox3d PropertyPointKernel::getBoundingBox() const
return _cPoints->getBoundBox();
}
PyObject *PropertyPointKernel::getPyObject(void)
PyObject *PropertyPointKernel::getPyObject()
{
PointsPy* points = new PointsPy(&*_cPoints);
points->setConst(); // set immutable
@@ -132,7 +132,7 @@ void PropertyPointKernel::RestoreDocFile(Base::Reader &reader)
hasSetValue();
}
App::Property *PropertyPointKernel::Copy(void) const
App::Property *PropertyPointKernel::Copy() const
{
PropertyPointKernel* prop = new PropertyPointKernel();
(*prop->_cPoints) = (*this->_cPoints);
@@ -147,7 +147,7 @@ void PropertyPointKernel::Paste(const App::Property &from)
hasSetValue();
}
unsigned int PropertyPointKernel::getMemSize (void) const
unsigned int PropertyPointKernel::getMemSize () const
{
return sizeof(Base::Vector3f) * this->_cPoints->size();
}

View File

@@ -44,7 +44,7 @@ public:
/// Sets the points to the property
void setValue( const PointKernel& m);
/// get the points (only const possible!)
const PointKernel &getValue(void) const;
const PointKernel &getValue() const;
const Data::ComplexGeoData* getComplexData() const;
//@}
@@ -56,17 +56,17 @@ public:
/** @name Python interface */
//@{
PyObject* getPyObject(void);
PyObject* getPyObject();
void setPyObject(PyObject *value);
//@}
/** @name Undo/Redo */
//@{
/// returns a new copy of the property (mainly for Undo/Redo and transactions)
App::Property *Copy(void) const;
App::Property *Copy() const;
/// paste the value from the property (mainly for Undo/Redo and transactions)
void Paste(const App::Property &from);
unsigned int getMemSize (void) const;
unsigned int getMemSize () const;
//@}
/** @name Save/restore */

View File

@@ -79,7 +79,7 @@ Structured::~Structured()
{
}
App::DocumentObjectExecReturn *Structured::execute(void)
App::DocumentObjectExecReturn *Structured::execute()
{
std::size_t size = Height.getValue() * Width.getValue();
if (size != Points.getValue().size())

View File

@@ -40,8 +40,8 @@ class PointsExport Structured : public Feature
public:
/// Constructor
Structured(void);
virtual ~Structured(void);
Structured();
virtual ~Structured();
App::PropertyInteger Width; /**< The width of the structured cloud. */
App::PropertyInteger Height; /**< The height of the structured cloud. */
@@ -49,9 +49,9 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
virtual const char* getViewProviderName() const {
return "PointsGui::ViewProviderStructured";
}
//@}

View File

@@ -38,7 +38,7 @@
#include <Mod/Points/App/PropertyPointKernel.h>
// use a different name to CreateCommand()
void CreatePointsCommands(void);
void CreatePointsCommands();
void loadPointsResource()
{
@@ -74,7 +74,7 @@ PyMOD_INIT_FUNC(PointsGui)
{
if (!Gui::Application::Instance) {
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
PyMOD_Return(0);
PyMOD_Return(nullptr);
}
// load dependent module
@@ -83,7 +83,7 @@ PyMOD_INIT_FUNC(PointsGui)
}
catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
PyMOD_Return(0);
PyMOD_Return(nullptr);
}
Base::Console().Log("Loading GUI of Points module... done\n");

View File

@@ -96,7 +96,7 @@ void CmdPointsImport::activated(int iMsg)
}
}
bool CmdPointsImport::isActive(void)
bool CmdPointsImport::isActive()
{
if (getActiveGuiDocument())
return true;
@@ -139,7 +139,7 @@ void CmdPointsExport::activated(int iMsg)
}
}
bool CmdPointsExport::isActive(void)
bool CmdPointsExport::isActive()
{
return getSelection().countObjectsOfType(Points::Feature::getClassTypeId()) > 0;
}
@@ -176,7 +176,7 @@ void CmdPointsTransform::activated(int iMsg)
commitCommand();
}
bool CmdPointsTransform::isActive(void)
bool CmdPointsTransform::isActive()
{
return getSelection().countObjectsOfType(Points::Feature::getClassTypeId()) > 0;
}
@@ -227,7 +227,7 @@ void CmdPointsConvert::activated(int iMsg)
std::vector<Base::Vector3d> normals;
data->getPoints(vertexes, normals, static_cast<float>(tol));
if (!vertexes.empty()) {
Points::Feature* fea = 0;
Points::Feature* fea = nullptr;
if (vertexes.size() == normals.size()) {
fea = static_cast<Points::Feature*>(Base::Type::fromName("Points::FeatureCustom").createInstance());
if (!fea) {
@@ -268,7 +268,7 @@ void CmdPointsConvert::activated(int iMsg)
abortCommand();
}
bool CmdPointsConvert::isActive(void)
bool CmdPointsConvert::isActive()
{
return getSelection().countObjectsOfType(Base::Type::fromName("App::GeoFeature")) > 0;
}
@@ -312,7 +312,7 @@ void CmdPointsPolyCut::activated(int iMsg)
}
}
bool CmdPointsPolyCut::isActive(void)
bool CmdPointsPolyCut::isActive()
{
// Check for the selected mesh feature (all Mesh types)
return getSelection().countObjectsOfType(Points::Feature::getClassTypeId()) > 0;
@@ -356,7 +356,7 @@ void CmdPointsMerge::activated(int iMsg)
updateActive();
}
bool CmdPointsMerge::isActive(void)
bool CmdPointsMerge::isActive()
{
return getSelection().countObjectsOfType(Points::Feature::getClassTypeId()) > 1;
}
@@ -464,12 +464,12 @@ void CmdPointsStructure::activated(int iMsg)
updateActive();
}
bool CmdPointsStructure::isActive(void)
bool CmdPointsStructure::isActive()
{
return getSelection().countObjectsOfType(Points::Feature::getClassTypeId()) == 1;
}
void CreatePointsCommands(void)
void CreatePointsCommands()
{
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
rcCmdMgr.addCommand(new CmdPointsImport());

View File

@@ -247,7 +247,7 @@ void ViewProviderPoints::setDisplayMode(const char* ModeName)
ViewProviderGeometryObject::setDisplayMode(ModeName);
}
std::vector<std::string> ViewProviderPoints::getDisplayModes(void) const
std::vector<std::string> ViewProviderPoints::getDisplayModes() const
{
std::vector<std::string> StrList;
StrList.push_back("Points");
@@ -650,8 +650,8 @@ template class PointsGuiExport ViewProviderPythonFeatureT<PointsGui::ViewProvide
void ViewProviderPointsBuilder::buildNodes(const App::Property* prop, std::vector<SoNode*>& nodes) const
{
SoCoordinate3 *pcPointsCoord=0;
SoPointSet *pcPoints=0;
SoCoordinate3 *pcPointsCoord=nullptr;
SoPointSet *pcPoints=nullptr;
if (nodes.empty()) {
pcPointsCoord = new SoCoordinate3();

View File

@@ -84,7 +84,7 @@ public:
/// set the viewing mode
virtual void setDisplayMode(const char* ModeName);
/// returns a list of all possible modes
virtual std::vector<std::string> getDisplayModes(void) const;
virtual std::vector<std::string> getDisplayModes() const;
virtual QIcon getIcon() const;
/// Sets the edit mnode