Skip to content

Commit

Permalink
remove toModel, fromModel1, fromModel2 to use he inherited attributes…
Browse files Browse the repository at this point in the history
… from MultiMapping
  • Loading branch information
damienmarchal committed Jun 12, 2024
1 parent 9aa7ac6 commit 077e984
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
10 changes: 3 additions & 7 deletions src/Cosserat/mapping/BaseCosseratMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,9 @@ class BaseCosseratMapping : public sofa::core::Multi2Mapping<TIn1, TIn2, TOut>
sofa::Data<vector<double>> d_curv_abs_frames;
sofa::Data<bool> d_debug;

/// Input Models container. New inputs are added through addInputModel(In* ).
sofa::core::State<In1> *m_fromModel1;

// TODO(dmarchal): why this maybe_unused on a data field ?
[[maybe_unused]] sofa::core::State<In2> *m_fromModel2;

sofa::core::State<Out> *m_toModel;
using Inherit1::fromModels1;
using Inherit1::fromModels2;
using Inherit1::toModels;

protected:
/// Constructor
Expand Down
5 changes: 2 additions & 3 deletions src/Cosserat/mapping/BaseCosseratMapping.inl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ BaseCosseratMapping<TIn1, TIn2, TOut>::BaseCosseratMapping()
d_curv_abs_frames(initData(&d_curv_abs_frames, "curv_abs_output",
" need to be com....")),
d_debug(initData(&d_debug, false, "debug", "printf for the debug")),
m_fromModel1(NULL), m_fromModel2(NULL), m_toModel(NULL),
m_index_input(0) {}

// _________________________________________________________________________________________
Expand All @@ -68,7 +67,7 @@ void BaseCosseratMapping<TIn1, TIn2, TOut>::init()

// Fill the initial vector
const OutDataVecCoord *xfromData =
m_toModel->read(sofa::core::ConstVecCoordId::position());
toModels[0]->read(sofa::core::ConstVecCoordId::position());

//TODO(dmarchal, 2024/07/12): is this line really needed ?
// it initialize a local variable, is it to force a xfromData updates ?
Expand Down Expand Up @@ -330,7 +329,7 @@ BaseCosseratMapping<TIn1, TIn2, TOut>::computeETA(const Vec6 &baseEta,

// Fill the initial vector
const In1DataVecCoord *x1fromData =
m_fromModel1->read(sofa::core::ConstVecCoordId::position());
fromModels1[0]->read(sofa::core::ConstVecCoordId::position());
const In1VecCoord x1from = x1fromData->getValue();

auto curv_abs_input = sofa::helper::getReadAccessor(d_curv_abs_section);
Expand Down

0 comments on commit 077e984

Please sign in to comment.