diff --git a/Sofa/Component/Collision/Detection/Algorithm/tests/CollisionPipeline_test.cpp b/Sofa/Component/Collision/Detection/Algorithm/tests/CollisionPipeline_test.cpp index 3078fc26c56..1550fc6e454 100644 --- a/Sofa/Component/Collision/Detection/Algorithm/tests/CollisionPipeline_test.cpp +++ b/Sofa/Component/Collision/Detection/Algorithm/tests/CollisionPipeline_test.cpp @@ -29,7 +29,6 @@ using std::string; using sofa::core::execparams::defaultInstance; #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::component::collision::detection::algorithm::CollisionPipeline ; @@ -111,7 +110,7 @@ void TestCollisionPipeline::checkCollisionPipelineWithNoAttributes() ASSERT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* clp = root->getObject("pipeline") ; + sofa::core::objectmodel::BaseObject* clp = root->getObject("pipeline") ; ASSERT_NE(clp, nullptr) ; } @@ -133,7 +132,7 @@ void TestCollisionPipeline::checkCollisionPipelineWithMissingIntersection() ASSERT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* clp = root->getObject("pipeline") ; + sofa::core::objectmodel::BaseComponent* clp = root->getObject("pipeline") ; ASSERT_NE(clp, nullptr) ; } @@ -155,7 +154,7 @@ void TestCollisionPipeline::checkCollisionPipelineWithMissingBroadPhase() ASSERT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* clp = root->getObject("pipeline") ; + sofa::core::objectmodel::BaseComponent* clp = root->getObject("pipeline") ; ASSERT_NE(clp, nullptr) ; } void TestCollisionPipeline::checkCollisionPipelineWithMissingNarrowPhase() @@ -176,7 +175,7 @@ void TestCollisionPipeline::checkCollisionPipelineWithMissingNarrowPhase() ASSERT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* clp = root->getObject("pipeline") ; + sofa::core::objectmodel::BaseComponent* clp = root->getObject("pipeline") ; ASSERT_NE(clp, nullptr) ; } void TestCollisionPipeline::checkCollisionPipelineWithMissingContactManager() @@ -197,7 +196,7 @@ void TestCollisionPipeline::checkCollisionPipelineWithMissingContactManager() ASSERT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* clp = root->getObject("pipeline") ; + sofa::core::objectmodel::BaseComponent* clp = root->getObject("pipeline") ; ASSERT_NE(clp, nullptr) ; } diff --git a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/LineCollisionModel.h b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/LineCollisionModel.h index 43f0c2c7830..882c8991d69 100644 --- a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/LineCollisionModel.h +++ b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/LineCollisionModel.h @@ -150,7 +150,7 @@ public : "' found in the context node."); return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } sofa::core::topology::BaseMeshTopology* getCollisionTopology() override diff --git a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/PointCollisionModel.h b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/PointCollisionModel.h index babfd1cf3e4..af6f5c7a158 100644 --- a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/PointCollisionModel.h +++ b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/PointCollisionModel.h @@ -116,7 +116,7 @@ class PointCollisionModel : public core::CollisionModel "' found in the context node."); return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } void computeBBox(const core::ExecParams* params, bool onlyVisible) override; diff --git a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/SphereCollisionModel.h b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/SphereCollisionModel.h index be5dd53cdf8..862544eca43 100644 --- a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/SphereCollisionModel.h +++ b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/SphereCollisionModel.h @@ -134,7 +134,7 @@ class SphereCollisionModel : public core::CollisionModel return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } template diff --git a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleCollisionModel.h b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleCollisionModel.h index 0b8e2aa5e36..7d89b77d3d7 100644 --- a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleCollisionModel.h +++ b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleCollisionModel.h @@ -207,7 +207,7 @@ class TriangleCollisionModel : public core::CollisionModel "' found in the context node."); return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } void computeBBox(const core::ExecParams* params, bool onlyVisible=false) override; diff --git a/Sofa/Component/Collision/Geometry/tests/Sphere_test.cpp b/Sofa/Component/Collision/Geometry/tests/Sphere_test.cpp index 8f14b6da125..97a4405ba82 100644 --- a/Sofa/Component/Collision/Geometry/tests/Sphere_test.cpp +++ b/Sofa/Component/Collision/Geometry/tests/Sphere_test.cpp @@ -30,7 +30,6 @@ using std::vector; using std::string; #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::simulation::Node ; @@ -434,7 +433,7 @@ void checkAttributes() EXPECT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* theSphere = root->getTreeNode("Level 1")->getObject("spheremodel") ; + sofa::core::objectmodel::BaseComponent* theSphere = root->getTreeNode("Level 1")->getObject("spheremodel") ; EXPECT_NE(theSphere, nullptr) ; /// List of the supported attributes the user expect to find @@ -462,7 +461,7 @@ void checkSceneWithVec3MechanicalModel() EXPECT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* theSphere = root->getTreeNode("Level 1")->getObject("spheremodel") ; + sofa::core::objectmodel::BaseComponent* theSphere = root->getTreeNode("Level 1")->getObject("spheremodel") ; EXPECT_NE(theSphere, nullptr) ; } @@ -481,7 +480,7 @@ void checkSceneWithRigid3dMechanicalModel() EXPECT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* theSphere = root->getTreeNode("Level 1")->getObject("spheremodel") ; + sofa::core::objectmodel::BaseComponent* theSphere = root->getTreeNode("Level 1")->getObject("spheremodel") ; EXPECT_NE(theSphere, nullptr) ; } diff --git a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/ContactListener.h b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/ContactListener.h index 9dcbaba1ae3..555ad0d2692 100644 --- a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/ContactListener.h +++ b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/ContactListener.h @@ -104,7 +104,7 @@ class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API ContactListener : public vir return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } template diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/BoxROI.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/BoxROI.h index 21c7878a2e9..bbf45b01428 100644 --- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/BoxROI.h +++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/BoxROI.h @@ -43,8 +43,7 @@ namespace sofa::component::engine::select::boxroi using core::topology::BaseMeshTopology ; using core::behavior::MechanicalState ; using core::objectmodel::BaseContext ; - using core::objectmodel::BaseObject ; - using core::visual::VisualParams ; + using core::visual::VisualParams ; using core::objectmodel::Event ; using core::ExecParams ; using core::DataEngine ; diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PairBoxRoi.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PairBoxRoi.h index 496a4b70b94..953f71320dd 100644 --- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PairBoxRoi.h +++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PairBoxRoi.h @@ -84,7 +84,7 @@ class PairBoxROI : public core::DataEngine } } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } protected: diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PlaneROI.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PlaneROI.h index 631a295fc77..f4b814f03ef 100644 --- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PlaneROI.h +++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PlaneROI.h @@ -88,7 +88,7 @@ class PlaneROI : public core::DataEngine } } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } protected: diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ProximityROI.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ProximityROI.h index 9e25ba3ae15..da9a26a6fe8 100644 --- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ProximityROI.h +++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ProximityROI.h @@ -82,7 +82,7 @@ class ProximityROI : public core::DataEngine } } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } public: diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/SubsetTopology.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/SubsetTopology.h index e6cfb51c47d..e7a33114904 100644 --- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/SubsetTopology.h +++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/SubsetTopology.h @@ -89,7 +89,7 @@ class SubsetTopology : public core::DataEngine } } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } protected: diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ValuesFromPositions.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ValuesFromPositions.h index 0c96979d6a2..7895db4afe0 100644 --- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ValuesFromPositions.h +++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ValuesFromPositions.h @@ -86,7 +86,7 @@ class ValuesFromPositions : public core::DataEngine } } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } protected: diff --git a/Sofa/Component/Engine/Select/tests/BoxROI_test.cpp b/Sofa/Component/Engine/Select/tests/BoxROI_test.cpp index 08425f2c4cb..a0c5c6c1fbd 100644 --- a/Sofa/Component/Engine/Select/tests/BoxROI_test.cpp +++ b/Sofa/Component/Engine/Select/tests/BoxROI_test.cpp @@ -42,7 +42,6 @@ using sofa::simulation::Simulation; using sofa::simulation::graph::DAGSimulation; #include using sofa::simulation::Node; -using sofa::core::objectmodel::BaseObject; using sofa::core::objectmodel::BaseData; using sofa::core::objectmodel::New; using sofa::defaulttype::Vec3Types; @@ -133,7 +132,7 @@ struct BoxROITest : public sofa::testing::BaseTest EXPECT_NE(root.get(), nullptr); root->init(sofa::core::execparams::defaultInstance()); - BaseObject* boxroi = root->getTreeNode("Level 1")->getObject("myBoxROI"); + sofa::core::objectmodel::BaseComponent* boxroi = root->getTreeNode("Level 1")->getObject("myBoxROI"); EXPECT_NE(boxroi, nullptr); EXPECT_EQ(boxroi->getComponentState(), ComponentState::Invalid ) << "The component cannot be initialized because it is missing a MechanicalObject. " @@ -202,7 +201,7 @@ struct BoxROITest : public sofa::testing::BaseTest const Node::SPtr root = SceneLoaderXML::loadFromMemory("testscene", scene.c_str()); EXPECT_NE(root.get(), nullptr); root->init(sofa::core::execparams::defaultInstance()); - BaseObject* boxroi = root->getTreeNode("Level 1")->getObject("myBoxROI"); + sofa::core::objectmodel::BaseComponent* boxroi = root->getTreeNode("Level 1")->getObject("myBoxROI"); EXPECT_NE(boxroi, nullptr); EXPECT_EQ(boxroi->getComponentState(), ComponentState::Valid ) << "The component should succeed in being initialized because there is a MeshLoader and a TopologyContainer in the current context. "; diff --git a/Sofa/Component/Haptics/src/sofa/component/haptics/LCPForceFeedback.h b/Sofa/Component/Haptics/src/sofa/component/haptics/LCPForceFeedback.h index 739924ee13a..f8c2bd6ec0f 100644 --- a/Sofa/Component/Haptics/src/sofa/component/haptics/LCPForceFeedback.h +++ b/Sofa/Component/Haptics/src/sofa/component/haptics/LCPForceFeedback.h @@ -104,7 +104,7 @@ class LCPForceFeedback : public MechanicalStateForceFeedback return false; } - return core::objectmodel::BaseObject::canCreate(obj, context, arg); + return core::objectmodel::BaseComponent::canCreate(obj, context, arg); } /// Override method to lock or unlock the force feedback computation. According to parameter, value == true (resp. false) will lock (resp. unlock) mutex @sa lockForce diff --git a/Sofa/Component/IO/Mesh/src/sofa/component/io/mesh/BaseVTKReader.h b/Sofa/Component/IO/Mesh/src/sofa/component/io/mesh/BaseVTKReader.h index 3e66049734c..6a219de4a06 100644 --- a/Sofa/Component/IO/Mesh/src/sofa/component/io/mesh/BaseVTKReader.h +++ b/Sofa/Component/IO/Mesh/src/sofa/component/io/mesh/BaseVTKReader.h @@ -36,7 +36,6 @@ namespace sofa::component::io::mesh::basevtkreader /// So that you can access to BaseVTKReader with /// sofa::component::loader::BaseVTKReader or sofa::component::loader::basevtkreader::BaseVTKReader -using sofa::core::objectmodel::BaseObject ; using sofa::core::objectmodel::BaseData ; using std::ofstream ; @@ -49,10 +48,10 @@ enum class VTKDatasetFormat { IMAGE_DATA, STRUCTURED_POINTS, POLYDATA, UNSTRUCTURED_GRID }; -class BaseVTKReader : public BaseObject +class BaseVTKReader : public sofa::core::objectmodel::BaseObject { public: - class BaseVTKDataIO : public BaseObject + class BaseVTKDataIO : public sofa::core::objectmodel::BaseObject { public: string name; diff --git a/Sofa/Component/IO/Mesh/src/sofa/component/io/mesh/BlenderExporter.h b/Sofa/Component/IO/Mesh/src/sofa/component/io/mesh/BlenderExporter.h index 785dbfc659b..8168a745917 100644 --- a/Sofa/Component/IO/Mesh/src/sofa/component/io/mesh/BlenderExporter.h +++ b/Sofa/Component/IO/Mesh/src/sofa/component/io/mesh/BlenderExporter.h @@ -105,7 +105,7 @@ class SOFA_COMPONENT_IO_MESH_API BlenderExporter: public sofa::simulation::BaseS "' found in the context node."); return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } }; diff --git a/Sofa/Component/IO/Mesh/src/sofa/component/io/mesh/MeshVTKLoader.cpp b/Sofa/Component/IO/Mesh/src/sofa/component/io/mesh/MeshVTKLoader.cpp index c169ef3a54b..868f9da0182 100644 --- a/Sofa/Component/IO/Mesh/src/sofa/component/io/mesh/MeshVTKLoader.cpp +++ b/Sofa/Component/IO/Mesh/src/sofa/component/io/mesh/MeshVTKLoader.cpp @@ -51,7 +51,6 @@ using namespace sofa::defaulttype; using namespace sofa::helper; using sofa::core::objectmodel::ComponentState; using sofa::core::objectmodel::BaseData ; -using sofa::core::objectmodel::BaseObject ; using sofa::type::Vec3 ; using sofa::type::Vec ; using std::istringstream; diff --git a/Sofa/Component/IO/Mesh/tests/MeshExporter_test.cpp b/Sofa/Component/IO/Mesh/tests/MeshExporter_test.cpp index 112017d7a2d..292a4d5b135 100644 --- a/Sofa/Component/IO/Mesh/tests/MeshExporter_test.cpp +++ b/Sofa/Component/IO/Mesh/tests/MeshExporter_test.cpp @@ -31,7 +31,6 @@ using std::string; using sofa::testing::BaseSimulationTest; #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::simulation::graph::DAGSimulation ; diff --git a/Sofa/Component/IO/Mesh/tests/STLExporter_test.cpp b/Sofa/Component/IO/Mesh/tests/STLExporter_test.cpp index 9753bd4101c..87ba7f07a97 100644 --- a/Sofa/Component/IO/Mesh/tests/STLExporter_test.cpp +++ b/Sofa/Component/IO/Mesh/tests/STLExporter_test.cpp @@ -29,7 +29,6 @@ using std::string; using sofa::testing::BaseSimulationTest; #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::simulation::graph::DAGSimulation ; diff --git a/Sofa/Component/IO/Mesh/tests/VisualModelOBJExporter_test.cpp b/Sofa/Component/IO/Mesh/tests/VisualModelOBJExporter_test.cpp index eeb1810bcd0..95e220789ba 100644 --- a/Sofa/Component/IO/Mesh/tests/VisualModelOBJExporter_test.cpp +++ b/Sofa/Component/IO/Mesh/tests/VisualModelOBJExporter_test.cpp @@ -29,7 +29,6 @@ using std::string; using sofa::testing::BaseSimulationTest; #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::simulation::graph::DAGSimulation ; diff --git a/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/PrecomputedWarpPreconditioner.h b/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/PrecomputedWarpPreconditioner.h index 74ae12683ac..bd57f8d29e8 100644 --- a/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/PrecomputedWarpPreconditioner.h +++ b/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/PrecomputedWarpPreconditioner.h @@ -141,7 +141,7 @@ class PrecomputedWarpPreconditioner : public sofa::component::linearsolver::Matr arg->logError(std::string("No mechanical state with the datatype '") + TDataTypes::Name() + "' 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); } protected : diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BarycentricMappers/BarycentricMapper.h b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BarycentricMappers/BarycentricMapper.h index 40113a11e61..b4635ebf70e 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BarycentricMappers/BarycentricMapper.h +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BarycentricMappers/BarycentricMapper.h @@ -60,10 +60,10 @@ class BarycentricMapper : public virtual core::objectmodel::BaseObject public: - using BaseObject::init; + using BaseComponent::init; virtual void init(const typename Out::VecCoord& out, const typename In::VecCoord& in) = 0; - using BaseObject::draw; + using BaseComponent::draw; virtual void draw(const core::visual::VisualParams*, const typename Out::VecCoord& out, const typename In::VecCoord& in) = 0; virtual void apply( typename Out::VecCoord& out, const typename In::VecCoord& in ) = 0; diff --git a/Sofa/Component/Mass/tests/DiagonalMass_test.cpp b/Sofa/Component/Mass/tests/DiagonalMass_test.cpp index 69956206f6f..5802a077ef7 100644 --- a/Sofa/Component/Mass/tests/DiagonalMass_test.cpp +++ b/Sofa/Component/Mass/tests/DiagonalMass_test.cpp @@ -62,7 +62,6 @@ using namespace sofa::defaulttype; using namespace sofa::component::topology::container::dynamic; using sofa::core::objectmodel::New; -using sofa::core::objectmodel::BaseObject; using sofa::component::mass::DiagonalMass; using sofa::component::statecontainer::MechanicalObject; @@ -115,7 +114,7 @@ class DiagonalMass_test : public BaseTest sofa::simulation::node::unload(root); } - void createSceneGraph(VecCoord positions, BaseObject::SPtr topologyContainer, BaseObject::SPtr geometryAlgorithms) + void createSceneGraph(VecCoord positions, sofa::core::objectmodel::BaseComponent::SPtr topologyContainer, sofa::core::objectmodel::BaseComponent::SPtr geometryAlgorithms) { node = root->createChild("node"); mstate = New >(); @@ -143,7 +142,7 @@ class DiagonalMass_test : public BaseTest EXPECT_NEAR(expectedMass[i], mass->d_vertexMass.getValue()[i], 1e-4); } - void runTest(VecCoord positions, BaseObject::SPtr topologyContainer, BaseObject::SPtr geometryAlgorithms, + void runTest(VecCoord positions, sofa::core::objectmodel::BaseComponent::SPtr topologyContainer, sofa::core::objectmodel::BaseComponent::SPtr geometryAlgorithms, MassType expectedTotalMass, const VecMass& expectedMass) { createSceneGraph(positions, topologyContainer, geometryAlgorithms); diff --git a/Sofa/Component/Mass/tests/MeshMatrixMass_test.cpp b/Sofa/Component/Mass/tests/MeshMatrixMass_test.cpp index 156940134ad..ed18303c34a 100644 --- a/Sofa/Component/Mass/tests/MeshMatrixMass_test.cpp +++ b/Sofa/Component/Mass/tests/MeshMatrixMass_test.cpp @@ -65,7 +65,6 @@ using namespace sofa::defaulttype; using namespace sofa::component::topology::container::dynamic; using sofa::core::objectmodel::New; -using sofa::core::objectmodel::BaseObject; using sofa::component::mass::MeshMatrixMass; using sofa::component::statecontainer::MechanicalObject; @@ -118,7 +117,7 @@ class MeshMatrixMass_test : public BaseTest sofa::simulation::node::unload(root); } - void createSceneGraph(VecCoord positions, BaseObject::SPtr topologyContainer, BaseObject::SPtr geometryAlgorithms) + void createSceneGraph(VecCoord positions, sofa::core::objectmodel::BaseComponent::SPtr topologyContainer, sofa::core::objectmodel::BaseComponent::SPtr geometryAlgorithms) { node = root->createChild("node"); mstate = New >(); @@ -161,7 +160,7 @@ class MeshMatrixMass_test : public BaseTest } } - void runTest(VecCoord positions, BaseObject::SPtr topologyContainer, BaseObject::SPtr geometryAlgorithms, + void runTest(VecCoord positions, sofa::core::objectmodel::BaseComponent::SPtr topologyContainer, sofa::core::objectmodel::BaseComponent::SPtr geometryAlgorithms, MassType expectedTotalMass, MassType expectedMassDensity, const VecMass& expectedVMass, const VecMass& expectedEMass) { createSceneGraph(positions, topologyContainer, geometryAlgorithms); diff --git a/Sofa/Component/MechanicalLoad/tests/PlaneForceField_test.cpp b/Sofa/Component/MechanicalLoad/tests/PlaneForceField_test.cpp index 20eced1a952..2d097f667e6 100644 --- a/Sofa/Component/MechanicalLoad/tests/PlaneForceField_test.cpp +++ b/Sofa/Component/MechanicalLoad/tests/PlaneForceField_test.cpp @@ -27,7 +27,6 @@ using sofa::testing::BaseSimulationTest; using sofa::simulation::Simulation ; using sofa::simulation::graph::DAGSimulation ; using sofa::simulation::Node ; -using sofa::core::objectmodel::BaseObject ; using sofa::core::objectmodel::BaseData ; using sofa::core::objectmodel::New ; using sofa::core::execparams::defaultInstance; diff --git a/Sofa/Component/Playback/src/sofa/component/playback/CompareState.h b/Sofa/Component/Playback/src/sofa/component/playback/CompareState.h index 3d85f2e450a..b501ab6453c 100644 --- a/Sofa/Component/Playback/src/sofa/component/playback/CompareState.h +++ b/Sofa/Component/Playback/src/sofa/component/playback/CompareState.h @@ -57,7 +57,7 @@ class SOFA_COMPONENT_PLAYBACK_API CompareState: public ReadState arg->logError("No mechanical state found in the context node."); return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } /// Return the total errors (position and velocity) diff --git a/Sofa/Component/Playback/src/sofa/component/playback/CompareTopology.h b/Sofa/Component/Playback/src/sofa/component/playback/CompareTopology.h index f96da0cb725..facf0cec367 100644 --- a/Sofa/Component/Playback/src/sofa/component/playback/CompareTopology.h +++ b/Sofa/Component/Playback/src/sofa/component/playback/CompareTopology.h @@ -57,7 +57,7 @@ class SOFA_COMPONENT_PLAYBACK_API CompareTopology: public ReadTopology arg->logError("Cannot find a mesh topology in the current context"); return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } /// Return the total number of errors diff --git a/Sofa/Component/Playback/src/sofa/component/playback/ReadState.h b/Sofa/Component/Playback/src/sofa/component/playback/ReadState.h index 9b816fc4684..0ba35f536ef 100644 --- a/Sofa/Component/Playback/src/sofa/component/playback/ReadState.h +++ b/Sofa/Component/Playback/src/sofa/component/playback/ReadState.h @@ -91,7 +91,7 @@ class SOFA_COMPONENT_PLAYBACK_API ReadState: public core::objectmodel::BaseObjec arg->logError("No mechanical state found in the context node."); return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } diff --git a/Sofa/Component/Playback/src/sofa/component/playback/ReadTopology.h b/Sofa/Component/Playback/src/sofa/component/playback/ReadTopology.h index a83d0390d4d..2c63f7aef63 100644 --- a/Sofa/Component/Playback/src/sofa/component/playback/ReadTopology.h +++ b/Sofa/Component/Playback/src/sofa/component/playback/ReadTopology.h @@ -90,7 +90,7 @@ class SOFA_COMPONENT_PLAYBACK_API ReadTopology: public core::objectmodel::BaseOb return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } diff --git a/Sofa/Component/Playback/src/sofa/component/playback/WriteState.h b/Sofa/Component/Playback/src/sofa/component/playback/WriteState.h index fe78b4c38d9..a107b38517f 100644 --- a/Sofa/Component/Playback/src/sofa/component/playback/WriteState.h +++ b/Sofa/Component/Playback/src/sofa/component/playback/WriteState.h @@ -103,7 +103,7 @@ class SOFA_COMPONENT_PLAYBACK_API WriteState: public core::objectmodel::BaseObje arg->logError("No mechanical state found in the context node."); return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } }; diff --git a/Sofa/Component/Playback/src/sofa/component/playback/WriteTopology.h b/Sofa/Component/Playback/src/sofa/component/playback/WriteTopology.h index 36795dad9e9..fc1bb551ec6 100644 --- a/Sofa/Component/Playback/src/sofa/component/playback/WriteTopology.h +++ b/Sofa/Component/Playback/src/sofa/component/playback/WriteTopology.h @@ -93,7 +93,7 @@ class SOFA_COMPONENT_PLAYBACK_API WriteTopology: public core::objectmodel::BaseO return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } }; diff --git a/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/APIVersion.h b/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/APIVersion.h index 0799c9c44dd..0cafabeca95 100644 --- a/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/APIVersion.h +++ b/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/APIVersion.h @@ -24,17 +24,16 @@ #include #include -using sofa::core::objectmodel::BaseObject ; namespace sofa::component::sceneutility::_apiversion_ { -class SOFA_COMPONENT_SCENEUTILITY_API APIVersion : public BaseObject +class SOFA_COMPONENT_SCENEUTILITY_API APIVersion : public sofa::core::objectmodel::BaseObject { public: - SOFA_CLASS(APIVersion, BaseObject); + SOFA_CLASS(APIVersion, sofa::core::objectmodel::BaseObject); const std::string& getApiLevel() ; void init() override ; diff --git a/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/InfoComponent.h b/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/InfoComponent.h index fab657df4fc..bcfdeef3c2a 100644 --- a/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/InfoComponent.h +++ b/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/InfoComponent.h @@ -32,14 +32,13 @@ namespace sofa::component::sceneutility::infocomponent /// fearing it will leak names into the global namespace. When closing this namespace /// selected object from this per-file namespace are then imported into their parent namespace. /// for ease of use -using sofa::core::objectmodel::BaseObject ; /// Despite this component does absolutely nothing... it is very useful as it can be used to /// retain information scene graph. -class SOFA_COMPONENT_SCENEUTILITY_API InfoComponent : public BaseObject +class SOFA_COMPONENT_SCENEUTILITY_API InfoComponent : public sofa::core::objectmodel::BaseComponent { public: - SOFA_CLASS(InfoComponent, BaseObject); + SOFA_CLASS(InfoComponent, sofa::core::objectmodel::BaseComponent); InfoComponent() {} ~InfoComponent() override{} diff --git a/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/MessageHandlerComponent.cpp b/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/MessageHandlerComponent.cpp index d800a95f905..b7acc2e062d 100644 --- a/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/MessageHandlerComponent.cpp +++ b/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/MessageHandlerComponent.cpp @@ -65,7 +65,7 @@ MessageHandlerComponent::MessageHandlerComponent() : void MessageHandlerComponent::parse ( core::objectmodel::BaseObjectDescription* arg ) { - BaseObject::parse(arg) ; + BaseComponent::parse(arg) ; const char* type=arg->getAttribute("handler") ; if(type==nullptr){ @@ -123,7 +123,7 @@ FileMessageHandlerComponent::~FileMessageHandlerComponent() void FileMessageHandlerComponent::parse ( core::objectmodel::BaseObjectDescription* arg ) { - BaseObject::parse(arg) ; + BaseComponent::parse(arg) ; const char* type=arg->getAttribute("filename") ; if(type==nullptr){ diff --git a/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/PauseAnimation.cpp b/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/PauseAnimation.cpp index 9ac0a51e009..acc7b85029f 100644 --- a/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/PauseAnimation.cpp +++ b/Sofa/Component/SceneUtility/src/sofa/component/sceneutility/PauseAnimation.cpp @@ -37,7 +37,7 @@ PauseAnimation::~PauseAnimation() void PauseAnimation::init() { - BaseObject::init(); + BaseComponent::init(); const simulation::Node *context = dynamic_cast(this->getContext()); root = dynamic_cast(context->getRootContext()); diff --git a/Sofa/Component/SolidMechanics/FEM/HyperElastic/src/sofa/component/solidmechanics/fem/hyperelastic/material/BaseMaterial.h b/Sofa/Component/SolidMechanics/FEM/HyperElastic/src/sofa/component/solidmechanics/fem/hyperelastic/material/BaseMaterial.h index 3d543cdf1a1..260728f86f8 100644 --- a/Sofa/Component/SolidMechanics/FEM/HyperElastic/src/sofa/component/solidmechanics/fem/hyperelastic/material/BaseMaterial.h +++ b/Sofa/Component/SolidMechanics/FEM/HyperElastic/src/sofa/component/solidmechanics/fem/hyperelastic/material/BaseMaterial.h @@ -42,7 +42,7 @@ class SOFA_COMPONENT_SOLIDMECHANICS_FEM_HYPERELASTIC_API BaseMaterial : public v void init() override { - this->core::objectmodel::BaseObject::init(); + this->core::objectmodel::BaseComponent::init(); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetGeometryAlgorithms.h b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetGeometryAlgorithms.h index 1be126bdaa8..9a8e6e60de3 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetGeometryAlgorithms.h +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetGeometryAlgorithms.h @@ -101,7 +101,7 @@ class PointSetGeometryAlgorithms : public core::topology::GeometryAlgorithms "' found in the context node."); return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } /** \brief Called by the state change callback to initialize added diff --git a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/GridTopology.h b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/GridTopology.h index 3873134d709..7c8df35f85a 100644 --- a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/GridTopology.h +++ b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/GridTopology.h @@ -158,7 +158,7 @@ using MeshTopology::getHexahedron; /// get Z from Point index @param i, will call @sa getPoint SReal getPZ(Index i) const override { return getPoint(i)[2]; } - /// Overload method from \sa BaseObject::parse . /// Parse the given description to assign values to this object's fields and potentially other parameters + /// Overload method from \sa BaseComponent::parse . /// Parse the given description to assign values to this object's fields and potentially other parameters void parse(core::objectmodel::BaseObjectDescription* arg) override ; /// Overload Method from @sa MeshTopology::getNbHexahedra diff --git a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/RegularGridTopology.h b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/RegularGridTopology.h index f5dfdf614b8..7b526fe2622 100644 --- a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/RegularGridTopology.h +++ b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/RegularGridTopology.h @@ -59,7 +59,7 @@ class SOFA_COMPONENT_TOPOLOGY_CONTAINER_GRID_API RegularGridTopology : public Gr /// BaseObject method should be overwritten by children void reinit() override; - /// Overload method from \sa BaseObject::parse . /// Parse the given description to assign values to this object's fields and potentially other parameters + /// Overload method from \sa BaseComponent::parse . /// Parse the given description to assign values to this object's fields and potentially other parameters void parse(core::objectmodel::BaseObjectDescription* arg) override; /** \brief Overload method of @sa GridTopology::getPointInGrid. diff --git a/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologicalChangeProcessor.h b/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologicalChangeProcessor.h index 2d7eeff331d..21afe5e3b42 100644 --- a/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologicalChangeProcessor.h +++ b/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologicalChangeProcessor.h @@ -127,7 +127,7 @@ class SOFA_COMPONENT_TOPOLOGY_UTILITY_API TopologicalChangeProcessor: public cor return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } void draw(const core::visual::VisualParams* vparams) override; diff --git a/Sofa/GL/Component/Rendering2D/tests/OglLabel_test.cpp b/Sofa/GL/Component/Rendering2D/tests/OglLabel_test.cpp index 20266fceafb..41028556b42 100644 --- a/Sofa/GL/Component/Rendering2D/tests/OglLabel_test.cpp +++ b/Sofa/GL/Component/Rendering2D/tests/OglLabel_test.cpp @@ -29,7 +29,6 @@ using std::string; using sofa::testing::BaseTest; #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::simulation::Simulation ; @@ -76,7 +75,7 @@ class OglLabelTest : public BaseTest root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* lm = root->getObject("label1") ; + sofa::core::objectmodel::BaseComponent* lm = root->getObject("label1") ; ASSERT_NE(nullptr, lm) ; OglLabel* ogllabel = dynamic_cast(lm); @@ -106,7 +105,7 @@ class OglLabelTest : public BaseTest ASSERT_NE(nullptr, root.get()) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* lm = root->getObject("label1") ; + sofa::core::objectmodel::BaseComponent* lm = root->getObject("label1") ; ASSERT_NE(nullptr, lm) ; OglLabel* ogllabel = dynamic_cast(lm); @@ -133,7 +132,7 @@ class OglLabelTest : public BaseTest ASSERT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* lm = root->getObject("label1") ; + sofa::core::objectmodel::BaseComponent* lm = root->getObject("label1") ; ASSERT_NE(lm, nullptr) ; /// List of the supported attributes the user expect to find diff --git a/Sofa/GL/Component/Rendering3D/tests/ClipPlane_test.cpp b/Sofa/GL/Component/Rendering3D/tests/ClipPlane_test.cpp index efe9e8b103c..5f2cd7a6764 100644 --- a/Sofa/GL/Component/Rendering3D/tests/ClipPlane_test.cpp +++ b/Sofa/GL/Component/Rendering3D/tests/ClipPlane_test.cpp @@ -29,7 +29,6 @@ using std::string; using sofa::testing::BaseTest; #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::simulation::Simulation ; @@ -89,7 +88,7 @@ void TestClipPlane::checkClipPlaneValidAttributes() ASSERT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* clp = root->getTreeNode("Level 1")->getObject("clipplane") ; + sofa::core::objectmodel::BaseObject* clp = root->getTreeNode("Level 1")->getObject("clipplane") ; ASSERT_NE(clp, nullptr) ; /// List of the supported attributes the user expect to find @@ -121,7 +120,7 @@ void TestClipPlane::checkClipPlaneAttributesValues(const std::string& dataname, ASSERT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* clp = root->getTreeNode("Level 1")->getObject("clipplane") ; + sofa::core::objectmodel::BaseObject* clp = root->getTreeNode("Level 1")->getObject("clipplane") ; ASSERT_NE(clp, nullptr) ; sofa::simulation::node::unload(root); diff --git a/Sofa/GL/Component/Shader/tests/LightManager_test.cpp b/Sofa/GL/Component/Shader/tests/LightManager_test.cpp index 27ced54f68f..74a83f36026 100644 --- a/Sofa/GL/Component/Shader/tests/LightManager_test.cpp +++ b/Sofa/GL/Component/Shader/tests/LightManager_test.cpp @@ -29,7 +29,6 @@ using std::string; using sofa::testing::BaseTest; #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::simulation::graph::DAGSimulation ; @@ -77,7 +76,7 @@ void checkAttributes() EXPECT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* lm = root->getTreeNode("Level 1")->getObject("lightmanager") ; + sofa::core::objectmodel::BaseObject* lm = root->getTreeNode("Level 1")->getObject("lightmanager") ; EXPECT_NE(lm, nullptr) ; /// List of the supported attributes the user expect to find diff --git a/Sofa/GL/Component/Shader/tests/Light_test.cpp b/Sofa/GL/Component/Shader/tests/Light_test.cpp index 34e4964347a..fd0e69921a6 100644 --- a/Sofa/GL/Component/Shader/tests/Light_test.cpp +++ b/Sofa/GL/Component/Shader/tests/Light_test.cpp @@ -8,7 +8,6 @@ using std::string; using sofa::testing::BaseTest; #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::simulation::graph::DAGSimulation ; @@ -18,7 +17,7 @@ using sofa::simulation::Node ; #include using sofa::simulation::SceneLoaderXML ; -using sofa::core::execparams::defaultInstance; +using sofa::core::execparams::defaultInstance; #include using sofa::helper::BackTrace ; @@ -80,7 +79,7 @@ void TestLight::checkLightMissingLightManager(const std::string& lighttype) ASSERT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* lm = root->getTreeNode("Level 1")->getObject("light1") ; + sofa::core::objectmodel::BaseComponent* lm = root->getTreeNode("Level 1")->getObject("light1") ; ASSERT_NE(lm, nullptr) ; sofa::simulation::node::unload(root); @@ -105,10 +104,10 @@ void TestLight::checkPositionalLightValidAttributes() ASSERT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* lm = root->getTreeNode("Level 1")->getObject("lightmanager") ; + sofa::core::objectmodel::BaseComponent* lm = root->getTreeNode("Level 1")->getObject("lightmanager") ; ASSERT_NE(lm, nullptr) ; - BaseObject* light = root->getTreeNode("Level 1")->getObject("light1") ; + sofa::core::objectmodel::BaseComponent* light = root->getTreeNode("Level 1")->getObject("light1") ; ASSERT_NE(light, nullptr) ; /// List of the supported attributes the user expect to find @@ -146,10 +145,10 @@ void TestLight::checkDirectionalLightValidAttributes() ASSERT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* lm = root->getTreeNode("Level 1")->getObject("lightmanager") ; + sofa::core::objectmodel::BaseComponent* lm = root->getTreeNode("Level 1")->getObject("lightmanager") ; ASSERT_NE(lm, nullptr) ; - BaseObject* light = root->getTreeNode("Level 1")->getObject("light1") ; + sofa::core::objectmodel::BaseComponent* light = root->getTreeNode("Level 1")->getObject("light1") ; ASSERT_NE(light, nullptr) ; /// List of the supported attributes the user expect to find @@ -187,10 +186,10 @@ void TestLight::checkSpotLightValidAttributes() ASSERT_NE(root.get(), nullptr) ; root->init(sofa::core::execparams::defaultInstance()) ; - BaseObject* lm = root->getTreeNode("Level 1")->getObject("lightmanager") ; + sofa::core::objectmodel::BaseComponent* lm = root->getTreeNode("Level 1")->getObject("lightmanager") ; ASSERT_NE(lm, nullptr) ; - BaseObject* light = root->getTreeNode("Level 1")->getObject("light1") ; + sofa::core::objectmodel::BaseComponent* light = root->getTreeNode("Level 1")->getObject("light1") ; ASSERT_NE(light, nullptr) ; /// List of the supported attributes the user expect to find diff --git a/Sofa/framework/Core/simutest/objectmodel/BaseLink_simutest.cpp b/Sofa/framework/Core/simutest/objectmodel/BaseLink_simutest.cpp index 76da1f529f1..dee3d284c6c 100644 --- a/Sofa/framework/Core/simutest/objectmodel/BaseLink_simutest.cpp +++ b/Sofa/framework/Core/simutest/objectmodel/BaseLink_simutest.cpp @@ -30,7 +30,6 @@ using sofa::testing::BaseSimulationTest ; using sofa::simulation::Node ; #include -using sofa::core::objectmodel::BaseObject; #include using sofa::core::PathResolver; diff --git a/Sofa/framework/Core/simutest/objectmodel/Base_test.cpp b/Sofa/framework/Core/simutest/objectmodel/Base_test.cpp index 5e2a456487d..f74bf3dc5b8 100644 --- a/Sofa/framework/Core/simutest/objectmodel/Base_test.cpp +++ b/Sofa/framework/Core/simutest/objectmodel/Base_test.cpp @@ -28,7 +28,6 @@ using sofa::testing::BaseSimulationTest ; using sofa::simulation::Node ; #include -using sofa::core::objectmodel::BaseObject; #include using sofa::defaulttype::Rigid3Types; @@ -38,17 +37,17 @@ using sofa::defaulttype::Vec3Types; namespace customns { -class CustomBaseObject : public BaseObject +class CustomBaseObject : public sofa::core::objectmodel::BaseComponent { public: - SOFA_CLASS(CustomBaseObject, BaseObject); + SOFA_CLASS(CustomBaseObject, sofa::core::objectmodel::BaseComponent); }; template -class CustomBaseObjectT : public BaseObject +class CustomBaseObjectT : public sofa::core::objectmodel::BaseComponent { public: - SOFA_CLASS(SOFA_TEMPLATE(CustomBaseObjectT, D), BaseObject); + SOFA_CLASS(SOFA_TEMPLATE(CustomBaseObjectT, D), sofa::core::objectmodel::BaseComponent); static const std::string GetCustomClassName() { return "MyFakeClassName"; } }; diff --git a/Sofa/framework/Core/simutest/objectmodel/PathResolver_simutest.cpp b/Sofa/framework/Core/simutest/objectmodel/PathResolver_simutest.cpp index 5d04ed72ede..33d2fc3fc2c 100644 --- a/Sofa/framework/Core/simutest/objectmodel/PathResolver_simutest.cpp +++ b/Sofa/framework/Core/simutest/objectmodel/PathResolver_simutest.cpp @@ -28,7 +28,6 @@ using sofa::testing::BaseSimulationTest ; using sofa::simulation::Node ; #include -using sofa::core::objectmodel::BaseObject; #include using sofa::core::PathResolver; @@ -84,13 +83,13 @@ TEST_P(PathResolverToBaseObject, CheckPathToBaseObject) auto& t = GetParam(); if(t[2]=="true") { - ASSERT_TRUE(PathResolver::CheckPath(node, BaseObject::GetClass(), t[0])) << t[1] << " " << t[2]; - ASSERT_TRUE(PathResolver::CheckPaths(node, BaseObject::GetClass(), t[0])) << t[1] << " " << t[2]; + ASSERT_TRUE(PathResolver::CheckPath(node, sofa::core::objectmodel::BaseObject::GetClass(), t[0])) << t[1] << " " << t[2]; + ASSERT_TRUE(PathResolver::CheckPaths(node, sofa::core::objectmodel::BaseComponent::GetClass(), t[0])) << t[1] << " " << t[2]; } else { - ASSERT_FALSE(PathResolver::CheckPath(node, BaseObject::GetClass(), t[0])) << t[1] << " " << t[2]; - ASSERT_FALSE(PathResolver::CheckPaths(node, BaseObject::GetClass(), t[0])) << t[1] << " " << t[2]; + ASSERT_FALSE(PathResolver::CheckPath(node, sofa::core::objectmodel::BaseComponent::GetClass(), t[0])) << t[1] << " " << t[2]; + ASSERT_FALSE(PathResolver::CheckPaths(node, sofa::core::objectmodel::BaseComponent::GetClass(), t[0])) << t[1] << " " << t[2]; } } @@ -111,13 +110,13 @@ TEST_F(PathResolverToBaseObject, DISABLED_CheckPathToBaseObject_tofix) if (t[2] == "true") { - ASSERT_TRUE(PathResolver::CheckPath(node, BaseObject::GetClass(), t[0])) << t[1] << " " << t[2]; - ASSERT_TRUE(PathResolver::CheckPaths(node, BaseObject::GetClass(), t[0])) << t[1] << " " << t[2]; + ASSERT_TRUE(PathResolver::CheckPath(node, sofa::core::objectmodel::BaseComponent::GetClass(), t[0])) << t[1] << " " << t[2]; + ASSERT_TRUE(PathResolver::CheckPaths(node, sofa::core::objectmodel::BaseComponent::GetClass(), t[0])) << t[1] << " " << t[2]; } else { - ASSERT_FALSE(PathResolver::CheckPath(node, BaseObject::GetClass(), t[0])) << t[1] << " " << t[2]; - ASSERT_FALSE(PathResolver::CheckPaths(node, BaseObject::GetClass(), t[0])) << t[1] << " " << t[2]; + ASSERT_FALSE(PathResolver::CheckPath(node, sofa::core::objectmodel::BaseComponent::GetClass(), t[0])) << t[1] << " " << t[2]; + ASSERT_FALSE(PathResolver::CheckPaths(node, sofa::core::objectmodel::BaseComponent::GetClass(), t[0])) << t[1] << " " << t[2]; } } diff --git a/Sofa/framework/Core/src/sofa/core/Mapping.h b/Sofa/framework/Core/src/sofa/core/Mapping.h index daf5a0b3606..e0af07bfdeb 100644 --- a/Sofa/framework/Core/src/sofa/core/Mapping.h +++ b/Sofa/framework/Core/src/sofa/core/Mapping.h @@ -222,7 +222,7 @@ class Mapping : public BaseMapping return false; } - if (dynamic_cast(stin) == dynamic_cast(stout)) + if (dynamic_cast(stin) == dynamic_cast(stout)) { // we should refuse to create mappings with the same input and output model, which may happen if a State object is missing in the child node arg->logError("Both the input and the output point to the same mechanical state ('"+stin->getName()+"')."); diff --git a/Sofa/framework/Core/src/sofa/core/behavior/ConstraintCorrection.h b/Sofa/framework/Core/src/sofa/core/behavior/ConstraintCorrection.h index fe8502f0070..6bac8538790 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/ConstraintCorrection.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/ConstraintCorrection.h @@ -150,7 +150,7 @@ class ConstraintCorrection : public BaseConstraintCorrection, public SingleState return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } void setMState(MechanicalState *_mstate) diff --git a/Sofa/framework/Core/src/sofa/core/behavior/ForceField.h b/Sofa/framework/Core/src/sofa/core/behavior/ForceField.h index c8bc6c8fd0d..aa02d9300cf 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/ForceField.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/ForceField.h @@ -223,7 +223,7 @@ class ForceField : public BaseForceField, public SingleStateAccessor } } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } return false; } diff --git a/Sofa/framework/Core/src/sofa/core/behavior/LagrangianConstraint.h b/Sofa/framework/Core/src/sofa/core/behavior/LagrangianConstraint.h index 52aba30d714..abab18939ac 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/LagrangianConstraint.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/LagrangianConstraint.h @@ -115,7 +115,7 @@ class LagrangianConstraint : public BaseLagrangianConstraint, public SingleState return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } virtual type::vector getBaseConstraintIdentifiers() override final diff --git a/Sofa/framework/Core/src/sofa/core/behavior/ProjectiveConstraintSet.h b/Sofa/framework/Core/src/sofa/core/behavior/ProjectiveConstraintSet.h index 6374406aa49..fb223b7894d 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/ProjectiveConstraintSet.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/ProjectiveConstraintSet.h @@ -153,7 +153,7 @@ class ProjectiveConstraintSet : public BaseProjectiveConstraintSet, public Singl return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } }; diff --git a/Sofa/framework/Core/src/sofa/core/fwd.h b/Sofa/framework/Core/src/sofa/core/fwd.h index a9ab6b73c8d..1363e64495c 100644 --- a/Sofa/framework/Core/src/sofa/core/fwd.h +++ b/Sofa/framework/Core/src/sofa/core/fwd.h @@ -72,7 +72,7 @@ SOFA_CORE_API SReal dt(const sofa::core::MechanicalParams*); namespace sofa::core::objectmodel { class Base; -class BaseObject; +class BaseComponent; class BaseNode; class BaseContext; class BaseData; @@ -263,7 +263,7 @@ SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::core::BaseMapping); SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::core::BehaviorModel); SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::core::CollisionModel); -SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::core::objectmodel::BaseObject); +SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::core::objectmodel::BaseComponent); SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::core::objectmodel::ContextObject); SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::core::objectmodel::ConfigurationSetting); diff --git a/Sofa/framework/Core/src/sofa/core/loader/BaseLoader.cpp b/Sofa/framework/Core/src/sofa/core/loader/BaseLoader.cpp index 6f89b28732c..2d4aee10dd3 100644 --- a/Sofa/framework/Core/src/sofa/core/loader/BaseLoader.cpp +++ b/Sofa/framework/Core/src/sofa/core/loader/BaseLoader.cpp @@ -39,7 +39,7 @@ BaseLoader::~BaseLoader() void BaseLoader::parse(sofa::core::objectmodel::BaseObjectDescription *arg) { - objectmodel::BaseObject::parse(arg); + objectmodel::BaseComponent::parse(arg); bool success = false; if (canLoad()) diff --git a/Sofa/framework/Core/src/sofa/core/loader/MeshLoader.cpp b/Sofa/framework/Core/src/sofa/core/loader/MeshLoader.cpp index fac3ed6e282..22e62cbcce5 100644 --- a/Sofa/framework/Core/src/sofa/core/loader/MeshLoader.cpp +++ b/Sofa/framework/Core/src/sofa/core/loader/MeshLoader.cpp @@ -183,7 +183,7 @@ void MeshLoader::clearBuffers() void MeshLoader::parse(sofa::core::objectmodel::BaseObjectDescription* arg) { - objectmodel::BaseObject::parse(arg); + objectmodel::BaseComponent::parse(arg); if (arg->getAttribute("scale")) { diff --git a/Sofa/framework/Core/src/sofa/core/loader/SceneLoader.cpp b/Sofa/framework/Core/src/sofa/core/loader/SceneLoader.cpp index 9e865655e51..a05bebcba02 100644 --- a/Sofa/framework/Core/src/sofa/core/loader/SceneLoader.cpp +++ b/Sofa/framework/Core/src/sofa/core/loader/SceneLoader.cpp @@ -34,7 +34,7 @@ SceneLoader::SceneLoader() : BaseLoader() void SceneLoader::parse(sofa::core::objectmodel::BaseObjectDescription* arg) { - objectmodel::BaseObject::parse(arg); + objectmodel::BaseComponent::parse(arg); if (canLoad()) load(/*d_filename.getFullPath().c_str()*/); diff --git a/Sofa/framework/Core/src/sofa/core/objectmodel/Base.h b/Sofa/framework/Core/src/sofa/core/objectmodel/Base.h index 597c97148ac..8f636ca47c8 100644 --- a/Sofa/framework/Core/src/sofa/core/objectmodel/Base.h +++ b/Sofa/framework/Core/src/sofa/core/objectmodel/Base.h @@ -410,7 +410,7 @@ class SOFA_CORE_API Base : public IntrusiveObject SOFA_BASE_CAST_DEFINITION( core, CollisionModel ) SOFA_BASE_CAST_DEFINITION( core, DataEngine ) SOFA_BASE_CAST_DEFINITION( objectmodel, BaseContext ) - SOFA_BASE_CAST_DEFINITION( objectmodel, BaseObject ) + SOFA_BASE_CAST_DEFINITION( objectmodel, BaseComponent ) SOFA_BASE_CAST_DEFINITION( objectmodel, BaseNode ) SOFA_BASE_CAST_DEFINITION( objectmodel, ContextObject ) SOFA_BASE_CAST_DEFINITION( objectmodel, ConfigurationSetting ) diff --git a/Sofa/framework/Core/src/sofa/core/objectmodel/BaseContext.h b/Sofa/framework/Core/src/sofa/core/objectmodel/BaseContext.h index e0ae2ddc670..e1125f5a4e1 100644 --- a/Sofa/framework/Core/src/sofa/core/objectmodel/BaseContext.h +++ b/Sofa/framework/Core/src/sofa/core/objectmodel/BaseContext.h @@ -188,9 +188,9 @@ class SOFA_CORE_API BaseContext : public virtual Base /// Returns a list of object of type passed as a parameter. There should be no /// Copy constructor because of Return Value Optimization. /// eg: - /// for(BaseObject* o : context->getObjects() ){ ... } + /// for(BaseComponent* o : context->getObjects() ){ ... } /// for(VisualModel* o : context->getObjects() ){ ... } - template + template std::vector getObjects(SearchDirection dir = SearchUp){ std::vector o; getObjects(o, dir) ; @@ -338,11 +338,11 @@ class SOFA_CORE_API BaseContext : public virtual Base /// @{ /// Mechanical Degrees-of-Freedom - virtual void setMechanicalState( BaseObject* ) + virtual void setMechanicalState( BaseComponent* ) { } /// Topology - virtual void setTopology( BaseObject* ) + virtual void setTopology( BaseComponent* ) { } /// @} @@ -362,13 +362,13 @@ class SOFA_CORE_API BaseContext : public virtual Base /// @{ /// Add an object, or return false if not supported - virtual bool addObject( sptr /*obj*/, TypeOfInsertion = TypeOfInsertion::AtEnd) + virtual bool addObject( sptr /*obj*/, TypeOfInsertion = TypeOfInsertion::AtEnd) { return false; } /// Remove an object, or return false if not supported - virtual bool removeObject( sptr /*obj*/ ) + virtual bool removeObject( sptr /*obj*/ ) { return false; } @@ -393,9 +393,9 @@ class SOFA_CORE_API BaseContext : public virtual Base /// @name Notifications for graph change listeners /// @{ - virtual void notifyAddSlave(core::objectmodel::BaseObject* master, core::objectmodel::BaseObject* slave); - virtual void notifyRemoveSlave(core::objectmodel::BaseObject* master, core::objectmodel::BaseObject* slave); - virtual void notifyMoveSlave(core::objectmodel::BaseObject* previousMaster, core::objectmodel::BaseObject* master, core::objectmodel::BaseObject* slave); + virtual void notifyAddSlave(core::objectmodel::BaseComponent* master, core::objectmodel::BaseComponent* slave); + virtual void notifyRemoveSlave(core::objectmodel::BaseComponent* master, core::objectmodel::BaseComponent* slave); + virtual void notifyMoveSlave(core::objectmodel::BaseComponent* previousMaster, core::objectmodel::BaseComponent* master, core::objectmodel::BaseComponent* slave); /// @} diff --git a/Sofa/framework/Core/src/sofa/core/objectmodel/BaseLink.cpp b/Sofa/framework/Core/src/sofa/core/objectmodel/BaseLink.cpp index f9697caf6ee..63af36587b4 100644 --- a/Sofa/framework/Core/src/sofa/core/objectmodel/BaseLink.cpp +++ b/Sofa/framework/Core/src/sofa/core/objectmodel/BaseLink.cpp @@ -209,8 +209,8 @@ std::string BaseLink::CreateString(const std::string& path, const std::string& d std::string BaseLink::CreateStringPath(Base* dest, Base* from) { if (!dest || dest == from) return std::string("[]"); - BaseObject* o = dest->toBaseObject(); - BaseObject* f = from->toBaseObject(); + BaseObject* o = dest->toBaseComponent(); + BaseObject* f = from->toBaseComponent(); const BaseContext* ctx = from->toBaseContext(); if (!ctx && f) ctx = f->getContext(); if (o) diff --git a/Sofa/framework/Core/src/sofa/core/objectmodel/BaseObject.cpp b/Sofa/framework/Core/src/sofa/core/objectmodel/BaseObject.cpp index 6e7394fdbb9..6cf99038245 100644 --- a/Sofa/framework/Core/src/sofa/core/objectmodel/BaseObject.cpp +++ b/Sofa/framework/Core/src/sofa/core/objectmodel/BaseObject.cpp @@ -32,7 +32,7 @@ namespace sofa::core::objectmodel { -BaseObject::BaseObject() +BaseComponent::BaseComponent() : Base() , f_listening(initData( &f_listening, false, "listening", "if true, handle the events, otherwise ignore the events")) , l_context(initLink("context","Graph Node containing this object (or BaseContext::getDefault() if no graph is used)")) @@ -48,7 +48,7 @@ BaseObject::BaseObject() f_listening.setAutoLink(false); } -BaseObject::~BaseObject() +BaseComponent::~BaseComponent() { assert(l_master.get() == nullptr); // an object that is still a slave should not be able to be deleted, as at least one smart pointer points to it for(auto& slave : l_slaves) @@ -62,7 +62,7 @@ BaseObject::~BaseObject() // This method insures that context is never nullptr (using BaseContext::getDefault() instead) // and that all slaves of an object share its context -void BaseObject::changeContextLink(BaseContext* before, BaseContext*& after) +void BaseComponent::changeContextLink(BaseContext* before, BaseContext*& after) { if (!after) after = BaseContext::getDefault(); if (before == after) return; @@ -81,14 +81,14 @@ void BaseObject::changeContextLink(BaseContext* before, BaseContext*& after) } /// This method insures that slaves objects have master and context links set correctly -void BaseObject::changeSlavesLink(BaseObject::SPtr ptr, std::size_t /*index*/, bool add) +void BaseComponent::changeSlavesLink(BaseComponent::SPtr ptr, std::size_t /*index*/, bool add) { if (!ptr) return; if (add) { ptr->l_master.set(this); ptr->l_context.set(getContext()); } else { ptr->l_master.reset(); ptr->l_context.reset(); } } -void BaseObject::parse( BaseObjectDescription* arg ) +void BaseComponent::parse( BaseObjectDescription* arg ) { if (arg->getAttribute("src")) { @@ -117,13 +117,13 @@ void BaseObject::parse( BaseObjectDescription* arg ) Base::parse(arg); } -void BaseObject::setSrc(const std::string &valueString, std::vector< std::string > *attributeList) +void BaseComponent::setSrc(const std::string &valueString, std::vector< std::string > *attributeList) { std::size_t posAt = valueString.rfind('@'); if (posAt == std::string::npos) posAt = 0; const std::string objectName = valueString.substr(posAt + 1); - const BaseObject* loader = getContext()->get(objectName); + const BaseComponent* loader = getContext()->get(objectName); if (!loader) { msg_error() << "Source object \"" << valueString << "\" NOT FOUND."; @@ -132,9 +132,9 @@ void BaseObject::setSrc(const std::string &valueString, std::vector< std::string setSrc(valueString, loader, attributeList); } -void BaseObject::setSrc(const std::string &valueString, const BaseObject *loader, std::vector< std::string > *attributeList) +void BaseComponent::setSrc(const std::string &valueString, const BaseComponent *loader, std::vector< std::string > *attributeList) { - BaseObject::MapData dataLoaderMap = loader->m_aliasData; + BaseComponent::MapData dataLoaderMap = loader->m_aliasData; if (attributeList != nullptr) { @@ -175,7 +175,7 @@ void BaseObject::setSrc(const std::string &valueString, const BaseObject *loader } } -Base* BaseObject::findLinkDestClass(const BaseClass* destType, const std::string& path, const BaseLink* link) +Base* BaseComponent::findLinkDestClass(const BaseClass* destType, const std::string& path, const BaseLink* link) { if (this->getContext() == BaseContext::getDefault()) return nullptr; @@ -184,32 +184,32 @@ Base* BaseObject::findLinkDestClass(const BaseClass* destType, const std::string } -const BaseContext* BaseObject::getContext() const +const BaseContext* BaseComponent::getContext() const { return l_context.get(); } -BaseContext* BaseObject::getContext() +BaseContext* BaseComponent::getContext() { return l_context.get(); } -const BaseObject* BaseObject::getMaster() const +const BaseComponent* BaseComponent::getMaster() const { return l_master.get(); } -BaseObject* BaseObject::getMaster() +BaseComponent* BaseComponent::getMaster() { return l_master.get(); } -const BaseObject::VecSlaves& BaseObject::getSlaves() const +const BaseComponent::VecSlaves& BaseComponent::getSlaves() const { return l_slaves.getValue(); } -BaseObject* BaseObject::getSlave(const std::string& name) const +BaseComponent* BaseComponent::getSlave(const std::string& name) const { for (auto slave : l_slaves) { @@ -219,9 +219,9 @@ BaseObject* BaseObject::getSlave(const std::string& name) const return nullptr; } -void BaseObject::addSlave(BaseObject::SPtr s) +void BaseComponent::addSlave(BaseComponent::SPtr s) { - const BaseObject::SPtr previous = s->getMaster(); + const BaseComponent::SPtr previous = s->getMaster(); if (previous == this) return; if (previous) previous->l_slaves.remove(s); @@ -232,7 +232,7 @@ void BaseObject::addSlave(BaseObject::SPtr s) this->getContext()->notifyAddSlave(this, s.get()); } -void BaseObject::removeSlave(BaseObject::SPtr s) +void BaseComponent::removeSlave(BaseComponent::SPtr s) { if (l_slaves.remove(s)) { @@ -240,7 +240,7 @@ void BaseObject::removeSlave(BaseObject::SPtr s) } } -void BaseObject::init() +void BaseComponent::init() { for(const auto data: this->m_vecData) { @@ -258,15 +258,15 @@ void BaseObject::init() } } -void BaseObject::bwdInit() +void BaseComponent::bwdInit() { } -void BaseObject::reinit() +void BaseComponent::reinit() { } -void BaseObject::updateInternal() +void BaseComponent::updateInternal() { const auto& mapTrackedData = m_internalDataTracker.getMapTrackedData(); for( auto const& it : mapTrackedData ) @@ -281,17 +281,17 @@ void BaseObject::updateInternal() } } -void BaseObject::trackInternalData(const objectmodel::BaseData& data) +void BaseComponent::trackInternalData(const objectmodel::BaseData& data) { m_internalDataTracker.trackData(data); } -void BaseObject::cleanTracker() +void BaseComponent::cleanTracker() { m_internalDataTracker.clean(); } -bool BaseObject::hasDataChanged(const objectmodel::BaseData& data) +bool BaseComponent::hasDataChanged(const objectmodel::BaseData& data) { bool dataFoundinTracker = false; const auto& mapTrackedData = m_internalDataTracker.getMapTrackedData(); @@ -314,22 +314,22 @@ bool BaseObject::hasDataChanged(const objectmodel::BaseData& data) return m_internalDataTracker.hasChanged(data); } -void BaseObject::doUpdateInternal() +void BaseComponent::doUpdateInternal() { } -void BaseObject::storeResetState() +void BaseComponent::storeResetState() { } -void BaseObject::reset() +void BaseComponent::reset() { } -void BaseObject::cleanup() +void BaseComponent::cleanup() { } -void BaseObject::handleEvent( Event* /*e*/ ) +void BaseComponent::handleEvent( Event* /*e*/ ) { } -void BaseObject::handleTopologyChange(core::topology::Topology* t) +void BaseComponent::handleTopologyChange(core::topology::Topology* t) { if (t == this->getContext()->getTopology()) { @@ -337,12 +337,12 @@ void BaseObject::handleTopologyChange(core::topology::Topology* t) } } -SReal BaseObject::getTime() const +SReal BaseComponent::getTime() const { return getContext()->getTime(); } -std::string BaseObject::getPathName() const +std::string BaseComponent::getPathName() const { auto node = dynamic_cast(getContext()); if(!node) diff --git a/Sofa/framework/Core/src/sofa/core/objectmodel/BaseObject.h b/Sofa/framework/Core/src/sofa/core/objectmodel/BaseObject.h index 8b149518b14..cf12eb0ae67 100644 --- a/Sofa/framework/Core/src/sofa/core/objectmodel/BaseObject.h +++ b/Sofa/framework/Core/src/sofa/core/objectmodel/BaseObject.h @@ -37,16 +37,16 @@ namespace sofa::core::objectmodel * It is able to process events, if listening enabled (default is false). * */ -class SOFA_CORE_API BaseObject : public virtual Base +class SOFA_CORE_API BaseComponent : public virtual Base { public: - SOFA_CLASS(BaseObject, Base); - SOFA_BASE_CAST_IMPLEMENTATION(BaseObject) + SOFA_CLASS(BaseComponent, Base); + SOFA_BASE_CAST_IMPLEMENTATION(BaseComponent) protected: - BaseObject(); + BaseComponent(); - ~BaseObject() override; + ~BaseComponent() override; public: @@ -126,21 +126,21 @@ class SOFA_CORE_API BaseObject : public virtual Base BaseContext* getContext(); - const BaseObject* getMaster() const; + const BaseComponent* getMaster() const; - BaseObject* getMaster(); + BaseComponent* getMaster(); - typedef sofa::core::objectmodel::MultiLink LinkSlaves; + typedef sofa::core::objectmodel::MultiLink LinkSlaves; typedef LinkSlaves::Container VecSlaves; const VecSlaves& getSlaves() const; - BaseObject* getSlave(const std::string& name) const; + BaseComponent* getSlave(const std::string& name) const; - virtual void addSlave(BaseObject::SPtr s); + virtual void addSlave(BaseComponent::SPtr s); - virtual void removeSlave(BaseObject::SPtr s); + virtual void removeSlave(BaseComponent::SPtr s); /// @} /// @name data access @@ -180,7 +180,7 @@ class SOFA_CORE_API BaseObject : public virtual Base /// Sets a source Object and parses it to collect dependent Data /// Use it before scene graph insertion - void setSrc(const std::string &v, const BaseObject *loader, std::vector< std::string > *attributeList=nullptr); + void setSrc(const std::string &v, const BaseComponent *loader, std::vector< std::string > *attributeList=nullptr); Base* findLinkDestClass(const BaseClass* destType, const std::string& path, const BaseLink* link) override; @@ -205,9 +205,9 @@ class SOFA_CORE_API BaseObject : public virtual Base ///@} /// - SingleLink l_context; + SingleLink l_context; LinkSlaves l_slaves; - SingleLink l_master; + SingleLink l_master; /// Implementation of the internal update virtual void doUpdateInternal(); @@ -217,7 +217,7 @@ class SOFA_CORE_API BaseObject : public virtual Base void changeContextLink(BaseContext* before, BaseContext*& after); /// This method insures that slaves objects have master and context links set correctly - void changeSlavesLink(BaseObject::SPtr ptr, std::size_t /*index*/, bool add); + void changeSlavesLink(BaseComponent::SPtr ptr, std::size_t /*index*/, bool add); /// BaseNode can set the context of its own objects friend class BaseNode; @@ -236,5 +236,7 @@ class SOFA_CORE_API BaseObject : public virtual Base virtual bool removeInNode( BaseNode* /*node*/ ) { return false; } }; +using BaseObject = BaseComponent; + } // namespace sofa::core::objectmodel diff --git a/Sofa/framework/Core/src/sofa/core/topology/TopologicalMapping.h b/Sofa/framework/Core/src/sofa/core/topology/TopologicalMapping.h index b64096f1b01..dbc8c213eea 100644 --- a/Sofa/framework/Core/src/sofa/core/topology/TopologicalMapping.h +++ b/Sofa/framework/Core/src/sofa/core/topology/TopologicalMapping.h @@ -145,14 +145,14 @@ class SOFA_CORE_API TopologicalMapping : public virtual objectmodel::BaseObject return false; } - if (dynamic_cast(stin) == dynamic_cast(stout)) + if (dynamic_cast(stin) == dynamic_cast(stout)) { // we should refuse to create mappings with the same input and output model, which may happen if a State object is missing in the child node arg->logError("Both the input mesh and the output mesh points to the same mesh topology ('"+stin->getName()+"')."); return false; } - return BaseObject::canCreate(obj, context, arg); + return BaseComponent::canCreate(obj, context, arg); } /// Construction method called by ObjectFactory. diff --git a/Sofa/framework/Core/test/ObjectFactoryJson_test.cpp b/Sofa/framework/Core/test/ObjectFactoryJson_test.cpp index ce051811eb5..98dcc49688e 100644 --- a/Sofa/framework/Core/test/ObjectFactoryJson_test.cpp +++ b/Sofa/framework/Core/test/ObjectFactoryJson_test.cpp @@ -50,10 +50,10 @@ TEST(ObjectFactoryJson, oneObject) } template -class DummyComponent : public core::objectmodel::BaseObject +class DummyComponent : public core::objectmodel::BaseComponent { public: - SOFA_CLASS(DummyComponent, BaseObject); + SOFA_CLASS(DummyComponent, core::objectmodel::BaseComponent); }; TEST(ObjectFactoryJson, oneTemplatedObject) diff --git a/Sofa/framework/Core/test/objectmodel/BaseClass_test.cpp b/Sofa/framework/Core/test/objectmodel/BaseClass_test.cpp index 9da2f01d6d8..bbe6318321c 100644 --- a/Sofa/framework/Core/test/objectmodel/BaseClass_test.cpp +++ b/Sofa/framework/Core/test/objectmodel/BaseClass_test.cpp @@ -20,7 +20,6 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #include -using sofa::core::objectmodel::BaseObject ; using sofa::core::objectmodel::Base ; #include @@ -34,10 +33,10 @@ using sofa::testing::BaseTest ; namespace sofa{ namespace another_namespace{ -class EmptyObject : public BaseObject +class EmptyObject : public sofa::core::objectmodel::BaseObject { public: - SOFA_CLASS(EmptyObject, BaseObject) ; + SOFA_CLASS(EmptyObject, sofa::core::objectmodel::BaseObject) ; }; } @@ -46,10 +45,10 @@ class EmptyObject : public BaseObject namespace sofa{ namespace numbered_namespace_123{ -class NumberedClass123 : public BaseObject +class NumberedClass123 : public sofa::core::objectmodel::BaseObject { public: - SOFA_CLASS(NumberedClass123, BaseObject) ; + SOFA_CLASS(NumberedClass123, sofa::core::objectmodel::BaseObject) ; }; class NumberedClass456 : public another_namespace::EmptyObject @@ -58,10 +57,10 @@ class NumberedClass456 : public another_namespace::EmptyObject SOFA_CLASS(NumberedClass456, another_namespace::EmptyObject) ; }; -class CustomName123 : public BaseObject +class CustomName123 : public sofa::core::objectmodel::BaseObject { public: - SOFA_CLASS(CustomName123, BaseObject) ; + SOFA_CLASS(CustomName123, sofa::core::objectmodel::BaseObject) ; static const std::string GetCustomClassName(){ return "ClassWithACustomName"; } static const std::string GetCustomTemplateName(){ return "ClassWithACustomTemplate"; } @@ -70,10 +69,10 @@ class CustomName123 : public BaseObject static const std::string className(){ return "TEST TEST"; } }; -class CustomNameOldWay : public BaseObject +class CustomNameOldWay : public sofa::core::objectmodel::BaseObject { public: - SOFA_CLASS(CustomNameOldWay, BaseObject) ; + SOFA_CLASS(CustomNameOldWay, sofa::core::objectmodel::BaseObject) ; static const std::string className(const CustomNameOldWay* =nullptr){ return "ClassWithACustomNameOldWay"; } @@ -93,46 +92,46 @@ class DataTwo { public: static std::string Name(){ return "Two" ;} }; class NotAType {}; template -class DefaultTemplate1 : public BaseObject +class DefaultTemplate1 : public sofa::core::objectmodel::BaseObject { public: - SOFA_CLASS(SOFA_TEMPLATE(DefaultTemplate1, DataType1), BaseObject) ; + SOFA_CLASS(SOFA_TEMPLATE(DefaultTemplate1, DataType1), sofa::core::objectmodel::BaseObject) ; }; template -class DefaultTemplate2 : public BaseObject +class DefaultTemplate2 : public sofa::core::objectmodel::BaseObject { public: - SOFA_CLASS(SOFA_TEMPLATE2(DefaultTemplate2, DataType1, DataType2), BaseObject) ; + SOFA_CLASS(SOFA_TEMPLATE2(DefaultTemplate2, DataType1, DataType2), sofa::core::objectmodel::BaseObject) ; }; template -class DefaultTemplate3 : public BaseObject +class DefaultTemplate3 : public sofa::core::objectmodel::BaseObject { public: - SOFA_CLASS(SOFA_TEMPLATE3(DefaultTemplate3, DataType1, DataType2, NotAType), BaseObject) ; + SOFA_CLASS(SOFA_TEMPLATE3(DefaultTemplate3, DataType1, DataType2, NotAType), sofa::core::objectmodel::BaseObject) ; }; template -class NotDefaultTemplate : public BaseObject +class NotDefaultTemplate : public sofa::core::objectmodel::BaseObject { public: - SOFA_CLASS(SOFA_TEMPLATE3(NotDefaultTemplate, DataType1, DataType2, NotAType), BaseObject) ; + SOFA_CLASS(SOFA_TEMPLATE3(NotDefaultTemplate, DataType1, DataType2, NotAType), sofa::core::objectmodel::BaseObject) ; static const std::string GetCustomTemplateName(){ return "non,oui"; } }; template -class OuterClass : public BaseObject +class OuterClass : public sofa::core::objectmodel::BaseObject { public: - SOFA_CLASS(SOFA_TEMPLATE(OuterClass, TDataType1), BaseObject); + SOFA_CLASS(SOFA_TEMPLATE(OuterClass, TDataType1), sofa::core::objectmodel::BaseObject); template - class InnerClass : public BaseObject + class InnerClass : public sofa::core::objectmodel::BaseObject { public: - SOFA_CLASS(SOFA_TEMPLATE(InnerClass, TDataType2), BaseObject); + SOFA_CLASS(SOFA_TEMPLATE(InnerClass, TDataType2), sofa::core::objectmodel::BaseObject); }; }; diff --git a/Sofa/framework/Core/test/objectmodel/BaseData_test.cpp b/Sofa/framework/Core/test/objectmodel/BaseData_test.cpp index 2cd808fbc9b..48cac0d105d 100644 --- a/Sofa/framework/Core/test/objectmodel/BaseData_test.cpp +++ b/Sofa/framework/Core/test/objectmodel/BaseData_test.cpp @@ -20,7 +20,6 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::testing::BaseTest; @@ -50,10 +49,10 @@ class MyData : public BaseData void doEndEditVoidPtr() override { } }; -class MyObject : public BaseObject +class MyObject : public sofa::core::objectmodel::BaseObject { public: - SOFA_CLASS(MyObject, BaseObject); + SOFA_CLASS(MyObject, sofa::core::objectmodel::BaseObject); MyData myData; MyObject() : myData() diff --git a/Sofa/framework/Core/test/objectmodel/BaseLink_test.cpp b/Sofa/framework/Core/test/objectmodel/BaseLink_test.cpp index c33e9c644ca..677fa6922f8 100644 --- a/Sofa/framework/Core/test/objectmodel/BaseLink_test.cpp +++ b/Sofa/framework/Core/test/objectmodel/BaseLink_test.cpp @@ -20,7 +20,6 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::core::objectmodel::BaseNode ; @@ -38,14 +37,14 @@ using sofa::testing::BaseTest ; #include "BaseLink_test.h" using SingleLinkImplementations = ::testing::Types< - SingleLink, - SingleLink>; + SingleLink, + SingleLink>; INSTANTIATE_TYPED_TEST_SUITE_P(SingleLink, BaseLinkTests, SingleLinkImplementations); using MultiLinkImplementations = ::testing::Types< - MultiLink, - MultiLink + MultiLink, + MultiLink >; INSTANTIATE_TYPED_TEST_SUITE_P(MultiLink, BaseLinkTests, MultiLinkImplementations); diff --git a/Sofa/framework/Core/test/objectmodel/BaseLink_test.h b/Sofa/framework/Core/test/objectmodel/BaseLink_test.h index e115c1936f6..edf81919485 100644 --- a/Sofa/framework/Core/test/objectmodel/BaseLink_test.h +++ b/Sofa/framework/Core/test/objectmodel/BaseLink_test.h @@ -20,7 +20,6 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::core::objectmodel::BaseNode ; @@ -33,13 +32,13 @@ using sofa::testing::BaseTest ; /*********************************************************************************** * This is checking that the predicates about BaseLink are still valid in an - * inhertited type + * inherited type ***********************************************************************************/ template -class FakeObject : public BaseObject +class FakeObject : public sofa::core::objectmodel::BaseObject { public: - FakeObject() : BaseObject() + FakeObject() : sofa::core::objectmodel::BaseObject() { } }; diff --git a/Sofa/framework/Core/test/objectmodel/MultiLink_test.cpp b/Sofa/framework/Core/test/objectmodel/MultiLink_test.cpp index 039564eb7cd..dcbfd3a02f2 100644 --- a/Sofa/framework/Core/test/objectmodel/MultiLink_test.cpp +++ b/Sofa/framework/Core/test/objectmodel/MultiLink_test.cpp @@ -20,7 +20,6 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::core::objectmodel::BaseNode ; diff --git a/Sofa/framework/Core/test/objectmodel/RemovedData_test.cpp b/Sofa/framework/Core/test/objectmodel/RemovedData_test.cpp index 9ee53e0530b..bb2b6ca8464 100644 --- a/Sofa/framework/Core/test/objectmodel/RemovedData_test.cpp +++ b/Sofa/framework/Core/test/objectmodel/RemovedData_test.cpp @@ -20,7 +20,6 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::testing::BaseTest; @@ -32,10 +31,10 @@ using sofa::core::objectmodel::lifecycle::RemovedData; namespace { -class MyObject : public BaseObject +class MyObject : public sofa::core::objectmodel::BaseObject { public: - SOFA_CLASS(MyObject, BaseObject); + SOFA_CLASS(MyObject, sofa::core::objectmodel::BaseObject); DeprecatedData deprecatedData {this, "v23.06", "v23.12", "deprecatedData", "You should now use XXXX"}; RemovedData removedData {this, "v23.06", "v23.12", "removedData", "You should now use XXXX"}; diff --git a/Sofa/framework/Core/test/objectmodel/SingleLink_test.cpp b/Sofa/framework/Core/test/objectmodel/SingleLink_test.cpp index 7ad36dabcd0..1b3d9820d50 100644 --- a/Sofa/framework/Core/test/objectmodel/SingleLink_test.cpp +++ b/Sofa/framework/Core/test/objectmodel/SingleLink_test.cpp @@ -20,7 +20,6 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::core::objectmodel::BaseNode ; @@ -33,24 +32,24 @@ using sofa::testing::BaseTest ; #include "BaseLink_test.h" -class EmptyObject : public BaseObject +class EmptyObject : public sofa::core::objectmodel::BaseObject { public: - SOFA_CLASS(EmptyObject, BaseObject) ; + SOFA_CLASS(EmptyObject, sofa::core::objectmodel::BaseObject) ; }; class SingleLink_test: public BaseTest { public: - SingleLink m_link ; - BaseObject::SPtr m_dst ; - BaseObject::SPtr m_src ; + SingleLink m_link ; + sofa::core::objectmodel::BaseObject::SPtr m_dst ; + sofa::core::objectmodel::BaseObject::SPtr m_src ; /// Create a link to an object. void doSetUp() override { - m_dst = sofa::core::objectmodel::New() ; - m_src = sofa::core::objectmodel::New() ; + m_dst = sofa::core::objectmodel::New() ; + m_src = sofa::core::objectmodel::New() ; m_dst->setName("destination") ; m_src->setName("source") ; @@ -87,14 +86,14 @@ TEST_F(SingleLink_test, checkCounterLogic ) TEST_F(SingleLink_test, checkMultiLink ) { - SingleLink smlink ; + SingleLink smlink ; ASSERT_EQ(smlink.size(), size_t(0)) ; smlink.add(m_dst.get()) ; ASSERT_EQ(smlink.size(), size_t(1)) ; smlink.add(m_dst.get()) ; ASSERT_EQ(smlink.size(), size_t(1)) ; - SingleLink slink ; + SingleLink slink ; ASSERT_EQ(slink.size(), size_t(0)) ; slink.add(m_dst.get()) ; ASSERT_EQ(slink.size(), size_t(1)) ; @@ -104,10 +103,10 @@ TEST_F(SingleLink_test, checkMultiLink ) TEST_F(SingleLink_test, getOwnerBase) { - const auto aBaseObject = sofa::core::objectmodel::New(); + const auto aBaseObject = sofa::core::objectmodel::New(); using sofa::core::objectmodel::BaseNode; - const BaseLink::InitLink initObjectLink(aBaseObject.get(), "objectlink", ""); - const SingleLink objectLink(initObjectLink) ; + const BaseLink::InitLink initObjectLink(aBaseObject.get(), "objectlink", ""); + const SingleLink objectLink(initObjectLink) ; ASSERT_EQ(objectLink.getOwnerBase(), aBaseObject.get()); // m_link is initialized without an owner. // getOwnerBase() should still work and return a nullptr diff --git a/Sofa/framework/SimpleApi/src/sofa/simpleapi/SimpleApi.cpp b/Sofa/framework/SimpleApi/src/sofa/simpleapi/SimpleApi.cpp index 63555fcb1d4..513e78d5391 100644 --- a/Sofa/framework/SimpleApi/src/sofa/simpleapi/SimpleApi.cpp +++ b/Sofa/framework/SimpleApi/src/sofa/simpleapi/SimpleApi.cpp @@ -93,10 +93,10 @@ NodeSPtr createRootNode(Simulation* s, const std::string& name, return root ; } -BaseObject::SPtr createObject(Node::SPtr parent, BaseObjectDescription& desc) +BaseComponent::SPtr createObject(Node::SPtr parent, BaseObjectDescription& desc) { /// Create the object. - BaseObject::SPtr obj = ObjectFactory::getInstance()->createObject(parent.get(), &desc); + BaseComponent::SPtr obj = ObjectFactory::getInstance()->createObject(parent.get(), &desc); if (obj == nullptr) { std::stringstream msg; @@ -112,7 +112,7 @@ BaseObject::SPtr createObject(Node::SPtr parent, BaseObjectDescription& desc) return obj ; } -BaseObject::SPtr createObject(Node::SPtr parent, const std::string& type, const std::map& params) +BaseComponent::SPtr createObject(Node::SPtr parent, const std::string& type, const std::map& params) { /// temporarily, the name is set to the type name. /// if a "name" parameter is provided, it will overwrite it. diff --git a/Sofa/framework/SimpleApi/src/sofa/simpleapi/SimpleApi.h b/Sofa/framework/SimpleApi/src/sofa/simpleapi/SimpleApi.h index e7b6fc4fa82..77a7fbf3568 100644 --- a/Sofa/framework/SimpleApi/src/sofa/simpleapi/SimpleApi.h +++ b/Sofa/framework/SimpleApi/src/sofa/simpleapi/SimpleApi.h @@ -33,7 +33,7 @@ namespace sofa::simpleapi { -using sofa::core::objectmodel::BaseObject; +using sofa::core::objectmodel::BaseComponent; using sofa::core::objectmodel::BaseObjectDescription; using sofa::simulation::Simulation ; @@ -53,11 +53,11 @@ NodeSPtr SOFA_SIMPLEAPI_API createRootNode( Simulation* s, const std::string& na ///@brief Create a sofa object in the provided node. ///The parameter "params" is for passing specific data argument to the created object including the ///object's type. -sofa::core::sptr SOFA_SIMPLEAPI_API createObject(NodeSPtr node, BaseObjectDescription& params); +sofa::core::sptr SOFA_SIMPLEAPI_API createObject(NodeSPtr node, BaseObjectDescription& params); ///@brief create a sofa object in the provided node of the given type. ///The parameter "params" is for passing specific data argument to the created object. -sofa::core::sptr SOFA_SIMPLEAPI_API createObject( NodeSPtr node, const std::string& type, +sofa::core::sptr SOFA_SIMPLEAPI_API createObject( NodeSPtr node, const std::string& type, const std::map& params = std::map{} ); ///@brief create a child to the provided nodeof given name. diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseSimulationExporter.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseSimulationExporter.cpp index 840d8f55f74..704a32bdae8 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseSimulationExporter.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseSimulationExporter.cpp @@ -95,7 +95,7 @@ void BaseSimulationExporter::handleEvent(Event *event){ } } - BaseObject::handleEvent(event) ; + sofa::core::objectmodel::BaseObject::handleEvent(event) ; } diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseSimulationExporter.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseSimulationExporter.h index bddb7c72660..16226a7b9ba 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseSimulationExporter.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseSimulationExporter.h @@ -35,17 +35,16 @@ namespace sofa::simulation namespace _basesimulationexporter_ { using sofa::core::objectmodel::Event ; -using sofa::core::objectmodel::BaseObject ; using sofa::core::objectmodel::DataFileName ; /** Component that export something from the scene could inherit from this class as it implement an uniform handling of the different data attributes. */ -class SOFA_SIMULATION_CORE_API BaseSimulationExporter : public virtual BaseObject +class SOFA_SIMULATION_CORE_API BaseSimulationExporter : public virtual sofa::core::objectmodel::BaseObject { public: - SOFA_ABSTRACT_CLASS(BaseSimulationExporter, BaseObject); + SOFA_ABSTRACT_CLASS(BaseSimulationExporter, sofa::core::objectmodel::BaseObject); DataFileName d_filename ; Data d_exportEveryNbSteps; diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/InitVisitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/InitVisitor.h index 55378676263..2115d6b6585 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/InitVisitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/InitVisitor.h @@ -32,7 +32,7 @@ namespace sofa::simulation /** Initialize a newly created (or modified) scene graph. - Forward: simulation::Node::initialize() This method puts the OdeSolver, if any, first in the list of components. Then BaseObject::init() for all components. + Forward: simulation::Node::initialize() This method puts the OdeSolver, if any, first in the list of components. Then BaseComponent::init() for all components. Backward: OdeSolver::bwdInit() diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp index 37753fa3d0c..35f6a5acba9 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp @@ -69,7 +69,6 @@ namespace sofa::simulation { using core::objectmodel::BaseNode; -using core::objectmodel::BaseObject; Node::Node(const std::string& nodename, Node* parent) : core::objectmodel::BaseNode() @@ -227,7 +226,7 @@ void Node::moveChild(BaseNode::SPtr node, BaseNode::SPtr prev_parent) doMoveChild(node, prev_parent); } /// Add an object. Detect the implemented interfaces and add the object to the corresponding lists. -bool Node::addObject(BaseObject::SPtr obj, sofa::core::objectmodel::TypeOfInsertion insertionLocation) +bool Node::addObject(sofa::core::objectmodel::BaseObject::SPtr obj, sofa::core::objectmodel::TypeOfInsertion insertionLocation) { // If an object we are trying to add already has a context, it is in another node in the // graph: we need to remove it from this context before to insert it into the current @@ -245,7 +244,7 @@ bool Node::addObject(BaseObject::SPtr obj, sofa::core::objectmodel::TypeOfInsert } /// Remove an object -bool Node::removeObject(BaseObject::SPtr obj) +bool Node::removeObject(sofa::core::objectmodel::BaseObject::SPtr obj) { notifyBeginRemoveObject(this, obj); const bool ret = doRemoveObject(obj); @@ -254,7 +253,7 @@ bool Node::removeObject(BaseObject::SPtr obj) } /// Move an object from another node -void Node::moveObject(BaseObject::SPtr obj) +void Node::moveObject(sofa::core::objectmodel::BaseObject::SPtr obj) { Node* prev_parent = down_cast(obj->getContext()->toBaseNode()); if (prev_parent) @@ -421,7 +420,7 @@ sofa::core::objectmodel::Base* Node::findLinkDestClass(const core::objectmodel:: return destType->dynamicCast(link->getOwnerBase()); } Node* node = this; - BaseObject* master = nullptr; + sofa::core::objectmodel::BaseObject* master = nullptr; bool based = false; if (ppos < psize && pathStr[ppos] == '[') // relative index in the list of objects { @@ -523,7 +522,7 @@ sofa::core::objectmodel::Base* Node::findLinkDestClass(const core::objectmodel:: { for (;;) { - BaseObject* obj = node->getObject(nameStr); + sofa::core::objectmodel::BaseObject* obj = node->getObject(nameStr); Node* childPtr = node->getChild(nameStr); if (childPtr) { @@ -568,7 +567,7 @@ sofa::core::objectmodel::Base* Node::findLinkDestClass(const core::objectmodel:: } for (ObjectIterator it = node->object.begin(), itend = node->object.end(); it != itend; ++it) { - BaseObject* obj = it->get(); + sofa::core::objectmodel::BaseObject* obj = it->get(); Base *o = destType->dynamicCast(obj); if (!o) continue; if(DEBUG_LINK) @@ -600,7 +599,7 @@ sofa::core::objectmodel::Base* Node::findLinkDestClass(const core::objectmodel:: } /// Add an object. Detect the implemented interfaces and add the object to the corresponding lists. -bool Node::doAddObject(BaseObject::SPtr sobj, sofa::core::objectmodel::TypeOfInsertion insertionLocation) +bool Node::doAddObject(sofa::core::objectmodel::BaseObject::SPtr sobj, sofa::core::objectmodel::TypeOfInsertion insertionLocation) { this->setObjectContext(sobj); if(insertionLocation == sofa::core::objectmodel::TypeOfInsertion::AtEnd) @@ -608,7 +607,7 @@ bool Node::doAddObject(BaseObject::SPtr sobj, sofa::core::objectmodel::TypeOfIns else object.addBegin(sobj); - BaseObject* obj = sobj.get(); + sofa::core::objectmodel::BaseObject* obj = sobj.get(); if( !obj->insertInNode( this ) ) { @@ -618,13 +617,13 @@ bool Node::doAddObject(BaseObject::SPtr sobj, sofa::core::objectmodel::TypeOfIns } /// Remove an object -bool Node::doRemoveObject(BaseObject::SPtr sobj) +bool Node::doRemoveObject(sofa::core::objectmodel::BaseObject::SPtr sobj) { dmsg_warning_when(sobj == nullptr) << "Trying to remove a nullptr object"; this->clearObjectContext(sobj); object.remove(sobj); - BaseObject* obj = sobj.get(); + sofa::core::objectmodel::BaseObject* obj = sobj.get(); if(obj != nullptr && !obj->removeInNode( this ) ) unsorted.remove(obj); @@ -632,7 +631,7 @@ bool Node::doRemoveObject(BaseObject::SPtr sobj) } /// Remove an object -void Node::doMoveObject(BaseObject::SPtr sobj, Node* prev_parent) +void Node::doMoveObject(sofa::core::objectmodel::BaseObject::SPtr sobj, Node* prev_parent) { if (prev_parent != nullptr) prev_parent->removeObject(sobj); diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/PropagateEventVisitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/PropagateEventVisitor.h index 7ae5a9752a2..1dd246499c0 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/PropagateEventVisitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/PropagateEventVisitor.h @@ -43,7 +43,7 @@ class SOFA_SIMULATION_CORE_API PropagateEventVisitor : public sofa::simulation:: ~PropagateEventVisitor() override; Visitor::Result processNodeTopDown(simulation::Node* node) override; - void processObject(simulation::Node*, core::objectmodel::BaseObject* obj); + void processObject(simulation::Node*, core::objectmodel::BaseComponent* obj); const char* getClassName() const override { return "PropagateEventVisitor"; } virtual std::string getInfos() const override { return std::string(m_event->getClassName()); } diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/ResetVisitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/ResetVisitor.h index 05389a2df9a..71d603453ea 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/ResetVisitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/ResetVisitor.h @@ -33,7 +33,7 @@ class SOFA_SIMULATION_CORE_API ResetVisitor : public Visitor public: ResetVisitor(const core::ExecParams* eparams) : Visitor(eparams) {} - void processObject(core::objectmodel::BaseObject* obj); + void processObject(core::objectmodel::BaseComponent* obj); Result processNodeTopDown(simulation::Node* node) override; void processNodeBottomUp(simulation::Node* node) override; @@ -48,7 +48,7 @@ class SOFA_SIMULATION_CORE_API StoreResetStateVisitor : public Visitor public: StoreResetStateVisitor(const core::ExecParams* eparams) : Visitor(eparams) {} - void processObject(core::objectmodel::BaseObject* obj); + void processObject(core::objectmodel::BaseComponent* obj); Result processNodeTopDown(simulation::Node* node) override; void processNodeBottomUp(simulation::Node* node) override; diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/TopologyChangeVisitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/TopologyChangeVisitor.h index 9be70787b0f..1164943ca10 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/TopologyChangeVisitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/TopologyChangeVisitor.h @@ -36,7 +36,7 @@ class SOFA_SIMULATION_CORE_API TopologyChangeVisitor : public Visitor ~TopologyChangeVisitor() override {} - virtual void processTopologyChange(simulation::Node* node, sofa::core::objectmodel::BaseObject* obj); + virtual void processTopologyChange(simulation::Node* node, sofa::core::objectmodel::BaseComponent* obj); Result processNodeTopDown(simulation::Node* node) override; void processNodeBottomUp(simulation::Node* node) override; diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/UpdateInternalDataVisitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/UpdateInternalDataVisitor.h index a4cec8d167c..6f61afb087f 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/UpdateInternalDataVisitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/UpdateInternalDataVisitor.h @@ -39,7 +39,7 @@ class SOFA_SIMULATION_CORE_API UpdateInternalDataVisitor : public Visitor public: UpdateInternalDataVisitor(const core::ExecParams* eparams): Visitor(eparams) {} - void processUpdateInternalData(simulation::Node* node, sofa::core::objectmodel::BaseObject* baseObj); + void processUpdateInternalData(simulation::Node* node, sofa::core::objectmodel::BaseComponent* baseObj); Result processNodeTopDown(simulation::Node* node) override; /// Specify whether this action can be parallelized. diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/UpdateLinksVisitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/UpdateLinksVisitor.h index cdd9a3d1e71..03a4573a9d1 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/UpdateLinksVisitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/UpdateLinksVisitor.h @@ -33,7 +33,7 @@ class SOFA_SIMULATION_CORE_API UpdateLinksVisitor : public Visitor public: UpdateLinksVisitor(const core::ExecParams* eparams) : Visitor(eparams) {} - void processObject(core::objectmodel::BaseObject* obj); + void processObject(core::objectmodel::BaseComponent* obj); Result processNodeTopDown(simulation::Node* node) override; void processNodeBottomUp(simulation::Node* node) override; diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/Visitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/Visitor.h index f24d6173b09..b78c2169986 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/Visitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/Visitor.h @@ -91,8 +91,8 @@ class SOFA_SIMULATION_CORE_API Visitor virtual std::string getInfos() const { return ""; } protected: - void debug_write_state_before( sofa::core::objectmodel::BaseObject* obj ) ; - void debug_write_state_after( sofa::core::objectmodel::BaseObject* obj ) ; + void debug_write_state_before( sofa::core::objectmodel::BaseComponent* obj ) ; + void debug_write_state_after( sofa::core::objectmodel::BaseComponent* obj ) ; /// Function to be called when a visitor executes a main task /// It surrounds the task function with debug information @@ -131,28 +131,28 @@ class SOFA_SIMULATION_CORE_API Visitor //method to compare the tags of the object with the ones of the visitor // return true if the object has all the tags of the visitor // or if no tag is set to the visitor - bool testTags(sofa::core::objectmodel::BaseObject* obj); + bool testTags(sofa::core::objectmodel::BaseComponent* obj); /// Alias for context->executeVisitor(this) virtual void execute(sofa::core::objectmodel::BaseContext* node, bool precomputedOrder=false); /// Optional helper method to call before handling an object if not using the for_each method. /// It currently takes care of time logging, but could be extended (step-by-step execution for instance) - virtual ctime_t begin(simulation::Node *node, sofa::core::objectmodel::BaseObject *obj, + virtual ctime_t begin(simulation::Node *node, sofa::core::objectmodel::BaseComponent *obj, const std::string &typeInfo = std::string("type")); /// Optional helper method to call after handling an object if not using the for_each method. /// It currently takes care of time logging, but could be extended (step-by-step execution for instance) - virtual void end(simulation::Node* node, sofa::core::objectmodel::BaseObject* obj, ctime_t t0); + virtual void end(simulation::Node* node, sofa::core::objectmodel::BaseComponent* obj, ctime_t t0); /// Optional helper method to call before handling an object if not using the for_each method. /// It currently takes care of time logging, but could be extended (step-by-step execution for instance) - virtual ctime_t begin(simulation::Visitor::VisitorContext *node, sofa::core::objectmodel::BaseObject *obj, + virtual ctime_t begin(simulation::Visitor::VisitorContext *node, sofa::core::objectmodel::BaseComponent *obj, const std::string &typeInfo = std::string("type")); /// Optional helper method to call after handling an object if not using the for_each method. /// It currently takes care of time logging, but could be extended (step-by-step execution for instance) - virtual void end(simulation::Visitor::VisitorContext* node, sofa::core::objectmodel::BaseObject* obj, ctime_t t0); + virtual void end(simulation::Visitor::VisitorContext* node, sofa::core::objectmodel::BaseComponent* obj, ctime_t t0); /// Specify whether this visitor can be parallelized. virtual bool isThreadSafe() const { return false; } diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/XMLPrintVisitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/XMLPrintVisitor.h index 2e13904f9e4..24097fbb38e 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/XMLPrintVisitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/XMLPrintVisitor.h @@ -45,7 +45,7 @@ class SOFA_SIMULATION_CORE_API XMLPrintVisitor : public Visitor template void processObjects(Seq& list); - void processBaseObject(sofa::core::objectmodel::BaseObject* obj); + void processBaseObject(sofa::core::objectmodel::BaseComponent* obj); Result processNodeTopDown(simulation::Node* node) override; void processNodeBottomUp(simulation::Node* node) override; diff --git a/Sofa/framework/Simulation/Graph/test/Link_test.cpp b/Sofa/framework/Simulation/Graph/test/Link_test.cpp index 212d3c8d90a..56ec9cf2d8c 100644 --- a/Sofa/framework/Simulation/Graph/test/Link_test.cpp +++ b/Sofa/framework/Simulation/Graph/test/Link_test.cpp @@ -28,7 +28,6 @@ using namespace sofa::simpleapi ; #include "Node_test.h" #include -using sofa::core::objectmodel::BaseObject ; #include using sofa::core::objectmodel::BaseNode ; @@ -45,15 +44,15 @@ struct Link_test : public BaseSimulationTest { SceneInstance si("root") ; - auto aBaseObject = sofa::core::objectmodel::New(); + auto aBaseObject = sofa::core::objectmodel::New(); sofa::core::objectmodel::Base* aBasePtr = aBaseObject.get(); si.root->addObject(aBaseObject); using sofa::core::objectmodel::BaseNode; - BaseLink::InitLink initObjectLink(aBaseObject.get(), "objectlink", ""); - BaseLink::InitLink initNodeLink(aBaseObject.get(), "nodelink", ""); - SingleLink objectLink(initObjectLink) ; - SingleLink nodeLink(initNodeLink); + BaseLink::InitLink initObjectLink(aBaseObject.get(), "objectlink", ""); + BaseLink::InitLink initNodeLink(aBaseObject.get(), "nodelink", ""); + SingleLink objectLink(initObjectLink) ; + SingleLink nodeLink(initNodeLink); // objectLink.add(aBasePtr); //< not possible because of template type specification @@ -69,14 +68,14 @@ struct Link_test : public BaseSimulationTest void read_multilink_test() { const SceneInstance si("root") ; - const BaseObject::SPtr A = sofa::core::objectmodel::New(); - const BaseObject::SPtr B = sofa::core::objectmodel::New(); - const BaseObject::SPtr C = sofa::core::objectmodel::New(); + const sofa::core::objectmodel::BaseComponent::SPtr A = sofa::core::objectmodel::New(); + const sofa::core::objectmodel::BaseComponent::SPtr B = sofa::core::objectmodel::New(); + const sofa::core::objectmodel::BaseComponent::SPtr C = sofa::core::objectmodel::New(); si.root->addObject(A); si.root->addObject(B); - const BaseLink::InitLink il1(B.get(), "l1", ""); - MultiLink withOwner(il1) ; + const BaseLink::InitLink il1(B.get(), "l1", ""); + MultiLink withOwner(il1) ; // 1. test with valid link & owner EXPECT_TRUE(withOwner.read("@/B")); @@ -91,12 +90,12 @@ struct Link_test : public BaseSimulationTest void read_test() { SceneInstance si("root") ; - BaseObject::SPtr A = sofa::core::objectmodel::New(); - BaseObject::SPtr B = sofa::core::objectmodel::New(); + sofa::core::objectmodel::BaseComponent::SPtr A = sofa::core::objectmodel::New(); + sofa::core::objectmodel::BaseComponent::SPtr B = sofa::core::objectmodel::New(); si.root->addObject(A); - BaseLink::InitLink il1(B.get(), "l1", ""); - SingleLink withOwner(il1) ; - SingleLink withoutOwner; + BaseLink::InitLink il1(B.get(), "l1", ""); + SingleLink withOwner(il1) ; + SingleLink withoutOwner; withoutOwner.setOwner(nullptr); // 1. test with invalid link & no owner @@ -126,12 +125,12 @@ struct Link_test : public BaseSimulationTest void read_test_tofix() { const SceneInstance si("root"); - const BaseObject::SPtr A = sofa::core::objectmodel::New(); - const BaseObject::SPtr B = sofa::core::objectmodel::New(); + const sofa::core::objectmodel::BaseComponent::SPtr A = sofa::core::objectmodel::New(); + const sofa::core::objectmodel::BaseComponent::SPtr B = sofa::core::objectmodel::New(); si.root->addObject(A); - const BaseLink::InitLink il1(B.get(), "l1", ""); - SingleLink withOwner(il1); - SingleLink withoutOwner; + const BaseLink::InitLink il1(B.get(), "l1", ""); + SingleLink withOwner(il1); + SingleLink withoutOwner; withoutOwner.setOwner(nullptr); // Here link is OK, but points to a BaseNode, while the link only accepts BaseObjects. Should return false. But returns true, since findLinkDest returns false in read() diff --git a/Sofa/framework/Simulation/Graph/test/MutationListener_test.cpp b/Sofa/framework/Simulation/Graph/test/MutationListener_test.cpp index bca065e28a5..73dcaa33304 100644 --- a/Sofa/framework/Simulation/Graph/test/MutationListener_test.cpp +++ b/Sofa/framework/Simulation/Graph/test/MutationListener_test.cpp @@ -27,7 +27,6 @@ using sofa::testing::BaseTest; #include #include using sofa::simulation::MutationListener; -using sofa::core::objectmodel::BaseObject; using sofa::simulation::Simulation; using sofa::simulation::Node; @@ -51,20 +50,20 @@ class TestMutationListener : public MutationListener log += "End Remove " + child->getName() + " from " + parent->getName() + "\n"; } - void onBeginAddObject(Node* parent, BaseObject* obj) override + void onBeginAddObject(Node* parent, sofa::core::objectmodel::BaseComponent* obj) override { log += "Begin Add " + obj->getName() + " to " + parent->getName() + "\n"; } - void onEndAddObject(Node* parent, BaseObject* obj) override + void onEndAddObject(Node* parent, sofa::core::objectmodel::BaseComponent* obj) override { log += "End Add " + obj->getName() + " to " + parent->getName() + "\n"; } - void onBeginRemoveObject(Node* parent, BaseObject* obj) override + void onBeginRemoveObject(Node* parent, sofa::core::objectmodel::BaseComponent* obj) override { log += "Begin Remove " + obj->getName() + " from " + parent->getName() + "\n"; } - void onEndRemoveObject(Node* parent, BaseObject* obj) override + void onEndRemoveObject(Node* parent, sofa::core::objectmodel::BaseComponent* obj) override { log += "End Remove " + obj->getName() + " from " + parent->getName() + "\n"; } @@ -85,8 +84,8 @@ struct MutationListener_test : public BaseTest Node::SPtr node1_1; Node::SPtr node1_2; Node::SPtr node2; - BaseObject::SPtr obj1; - BaseObject::SPtr obj2; + sofa::core::objectmodel::BaseComponent::SPtr obj1; + sofa::core::objectmodel::BaseComponent::SPtr obj2; MutationListener_test() {} @@ -223,13 +222,13 @@ struct MutationListener_test : public BaseTest void test_addObject() { sofa::core::objectmodel::BaseObjectDescription bod1("obj1", "BaseObject"); - obj1 = sofa::core::objectmodel::New(); + obj1 = sofa::core::objectmodel::New(); obj1->parse(&bod1); root->addObject(obj1); EXPECT_EQ("Begin Add obj1 to root\nEnd Add obj1 to root\n", listener.log); listener.clearLog(); sofa::core::objectmodel::BaseObjectDescription bod2("obj2", "BaseObject"); - obj2 = sofa::core::objectmodel::New(); + obj2 = sofa::core::objectmodel::New(); obj2->parse(&bod2); root->addObject(obj2); EXPECT_EQ("Begin Add obj2 to root\nEnd Add obj2 to root\n", listener.log); @@ -293,11 +292,11 @@ struct MutationListener_test : public BaseTest const Node::SPtr node2 = sofa::core::objectmodel::New("node2"); node1->addChild(node2); sofa::core::objectmodel::BaseObjectDescription bod1("obj1", "BaseObject"); - obj1 = sofa::core::objectmodel::New(); + obj1 = sofa::core::objectmodel::New(); obj1->parse(&bod1); node2->addObject(obj1); sofa::core::objectmodel::BaseObjectDescription bod2("obj2", "BaseObject"); - obj2 = sofa::core::objectmodel::New(); + obj2 = sofa::core::objectmodel::New(); obj2->parse(&bod2); node2->addObject(obj2); listener.clearLog(); @@ -315,11 +314,11 @@ struct MutationListener_test : public BaseTest const Node::SPtr node2 = sofa::core::objectmodel::New("node2"); node1->addChild(node2); sofa::core::objectmodel::BaseObjectDescription bod1("obj1", "BaseObject"); - obj1 = sofa::core::objectmodel::New(); + obj1 = sofa::core::objectmodel::New(); obj1->parse(&bod1); node2->addObject(obj1); sofa::core::objectmodel::BaseObjectDescription bod2("obj2", "BaseObject"); - obj2 = sofa::core::objectmodel::New(); + obj2 = sofa::core::objectmodel::New(); obj2->parse(&bod2); node2->addObject(obj2); root->addChild(node1); @@ -338,11 +337,11 @@ struct MutationListener_test : public BaseTest const Node::SPtr node2 = sofa::core::objectmodel::New("node2"); node1->addChild(node2); sofa::core::objectmodel::BaseObjectDescription bod1("obj1", "BaseObject"); - obj1 = sofa::core::objectmodel::New(); + obj1 = sofa::core::objectmodel::New(); obj1->parse(&bod1); node2->addObject(obj1); sofa::core::objectmodel::BaseObjectDescription bod2("obj2", "BaseObject"); - obj2 = sofa::core::objectmodel::New(); + obj2 = sofa::core::objectmodel::New(); obj2->parse(&bod2); node2->addObject(obj2); root->addChild(node1); @@ -370,11 +369,11 @@ struct MutationListener_test : public BaseTest const Node::SPtr node8 = sofa::core::objectmodel::New("node8"); sofa::core::objectmodel::BaseObjectDescription bod1("obj1", "BaseObject"); - obj1 = sofa::core::objectmodel::New(); + obj1 = sofa::core::objectmodel::New(); obj1->parse(&bod1); node1->addObject(obj1); sofa::core::objectmodel::BaseObjectDescription bod2("obj2", "BaseObject"); - obj2 = sofa::core::objectmodel::New(); + obj2 = sofa::core::objectmodel::New(); obj2->parse(&bod2); node1->addObject(obj2); diff --git a/Sofa/framework/Simulation/Graph/test/Node_test.cpp b/Sofa/framework/Simulation/Graph/test/Node_test.cpp index 8f0b4540562..ed2dff0e225 100644 --- a/Sofa/framework/Simulation/Graph/test/Node_test.cpp +++ b/Sofa/framework/Simulation/Graph/test/Node_test.cpp @@ -55,7 +55,7 @@ TEST( Node_test, getPathName) const Node::SPtr root = sofa::simpleapi::createNode("A"); const Node::SPtr B = createChild(root, "B"); const Node::SPtr D = createChild(B, "D"); - const BaseObject::SPtr C = core::objectmodel::New("C"); + const sofa::core::objectmodel::BaseComponent::SPtr C = core::objectmodel::New("C"); root->addObject(C); EXPECT_STREQ(root->getPathName().c_str(), "/"); @@ -67,8 +67,8 @@ TEST( Node_test, getPathName) TEST(Node_test, addObject) { const sofa::core::sptr root = sofa::simpleapi::createNode("root"); - const BaseObject::SPtr A = core::objectmodel::New("A"); - const BaseObject::SPtr B = core::objectmodel::New("B"); + const sofa::core::objectmodel::BaseComponent::SPtr A = core::objectmodel::New("A"); + const sofa::core::objectmodel::BaseComponent::SPtr B = core::objectmodel::New("B"); root->addObject(A); @@ -83,8 +83,8 @@ TEST(Node_test, addObject) TEST(Node_test, addObjectAtFront) { const sofa::core::sptr root = sofa::simpleapi::createNode("root"); - const BaseObject::SPtr A = core::objectmodel::New("A"); - const BaseObject::SPtr B = core::objectmodel::New("B"); + const sofa::core::objectmodel::BaseComponent::SPtr A = core::objectmodel::New("A"); + const sofa::core::objectmodel::BaseComponent::SPtr B = core::objectmodel::New("B"); root->addObject(A); @@ -103,8 +103,8 @@ TEST(Node_test, addObjectPreventingSharedContext) const sofa::core::sptr root = sofa::simpleapi::createNode("root"); - const BaseObject::SPtr A = core::objectmodel::New("A"); - const BaseObject::SPtr B = core::objectmodel::New("B"); + const core::objectmodel::BaseObject::SPtr A = core::objectmodel::New("A"); + const core::objectmodel::BaseObject::SPtr B = core::objectmodel::New("B"); const auto child1 = sofa::simpleapi::createChild(root, "child1"); const auto child2 = sofa::simpleapi::createChild(root, "child2"); diff --git a/applications/plugins/MultiThreading/src/MultiThreading/DataExchange.inl b/applications/plugins/MultiThreading/src/MultiThreading/DataExchange.inl index e8501ae6626..cb9f1244571 100644 --- a/applications/plugins/MultiThreading/src/MultiThreading/DataExchange.inl +++ b/applications/plugins/MultiThreading/src/MultiThreading/DataExchange.inl @@ -28,7 +28,7 @@ namespace sofa::core template DataExchange::DataExchange( const char* from, const char* to ) - : BaseObject() + : BaseComponent() , mSource(initData(&mSource,"from","source object to copy")) , mDestination(initData(&mDestination,"to","destination object to copy")) , mSourcePtr(nullptr) diff --git a/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.cpp b/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.cpp index 61ab852d8b2..02e030a9c14 100644 --- a/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.cpp +++ b/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.cpp @@ -62,7 +62,6 @@ using sofa::helper::system::DataRepository ; static sofa::simulation::Node::SPtr root = nullptr; -using sofa::core::objectmodel::BaseObject ; Node::SPtr createRootWithCollisionPipeline(const std::string& responseType) @@ -184,7 +183,7 @@ Node::SPtr createObstacle(Node::SPtr parent, const std::string &filenameCollisi } -Node::SPtr createCollisionNodeVec3(Node::SPtr parent, BaseObject::SPtr dof, +Node::SPtr createCollisionNodeVec3(Node::SPtr parent, sofa::core::objectmodel::BaseObject::SPtr dof, const std::string &filename, const std::vector &elements, const Deriv3& translation, const Deriv3 &rotation) @@ -214,7 +213,7 @@ Node::SPtr createCollisionNodeVec3(Node::SPtr parent, BaseObject::SPtr dof, } simulation::Node::SPtr createVisualNodeVec3(simulation::Node::SPtr parent, - BaseObject::SPtr dof, + sofa::core::objectmodel::BaseObject::SPtr dof, const std::string &filename, const std::string& color, const Deriv3& translation, const Deriv3 &rotation, const MappingType &mappingT) @@ -259,7 +258,7 @@ simulation::Node::SPtr createVisualNodeVec3(simulation::Node::SPtr parent, -Node::SPtr createCollisionNodeRigid(Node::SPtr parent, BaseObject::SPtr dofRigid, +Node::SPtr createCollisionNodeRigid(Node::SPtr parent, sofa::core::objectmodel::BaseObject::SPtr dofRigid, const std::string &filename, const std::vector &elements, const Deriv3& translation, const Deriv3 &rotation) @@ -290,7 +289,7 @@ Node::SPtr createCollisionNodeRigid(Node::SPtr parent, BaseObject::SPtr dofRig return node; } -Node::SPtr createVisualNodeRigid(Node::SPtr parent, BaseObject::SPtr dofRigid, +Node::SPtr createVisualNodeRigid(Node::SPtr parent, sofa::core::objectmodel::BaseObject::SPtr dofRigid, const std::string &filename, const std::string& color, const Deriv3& translation, const Deriv3 &rotation) { diff --git a/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.h b/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.h index 4e96d044df9..697a8738744 100644 --- a/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.h +++ b/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.h @@ -34,7 +34,6 @@ namespace sofa::modeling { -using sofa::core::objectmodel::BaseObject ; typedef SReal Scalar; typedef sofa::defaulttype::Vec3Types::Deriv Deriv3; @@ -65,13 +64,13 @@ SOFA_SCENECREATOR_API simulation::Node::SPtr createObstacle(simulation::Node::SP /// Create a collision node using Barycentric Mapping, using a 3d model specified by filename. /// elements is a vector of type of collision models (Triangle, Line, Point, Sphere) /// an initial transformation can be performed -SOFA_SCENECREATOR_API simulation::Node::SPtr createCollisionNodeVec3(simulation::Node::SPtr parent, BaseObject::SPtr dof, +SOFA_SCENECREATOR_API simulation::Node::SPtr createCollisionNodeVec3(simulation::Node::SPtr parent, sofa::core::objectmodel::BaseObject::SPtr dof, const std::string &filename, const std::vector &elements, const Deriv3& translation=Deriv3(), const Deriv3 &rotation=Deriv3()); -SOFA_SCENECREATOR_API simulation::Node::SPtr createVisualNodeVec3(simulation::Node::SPtr parent, BaseObject::SPtr dof, +SOFA_SCENECREATOR_API simulation::Node::SPtr createVisualNodeVec3(simulation::Node::SPtr parent, sofa::core::objectmodel::BaseObject::SPtr dof, const std::string &filename, const std::string& color, const Deriv3& translation=Deriv3(), const Deriv3 &rotation=Deriv3(), @@ -82,14 +81,14 @@ SOFA_SCENECREATOR_API simulation::Node::SPtr createVisualNodeVec3(simulation::No /// elements is a vector of type of collision models (Triangle, Line, Point, Sphere) /// an initial transformation can be performed SOFA_SCENECREATOR_API simulation::Node::SPtr createCollisionNodeRigid(simulation::Node::SPtr parent, - BaseObject::SPtr dofRigid, + sofa::core::objectmodel::BaseObject::SPtr dofRigid, const std::string &filename, const std::vector &elements, const Deriv3& translation=Deriv3(), const Deriv3 &rotation=Deriv3()); SOFA_SCENECREATOR_API simulation::Node::SPtr createVisualNodeRigid(simulation::Node::SPtr parent, - BaseObject::SPtr dofRigid, + sofa::core::objectmodel::BaseObject::SPtr dofRigid, const std::string &filename, const std::string& color, const Deriv3& translation=Deriv3(), diff --git a/applications/projects/SceneChecking/tests/SceneChecker_test.cpp b/applications/projects/SceneChecking/tests/SceneChecker_test.cpp index 2ffe0b510c4..708f58e4533 100644 --- a/applications/projects/SceneChecking/tests/SceneChecker_test.cpp +++ b/applications/projects/SceneChecking/tests/SceneChecker_test.cpp @@ -51,7 +51,6 @@ using sofa::core::execparams::defaultInstance; /// This component is only for testing the APIVersion system. //////////////////////////////////////////////////////////////////////////////////////////////////// #include -using sofa::core::objectmodel::BaseObject; using sofa::core::objectmodel::Base; #include @@ -60,10 +59,10 @@ using sofa::core::ExecParams; #include -class ComponentDeprecated : public BaseObject +class ComponentDeprecated : public sofa::core::objectmodel::BaseComponent { public: - SOFA_CLASS(ComponentDeprecated, BaseObject); + SOFA_CLASS(ComponentDeprecated, sofa::core::objectmodel::BaseComponent); public: };