Skip to content

Commit

Permalink
Minor code clean up.
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Feb 2, 2024
1 parent e746485 commit 9aa3b33
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Result<> LabelTriangleGeometry::operator()()
return MakeErrorResult(check, fmt::format("Error finding element neighbors for {} geometry", triangle.getName()));
}

const TriangleGeom::ElementDynamicList* triangleNeighbors = triangle.getElementNeighbors();
const TriangleGeom::ElementDynamicList* triangleNeighborsPtr = triangle.getElementNeighbors();

auto& regionIds = m_DataStructure.getDataRefAs<Int32Array>(m_InputValues->RegionIdsPath);

Expand All @@ -57,22 +57,22 @@ Result<> LabelTriangleGeometry::operator()()
triangleCounts[regionCount]++;

usize size = 0;
triList[size] = i;
triList[size] = static_cast<int32>(i);
size++;
while(size > 0)
{
TriangleGeom::MeshIndexType tri = triList[size - 1];
size -= 1;
uint16_t tCount = triangleNeighbors->getNumberOfElements(tri);
TriangleGeom::MeshIndexType* data = triangleNeighbors->getElementListPointer(tri);
uint16_t tCount = triangleNeighborsPtr->getNumberOfElements(tri);
TriangleGeom::MeshIndexType* dataPtr = triangleNeighborsPtr->getElementListPointer(tri);
for(int j = 0; j < tCount; j++)
{
TriangleGeom::MeshIndexType neighTri = data[j];
TriangleGeom::MeshIndexType neighTri = dataPtr[j];
if(regionIds[neighTri] == 0)
{
regionIds[neighTri] = regionCount;
triangleCounts[regionCount]++;
triList[size] = neighTri;
triList[size] = static_cast<int32>(neighTri);
size++;
if(size >= triList.size())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ IFilter::PreflightResult LabelTriangleGeometryFilter::preflightImpl(const DataSt
std::vector<PreflightValue> preflightUpdatedValues;

{
const auto* triangleGeom = dataStructure.getDataAs<TriangleGeom>(pTriangleGeomPathValue);
if(triangleGeom == nullptr)
const auto* triangleGeomPtr = dataStructure.getDataAs<TriangleGeom>(pTriangleGeomPathValue);
if(triangleGeomPtr == nullptr)
{
return MakePreflightErrorResult(-34510, fmt::format("{} is not a valid Triangle Geometry", pTriangleGeomPathValue.toString()));
}
usize numTris = triangleGeom->getNumberOfFaces();
usize numTris = triangleGeomPtr->getNumberOfFaces();
auto createArrayAction = std::make_unique<CreateArrayAction>(DataType::int32, std::vector<usize>{numTris}, std::vector<usize>{1}, pRegionIdsNameValue);
resultOutputActions.value().appendAction(std::move(createArrayAction));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace nx::core
{
/**
* @class LabelTriangleGeometryFilter
* @brief This filter will ....
* @brief
*/
class SIMPLNXCORE_EXPORT LabelTriangleGeometryFilter : public IFilter
{
Expand Down

0 comments on commit 9aa3b33

Please sign in to comment.