Skip to content

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

Closed

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

issue: enhancement

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions