Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SofaTopologyMapping] Fix shadowed variable #2158 #2413

Merged
merged 2 commits into from
Oct 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -232,27 +232,24 @@ void Edge2QuadTopologicalMapping::init()
}
else
{
for (unsigned int j=0; j<d_edgeList.getValue().size(); ++j)
for (const auto i : d_edgeList.getValue())
{
unsigned int i=d_edgeList.getValue()[j];

unsigned int p0 = edgeArray[i][0];
unsigned int p1 = edgeArray[i][1];
const unsigned int p0 = edgeArray[i][0];
const unsigned int p1 = edgeArray[i][1];
alxbilger marked this conversation as resolved.
Show resolved Hide resolved

sofa::type::vector<Index> out_info;

for(unsigned int j=0; j<N; ++j)
{

unsigned int q0 = p0*N+j;
unsigned int q1 = p1*N+j;
unsigned int q2 = p1*N+((j+1)%N);
unsigned int q3 = p0*N+((j+1)%N);
const unsigned int q0 = p0*N+j;
const unsigned int q1 = p1*N+j;
const unsigned int q2 = p1*N+((j+1)%N);
const unsigned int q3 = p0*N+((j+1)%N);
alxbilger marked this conversation as resolved.
Show resolved Hide resolved

if(d_flipNormals.getValue())
to_tstm->addQuadProcess(Quad((unsigned int) q0, (unsigned int) q3, (unsigned int) q2, (unsigned int) q1));
to_tstm->addQuadProcess(Quad(q0, q3, q2, q1));
else
to_tstm->addQuadProcess(Quad((unsigned int) q0, (unsigned int) q1, (unsigned int) q2, (unsigned int) q3));
to_tstm->addQuadProcess(Quad(q0, q1, q2, q3));
Loc2GlobVec.push_back(i);
out_info.push_back((unsigned int)Loc2GlobVec.size()-1);
}
Expand Down