Skip to content

[algorithm] Refactor InsertionAlgorithm to use an Operation for coupling point removal #86

@th-skam

Description

@th-skam

The following lines could be replaced by an Operation:

const EdgeProximity::SPtr edgeProx =
dynamic_pointer_cast<EdgeProximity>(shaftProx);
if (edgeProx)
{
const type::Vec3 normal = (edgeProx->element()->getP1()->getPosition() -
edgeProx->element()->getP0()->getPosition())
.normalized();
// If the (last) coupling point lies ahead of the tip (positive dot product),
// the needle is retreating. Thus, that point is removed.
if (dot(tip2Pt, normal) > 0_sreal)
{
m_couplingPts.pop_back();
}
}

The InsertionAlgorithm is a customized algorithm class for needle insertion. There could be equivalent customized Operation classes.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions