[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
committed by
WandererFan
parent
a207d11fa4
commit
e92ed45df9
@@ -56,7 +56,7 @@ public:
|
||||
&Module::show,
|
||||
"show(points,[string]) -- Add the points to the active document or "
|
||||
"create one if no document exists.");
|
||||
initialize("This module is the Points module.");// register with Python
|
||||
initialize("This module is the Points module."); // register with Python
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -434,4 +434,4 @@ PyObject* initModule()
|
||||
return Base::Interpreter().addModule(new Module);
|
||||
}
|
||||
|
||||
}// namespace Points
|
||||
} // namespace Points
|
||||
|
||||
@@ -228,7 +228,7 @@ public:
|
||||
//@}
|
||||
};
|
||||
|
||||
}// namespace Points
|
||||
} // namespace Points
|
||||
|
||||
|
||||
#endif// POINTS_POINTPROPERTIES_H
|
||||
#endif // POINTS_POINTPROPERTIES_H
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/math/special_functions/fpclassify.hpp>// needed for compilation on some systems
|
||||
#include <boost/math/special_functions/fpclassify.hpp> // needed for compilation on some systems
|
||||
#include <boost/regex.hpp>
|
||||
#endif
|
||||
|
||||
@@ -535,7 +535,7 @@ lzfDecompress(const void* const in_data, unsigned int in_len, void* out_data, un
|
||||
*op++ = *ref++;
|
||||
/* FALLTHRU */
|
||||
case 0:
|
||||
*op++ = *ref++;// two octets more
|
||||
*op++ = *ref++; // two octets more
|
||||
*op++ = *ref++;
|
||||
}
|
||||
}
|
||||
@@ -543,7 +543,7 @@ lzfDecompress(const void* const in_data, unsigned int in_len, void* out_data, un
|
||||
|
||||
return (static_cast<unsigned int>(op - static_cast<unsigned char*>(out_data)));
|
||||
}
|
||||
}// namespace Points
|
||||
} // namespace Points
|
||||
|
||||
PlyReader::PlyReader() = default;
|
||||
|
||||
@@ -733,7 +733,7 @@ std::size_t PlyReader::readHeader(std::istream& in,
|
||||
in.read(ply, 3);
|
||||
in.ignore(1);
|
||||
if (!in || (ply[0] != 'p') || (ply[1] != 'l') || (ply[2] != 'y')) {
|
||||
throw Base::BadFormatError("Not a ply file");// wrong header
|
||||
throw Base::BadFormatError("Not a ply file"); // wrong header
|
||||
}
|
||||
|
||||
while (std::getline(in, line)) {
|
||||
@@ -807,8 +807,8 @@ std::size_t PlyReader::readHeader(std::istream& in,
|
||||
std::list<std::string> number;
|
||||
if (list[1] == "list") {
|
||||
number.insert(number.end(), list.begin(), list.end());
|
||||
number.pop_front();// property
|
||||
number.pop_front();// list
|
||||
number.pop_front(); // property
|
||||
number.pop_front(); // list
|
||||
number.pop_back();
|
||||
}
|
||||
else {
|
||||
@@ -1768,7 +1768,7 @@ private:
|
||||
PointKernel points;
|
||||
std::vector<Base::Vector3f> normals;
|
||||
};
|
||||
}// namespace
|
||||
} // namespace
|
||||
|
||||
E57Reader::E57Reader(bool Color, bool State, double Distance)
|
||||
: useColor {Color}
|
||||
|
||||
@@ -177,7 +177,7 @@ public:
|
||||
void write(const std::string& filename) override;
|
||||
};
|
||||
|
||||
}// namespace Points
|
||||
} // namespace Points
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -96,7 +96,7 @@ PROPERTY_SOURCE_TEMPLATE(Points::FeatureCustom, Points::Feature)
|
||||
|
||||
// explicit template instantiation
|
||||
template class PointsExport FeatureCustomT<Points::Feature>;
|
||||
}// namespace App
|
||||
} // namespace App
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
@@ -113,4 +113,4 @@ const char* Points::FeaturePython::getViewProviderName() const
|
||||
|
||||
// explicit template instantiation
|
||||
template class PointsExport FeaturePythonT<Points::Feature>;
|
||||
}// namespace App
|
||||
} // namespace App
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include <App/FeatureCustom.h>
|
||||
#include <App/FeaturePython.h>
|
||||
#include <App/GeoFeature.h>// must be first include
|
||||
#include <App/GeoFeature.h> // must be first include
|
||||
#include <App/PropertyGeo.h>
|
||||
|
||||
#include "Points.h"
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
using FeatureCustom = App::FeatureCustomT<Feature>;
|
||||
using FeaturePython = App::FeaturePythonT<Feature>;
|
||||
|
||||
}// namespace Points
|
||||
} // namespace Points
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -105,7 +105,7 @@ PointsGrid::PointsGrid(const PointKernel& rclM, double fGridLen)
|
||||
, _fMinY(0.0f)
|
||||
, _fMinZ(0.0f)
|
||||
{
|
||||
Base::BoundBox3d clBBPts;// = _pclPoints->GetBoundBox();
|
||||
Base::BoundBox3d clBBPts; // = _pclPoints->GetBoundBox();
|
||||
for (const auto& pnt : *_pclPoints) {
|
||||
clBBPts.Add(pnt);
|
||||
}
|
||||
@@ -164,7 +164,7 @@ void PointsGrid::InitGrid()
|
||||
// Determine the grid length and offset
|
||||
//
|
||||
{
|
||||
Base::BoundBox3d clBBPts;// = _pclPoints->GetBoundBox();
|
||||
Base::BoundBox3d clBBPts; // = _pclPoints->GetBoundBox();
|
||||
for (const auto& pnt : *_pclPoints) {
|
||||
clBBPts.Add(pnt);
|
||||
}
|
||||
@@ -341,7 +341,7 @@ void PointsGrid::CalculateGridLength(unsigned long ulCtGrid, unsigned long ulMax
|
||||
// Calculate grid lengths or number of grids per dimension
|
||||
// There should be about 10 (?!?!) facets per grid
|
||||
// or max grids should not exceed 10000
|
||||
Base::BoundBox3d clBBPtsEnlarged;// = _pclPoints->GetBoundBox();
|
||||
Base::BoundBox3d clBBPtsEnlarged; // = _pclPoints->GetBoundBox();
|
||||
for (const auto& pnt : *_pclPoints) {
|
||||
clBBPtsEnlarged.Add(pnt);
|
||||
}
|
||||
@@ -387,7 +387,7 @@ void PointsGrid::CalculateGridLength(int iCtGridPerAxis)
|
||||
// Calculate grid lengths or number of grids per dimension
|
||||
// There should be about 10 (?!?!) facets per grid
|
||||
// or max grids should not exceed 10000
|
||||
Base::BoundBox3d clBBPts;// = _pclPoints->GetBoundBox();
|
||||
Base::BoundBox3d clBBPts; // = _pclPoints->GetBoundBox();
|
||||
for (const auto& pnt : *_pclPoints) {
|
||||
clBBPts.Add(pnt);
|
||||
}
|
||||
@@ -452,7 +452,7 @@ void PointsGrid::CalculateGridLength(int iCtGridPerAxis)
|
||||
|
||||
} break;
|
||||
case 1: {
|
||||
_ulCtGridsX = 1;// bLenghtXisZero
|
||||
_ulCtGridsX = 1; // bLenghtXisZero
|
||||
|
||||
double fArea = fLenghtY * fLenghtZ;
|
||||
|
||||
@@ -468,7 +468,7 @@ void PointsGrid::CalculateGridLength(int iCtGridPerAxis)
|
||||
_ulCtGridsZ = std::max<unsigned long>((unsigned long)(fLenghtZ / fLengthGrid), 1);
|
||||
} break;
|
||||
case 2: {
|
||||
_ulCtGridsY = 1;// bLenghtYisZero
|
||||
_ulCtGridsY = 1; // bLenghtYisZero
|
||||
|
||||
double fArea = fLenghtX * fLenghtZ;
|
||||
|
||||
@@ -484,12 +484,12 @@ void PointsGrid::CalculateGridLength(int iCtGridPerAxis)
|
||||
_ulCtGridsZ = std::max<unsigned long>((unsigned long)(fLenghtZ / fLengthGrid), 1);
|
||||
} break;
|
||||
case 3: {
|
||||
_ulCtGridsX = 1; // bLenghtXisZero
|
||||
_ulCtGridsY = 1; // bLenghtYisZero
|
||||
_ulCtGridsZ = iMaxGrids;// bLenghtYisZero
|
||||
_ulCtGridsX = 1; // bLenghtXisZero
|
||||
_ulCtGridsY = 1; // bLenghtYisZero
|
||||
_ulCtGridsZ = iMaxGrids; // bLenghtYisZero
|
||||
} break;
|
||||
case 4: {
|
||||
_ulCtGridsZ = 1;// bLenghtZisZero
|
||||
_ulCtGridsZ = 1; // bLenghtZisZero
|
||||
|
||||
double fArea = fLenghtX * fLenghtY;
|
||||
|
||||
@@ -505,19 +505,19 @@ void PointsGrid::CalculateGridLength(int iCtGridPerAxis)
|
||||
_ulCtGridsY = std::max<unsigned long>((unsigned long)(fLenghtY / fLengthGrid), 1);
|
||||
} break;
|
||||
case 5: {
|
||||
_ulCtGridsX = 1; // bLenghtXisZero
|
||||
_ulCtGridsZ = 1; // bLenghtZisZero
|
||||
_ulCtGridsY = iMaxGrids;// bLenghtYisZero
|
||||
_ulCtGridsX = 1; // bLenghtXisZero
|
||||
_ulCtGridsZ = 1; // bLenghtZisZero
|
||||
_ulCtGridsY = iMaxGrids; // bLenghtYisZero
|
||||
} break;
|
||||
case 6: {
|
||||
_ulCtGridsY = 1; // bLenghtYisZero
|
||||
_ulCtGridsZ = 1; // bLenghtZisZero
|
||||
_ulCtGridsX = iMaxGrids;// bLenghtYisZero
|
||||
_ulCtGridsY = 1; // bLenghtYisZero
|
||||
_ulCtGridsZ = 1; // bLenghtZisZero
|
||||
_ulCtGridsX = iMaxGrids; // bLenghtYisZero
|
||||
} break;
|
||||
case 7: {
|
||||
_ulCtGridsX = iMaxGrids;// bLenghtXisZero
|
||||
_ulCtGridsY = iMaxGrids;// bLenghtYisZero
|
||||
_ulCtGridsZ = iMaxGrids;// bLenghtZisZero
|
||||
_ulCtGridsX = iMaxGrids; // bLenghtXisZero
|
||||
_ulCtGridsY = iMaxGrids; // bLenghtYisZero
|
||||
_ulCtGridsZ = iMaxGrids; // bLenghtZisZero
|
||||
} break;
|
||||
}
|
||||
}
|
||||
@@ -528,7 +528,7 @@ void PointsGrid::SearchNearestFromPoint(const Base::Vector3d& rclPt,
|
||||
raclInd.clear();
|
||||
Base::BoundBox3d clBB = GetBoundBox();
|
||||
|
||||
if (clBB.IsInBox(rclPt)) {// Point lies within
|
||||
if (clBB.IsInBox(rclPt)) { // Point lies within
|
||||
unsigned long ulX, ulY, ulZ;
|
||||
Position(rclPt, ulX, ulY, ulZ);
|
||||
// int nX = ulX, nY = ulY, nZ = ulZ;
|
||||
@@ -538,7 +538,7 @@ void PointsGrid::SearchNearestFromPoint(const Base::Vector3d& rclPt,
|
||||
}
|
||||
GetHull(ulX, ulY, ulZ, ulLevel, raclInd);
|
||||
}
|
||||
else {// Point outside
|
||||
else { // Point outside
|
||||
Base::BoundBox3d::SIDE tSide = clBB.GetSideFromRay(rclPt, clBB.GetCenter() - rclPt);
|
||||
switch (tSide) {
|
||||
case Base::BoundBox3d::RIGHT: {
|
||||
@@ -720,10 +720,10 @@ void PointsGrid::Validate()
|
||||
bool PointsGrid::Verify() const
|
||||
{
|
||||
if (!_pclPoints) {
|
||||
return false;// no point cloud attached
|
||||
return false; // no point cloud attached
|
||||
}
|
||||
if (_pclPoints->size() != _ulCtElements) {
|
||||
return false;// not up-to-date
|
||||
return false; // not up-to-date
|
||||
}
|
||||
|
||||
PointsGridIterator it(*this);
|
||||
@@ -733,7 +733,7 @@ bool PointsGrid::Verify() const
|
||||
for (unsigned long element : aulElements) {
|
||||
const Base::Vector3d& cP = _pclPoints->getPoint(element);
|
||||
if (!it.GetBoundBox().IsInBox(cP)) {
|
||||
return false;// point doesn't lie inside the grid element
|
||||
return false; // point doesn't lie inside the grid element
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -813,19 +813,19 @@ bool PointsGridIterator::InitOnRay(const Base::Vector3d& rclPt,
|
||||
_bValidRay = false;
|
||||
|
||||
// point lies within global BB
|
||||
if (_rclGrid.GetBoundBox().IsInBox(rclPt)) {// determine the voxel by the starting point
|
||||
if (_rclGrid.GetBoundBox().IsInBox(rclPt)) { // determine the voxel by the starting point
|
||||
_rclGrid.Position(rclPt, _ulX, _ulY, _ulZ);
|
||||
raulElements.insert(raulElements.end(),
|
||||
_rclGrid._aulGrid[_ulX][_ulY][_ulZ].begin(),
|
||||
_rclGrid._aulGrid[_ulX][_ulY][_ulZ].end());
|
||||
_bValidRay = true;
|
||||
}
|
||||
else {// StartPoint outside
|
||||
else { // StartPoint outside
|
||||
Base::Vector3d cP0, cP1;
|
||||
if (_rclGrid.GetBoundBox().IntersectWithLine(rclPt,
|
||||
rclDir,
|
||||
cP0,
|
||||
cP1)) {// determine the next point
|
||||
cP1)) { // determine the next point
|
||||
if ((cP0 - rclPt).Length() < (cP1 - rclPt).Length()) {
|
||||
_rclGrid.Position(cP0, _ulX, _ulY, _ulZ);
|
||||
}
|
||||
@@ -846,7 +846,7 @@ bool PointsGridIterator::InitOnRay(const Base::Vector3d& rclPt,
|
||||
bool PointsGridIterator::NextOnRay(std::vector<unsigned long>& raulElements)
|
||||
{
|
||||
if (!_bValidRay) {
|
||||
return false;// not initialized or beam exited
|
||||
return false; // not initialized or beam exited
|
||||
}
|
||||
|
||||
raulElements.clear();
|
||||
@@ -891,7 +891,8 @@ bool PointsGridIterator::NextOnRay(std::vector<unsigned long>& raulElements)
|
||||
|
||||
GridElement pos(_ulX, _ulY, _ulZ);
|
||||
if (_cSearchPositions.find(pos) != _cSearchPositions.end()) {
|
||||
_bValidRay = false;// grid element already visited => result from GetSideFromRay invalid
|
||||
_bValidRay =
|
||||
false; // grid element already visited => result from GetSideFromRay invalid
|
||||
}
|
||||
}
|
||||
|
||||
@@ -903,7 +904,7 @@ bool PointsGridIterator::NextOnRay(std::vector<unsigned long>& raulElements)
|
||||
_rclGrid._aulGrid[_ulX][_ulY][_ulZ].end());
|
||||
}
|
||||
else {
|
||||
_bValidRay = false;// ray exited
|
||||
_bValidRay = false; // ray exited
|
||||
}
|
||||
|
||||
return _bValidRay;
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
|
||||
#include "Points.h"
|
||||
|
||||
#define POINTS_CT_GRID 256 // Default value for number of elements per grid
|
||||
#define POINTS_MAX_GRIDS 100000// Default value for maximum number of grids
|
||||
#define POINTS_CT_GRID 256 // Default value for number of elements per grid
|
||||
#define POINTS_MAX_GRIDS 100000 // Default value for maximum number of grids
|
||||
#define POINTS_CT_GRID_PER_AXIS 20
|
||||
#define PONTSGRID_BBOX_EXTENSION 10.0f
|
||||
|
||||
@@ -350,6 +350,6 @@ inline bool PointsGrid::CheckPos(unsigned long ulX, unsigned long ulY, unsigned
|
||||
|
||||
// --------------------------------------------------------------
|
||||
|
||||
}// namespace Points
|
||||
} // namespace Points
|
||||
|
||||
#endif// POINTS_GRID_H
|
||||
#endif // POINTS_GRID_H
|
||||
|
||||
@@ -55,6 +55,6 @@
|
||||
// Qt
|
||||
#include <QtConcurrentMap>
|
||||
|
||||
#endif//_PreComp_
|
||||
#endif //_PreComp_
|
||||
|
||||
#endif
|
||||
|
||||
@@ -236,7 +236,7 @@ private:
|
||||
std::vector<CurvatureInfo> _lValueList;
|
||||
};
|
||||
|
||||
}// namespace Points
|
||||
} // namespace Points
|
||||
|
||||
|
||||
#endif// POINTS_POINTPROPERTIES_H
|
||||
#endif // POINTS_POINTPROPERTIES_H
|
||||
|
||||
@@ -78,7 +78,7 @@ Base::BoundBox3d PropertyPointKernel::getBoundingBox() const
|
||||
PyObject* PropertyPointKernel::getPyObject()
|
||||
{
|
||||
PointsPy* points = new PointsPy(&*_cPoints);
|
||||
points->setConst();// set immutable
|
||||
points->setConst(); // set immutable
|
||||
return points;
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ private:
|
||||
Base::Reference<PointKernel> _cPoints;
|
||||
};
|
||||
|
||||
}// namespace Points
|
||||
} // namespace Points
|
||||
|
||||
|
||||
#endif// POINTS_PROPERTYPOINTKERNEL_H
|
||||
#endif // POINTS_PROPERTYPOINTKERNEL_H
|
||||
|
||||
@@ -90,4 +90,4 @@ PROPERTY_SOURCE_TEMPLATE(Points::StructuredCustom, Points::Structured)
|
||||
|
||||
// explicit template instantiation
|
||||
template class PointsExport FeatureCustomT<Points::Structured>;
|
||||
}// namespace App
|
||||
} // namespace App
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
|
||||
using StructuredCustom = App::FeatureCustomT<Structured>;
|
||||
|
||||
}// namespace Points
|
||||
} // namespace Points
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -60,6 +60,6 @@ bool copyProperty(App::DocumentObject* target,
|
||||
return false;
|
||||
}
|
||||
|
||||
}// namespace Points
|
||||
} // namespace Points
|
||||
|
||||
#endif// POINTS_TOOLS_H
|
||||
#endif // POINTS_TOOLS_H
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
Module()
|
||||
: Py::ExtensionModule<Module>("PointsGui")
|
||||
{
|
||||
initialize("This module is the PointsGui module.");// register with Python
|
||||
initialize("This module is the PointsGui module."); // register with Python
|
||||
}
|
||||
};
|
||||
|
||||
@@ -61,7 +61,7 @@ PyObject* initModule()
|
||||
return Base::Interpreter().addModule(new Module);
|
||||
}
|
||||
|
||||
}// namespace PointsGui
|
||||
} // namespace PointsGui
|
||||
|
||||
|
||||
/* Python entry */
|
||||
|
||||
@@ -48,6 +48,6 @@ private:
|
||||
std::string _FileName;
|
||||
};
|
||||
|
||||
}// namespace PointsGui
|
||||
} // namespace PointsGui
|
||||
|
||||
#endif// POINTSGUI_DLGREADPOINTS_H
|
||||
#endif // POINTSGUI_DLGREADPOINTS_H
|
||||
|
||||
@@ -52,6 +52,6 @@
|
||||
#include <Inventor/nodes/SoNormal.h>
|
||||
#include <Inventor/nodes/SoPointSet.h>
|
||||
|
||||
#endif//_PreComp_
|
||||
#endif //_PreComp_
|
||||
|
||||
#endif// POINTSGUI_PRECOMPILED_H
|
||||
#endif // POINTSGUI_PRECOMPILED_H
|
||||
|
||||
@@ -477,7 +477,7 @@ void ViewProviderScattered::cut(const std::vector<SbVec2f>& picked,
|
||||
}
|
||||
|
||||
if (removeIndices.empty()) {
|
||||
return;// nothing needs to be done
|
||||
return; // nothing needs to be done
|
||||
}
|
||||
|
||||
// Remove the points from the cloud and open a transaction object for the undo/redo stuff
|
||||
@@ -671,7 +671,7 @@ PROPERTY_SOURCE_TEMPLATE(PointsGui::ViewProviderPython, PointsGui::ViewProviderS
|
||||
|
||||
// explicit template instantiation
|
||||
template class PointsGuiExport ViewProviderPythonFeatureT<PointsGui::ViewProviderScattered>;
|
||||
}// namespace Gui
|
||||
} // namespace Gui
|
||||
|
||||
// -------------------------------------------------
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class PropertyGreyValueList;
|
||||
class PropertyNormalList;
|
||||
class PointKernel;
|
||||
class Feature;
|
||||
}// namespace Points
|
||||
} // namespace Points
|
||||
|
||||
namespace PointsGui
|
||||
{
|
||||
@@ -175,7 +175,7 @@ protected:
|
||||
|
||||
using ViewProviderPython = Gui::ViewProviderPythonFeatureT<ViewProviderScattered>;
|
||||
|
||||
}// namespace PointsGui
|
||||
} // namespace PointsGui
|
||||
|
||||
|
||||
#endif// POINTSGUI_VIEWPROVIDERPOINTS_H
|
||||
#endif // POINTSGUI_VIEWPROVIDERPOINTS_H
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
using namespace PointsGui;
|
||||
|
||||
#if 0// needed for Qt's lupdate utility
|
||||
#if 0 // needed for Qt's lupdate utility
|
||||
qApp->translate("Workbench", "Points tools");
|
||||
qApp->translate("Workbench", "&Points");
|
||||
#endif
|
||||
|
||||
@@ -47,7 +47,7 @@ protected:
|
||||
Gui::MenuItem* setupMenuBar() const override;
|
||||
};
|
||||
|
||||
}// namespace PointsGui
|
||||
} // namespace PointsGui
|
||||
|
||||
|
||||
#endif// POINTS_WORKBENCH_H
|
||||
#endif // POINTS_WORKBENCH_H
|
||||
|
||||
@@ -44,4 +44,4 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif// POINTS_GLOBAL_H
|
||||
#endif // POINTS_GLOBAL_H
|
||||
|
||||
Reference in New Issue
Block a user