Skip to content

Commit aee4031

Browse files
committed
[algorithm] Revert back to m_couplingPts naming
1 parent 9b58652 commit aee4031

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/sofa/collisionAlgorithm/algorithm/InsertionAlgorithm.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class InsertionAlgorithm : public BaseAlgorithm
3131
Data<bool> d_projective;
3232
Data<SReal> d_punctureForceThreshold, d_tipDistThreshold;
3333
ConstraintSolver::SPtr m_constraintSolver;
34-
std::vector<BaseProximity::SPtr> m_CPs;
34+
std::vector<BaseProximity::SPtr> m_couplingPts;
3535
Data<bool> d_drawCollision, d_drawPoints;
3636
Data<SReal> d_drawPointsScale;
3737

@@ -58,7 +58,7 @@ class InsertionAlgorithm : public BaseAlgorithm
5858
"the last proximity detection. Once exceeded, a new "
5959
"proximity pair is added for the needle-volume coupling.")),
6060
m_constraintSolver(nullptr),
61-
m_CPs(),
61+
m_couplingPts(),
6262
d_drawCollision(initData(&d_drawCollision, false, "drawcollision", "Draw collision.")),
6363
d_drawPoints(initData(&d_drawPoints, false, "drawPoints", "Draw detection outputs.")),
6464
d_drawPointsScale(initData(&d_drawPointsScale, 0.0005, "drawPointsScale",
@@ -125,7 +125,7 @@ class InsertionAlgorithm : public BaseAlgorithm
125125
insertionOutput.clear();
126126
collisionOutput.clear();
127127

128-
if (m_CPs.empty())
128+
if (m_couplingPts.empty())
129129
{
130130
// 1. Puncture algorithm
131131
auto createTipProximity =
@@ -161,7 +161,7 @@ class InsertionAlgorithm : public BaseAlgorithm
161161
}
162162
if (norm > punctureForceThreshold)
163163
{
164-
m_CPs.push_back(surfProx);
164+
m_couplingPts.push_back(surfProx);
165165
continue;
166166
}
167167
}
@@ -178,7 +178,7 @@ class InsertionAlgorithm : public BaseAlgorithm
178178
}
179179

180180
// 1.3 Collision with the shaft geometry
181-
if (m_CPs.empty())
181+
if (m_couplingPts.empty())
182182
{
183183
auto createShaftProximity =
184184
Operations::CreateCenterProximity::Operation::get(l_shaftGeom->getTypeInfo());
@@ -215,7 +215,7 @@ class InsertionAlgorithm : public BaseAlgorithm
215215
const BaseProximity::SPtr tipProx = createTipProximity(itTip->element());
216216
if (!tipProx) return;
217217

218-
type::Vec3 lastCP = m_CPs.back()->getPosition();
218+
type::Vec3 lastCP = m_couplingPts.back()->getPosition();
219219
const SReal tipDistThreshold = this->d_tipDistThreshold.getValue();
220220

221221
// Vector from tip to last coupling point; used for distance and directional checks
@@ -287,7 +287,7 @@ class InsertionAlgorithm : public BaseAlgorithm
287287
if (isInTetra)
288288
{
289289
volProx->normalize();
290-
m_CPs.push_back(volProx);
290+
m_couplingPts.push_back(volProx);
291291
lastCP = volProx->getPosition();
292292
}
293293
}
@@ -313,7 +313,7 @@ class InsertionAlgorithm : public BaseAlgorithm
313313
// product), the needle is retreating. Thus, that point is removed.
314314
if (dot(tipToLastCP, normal) > 0_sreal)
315315
{
316-
m_CPs.pop_back();
316+
m_couplingPts.pop_back();
317317
}
318318
}
319319
else
@@ -330,24 +330,24 @@ class InsertionAlgorithm : public BaseAlgorithm
330330
}
331331
}
332332

333-
if (!m_CPs.empty())
333+
if (!m_couplingPts.empty())
334334
{
335335
// 3. Re-project proximities on the shaft geometry
336336
auto findClosestProxOnShaft =
337337
Operations::FindClosestProximity::Operation::get(l_shaftGeom);
338338
auto projectOnShaft = Operations::Project::Operation::get(l_shaftGeom);
339-
for (int i = 0; i < m_CPs.size(); i++)
339+
for (int i = 0; i < m_couplingPts.size(); i++)
340340
{
341341
const BaseProximity::SPtr shaftProx = findClosestProxOnShaft(
342-
m_CPs[i], l_shaftGeom.get(), projectOnShaft, getFilterFunc());
342+
m_couplingPts[i], l_shaftGeom.get(), projectOnShaft, getFilterFunc());
343343
if (!shaftProx) continue;
344344
shaftProx->normalize();
345-
insertionOutput.add(shaftProx, m_CPs[i]);
345+
insertionOutput.add(shaftProx, m_couplingPts[i]);
346346
}
347347
// This is a final-frontier check: If there are coupling points stored, but the
348348
// findClosestProxOnShaf operation yields no proximities on the shaft, it could be
349349
// because the needle has exited abruptly. Thus, we clear the coupling points.
350-
if (insertionOutput.size() == 0) m_CPs.clear();
350+
if (insertionOutput.size() == 0) m_couplingPts.clear();
351351
}
352352

353353
d_collisionOutput.endEdit();

0 commit comments

Comments
 (0)