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

@@ -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)));