[Meh] Core: remove unnecessary Boolean comparisons - part 1

This commit is contained in:
Uwe
2022-06-19 18:12:56 +02:00
parent c78775163e
commit 1b73fbf645
13 changed files with 63 additions and 63 deletions

View File

@@ -83,7 +83,7 @@ bool MeshAlgorithm::NearestFacetOnRay (const Base::Vector3f &rclPt, const Base::
MeshFacetIterator clFIter(_rclMesh);
for (clFIter.Init(); clFIter.More(); clFIter.Next()) {
if (clFIter->Foraminate(rclPt, rclDir, clRes, fMaxAngle)) {
if (bSol == false) {
if (!bSol) {
// first solution
bSol = true;
clProj = clRes;
@@ -113,11 +113,11 @@ bool MeshAlgorithm::NearestFacetOnRay (const Base::Vector3f &rclPt, const Base::
std::vector<FacetIndex> aulFacets;
MeshGridIterator clGridIter(rclGrid);
if (clGridIter.InitOnRay(rclPt, rclDir, aulFacets) == true) {
if (RayNearestField(rclPt, rclDir, aulFacets, rclRes, rulFacet) == false) {
if (clGridIter.InitOnRay(rclPt, rclDir, aulFacets)) {
if (!RayNearestField(rclPt, rclDir, aulFacets, rclRes, rulFacet)) {
aulFacets.clear();
while (clGridIter.NextOnRay(aulFacets) == true) {
if (RayNearestField(rclPt, rclDir, aulFacets, rclRes, rulFacet) == true)
while (clGridIter.NextOnRay(aulFacets)) {
if (RayNearestField(rclPt, rclDir, aulFacets, rclRes, rulFacet))
return true;
}
}
@@ -134,11 +134,11 @@ bool MeshAlgorithm::NearestFacetOnRay (const Base::Vector3f &rclPt, const Base::
std::vector<FacetIndex> aulFacets;
MeshGridIterator clGridIter(rclGrid);
if (clGridIter.InitOnRay(rclPt, rclDir, fMaxSearchArea, aulFacets) == true) {
if (RayNearestField(rclPt, rclDir, aulFacets, rclRes, rulFacet, 1.75f) == false) {
if (clGridIter.InitOnRay(rclPt, rclDir, fMaxSearchArea, aulFacets)) {
if (!RayNearestField(rclPt, rclDir, aulFacets, rclRes, rulFacet, 1.75f)) {
aulFacets.clear();
while (clGridIter.NextOnRay(aulFacets) == true) {
if (RayNearestField(rclPt, rclDir, aulFacets, rclRes, rulFacet, 1.75f) == true)
while (clGridIter.NextOnRay(aulFacets)) {
if (RayNearestField(rclPt, rclDir, aulFacets, rclRes, rulFacet, 1.75f))
return true;
}
}
@@ -158,8 +158,8 @@ bool MeshAlgorithm::NearestFacetOnRay (const Base::Vector3f &rclPt, const Base::
for (std::vector<FacetIndex>::const_iterator pI = raulFacets.begin(); pI != raulFacets.end(); ++pI) {
MeshGeomFacet rclSFacet = _rclMesh.GetFacet(*pI);
if (rclSFacet.Foraminate(rclPt, rclDir, clRes) == true) {
if (bSol == false) {// first solution
if (rclSFacet.Foraminate(rclPt, rclDir, clRes)) {
if (!bSol) {// first solution
bSol = true;
clProj = clRes;
ulInd = *pI;
@@ -189,8 +189,8 @@ bool MeshAlgorithm::RayNearestField (const Base::Vector3f &rclPt, const Base::Ve
FacetIndex ulInd = 0;
for (std::vector<FacetIndex>::const_iterator pF = raulFacets.begin(); pF != raulFacets.end(); ++pF) {
if (_rclMesh.GetFacet(*pF).Foraminate(rclPt, rclDir, clRes/*, fMaxAngle*/) == true) {
if (bSol == false) { // first solution
if (_rclMesh.GetFacet(*pF).Foraminate(rclPt, rclDir, clRes/*, fMaxAngle*/)) {
if (!bSol) { // first solution
bSol = true;
clProj = clRes;
ulInd = *pF;
@@ -352,7 +352,7 @@ void MeshAlgorithm::GetFacetBorders (const std::vector<FacetIndex> &raulInd,
for (unsigned short i = 0; i < 3; i++) {
FacetIndex ulNB = rclFacet._aulNeighbours[i];
if (ulNB != FACET_INDEX_MAX) {
if (rclFAry[ulNB].IsFlag(MeshFacet::VISIT) == true)
if (rclFAry[ulNB].IsFlag(MeshFacet::VISIT))
continue;
}
@@ -1144,7 +1144,7 @@ void MeshAlgorithm::CheckFacets(const MeshFacetGrid& rclGrid, const Base::ViewPr
for (int j=0; j<3; j++) {
clPt2d = fixedProj(clIter->_aclPoints[j]);
if ((clPolyBBox.Contains(Base::Vector2d(clPt2d.x, clPt2d.y)) &&
rclPoly.Contains(Base::Vector2d(clPt2d.x, clPt2d.y))) == false) {
!rclPoly.Contains(Base::Vector2d(clPt2d.x, clPt2d.y)))) {
raulFacets.push_back(clIter.Position());
break;
}
@@ -1304,7 +1304,7 @@ void MeshAlgorithm::CheckBorderFacets (const std::vector<FacetIndex> &raclFacetI
rclFAry[*pF].ResetFlag(MeshFacet::TMP0);
continue;
}
if (rclFAry[ulNB].IsFlag(MeshFacet::TMP0) == false)
if (!rclFAry[ulNB].IsFlag(MeshFacet::TMP0))
{
raclResultIndices.push_back(*pF);
rclFAry[*pF].ResetFlag(MeshFacet::TMP0);
@@ -1334,7 +1334,7 @@ void MeshAlgorithm::GetBorderPoints (const std::vector<FacetIndex> &raclFacetInd
raclResultPointsIndices.insert(rclFacet._aulPoints[(i+1)%3]);
continue;
}
if (rclFAry[ulNB].IsFlag(MeshFacet::TMP0) == false)
if (!rclFAry[ulNB].IsFlag(MeshFacet::TMP0))
{
raclResultPointsIndices.insert(rclFacet._aulPoints[i]);
raclResultPointsIndices.insert(rclFacet._aulPoints[(i+1)%3]);
@@ -1411,7 +1411,7 @@ bool MeshAlgorithm::CutWithPlane (const Base::Vector3f &clBase, const Base::Vect
for (clGridIter.Init(); clGridIter.More(); clGridIter.Next())
{
// if Gridvoxel intersects the plane: pick up all facets for cutting
if (clGridIter.GetBoundBox().IsCutPlane(clBase, clNormal) == true)
if (clGridIter.GetBoundBox().IsCutPlane(clBase, clNormal))
clGridIter.GetElements(aulFacets);
}
@@ -1428,7 +1428,7 @@ bool MeshAlgorithm::CutWithPlane (const Base::Vector3f &clBase, const Base::Vect
const MeshGeomFacet clF(_rclMesh.GetFacet(*pF));
// Cut the facet and store the cutting path
if (clF.IntersectWithPlane(clBase, clNormal, clE1, clE2) == true)
if (clF.IntersectWithPlane(clBase, clNormal, clE1, clE2))
clTempPoly.emplace_back(clE1, clE2);
}
@@ -1615,22 +1615,22 @@ void MeshAlgorithm::GetFacetsFromPlane (const MeshFacetGrid &rclGrid, const Base
MeshGridIterator clGridIter(rclGrid);
for (clGridIter.Init(); clGridIter.More(); clGridIter.Next()) {
// add facets from grid if the plane if cut the grid-voxel
if (clGridIter.GetBoundBox().IsCutPlane(clBase, clNormal) == true)
if (clGridIter.GetBoundBox().IsCutPlane(clBase, clNormal))
clGridIter.GetElements(aulFacets);
}
// testing facet against planes
for (std::vector<FacetIndex>::iterator pI = aulFacets.begin(); pI != aulFacets.end(); ++pI) {
MeshGeomFacet clSFacet = _rclMesh.GetFacet(*pI);
if (clSFacet.IntersectWithPlane(clBase, clNormal) == true) {
if (clSFacet.IntersectWithPlane(clBase, clNormal)) {
bool bInner = false;
for (int i = 0; (i < 3) && (bInner == false); i++) {
for (int i = 0; (i < 3) && !bInner; i++) {
Base::Vector3f clPt = clSFacet._aclPoints[i];
if ((clPt.DistanceToPlane(rclLeft, clPtNormal) <= 0.0f) && (clPt.DistanceToPlane(rclRight, clPtNormal) >= 0.0f))
bInner = true;
}
if (bInner == true)
if (bInner)
rclRes.push_back(*pI);
}
}
@@ -1666,7 +1666,7 @@ bool MeshAlgorithm::Distance (const Base::Vector3f &rclPt, FacetIndex ulFacetIdx
clBB.Add(rclPAry[*pulIdx]);
clBB.Enlarge(fMaxDistance);
if (clBB.IsInBox(rclPt) == false)
if (!clBB.IsInBox(rclPt))
return false;
rfDistance = _rclMesh.GetFacet(ulFacetIdx).DistanceToPoint(rclPt);

View File

@@ -465,7 +465,7 @@ unsigned long MeshEvalDegeneratedFacets::CountEdgeTooSmall (float fMinEdgeLength
MeshFacetIterator clFIter(_rclMesh);
unsigned long k = 0;
while (clFIter.EndReached() == false) {
while (!clFIter.EndReached()) {
for (int i = 0; i < 3; i++) {
if (Base::Distance(clFIter->_aclPoints[i], clFIter->_aclPoints[(i+1)%3]) < fMinEdgeLength)
k++;

View File

@@ -181,7 +181,7 @@ MeshFacetArray& MeshFacetArray::operator = (const MeshFacetArray &rclFAry)
bool MeshGeomEdge::ContainedByOrIntersectBoundingBox ( const Base::BoundBox3f &rclBB ) const
{
// Test whether all corner points of the Edge are on one of the 6 sides of the BB
if ((GetBoundBox() && rclBB) == false)
if (!(GetBoundBox() && rclBB))
return false;
// Test whether Edge-BB is completely in BB

View File

@@ -804,7 +804,7 @@ inline void MeshGeomFacet::CalcNormal () const
inline Base::Vector3f MeshGeomFacet::GetNormal () const
{
if (_bNormalCalculated == false)
if (!_bNormalCalculated)
CalcNormal();
return _clNormal;
}
@@ -860,7 +860,7 @@ inline float MeshGeomFacet::Area () const
inline bool MeshGeomFacet::ContainedByOrIntersectBoundingBox ( const Base::BoundBox3f &rclBB ) const
{
// Test, if all corner points of the facet are on one of the 6 sides of the BB
if ((GetBoundBox() && rclBB) == false)
if (!(GetBoundBox() && rclBB))
return false;
// Test, whether Facet-BB is completely within BB

View File

@@ -160,7 +160,7 @@ unsigned long MeshGrid::Inside (const Base::BoundBox3f &rclBB, std::vector<Eleme
}
}
if (bDelDoubles == true)
if (bDelDoubles)
{
// remove duplicate mentions
std::sort(raulElements.begin(), raulElements.end());
@@ -195,7 +195,7 @@ unsigned long MeshGrid::Inside (const Base::BoundBox3f &rclBB, std::vector<Eleme
}
}
if (bDelDoubles == true)
if (bDelDoubles)
{
// remove duplicate mentions
std::sort(raulElements.begin(), raulElements.end());
@@ -455,7 +455,7 @@ void MeshGrid::SearchNearestFromPoint (const Base::Vector3f &rclPt, std::set<Ele
raclInd.clear();
Base::BoundBox3f clBB = GetBoundBox();
if (clBB.IsInBox(rclPt) == true)
if (clBB.IsInBox(rclPt))
{ // Point lies within
unsigned long ulX, ulY, ulZ;
Position(rclPt, ulX, ulY, ulZ);
@@ -753,7 +753,7 @@ bool MeshFacetGrid::Verify() const
for ( std::vector<ElementIndex>::iterator itF = aulElements.begin(); itF != aulElements.end(); ++itF )
{
cF.Set( *itF );
if ( cF->IntersectBoundingBox( it.GetBoundBox() ) == false )
if (!cF->IntersectBoundingBox(it.GetBoundBox()))
return false; // no intersection between facet although the facet is in grid
}
}
@@ -785,7 +785,7 @@ unsigned long MeshFacetGrid::SearchNearestFromPoint (const Base::Vector3f &rclPt
float fMinDist = FLOAT_MAX;
Base::BoundBox3f clBB = GetBoundBox();
if (clBB.IsInBox(rclPt) == true)
if (clBB.IsInBox(rclPt))
{ // Point lies within
unsigned long ulX, ulY, ulZ;
Position(rclPt, ulX, ulY, ulZ);
@@ -912,7 +912,7 @@ unsigned long MeshFacetGrid::SearchNearestFromPoint (const Base::Vector3f &rclPt
{
float fDist;
if (clFTool.Distance(rclPt, *pI, fMinDist, fDist) == true)
if (clFTool.Distance(rclPt, *pI, fMinDist, fDist))
{
fMinDist = fDist;
ulFacetInd = *pI;
@@ -1095,7 +1095,7 @@ bool MeshPointGrid::Verify() const
for ( std::vector<ElementIndex>::iterator itP = aulElements.begin(); itP != aulElements.end(); ++itP )
{
cP.Set( *itP );
if ( it.GetBoundBox().IsInBox( *cP ) == false )
if (!it.GetBoundBox().IsInBox(*cP))
return false; // point doesn't lie inside the grid element
}
}
@@ -1176,7 +1176,7 @@ bool MeshGridIterator::InitOnRay (const Base::Vector3f &rclPt, const Base::Vecto
_bValidRay = false;
// point lies within global BB
if ((_rclGrid.GetBoundBox().IsInBox(rclPt)) == true)
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());
@@ -1185,7 +1185,7 @@ bool MeshGridIterator::InitOnRay (const Base::Vector3f &rclPt, const Base::Vecto
else
{ // Start point outside
Base::Vector3f cP0, cP1;
if (_rclGrid.GetBoundBox().IntersectWithLine(rclPt, rclDir, cP0, cP1) == true)
if (_rclGrid.GetBoundBox().IntersectWithLine(rclPt, rclDir, cP0, cP1))
{ // determine the next point
if ((cP0 - rclPt).Length() < (cP1 - rclPt).Length())
_rclGrid.Position(cP0, _ulX, _ulY, _ulZ);
@@ -1202,7 +1202,7 @@ bool MeshGridIterator::InitOnRay (const Base::Vector3f &rclPt, const Base::Vecto
bool MeshGridIterator::NextOnRay (std::vector<ElementIndex> &raulElements)
{
if (_bValidRay == false)
if (!_bValidRay)
return false; // not initialized or beam exited
raulElements.clear();
@@ -1240,7 +1240,7 @@ bool MeshGridIterator::NextOnRay (std::vector<ElementIndex> &raulElements)
_bValidRay = false; // grid element already visited => result from GetSideFromRay invalid
}
if ((_bValidRay == true) && (_rclGrid.CheckPos(_ulX, _ulY, _ulZ) == true))
if (_bValidRay && _rclGrid.CheckPos(_ulX, _ulY, _ulZ))
{
GridElement pos(_ulX, _ulY, _ulZ); _cSearchPositions.insert(pos);
raulElements.insert(raulElements.end(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].begin(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].end());

View File

@@ -190,7 +190,7 @@ std::ostream& MeshInfo::InternalPointInfo (std::ostream& rclStream) const
<< std::setw(8) << (*pPIter).x << ", "
<< std::setw(8) << (*pPIter).y << ", "
<< std::setw(8) << (*pPIter).z << ")";
if (pPIter->IsValid() == true)
if (pPIter->IsValid())
rclStream << std::endl;
else
rclStream << " invalid" << std::endl;
@@ -220,7 +220,7 @@ std::ostream& MeshInfo::InternalFacetInfo (std::ostream& rclStream) const
<< std::setw(4) << pFIter->_aulNeighbours[1] << ", "
<< std::setw(4) << pFIter->_aulNeighbours[2] << ") ";
if (pFIter->IsValid() == true)
if (pFIter->IsValid())
rclStream << std::endl;
else
rclStream << " invalid" << std::endl;

View File

@@ -561,7 +561,7 @@ void MeshKernel::DeletePoints (const std::vector<PointIndex> &raulPoints)
MeshPoint &rclP1 = _aclPointArray[pF->_aulPoints[1]];
MeshPoint &rclP2 = _aclPointArray[pF->_aulPoints[2]];
if ((rclP0.IsValid() == false) || (rclP1.IsValid() == false) || (rclP2.IsValid() == false)) {
if (!rclP0.IsValid() || !rclP1.IsValid() || !rclP2.IsValid()) {
pF->SetInvalid();
}
else {
@@ -609,7 +609,7 @@ void MeshKernel::ErasePoint (PointIndex ulIndex, FacetIndex ulFacetIndex, bool b
}
if (bOnlySetInvalid == false) {
if (!bOnlySetInvalid) {
// completely remove point
_aclPointArray.erase(_aclPointArray.begin() + ulIndex);
@@ -642,14 +642,14 @@ void MeshKernel::RemoveInvalids ()
pPEnd = _aclPointArray.end();
for (pPIter = _aclPointArray.begin(); pPIter != pPEnd; ++pPIter) {
*pDIter++ = ulDec;
if (pPIter->IsValid() == false)
if (!pPIter->IsValid())
ulDec++;
}
// correct point indices of the facets
pFEnd = _aclFacetArray.end();
for (pFIter = _aclFacetArray.begin(); pFIter != pFEnd; ++pFIter) {
if (pFIter->IsValid() == true) {
if (pFIter->IsValid()) {
pFIter->_aulPoints[0] -= aulDecrements[pFIter->_aulPoints[0]];
pFIter->_aulPoints[1] -= aulDecrements[pFIter->_aulPoints[1]];
pFIter->_aulPoints[2] -= aulDecrements[pFIter->_aulPoints[2]];
@@ -664,7 +664,7 @@ void MeshKernel::RemoveInvalids ()
MeshPointArray::_TIterator pPTemp = aclTempPt.begin();
pPEnd = _aclPointArray.end();
for (pPIter = _aclPointArray.begin(); pPIter != pPEnd; ++pPIter) {
if (pPIter->IsValid() == true)
if (pPIter->IsValid())
*pPTemp++ = *pPIter;
}
@@ -681,18 +681,18 @@ void MeshKernel::RemoveInvalids ()
pFEnd = _aclFacetArray.end();
for (pFIter = _aclFacetArray.begin(); pFIter != pFEnd; ++pFIter, ++pDIter) {
*pDIter = ulDec;
if (pFIter->IsValid() == false)
if (!pFIter->IsValid())
ulDec++;
}
// correct neighbour indices of the facets
pFEnd = _aclFacetArray.end();
for (pFIter = _aclFacetArray.begin(); pFIter != pFEnd; ++pFIter) {
if (pFIter->IsValid() == true) {
if (pFIter->IsValid()) {
for (int i = 0; i < 3; i++) {
FacetIndex k = pFIter->_aulNeighbours[i];
if (k != FACET_INDEX_MAX) {
if (_aclFacetArray[k].IsValid() == true)
if (_aclFacetArray[k].IsValid())
pFIter->_aulNeighbours[i] -= aulDecrements[k];
else
pFIter->_aulNeighbours[i] = FACET_INDEX_MAX;
@@ -708,7 +708,7 @@ void MeshKernel::RemoveInvalids ()
MeshFacetArray::_TIterator pFTemp = aclFArray.begin();
pFEnd = _aclFacetArray.end();
for (pFIter = _aclFacetArray.begin(); pFIter != pFEnd; ++pFIter) {
if (pFIter->IsValid() == true)
if (pFIter->IsValid())
*pFTemp++ = *pFIter;
}

View File

@@ -79,7 +79,7 @@ unsigned long MeshSearchNeighbours::NeighboursFromFacet (FacetIndex ulFacetIdx,
int nCtExpandRadius = 0;
// search neighbours, add not marked facets, test distance, add outer points
MeshFacetArray::_TConstIterator f_beg = _rclFAry.begin();
while ((bFound == true) && (nCtExpandRadius < 10)) {
while (bFound && (nCtExpandRadius < 10)) {
bFound = false;
std::set<PointIndex> aclTmp;
@@ -124,7 +124,7 @@ unsigned long MeshSearchNeighbours::NeighboursFromFacet (FacetIndex ulFacetIdx,
for (std::set<PointIndex>::iterator pI = _aclResult.begin(); pI != _aclResult.end(); ++pI, i++)
raclResultPoints[i] = _rclPAry[*pI];
if (bAddPoints == true) {
if (bAddPoints) {
// sort points, remove points lying furthest from center
std::sort(raclResultPoints.begin(), raclResultPoints.end(), CDistRad(_clCenter));
raclResultPoints.erase(raclResultPoints.begin() + ulMinPoints, raclResultPoints.end());
@@ -172,7 +172,7 @@ unsigned long MeshSearchNeighbours::NeighboursFromSampledFacets (FacetIndex ulFa
// search neighbours, add not marked facets, test distance, add outer points
MeshFacetArray::_TConstIterator f_beg = _rclFAry.begin();
while (bFound == true) {
while (bFound) {
bFound = false;
std::set<PointIndex> aclTmp;
@@ -204,7 +204,7 @@ unsigned long MeshSearchNeighbours::NeighboursFromSampledFacets (FacetIndex ulFa
// facet points
for (std::set<PointIndex>::iterator pI = _aclResult.begin(); pI != _aclResult.end(); ++pI) {
if (InnerPoint(_rclPAry[*pI]) == true)
if (InnerPoint(_rclPAry[*pI]))
raclResultPoints.push_back(_rclPAry[*pI]);
}
@@ -232,12 +232,12 @@ bool MeshSearchNeighbours::AccumulateNeighbours (const MeshFacet &rclF, FacetInd
else { // add points inner radius
bFound = TriangleCutsSphere(rclF);
if (bFound == true) {
if (bFound) {
std::vector<Base::Vector3f> &rclT = _aclSampledFacets[ulFIdx];
std::vector<Base::Vector3f> clTmp;
clTmp.reserve(rclT.size());
for (std::vector<Base::Vector3f>::iterator pI = rclT.begin(); pI != rclT.end(); ++pI) {
if (InnerPoint(*pI) == true)
if (InnerPoint(*pI))
clTmp.push_back(*pI);
}
_aclPointsResult.insert(_aclPointsResult.end(), clTmp.begin(), clTmp.end());
@@ -284,7 +284,7 @@ unsigned long MeshSearchNeighbours::NeighboursFacetFromFacet (FacetIndex ulFacet
// search neighbours, add not marked facets, test distance, add outer points
MeshFacetArray::_TConstIterator f_beg = _rclFAry.begin();
while (bFound == true) {
while (bFound) {
bFound = false;
std::set<PointIndex> aclTmp;

View File

@@ -101,7 +101,7 @@ inline bool MeshSearchNeighbours::CheckDistToFacet (const MeshFacet &rclF)
for (int i = 0; i < 3; i++)
{
PointIndex ulPIdx = rclF._aulPoints[i];
if (_rclPAry[ulPIdx].IsFlag(MeshPoint::MARKED) == false)
if (!_rclPAry[ulPIdx].IsFlag(MeshPoint::MARKED))
{
if (Base::DistanceP2(_clCenter, _rclPAry[ulPIdx]) < _fMaxDistanceP2)
{

View File

@@ -481,7 +481,7 @@ QuasiDelaunayTriangulator::~QuasiDelaunayTriangulator()
bool QuasiDelaunayTriangulator::Triangulate()
{
if (EarClippingTriangulator::Triangulate() == false)
if (!EarClippingTriangulator::Triangulate())
return false; // no valid triangulation
// For each internal edge get the adjacent facets. When doing an edge swap we must update

View File

@@ -271,7 +271,7 @@ bool MeshTrimming::GetIntersectionPointsOfPolygonAndFacet(FacetIndex ulIndex, in
iIntsctWithEdge2++;
}
if (bPushBack == true)
if (bPushBack)
raclPoints.push_back(clIntersection);
}
}

View File

@@ -62,14 +62,14 @@ unsigned long MeshKernel::VisitNeighbourFacets (MeshFacetVisitor &rclFVisitor, F
if (!rclFVisitor.AllowVisit(*clNBFacet, *clCurrFacet, j, ulLevel, i))
continue;
if (clNBFacet->IsFlag(MeshFacet::VISIT) == true)
if (clNBFacet->IsFlag(MeshFacet::VISIT))
continue; // neighbour facet already visited
else {
// visit and mark
ulVisited++;
clNextLevel.push_back(j);
clNBFacet->SetFlag(MeshFacet::VISIT);
if (rclFVisitor.Visit(*clNBFacet, *clCurrFacet, j, ulLevel) == false)
if (!rclFVisitor.Visit(*clNBFacet, *clCurrFacet, j, ulLevel))
return ulVisited;
}
}

View File

@@ -100,7 +100,7 @@ inline bool MeshSearchNeighbourFacetsVisitor::Visit (const MeshFacet &rclFacet,
{
(void)rclFrom;
if (ulLevel > _ulCurrentLevel) {
if (_bFacetsFoundInCurrentLevel == false)
if (!_bFacetsFoundInCurrentLevel)
return false;
_ulCurrentLevel = ulLevel;
_bFacetsFoundInCurrentLevel = false;