diff --git a/CMakeLists.txt b/CMakeLists.txt index f940cd090..c757c96c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -182,7 +182,7 @@ SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) SET_PROPERTY(TARGET ${PROJECT_NAME} PROPERTY FOLDER "plugins") # Config files and install rules for pythons scripts -sofa_install_pythonscripts(PLUGIN_NAME ${PROJECT_NAME} PYTHONSCRIPTS_SOURCE_DIR "python") +sofa_install_pythonscripts(PLUGIN_NAME ${PROJECT_NAME} PYTHONSCRIPTS_SOURCE_DIR "examples/python3") sofa_add_subdirectory(plugin extensions/CUDA BeamAdapter.CUDA) diff --git a/src/BeamAdapter/component/BeamInterpolation.inl b/src/BeamAdapter/component/BeamInterpolation.inl index d5bd84fc7..a65339de6 100644 --- a/src/BeamAdapter/component/BeamInterpolation.inl +++ b/src/BeamAdapter/component/BeamInterpolation.inl @@ -538,14 +538,14 @@ template void BeamInterpolation::getYoungModulusAtX(int beamId, Real& /*x_curv*/, Real& youngModulus, Real& cPoisson) { const auto& defaultYoungModuli = d_defaultYoungModulus.getValue(); - if (beamId < defaultYoungModuli.size()) { + if (beamId < (int)defaultYoungModuli.size()) { youngModulus = defaultYoungModuli[beamId]; } else { youngModulus = m_defaultYoungModulus; } const auto& poissonRatios = d_poissonRatio.getValue(); - if (beamId < poissonRatios.size()) { + if (beamId < (int)poissonRatios.size()) { cPoisson = poissonRatios[beamId]; } else { cPoisson = m_defaultPoissonRatio; diff --git a/src/BeamAdapter/component/constraint/AdaptiveBeamLengthConstraint.inl b/src/BeamAdapter/component/constraint/AdaptiveBeamLengthConstraint.inl index 9d875919b..fa02b9109 100644 --- a/src/BeamAdapter/component/constraint/AdaptiveBeamLengthConstraint.inl +++ b/src/BeamAdapter/component/constraint/AdaptiveBeamLengthConstraint.inl @@ -49,10 +49,12 @@ public: AdaptiveBeamLengthConstraintResolution(SReal* initF=nullptr, bool* active=nullptr) : ConstraintResolution(1) ,m_initF(initF), m_active(active) { } - void init(int line, SReal** w, SReal* force) override; - void resolution(int line, SReal** w, SReal* d, SReal* force); - void store(int line, SReal* force, bool convergence) override; + virtual void init(int line, SReal** w, SReal* force) override; + virtual void store(int line, SReal* force, bool convergence) override; + using sofa::core::behavior::ConstraintResolution::resolution; + void resolution(int line, SReal** w, SReal* d, SReal* force); + protected: SReal* m_initF; bool* m_active; diff --git a/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.inl b/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.inl index 0d24c7736..695d9aaf1 100644 --- a/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.inl +++ b/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.inl @@ -284,7 +284,7 @@ void AdaptiveBeamSlidingConstraint::draw(const VisualParams* vparams) points.reserve(x.size()); colors.reserve(x.size()); - for (auto i = 0; i < x.size(); i++) + for (sofa::Size i = 0; i < x.size(); i++) { point = DataTypes::getCPos(x[i]); points.push_back(point); diff --git a/src/BeamAdapter/component/constraint/ImplicitSurfaceAdaptiveConstraint.inl b/src/BeamAdapter/component/constraint/ImplicitSurfaceAdaptiveConstraint.inl index b1960b416..d3777ad82 100644 --- a/src/BeamAdapter/component/constraint/ImplicitSurfaceAdaptiveConstraint.inl +++ b/src/BeamAdapter/component/constraint/ImplicitSurfaceAdaptiveConstraint.inl @@ -639,7 +639,7 @@ void ImplicitSurfaceAdaptiveConstraint::draw(const core::visual::Visu const auto stateLifeCycle = vparams->drawTool()->makeStateLifeCycle(); vparams->drawTool()->disableLighting(); - std::vector pointsToDraw; + std::vector pointsToDraw; std::vector colors; typename sofa::type::vector::iterator it = m_vecPotentialContact.begin(); @@ -664,7 +664,7 @@ void ImplicitSurfaceAdaptiveConstraint::draw(const core::visual::Visu vparams->drawTool()->drawPoints(pointsToDraw, 2, colors); colors.clear(); - std::vector linesToDraw; + std::vector linesToDraw; for (unsigned int i=0; i::onBeginAnimationStep(const double / else { const type::vector& times = d_timeSteps.getValue(); - if (!times.empty() && m_readStep < times.size()) + if (!times.empty() && m_readStep < (int)times.size()) { const Real& time = times[m_readStep]; diff --git a/src/BeamAdapter/component/controller/InterventionalRadiologyController.inl b/src/BeamAdapter/component/controller/InterventionalRadiologyController.inl index 5b96e4748..3d0fd1132 100644 --- a/src/BeamAdapter/component/controller/InterventionalRadiologyController.inl +++ b/src/BeamAdapter/component/controller/InterventionalRadiologyController.inl @@ -366,10 +366,10 @@ void InterventionalRadiologyController::onBeginAnimationStep(const do template void InterventionalRadiologyController::applyAction(sofa::beamadapter::BeamAdapterAction action) { - int id = d_controlledInstrument.getValue(); - if (id >= m_instrumentsList.size()) + int id = d_controlledInstrument.getValue(); + if (id >= (int)m_instrumentsList.size()) { - msg_warning() << "Controlled Instument num " << id << " does not exist (size =" << m_instrumentsList.size() << ")."; + msg_warning() << "Controlled Instrument num " << id << " does not exist (size =" << m_instrumentsList.size() << ")."; return; } @@ -403,7 +403,7 @@ void InterventionalRadiologyController::applyAction(sofa::beamadapter } case BeamAdapterAction::SWITCH_NEXT_TOOL: { - if (id + 1 >= m_instrumentsList.size()) + if (id + 1 >= (int)m_instrumentsList.size()) msg_warning() << "Switching to next tool is not possible, no more instrument in list."; else d_controlledInstrument.setValue(id + 1); @@ -455,7 +455,7 @@ void InterventionalRadiologyController::computeInstrumentsCurvAbs(typ // Step 2 => add the beams given the sampling parameters double maxAbsLength=0.0; Real xSampling = 0.0; - for (auto i=0; i xP_noticeable_I; type::vector< int > density_I; diff --git a/src/BeamAdapter/component/engine/WireRestShape.inl b/src/BeamAdapter/component/engine/WireRestShape.inl index 7a2a759fd..07753a5a6 100644 --- a/src/BeamAdapter/component/engine/WireRestShape.inl +++ b/src/BeamAdapter/component/engine/WireRestShape.inl @@ -245,7 +245,7 @@ void WireRestShape::getRestTransformOnX(Transform &global_H_local, co } const type::vector& keyPts = d_keyPoints.getValue(); - for (auto i = 1; i < keyPts.size(); ++i) + for (sofa::Size i = 1; i < keyPts.size(); ++i) { if (x_used <= keyPts[i]) { @@ -306,7 +306,7 @@ template void WireRestShape::getNumberOfCollisionSegment(Real &dx, unsigned int &numLines) { numLines = 0; - for (auto i = 0; i < l_sectionMaterials.size(); ++i) + for (sofa::Size i = 0; i < l_sectionMaterials.size(); ++i) { numLines += l_sectionMaterials.get(i)->getNbCollisionEdges(); } diff --git a/src/BeamAdapter/component/mapping/BeamProjectionDifferenceMultiMapping.inl b/src/BeamAdapter/component/mapping/BeamProjectionDifferenceMultiMapping.inl index ca2a64f27..610961e57 100644 --- a/src/BeamAdapter/component/mapping/BeamProjectionDifferenceMultiMapping.inl +++ b/src/BeamAdapter/component/mapping/BeamProjectionDifferenceMultiMapping.inl @@ -62,7 +62,7 @@ BeamProjectionDifferenceMultiMapping::BeamProjectionDifference , m_updateJ(false) { auto directions = sofa::helper::getWriteAccessor(d_directions); - directions.resize(OutDeriv::total_size, true); + directions.resize(OutDeriv::total_size); }