From c604f7b4f6bf0138ea91e97264d95b9c98d835cd Mon Sep 17 00:00:00 2001 From: Frederick Roy Date: Thu, 2 Apr 2026 14:32:31 +0900 Subject: [PATCH] fix deprecations: vec casting and baseobject --- src/BeamAdapter/component/BeamInterpolation.h | 2 +- src/BeamAdapter/component/WireBeamInterpolation.h | 2 +- .../constraint/AdaptiveBeamSlidingConstraint.cpp | 2 +- .../constraint/AdaptiveBeamSlidingConstraint.h | 2 +- .../component/controller/AdaptiveBeamController.h | 2 +- .../controller/InterventionalRadiologyController.h | 2 +- .../controller/InterventionalRadiologyController.inl | 6 +++--- .../component/controller/SutureController.inl | 4 ++-- src/BeamAdapter/component/engine/WireRestShape.h | 8 ++++---- .../forcefield/AdaptiveBeamForceFieldAndMass.h | 2 +- .../forcefield/AdaptiveInflatableBeamForceField.h | 4 ++-- .../forcefield/AdaptiveInflatableBeamForceField.inl | 4 ++-- .../component/mapping/MultiAdaptiveBeamMapping.inl | 2 +- .../component/model/BaseRodSectionMaterial.h | 10 +++++----- src/BeamAdapter/component/model/RodMeshSection.inl | 2 +- src/BeamAdapter/component/model/RodSpireSection.inl | 2 +- src/BeamAdapter/component/model/RodStraightSection.inl | 2 +- src/BeamAdapter/utils/deprecatedcomponent.h | 8 ++++---- 18 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/BeamAdapter/component/BeamInterpolation.h b/src/BeamAdapter/component/BeamInterpolation.h index cfe9dd77e..be288fc1d 100644 --- a/src/BeamAdapter/component/BeamInterpolation.h +++ b/src/BeamAdapter/component/BeamInterpolation.h @@ -111,7 +111,7 @@ class BeamInterpolation : public BaseBeamInterpolation "' found in the context node."); return false; } - return sofa::core::objectmodel::BaseObject::canCreate(obj, context, arg); + return sofa::core::objectmodel::BaseComponent::canCreate(obj, context, arg); } //////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/BeamAdapter/component/WireBeamInterpolation.h b/src/BeamAdapter/component/WireBeamInterpolation.h index 32f69ee1b..cfffe0b31 100644 --- a/src/BeamAdapter/component/WireBeamInterpolation.h +++ b/src/BeamAdapter/component/WireBeamInterpolation.h @@ -46,7 +46,7 @@ #include #include -#include +#include namespace beamadapter diff --git a/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.cpp b/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.cpp index f70820d7a..54c6ce840 100644 --- a/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.cpp +++ b/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.cpp @@ -30,7 +30,7 @@ #include -using sofa::core::objectmodel::BaseObject ; +using sofa::core::objectmodel::BaseComponent ; using sofa::core::objectmodel::BaseContext ; using sofa::core::objectmodel::BaseObjectDescription ; #include diff --git a/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.h b/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.h index 2f1fd14a0..f47870c6b 100644 --- a/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.h +++ b/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.h @@ -64,7 +64,7 @@ class SOFA_BEAMADAPTER_API AdaptiveBeamSlidingConstraint : public PairInteractio typedef Vec<3, Real> Vec3; typedef Vec<6, Real> Vec6; - /////////////////////////// Inherited from BaseObject ////////////////////////////////////////// + /////////////////////////// Inherited from BaseComponent ////////////////////////////////////////// virtual void init() override ; virtual void reset() override ; virtual void draw(const VisualParams* vparams) override ; diff --git a/src/BeamAdapter/component/controller/AdaptiveBeamController.h b/src/BeamAdapter/component/controller/AdaptiveBeamController.h index eb04973a9..62bc7d207 100644 --- a/src/BeamAdapter/component/controller/AdaptiveBeamController.h +++ b/src/BeamAdapter/component/controller/AdaptiveBeamController.h @@ -101,7 +101,7 @@ public : AdaptiveBeamController(); virtual ~AdaptiveBeamController() = default; - /////////////// Inherited from BaseObject ///////////////////////////////////////////////////// + /////////////// Inherited from BaseComponent ///////////////////////////////////////////////////// virtual void init() override ; virtual void reinit() override ; diff --git a/src/BeamAdapter/component/controller/InterventionalRadiologyController.h b/src/BeamAdapter/component/controller/InterventionalRadiologyController.h index bdc4aeba5..7cbb48b29 100644 --- a/src/BeamAdapter/component/controller/InterventionalRadiologyController.h +++ b/src/BeamAdapter/component/controller/InterventionalRadiologyController.h @@ -82,7 +82,7 @@ class InterventionalRadiologyController : public sofa::component::controller::Me InterventionalRadiologyController(); virtual ~InterventionalRadiologyController() = default; - ////////////////////// Inherited from BaseObject /////////////////////////////////////////////// + ////////////////////// Inherited from BaseComponent /////////////////////////////////////////////// virtual void init() override ; //////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/BeamAdapter/component/controller/InterventionalRadiologyController.inl b/src/BeamAdapter/component/controller/InterventionalRadiologyController.inl index 08203f489..e850ed188 100644 --- a/src/BeamAdapter/component/controller/InterventionalRadiologyController.inl +++ b/src/BeamAdapter/component/controller/InterventionalRadiologyController.inl @@ -122,7 +122,7 @@ void InterventionalRadiologyController::init() if (m_instrumentsList.empty()) { msg_error() << "No instrument found (no WireBeamInterpolation)! the component can not work and will be set to Invalid."; - sofa::core::objectmodel::BaseObject::d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid); + sofa::core::objectmodel::BaseComponent::d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid); return; } else @@ -260,7 +260,7 @@ void InterventionalRadiologyController::init() if (!this->mState) { msg_error() << "No MechanicalState found. The component can not work and will be set to Invalid."; - sofa::core::objectmodel::BaseObject::d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid); + sofa::core::objectmodel::BaseComponent::d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid); return; } @@ -293,7 +293,7 @@ void InterventionalRadiologyController::init() applyInterventionalRadiologyController(); - sofa::core::objectmodel::BaseObject::d_componentState.setValue(sofa::core::objectmodel::ComponentState::Valid); + sofa::core::objectmodel::BaseComponent::d_componentState.setValue(sofa::core::objectmodel::ComponentState::Valid); } template diff --git a/src/BeamAdapter/component/controller/SutureController.inl b/src/BeamAdapter/component/controller/SutureController.inl index cb0aad4de..a427a8396 100644 --- a/src/BeamAdapter/component/controller/SutureController.inl +++ b/src/BeamAdapter/component/controller/SutureController.inl @@ -1205,8 +1205,8 @@ void SutureController::draw(const core::visual::VisualParams* vparams for (unsigned int i=0; i(m_rigidCurveSegments[i].second - m_rigidCurveSegments[i].first); + sofa::type::Vec3f sizeArrows (Length/4, Length/8, Length/8); vparams->drawTool()->drawFrame(m_vecGlobalHGravityCenter[i].getOrigin(), m_vecGlobalHGravityCenter[i].getOrientation(), sizeArrows); } diff --git a/src/BeamAdapter/component/engine/WireRestShape.h b/src/BeamAdapter/component/engine/WireRestShape.h index f866a226e..eadf4e473 100644 --- a/src/BeamAdapter/component/engine/WireRestShape.h +++ b/src/BeamAdapter/component/engine/WireRestShape.h @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include @@ -55,10 +55,10 @@ using sofa::core::loader::MeshLoader; * This component compute the beam discretization and the shape functions on multiple segments using curvilinear abscissa. */ template -class WireRestShape : public core::objectmodel::BaseObject +class WireRestShape : public core::objectmodel::BaseComponent { public: - SOFA_CLASS(WireRestShape, core::objectmodel::BaseObject); + SOFA_CLASS(WireRestShape, core::objectmodel::BaseComponent); using Coord = typename DataTypes::Coord; using Real = typename Coord::value_type; @@ -76,7 +76,7 @@ class WireRestShape : public core::objectmodel::BaseObject */ virtual ~WireRestShape() = default; - /////////////////////////// Inherited from BaseObject ////////////////////////////////////////// + /////////////////////////// Inherited from BaseComponent ////////////////////////////////////////// void init() override ; diff --git a/src/BeamAdapter/component/forcefield/AdaptiveBeamForceFieldAndMass.h b/src/BeamAdapter/component/forcefield/AdaptiveBeamForceFieldAndMass.h index 2bea4791e..60c14cdd5 100644 --- a/src/BeamAdapter/component/forcefield/AdaptiveBeamForceFieldAndMass.h +++ b/src/BeamAdapter/component/forcefield/AdaptiveBeamForceFieldAndMass.h @@ -108,7 +108,7 @@ class AdaptiveBeamForceFieldAndMass : public core::behavior::Mass ///////////////////////////////////// - /// This is inhereted from BaseObject + /// This is inhereted from BaseComponent ///////////////////////////////////// void init() override ; void reinit() override ; diff --git a/src/BeamAdapter/component/forcefield/AdaptiveInflatableBeamForceField.h b/src/BeamAdapter/component/forcefield/AdaptiveInflatableBeamForceField.h index fb35a2f4c..216264acc 100644 --- a/src/BeamAdapter/component/forcefield/AdaptiveInflatableBeamForceField.h +++ b/src/BeamAdapter/component/forcefield/AdaptiveInflatableBeamForceField.h @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include @@ -143,7 +143,7 @@ class AdaptiveInflatableBeamForceField : public Mass ///////////////////////////////////// - /// This is inhereted from BaseObject + /// This is inhereted from BaseComponent ///////////////////////////////////// virtual void init() override ; virtual void reinit() override ; diff --git a/src/BeamAdapter/component/forcefield/AdaptiveInflatableBeamForceField.inl b/src/BeamAdapter/component/forcefield/AdaptiveInflatableBeamForceField.inl index 9566c6019..83ab47b76 100644 --- a/src/BeamAdapter/component/forcefield/AdaptiveInflatableBeamForceField.inl +++ b/src/BeamAdapter/component/forcefield/AdaptiveInflatableBeamForceField.inl @@ -796,10 +796,10 @@ template void AdaptiveInflatableBeamForceField::drawElement(const VisualParams *vparams, int beam, Transform &global_H0_local, Transform &global_H1_local) { - double length = (double) l_interpolation->getLength(beam); + float length = static_cast(l_interpolation->getLength(beam)); /// ARROWS - Vec3 sizeArrows (length/4., length/8., length/8.); + type::Vec3f sizeArrows (length/4., length/8., length/8.); vparams->drawTool()->drawFrame(global_H0_local.getOrigin(), global_H0_local.getOrientation(), sizeArrows); vparams->drawTool()->drawFrame(global_H1_local.getOrigin(), global_H1_local.getOrientation(), sizeArrows); diff --git a/src/BeamAdapter/component/mapping/MultiAdaptiveBeamMapping.inl b/src/BeamAdapter/component/mapping/MultiAdaptiveBeamMapping.inl index 3994568eb..894357069 100644 --- a/src/BeamAdapter/component/mapping/MultiAdaptiveBeamMapping.inl +++ b/src/BeamAdapter/component/mapping/MultiAdaptiveBeamMapping.inl @@ -287,7 +287,7 @@ void MultiAdaptiveBeamMapping< TIn, TOut>::init() if (!ircontroller) { msg_error() << "No InterventionalRadiologyController found, this component cannot work and will be invalid."; - sofa::core::objectmodel::BaseObject::d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid); + sofa::core::objectmodel::BaseComponent::d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid); return; } else diff --git a/src/BeamAdapter/component/model/BaseRodSectionMaterial.h b/src/BeamAdapter/component/model/BaseRodSectionMaterial.h index 03a450ad6..cb74801dd 100644 --- a/src/BeamAdapter/component/model/BaseRodSectionMaterial.h +++ b/src/BeamAdapter/component/model/BaseRodSectionMaterial.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -48,10 +48,10 @@ using sofa::core::loader::MeshLoader; * - Mechanical parameters: @sa d_poissonRatio and @sa d_youngModulus */ template -class BaseRodSectionMaterial : public core::objectmodel::BaseObject +class BaseRodSectionMaterial : public core::objectmodel::BaseComponent { public: - SOFA_CLASS(SOFA_TEMPLATE(BaseRodSectionMaterial, DataTypes), core::objectmodel::BaseObject); + SOFA_CLASS(SOFA_TEMPLATE(BaseRodSectionMaterial, DataTypes), core::objectmodel::BaseComponent); using Coord = typename DataTypes::Coord; using Real = typename Coord::value_type; @@ -60,12 +60,12 @@ class BaseRodSectionMaterial : public core::objectmodel::BaseObject using Quat = sofa::type::Quat; using Size = sofa::Size; - /////////////////////////// Inherited from BaseObject ////////////////////////////////////////// + /////////////////////////// Inherited from BaseComponent ////////////////////////////////////////// /// Default Constructor BaseRodSectionMaterial(); - /// init method from BaseObject API. Will call internal @see initSection to be overriden by children + /// init method from BaseComponent API. Will call internal @see initSection to be overriden by children void init() override; diff --git a/src/BeamAdapter/component/model/RodMeshSection.inl b/src/BeamAdapter/component/model/RodMeshSection.inl index 81b57bd0d..61eee6e4e 100644 --- a/src/BeamAdapter/component/model/RodMeshSection.inl +++ b/src/BeamAdapter/component/model/RodMeshSection.inl @@ -23,7 +23,7 @@ #include #include -#include +#include #define EPSILON 0.0001 diff --git a/src/BeamAdapter/component/model/RodSpireSection.inl b/src/BeamAdapter/component/model/RodSpireSection.inl index 8bc409a67..b15a4e2ad 100644 --- a/src/BeamAdapter/component/model/RodSpireSection.inl +++ b/src/BeamAdapter/component/model/RodSpireSection.inl @@ -23,7 +23,7 @@ #include #include -#include +#include namespace beamadapter { diff --git a/src/BeamAdapter/component/model/RodStraightSection.inl b/src/BeamAdapter/component/model/RodStraightSection.inl index 7d939fd00..e74851ca0 100644 --- a/src/BeamAdapter/component/model/RodStraightSection.inl +++ b/src/BeamAdapter/component/model/RodStraightSection.inl @@ -23,7 +23,7 @@ #include #include -#include +#include namespace beamadapter { diff --git a/src/BeamAdapter/utils/deprecatedcomponent.h b/src/BeamAdapter/utils/deprecatedcomponent.h index 2725db209..a30313a72 100644 --- a/src/BeamAdapter/utils/deprecatedcomponent.h +++ b/src/BeamAdapter/utils/deprecatedcomponent.h @@ -21,19 +21,19 @@ ******************************************************************************/ #pragma once -#include +#include namespace sofa::component { -using sofa::core::objectmodel::BaseObject ; +using sofa::core::objectmodel::BaseComponent ; using sofa::core::objectmodel::BaseContext ; using sofa::core::objectmodel::BaseObjectDescription ; -class DeprecatedComponent : public BaseObject +class DeprecatedComponent : public BaseComponent { public: - SOFA_CLASS(DeprecatedComponent, BaseObject) ; + SOFA_CLASS(DeprecatedComponent, BaseComponent) ; /// Pre-construction check method called by ObjectFactory. template