Fix mixed line endings

This commit is contained in:
Zheng, Lei
2022-04-26 21:45:10 +08:00
committed by Chris Hennes
parent 2753dd4ca7
commit 3ef438eaf0
66 changed files with 344 additions and 344 deletions

View File

@@ -789,7 +789,7 @@ bool MeshAlgorithm::FillupHole(const std::vector<PointIndex>& boundary,
void MeshAlgorithm::SetFacetsProperty(const std::vector<FacetIndex> &raulInds, const std::vector<unsigned long> &raulProps) const
{
if (raulInds.size() != raulProps.size())
if (raulInds.size() != raulProps.size())
return;
std::vector<unsigned long>::const_iterator iP = raulProps.begin();

View File

@@ -275,7 +275,7 @@ struct MeshFastBuilder::Private {
}
bool operator<(const Vertex& rhs) const
{
if (x != rhs.x)
if (x != rhs.x)
return x < rhs.x;
else if (y != rhs.y) return y < rhs.y;
else if (z != rhs.z) return z < rhs.z;

View File

@@ -301,7 +301,7 @@ struct MeshFacet_Less
if (y1 > y2)
{ tmp = y1; y1 = y2; y2 = tmp; }
if (x0 < y0)
if (x0 < y0)
return true;
else if (x0 > y0) return false;
else if (x1 < y1) return true;
@@ -1066,8 +1066,8 @@ bool MeshEvalRangePoint::Evaluate()
PointIndex ulCtPoints = _rclMesh.CountPoints();
for (MeshFacetArray::_TConstIterator it = rFaces.begin(); it != rFaces.end(); ++it) {
if (std::find_if(it->_aulPoints, it->_aulPoints + 3, [ulCtPoints](PointIndex i) {
return i >= ulCtPoints;
if (std::find_if(it->_aulPoints, it->_aulPoints + 3, [ulCtPoints](PointIndex i) {
return i >= ulCtPoints;
}) < it->_aulPoints + 3)
return false;
}
@@ -1083,8 +1083,8 @@ std::vector<PointIndex> MeshEvalRangePoint::GetIndices() const
PointIndex ind=0;
for (MeshFacetArray::_TConstIterator it = rFaces.begin(); it != rFaces.end(); ++it, ind++) {
if (std::find_if(it->_aulPoints, it->_aulPoints + 3, [ulCtPoints](PointIndex i) {
return i >= ulCtPoints;
if (std::find_if(it->_aulPoints, it->_aulPoints + 3, [ulCtPoints](PointIndex i) {
return i >= ulCtPoints;
}) < it->_aulPoints + 3)
aInds.push_back(ind);
}

View File

@@ -250,7 +250,7 @@ bool MeshInput::LoadSTL (std::istream &rstrIn)
// the file size has only 134 bytes in this case. On the other hand we must overread the first 80 bytes
// because it can happen that the file is binary but contains one of these keywords.
std::streambuf* buf = rstrIn.rdbuf();
if (!buf)
if (!buf)
return false;
buf->pubseekoff(80, std::ios::beg, std::ios::in);
uint32_t ulCt, ulBytes=50;

View File

@@ -1406,7 +1406,7 @@ void MeshTopoAlgorithm::SplitNeighbourFacet(FacetIndex ulFacetPos, unsigned shor
bool MeshTopoAlgorithm::RemoveDegeneratedFacet(FacetIndex index)
{
if (index >= _rclMesh._aclFacetArray.size())
if (index >= _rclMesh._aclFacetArray.size())
return false;
MeshFacet& rFace = _rclMesh._aclFacetArray[index];
@@ -1476,7 +1476,7 @@ bool MeshTopoAlgorithm::RemoveDegeneratedFacet(FacetIndex index)
bool MeshTopoAlgorithm::RemoveCorruptedFacet(FacetIndex index)
{
if (index >= _rclMesh._aclFacetArray.size())
if (index >= _rclMesh._aclFacetArray.size())
return false;
MeshFacet& rFace = _rclMesh._aclFacetArray[index];

View File

@@ -383,14 +383,14 @@ bool EarClippingTriangulator::Triangulate::Snip(const std::vector<Base::Vector3f
Cx = contour[V[w]].x;
Cy = contour[V[w]].y;
if (FLOAT_EPS > (((Bx-Ax)*(Cy-Ay)) - ((By-Ay)*(Cx-Ax))))
if (FLOAT_EPS > (((Bx-Ax)*(Cy-Ay)) - ((By-Ay)*(Cx-Ax))))
return false;
for (p=0;p<n;p++) {
if( (p == u) || (p == v) || (p == w) ) continue;
Px = contour[V[p]].x;
Py = contour[V[p]].y;
if (InsideTriangle(Ax,Ay,Bx,By,Cx,Cy,Px,Py))
if (InsideTriangle(Ax,Ay,Bx,By,Cx,Cy,Px,Py))
return false;
}
@@ -405,7 +405,7 @@ bool EarClippingTriangulator::Triangulate::Process(const std::vector<Base::Vecto
/* allocate and initialize list of Vertices in polygon */
int n = contour.size();
if ( n < 3 )
if ( n < 3 )
return false;
int *V = new int[n];
@@ -607,7 +607,7 @@ struct Vertex2d_Less
{
if (fabs(p.x - q.x) < MeshDefinitions::_fMinPointDistanceD1) {
if (fabs(p.y - q.y) < MeshDefinitions::_fMinPointDistanceD1) {
return false;
return false;
} else return p.y < q.y;
} else return p.x < q.x;
}

View File

@@ -79,7 +79,7 @@ HarmonizeNormals::~HarmonizeNormals()
App::DocumentObjectExecReturn *HarmonizeNormals::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link)
if (!link)
return new App::DocumentObjectExecReturn("No mesh linked");
App::Property* prop = link->getPropertyByName("Mesh");
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
@@ -108,7 +108,7 @@ FlipNormals::~FlipNormals()
App::DocumentObjectExecReturn *FlipNormals::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link)
if (!link)
return new App::DocumentObjectExecReturn("No mesh linked");
App::Property* prop = link->getPropertyByName("Mesh");
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
@@ -137,7 +137,7 @@ FixNonManifolds::~FixNonManifolds()
App::DocumentObjectExecReturn *FixNonManifolds::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link)
if (!link)
return new App::DocumentObjectExecReturn("No mesh linked");
App::Property* prop = link->getPropertyByName("Mesh");
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
@@ -166,7 +166,7 @@ FixDuplicatedFaces::~FixDuplicatedFaces()
App::DocumentObjectExecReturn *FixDuplicatedFaces::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link)
if (!link)
return new App::DocumentObjectExecReturn("No mesh linked");
App::Property* prop = link->getPropertyByName("Mesh");
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
@@ -195,7 +195,7 @@ FixDuplicatedPoints::~FixDuplicatedPoints()
App::DocumentObjectExecReturn *FixDuplicatedPoints::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link)
if (!link)
return new App::DocumentObjectExecReturn("No mesh linked");
App::Property* prop = link->getPropertyByName("Mesh");
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
@@ -224,7 +224,7 @@ FixDegenerations::~FixDegenerations()
App::DocumentObjectExecReturn *FixDegenerations::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link)
if (!link)
return new App::DocumentObjectExecReturn("No mesh linked");
App::Property* prop = link->getPropertyByName("Mesh");
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
@@ -254,7 +254,7 @@ FixDeformations::~FixDeformations()
App::DocumentObjectExecReturn *FixDeformations::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link)
if (!link)
return new App::DocumentObjectExecReturn("No mesh linked");
App::Property* prop = link->getPropertyByName("Mesh");
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
@@ -285,7 +285,7 @@ FixIndices::~FixIndices()
App::DocumentObjectExecReturn *FixIndices::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link)
if (!link)
return new App::DocumentObjectExecReturn("No mesh linked");
App::Property* prop = link->getPropertyByName("Mesh");
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
@@ -316,7 +316,7 @@ FillHoles::~FillHoles()
App::DocumentObjectExecReturn *FillHoles::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link)
if (!link)
return new App::DocumentObjectExecReturn("No mesh linked");
App::Property* prop = link->getPropertyByName("Mesh");
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
@@ -348,7 +348,7 @@ RemoveComponents::~RemoveComponents()
App::DocumentObjectExecReturn *RemoveComponents::execute()
{
App::DocumentObject* link = Source.getValue();
if (!link)
if (!link)
return new App::DocumentObjectExecReturn("No mesh linked");
App::Property* prop = link->getPropertyByName("Mesh");
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {

View File

@@ -1454,8 +1454,8 @@ void MeshObject::removeSelfIntersections(const std::vector<FacetIndex>& indices)
if (indices.size() % 2 != 0)
return;
unsigned long cntfacets = _kernel.CountFacets();
if (std::find_if(indices.begin(), indices.end(), [cntfacets](FacetIndex v) {
return v >= cntfacets;
if (std::find_if(indices.begin(), indices.end(), [cntfacets](FacetIndex v) {
return v >= cntfacets;
}) < indices.end())
return;
std::vector<std::pair<FacetIndex, FacetIndex> > selfIntersections;

View File

@@ -72,7 +72,7 @@ int MeshPy::PyInit(PyObject* args, PyObject*)
try {
this->parentProperty = nullptr;
// if no mesh is given
if (!pcObj)
if (!pcObj)
return 0;
if (PyObject_TypeCheck(pcObj, &(MeshPy::Type))) {
getMeshObjectPtr()->operator = (*static_cast<MeshPy*>(pcObj)->getMeshObjectPtr());
@@ -81,14 +81,14 @@ int MeshPy::PyInit(PyObject* args, PyObject*)
PyObject* ret = addFacets(args);
bool ok = (ret!=nullptr);
Py_XDECREF(ret);
if (!ok)
if (!ok)
return -1;
}
else if (PyTuple_Check(pcObj)) {
PyObject* ret = addFacets(args);
bool ok = (ret!=nullptr);
Py_XDECREF(ret);
if (!ok)
if (!ok)
return -1;
}
else if (PyUnicode_Check(pcObj)) {