Skip to content

Commit

Permalink
Cleans up code.
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Dec 10, 2024
1 parent fd3ca41 commit 156ad24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,6 @@ Result<> SurfaceNets::operator()()
vData[3] = {vertexIndices[3], 00.0f, 0.0f, 0.0f};

const bool isQuadFrontFacing = (quadLabels[0] < quadLabels[1]);
if(quadLabels[0] == MMSurfaceNet::Padding)
{
quadLabels[0] = -1;
}
if(quadLabels[1] == MMSurfaceNet::Padding)
{
quadLabels[1] = -1;
}

getQuadTriangleIDs(vData, isQuadFrontFacing, triangleVtxIDs);
t1 = {static_cast<usize>(triangleVtxIDs[0]), static_cast<usize>(triangleVtxIDs[1]), static_cast<usize>(triangleVtxIDs[2])};
Expand Down Expand Up @@ -311,15 +303,8 @@ Result<> SurfaceNets::operator()()
vData[2] = {vertexIndices[2], 00.0f, 0.0f, 0.0f};
vData[3] = {vertexIndices[3], 00.0f, 0.0f, 0.0f};

const bool isQuadFrontFacing = (quadLabels[0] < quadLabels[1]); ///
if(quadLabels[0] == MMSurfaceNet::Padding)
{
quadLabels[0] = -1;
}
if(quadLabels[1] == MMSurfaceNet::Padding)
{
quadLabels[1] = -1;
}
const bool isQuadFrontFacing = (quadLabels[0] < quadLabels[1]);

getQuadTriangleIDs(vData, isQuadFrontFacing, triangleVtxIDs);
t1 = {static_cast<usize>(triangleVtxIDs[0]), static_cast<usize>(triangleVtxIDs[1]), static_cast<usize>(triangleVtxIDs[2])};
t2 = {static_cast<usize>(triangleVtxIDs[3]), static_cast<usize>(triangleVtxIDs[4]), static_cast<usize>(triangleVtxIDs[5])};
Expand Down Expand Up @@ -370,14 +355,7 @@ Result<> SurfaceNets::operator()()
vData[3] = {vertexIndices[3], 00.0f, 0.0f, 0.0f};

const bool isQuadFrontFacing = (quadLabels[0] < quadLabels[1]);
if(quadLabels[0] == MMSurfaceNet::Padding)
{
quadLabels[0] = -1;
}
if(quadLabels[1] == MMSurfaceNet::Padding)
{
quadLabels[1] = -1;
}

getQuadTriangleIDs(vData, isQuadFrontFacing, triangleVtxIDs);
t1 = {static_cast<usize>(triangleVtxIDs[0]), static_cast<usize>(triangleVtxIDs[1]), static_cast<usize>(triangleVtxIDs[2])};
t2 = {static_cast<usize>(triangleVtxIDs[3]), static_cast<usize>(triangleVtxIDs[4]), static_cast<usize>(triangleVtxIDs[5])};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ MMCellMap::MMCellMap(int32_t* labels, int arraySize[3], float voxelSize[3])
// corner.
Cell* pCell = m_cellArray;
int32_t* pLabel = labels;
int32_t padLabel = (int32_t)MMSurfaceNet::ReservedLabel::Padding;
for(int k = 0; k < m_arraySize[2]; k++)
{
for(int j = 0; j < m_arraySize[1]; j++)
Expand All @@ -48,7 +47,7 @@ MMCellMap::MMCellMap(int32_t* labels, int arraySize[3], float voxelSize[3])
{
if(i == 0 || i == m_arraySize[0] - 1 || j == 0 || j == m_arraySize[1] - 1 || k == 0 || k == m_arraySize[2] - 1)
{
initCell(pCell++, padLabel);
initCell(pCell++, static_cast<int32_t>(MMSurfaceNet::ReservedLabel::Padding));
}
else
{
Expand Down

0 comments on commit 156ad24

Please sign in to comment.