Skip to content

Commit 64b002c

Browse files
fredroyalxbilger
authored andcommitted
replace baseobject with basecomponent
1 parent 37ca9db commit 64b002c

27 files changed

+48
-48
lines changed

Plugin/src/SofaPython3/DataHelper.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ void checkAmbiguousCreation(BaseNode* self, const std::string& name, const std::
525525

526526
}
527527

528-
void checkAmbiguousCreation(BaseObject* self, const std::string& name, const std::string& type)
528+
void checkAmbiguousCreation(BaseComponent* self, const std::string& name, const std::string& type)
529529
{
530530
if (!self) return;
531531

@@ -543,14 +543,14 @@ void checkAmbiguousCreation(BaseObject* self, const std::string& name, const std
543543
void checkAmbiguousCreation(Base* self, const std::string& name, const std::string& type)
544544
{
545545
checkAmbiguousCreation(dynamic_cast<BaseNode*>(self), name, type);
546-
checkAmbiguousCreation(dynamic_cast<BaseObject*>(self), name, type);
546+
checkAmbiguousCreation(dynamic_cast<BaseComponent*>(self), name, type);
547547
}
548548

549549
void checkAmbiguousCreation(py::object& py_self, const std::string& name, const std::string& type)
550550
{
551551
Base* self = py::cast<Base*>(py_self);
552552
checkAmbiguousCreation(dynamic_cast<BaseNode*>(self), name, type);
553-
checkAmbiguousCreation(dynamic_cast<BaseObject*>(self), name, type);
553+
checkAmbiguousCreation(dynamic_cast<BaseComponent*>(self), name, type);
554554

555555
if (py_self.attr("__dict__").contains(name))
556556
msg_warning(self) << "Ambiguous creation of " << type << " named '" << name << "' in " << self->getName() << ": Component alread has a python attribute with such name in __dict__";
@@ -581,7 +581,7 @@ BaseData* addData(py::object py_self, const std::string& name, py::object value,
581581
data = deriveTypeFromParent(dynamic_cast<BaseNode*>(self)->getContext(),
582582
py::cast<py::str>(value));
583583
else
584-
data = deriveTypeFromParent(dynamic_cast<BaseObject*>(self)->getContext(),
584+
data = deriveTypeFromParent(dynamic_cast<BaseComponent*>(self)->getContext(),
585585
py::cast<py::str>(value));
586586
if (!data)
587587
throw py::type_error("Cannot deduce type from value");

Plugin/src/SofaPython3/DataHelper.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <sofa/helper/Factory.h>
2929
#include <sofa/core/objectmodel/Data.h>
3030
#include <sofa/core/objectmodel/Base.h>
31-
#include <sofa/core/objectmodel/BaseObject.h>
31+
#include <sofa/core/objectmodel/BaseComponent.h>
3232
#include <sofa/core/objectmodel/BaseNode.h>
3333
#include <SofaPython3/config.h>
3434

@@ -62,7 +62,7 @@ namespace sofa {
6262
if (l.getTargetBase())
6363
{
6464
auto bn = l.getTargetBase()->toBaseNode();
65-
auto bo = l.getTargetBase()->toBaseObject();
65+
auto bo = l.getTargetBase()->toBaseComponent();
6666
out << "@" + (bn ? bn->getPathName() : bo->getPathName());
6767
}
6868
out << l.getTargetPath();
@@ -148,7 +148,7 @@ namespace sofa {
148148
if (ptr.getTargetBase())
149149
{
150150
auto bn = ptr.getTargetBase()->toBaseNode();
151-
auto bo = ptr.getTargetBase()->toBaseObject();
151+
auto bo = ptr.getTargetBase()->toBaseComponent();
152152
return "@" + (bn ? bn->getPathName() : bo->getPathName());
153153
}
154154
return ptr.getTargetPath();
@@ -181,7 +181,7 @@ using sofa::core::objectmodel::Base;
181181
using sofa::core::objectmodel::BaseData;
182182
using sofa::core::objectmodel::BaseLink;
183183
using sofa::core::objectmodel::BaseNode;
184-
using sofa::core::objectmodel::BaseObject;
184+
using sofa::core::objectmodel::BaseComponent;
185185
using sofa::defaulttype::AbstractTypeInfo;
186186

187187
SOFAPYTHON3_API void setItem2D(pybind11::array a, pybind11::slice slice, pybind11::object o);

bindings/Modules/src/SofaPython3/SofaBaseTopology/Binding_RegularGridTopology.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <SofaPython3/PythonFactory.h>
2727

2828
using sofa::component::topology::container::grid::RegularGridTopology;
29-
using sofa::core::objectmodel::BaseObject;
29+
using sofa::core::objectmodel::BaseComponent;
3030

3131
PYBIND11_DECLARE_HOLDER_TYPE(Base, sofa::core::sptr<Base>, true)
3232

@@ -35,7 +35,7 @@ namespace sofapython3 {
3535
namespace py { using namespace pybind11; }
3636

3737
void moduleAddRegularGridTopology(pybind11::module& m) {
38-
py::class_<RegularGridTopology, sofa::core::objectmodel::BaseObject,sofa::core::sptr<RegularGridTopology>>
38+
py::class_<RegularGridTopology, sofa::core::objectmodel::BaseComponent,sofa::core::sptr<RegularGridTopology>>
3939
c (m, "RegularGridTopology", doc::SofaBaseTopology::regularGridTopologyClass);
4040

4141
c.def("getPoint", &RegularGridTopology::getPoint, doc::SofaBaseTopology::getPoint);

bindings/Modules/src/SofaPython3/SofaBaseTopology/Binding_SparseGridTopology.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <SofaPython3/PythonFactory.h>
2828

2929
using sofa::component::topology::container::grid::SparseGridTopology;
30-
using sofa::core::objectmodel::BaseObject;
30+
using sofa::core::objectmodel::BaseComponent;
3131

3232
PYBIND11_DECLARE_HOLDER_TYPE(Base, sofa::core::sptr<Base>, true)
3333

@@ -36,7 +36,7 @@ namespace sofapython3 {
3636
namespace py { using namespace pybind11; }
3737

3838
void moduleAddSparseGridTopology(pybind11::module& m) {
39-
py::class_<SparseGridTopology, sofa::core::objectmodel::BaseObject,sofa::core::sptr<SparseGridTopology>>
39+
py::class_<SparseGridTopology, sofa::core::objectmodel::BaseComponent,sofa::core::sptr<SparseGridTopology>>
4040
c(m, "SparseGridTopology", doc::SofaBaseTopology::sparseGridTopologyClass);
4141

4242
// getRegularGrid ()

bindings/Modules/src/SofaPython3/SofaConstraintSolver/Binding_ConstraintSolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void moduleAddConstraintSolver(py::module &m)
3939
{
4040
const auto typeName = ConstraintSolverImpl::GetClass()->className;
4141
py::class_<ConstraintSolverImpl,
42-
sofa::core::objectmodel::BaseObject,
42+
sofa::core::objectmodel::BaseComponent,
4343
sofapython3::py_shared_ptr<ConstraintSolverImpl> > c(m, typeName.c_str(), sofapython3::doc::constraintsolver::constraintSolverClass);
4444

4545
c.def("W", [](ConstraintSolverImpl& self) -> EigenMatrixMap

bindings/Modules/src/SofaPython3/SofaDeformable/Binding_SpringForceField.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void bindSpringForcefield(py::module& m) {
5151
DataType::Name();
5252

5353
py::class_<SpringForceField,
54-
sofa::core::objectmodel::BaseObject,
54+
sofa::core::objectmodel::BaseComponent,
5555
py_shared_ptr<SpringForceField>> s (m, type_name.c_str(), sofapython3::doc::SofaDeformable::SpringForceFieldClass);
5656

5757
// remove all springs and optionally reserve memory for #reserve springs in the vector of springs

bindings/Modules/src/SofaPython3/SofaLinearSolver/Binding_LinearSolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void bindLinearSolvers(py::module &m)
6262
const std::string typeName = CRSLinearSolver::GetClass()->className + CRSLinearSolver::GetCustomTemplateName();
6363

6464
py::class_<CRSLinearSolver,
65-
sofa::core::objectmodel::BaseObject,
65+
sofa::core::objectmodel::BaseComponent,
6666
sofapython3::py_shared_ptr<CRSLinearSolver> > c(m, typeName.c_str(), sofapython3::doc::linearsolver::linearSolverClass);
6767

6868
c.def("A", [](CRSLinearSolver& self) -> EigenSparseMatrix

bindings/Modules/src/SofaPython3/SofaLinearSystem/Binding_LinearSystem.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Vector<typename TVector::Real> getSolutionVector(sofa::component::linearsystem::
6565
template<class TMatrix, class TVector>
6666
using LinearSystemClass =
6767
py::class_<sofa::component::linearsystem::TypedMatrixLinearSystem<TMatrix, TVector>,
68-
sofa::core::objectmodel::BaseObject,
68+
sofa::core::objectmodel::BaseComponent,
6969
sofapython3::py_shared_ptr<sofa::component::linearsystem::TypedMatrixLinearSystem<TMatrix, TVector>> >;
7070

7171
template<class TMatrix, class TVector>

bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Base.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ py::object BindingBase::getData(Base& self, const std::string& s)
430430

431431
std::string BindingBase::getPathName(Base& self)
432432
{
433-
return self.toBaseNode() ? self.toBaseNode()->getPathName() : self.toBaseObject()->getPathName();
433+
return self.toBaseNode() ? self.toBaseNode()->getPathName() : self.toBaseComponent()->getPathName();
434434
}
435435

436436
std::string BindingBase::getLinkPath(Base& self)

bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_BaseCamera.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include <SofaPython3/PythonFactory.h>
3333

3434
namespace py { using namespace pybind11; }
35-
using sofa::core::objectmodel::BaseObject;
35+
using sofa::core::objectmodel::BaseComponent;
3636
using sofa::component::visual::BaseCamera;
3737

3838
namespace sofapython3 {
@@ -74,7 +74,7 @@ void moduleAddBaseCamera(py::module &m)
7474
{
7575
/// register the BaseCamera binding in the pybind11 typeing sytem
7676
py::class_<BaseCamera,
77-
sofa::core::objectmodel::BaseObject,
77+
sofa::core::objectmodel::BaseComponent,
7878
py_shared_ptr<BaseCamera>> c(m, "Camera", sofapython3::doc::baseCamera::baseCameraClass);
7979

8080
/// register the BaseCamera binding in the downcasting subsystem

0 commit comments

Comments
 (0)