From 964136a2c24ba73ac9c77d11da2f8bb8967a3f4f Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 9 Jan 2025 16:37:53 +0100 Subject: [PATCH] [Mapping] Fix draw in RigidMapping (#5204) * [Mapping] Fix draw in RigidMapping * Apply suggestions from code review Co-authored-by: Frederick Roy --------- Co-authored-by: Frederick Roy --- .../src/sofa/component/mapping/nonlinear/RigidMapping.inl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/RigidMapping.inl b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/RigidMapping.inl index fa2d0f1911c..195d6803c96 100644 --- a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/RigidMapping.inl +++ b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/RigidMapping.inl @@ -772,8 +772,11 @@ void RigidMapping::setJMatrixBlock(unsigned outIdx, unsigned inIdx) template void RigidMapping::draw(const core::visual::VisualParams* vparams) { - if (!vparams->displayFlags().getShowMappings() || this->toModel==nullptr ) + if (!vparams->displayFlags().getShowMappings() || !this->toModel ) return; + + [[maybe_unused]] const auto stateLifeCycle = vparams->drawTool()->makeStateLifeCycle(); + std::vector points; type::Vec3 point;