Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace sofa::component::collision::detection::algorithm
{

BaseSubCollisionPipeline::BaseSubCollisionPipeline()
: sofa::core::objectmodel::BaseObject()
: sofa::core::objectmodel::BaseComponent()
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ namespace sofa::component::collision::detection::algorithm
* @see SubCollisionPipeline for a concrete implementation
* @see CompositeCollisionPipeline for the aggregator that manages sub-pipelines
*/
class SOFA_COMPONENT_COLLISION_DETECTION_ALGORITHM_API BaseSubCollisionPipeline : public sofa::core::objectmodel::BaseObject
class SOFA_COMPONENT_COLLISION_DETECTION_ALGORITHM_API BaseSubCollisionPipeline : public sofa::core::objectmodel::BaseComponent
{
public:
SOFA_ABSTRACT_CLASS(BaseSubCollisionPipeline, sofa::core::objectmodel::BaseObject);
SOFA_ABSTRACT_CLASS(BaseSubCollisionPipeline, sofa::core::objectmodel::BaseComponent);

protected:
BaseSubCollisionPipeline();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
namespace sofa::component::collision::detection::algorithm
{

class SOFA_COMPONENT_COLLISION_DETECTION_ALGORITHM_API BruteForceDetection final : public sofa::core::objectmodel::BaseObject
class SOFA_COMPONENT_COLLISION_DETECTION_ALGORITHM_API BruteForceDetection final : public sofa::core::objectmodel::BaseComponent
{
public:
SOFA_CLASS(BruteForceDetection, sofa::core::objectmodel::BaseObject);
SOFA_CLASS(BruteForceDetection, sofa::core::objectmodel::BaseComponent);

void init() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
namespace sofa::component::collision::detection::algorithm
{

class SOFA_COMPONENT_COLLISION_DETECTION_ALGORITHM_API DirectSAP final : public sofa::core::objectmodel::BaseObject
class SOFA_COMPONENT_COLLISION_DETECTION_ALGORITHM_API DirectSAP final : public sofa::core::objectmodel::BaseComponent
{
public:
SOFA_CLASS(DirectSAP, sofa::core::objectmodel::BaseObject);
SOFA_CLASS(DirectSAP, sofa::core::objectmodel::BaseComponent);

void init() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ namespace sofa::component::collision::detection::algorithm
* colliding state. It must be used with a TriangleOctreeModel,as an octree is used to traverse the object.
*/
class SOFA_COMPONENT_COLLISION_DETECTION_ALGORITHM_API RayTraceDetection final :
public sofa::core::objectmodel::BaseObject
public sofa::core::objectmodel::BaseComponent
{
public:
SOFA_CLASS(RayTraceDetection, sofa::core::objectmodel::BaseObject);
SOFA_CLASS(RayTraceDetection, sofa::core::objectmodel::BaseComponent);

void init() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ using std::string;
#include <sofa/core/fwd.h>
using sofa::core::execparams::defaultInstance;

#include<sofa/core/objectmodel/BaseObject.h>
using sofa::core::objectmodel::BaseObject ;
#include<sofa/core/objectmodel/BaseComponent.h>
using sofa::core::objectmodel::BaseComponent ;

#include <sofa/component/collision/detection/algorithm/CollisionPipeline.h>
using sofa::component::collision::detection::algorithm::CollisionPipeline ;
Expand Down Expand Up @@ -117,7 +117,7 @@ void TestCollisionPipeline::checkCollisionPipelineWithNoAttributes()
ASSERT_NE(root.get(), nullptr) ;
root->init(sofa::core::execparams::defaultInstance()) ;

sofa::core::objectmodel::BaseObject* clp = root->getObject("pipeline") ;
sofa::core::objectmodel::BaseComponent* clp = root->getObject("pipeline") ;
ASSERT_NE(clp, nullptr) ;
}

Expand All @@ -143,7 +143,7 @@ void TestCollisionPipeline::checkCollisionPipelineWithMissingIntersection()
ASSERT_NE(root.get(), nullptr) ;
root->init(sofa::core::execparams::defaultInstance()) ;

sofa::core::objectmodel::BaseObject* clp = root->getObject("pipeline") ;
sofa::core::objectmodel::BaseComponent* clp = root->getObject("pipeline") ;
ASSERT_NE(clp, nullptr) ;
}

Expand All @@ -169,7 +169,7 @@ void TestCollisionPipeline::checkCollisionPipelineWithMissingBroadPhase()
ASSERT_NE(root.get(), nullptr) ;
root->init(sofa::core::execparams::defaultInstance()) ;

sofa::core::objectmodel::BaseObject* clp = root->getObject("pipeline") ;
sofa::core::objectmodel::BaseComponent* clp = root->getObject("pipeline") ;
ASSERT_NE(clp, nullptr) ;
}
void TestCollisionPipeline::checkCollisionPipelineWithMissingNarrowPhase()
Expand All @@ -194,7 +194,7 @@ void TestCollisionPipeline::checkCollisionPipelineWithMissingNarrowPhase()
ASSERT_NE(root.get(), nullptr) ;
root->init(sofa::core::execparams::defaultInstance()) ;

sofa::core::objectmodel::BaseObject* clp = root->getObject("pipeline") ;
sofa::core::objectmodel::BaseComponent* clp = root->getObject("pipeline") ;
ASSERT_NE(clp, nullptr) ;
}
void TestCollisionPipeline::checkCollisionPipelineWithMissingContactManager()
Expand All @@ -219,7 +219,7 @@ void TestCollisionPipeline::checkCollisionPipelineWithMissingContactManager()
ASSERT_NE(root.get(), nullptr) ;
root->init(sofa::core::execparams::defaultInstance()) ;

BaseObject* clp = root->getObject("pipeline") ;
BaseComponent* clp = root->getObject("pipeline") ;
ASSERT_NE(clp, nullptr) ;

}
Expand All @@ -243,7 +243,7 @@ void TestCollisionPipeline::checkCollisionPipelineWithMissingCollisionModel()
ASSERT_NE(root.get(), nullptr) ;
root->init(sofa::core::execparams::defaultInstance()) ;

sofa::core::objectmodel::BaseObject* clp = root->getObject("pipeline") ;
sofa::core::objectmodel::BaseComponent* clp = root->getObject("pipeline") ;
ASSERT_NE(clp, nullptr) ;

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void LineCollisionModel<DataTypes>::init()
if (!bmt)
{
msg_error() << "No topology component found at path: " << l_topology.getLinkedPath() << ", nor in current context: " << this->getContext()->name << ". LineCollisionModel<sofa::defaulttype::Vec3Types> requires a MeshTopology";
sofa::core::objectmodel::BaseObject::d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid);
this->d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid);
return;
}
resize( bmt->getNbEdges() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void TetrahedronCollisionModel::init()
if (!m_topology)
{
msg_error() << "No topology component found at path: " << l_topology.getLinkedPath() << ", nor in current context: " << this->getContext()->name << ". TetrahedronCollisionModel requires a BaseMeshTopology";
sofa::core::objectmodel::BaseObject::d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid);
this->d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void TriangleCollisionModel<DataTypes>::init()
if (!m_topology)
{
msg_error() << "No topology component found at path: " << l_topology.getLinkedPath() << ", nor in current context: " << this->getContext()->name << ". TriangleCollisionModel<sofa::defaulttype::Vec3Types> requires a Triangular Topology";
sofa::core::objectmodel::BaseObject::d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid);
this->d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid);
return;
}

Expand Down
8 changes: 4 additions & 4 deletions Sofa/Component/Collision/Geometry/tests/Sphere_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using std::vector;
using std::string;

#include<sofa/core/objectmodel/BaseObject.h>
using sofa::core::objectmodel::BaseObject ;
using sofa::core::objectmodel::BaseComponent ;

#include<sofa/simulation/Node.h>
using sofa::simulation::Node ;
Expand Down Expand Up @@ -434,7 +434,7 @@ void checkAttributes()
EXPECT_NE(root.get(), nullptr) ;
root->init(sofa::core::execparams::defaultInstance()) ;

sofa::core::objectmodel::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
Expand Down Expand Up @@ -462,7 +462,7 @@ void checkSceneWithVec3MechanicalModel()
EXPECT_NE(root.get(), nullptr) ;
root->init(sofa::core::execparams::defaultInstance()) ;

sofa::core::objectmodel::BaseObject* theSphere = root->getTreeNode("Level 1")->getObject("spheremodel") ;
sofa::core::objectmodel::BaseComponent* theSphere = root->getTreeNode("Level 1")->getObject("spheremodel") ;
EXPECT_NE(theSphere, nullptr) ;
}

Expand All @@ -481,7 +481,7 @@ void checkSceneWithRigid3dMechanicalModel()
EXPECT_NE(root.get(), nullptr) ;
root->init(sofa::core::execparams::defaultInstance()) ;

sofa::core::objectmodel::BaseObject* theSphere = root->getTreeNode("Level 1")->getObject("spheremodel") ;
sofa::core::objectmodel::BaseComponent* theSphere = root->getTreeNode("Level 1")->getObject("spheremodel") ;
EXPECT_NE(theSphere, nullptr) ;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ namespace sofa::component::collision::response::contact
// forward declaration
class NarrowPhaseDetection;

class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API ContactListener : public virtual core::objectmodel::BaseObject
class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API ContactListener : public virtual core::objectmodel::BaseComponent
{
public:
SOFA_ABSTRACT_CLASS(ContactListener, core::objectmodel::BaseObject);
SOFA_ABSTRACT_CLASS(ContactListener, core::objectmodel::BaseComponent);


ContactListener(core::CollisionModel* collModel1 = nullptr, core::CollisionModel* collModel2 = nullptr );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class PenalityContactForceField : public core::behavior::PairInteractionForceFie
// -- tool grabbing utility
void grabPoint( const core::behavior::MechanicalState<defaulttype::Vec3Types> *tool,
const type::vector< sofa::Index > &index,
type::vector< std::pair< core::objectmodel::BaseObject*, type::Vec3f> > &result,
type::vector< std::pair< core::objectmodel::BaseComponent*, type::Vec3f> > &result,
type::vector< sofa::Index > &triangle,
type::vector< sofa::Index > &index_point) ;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,13 @@ template<class DataTypes>
void PenalityContactForceField<DataTypes>::grabPoint(
const core::behavior::MechanicalState<defaulttype::Vec3Types> *tool,
const type::vector< sofa::Index > &index,
type::vector< std::pair< core::objectmodel::BaseObject*, type::Vec3f> > &result,
type::vector< std::pair< core::objectmodel::BaseComponent*, type::Vec3f> > &result,
type::vector< sofa::Index > &triangle,
type::vector< sofa::Index > &index_point)
{
const auto& contactsRef = contacts.getValue();

if (static_cast< core::objectmodel::BaseObject *>(this->mstate1) == static_cast< const core::objectmodel::BaseObject *>(tool))
if (static_cast< core::objectmodel::BaseComponent *>(this->mstate1) == static_cast< const core::objectmodel::BaseComponent *>(tool))
{
const auto& mstate2Pos = this->mstate2->read(core::vec_id::read_access::position)->getValue();

Expand All @@ -355,14 +355,14 @@ void PenalityContactForceField<DataTypes>::grabPoint(
{
if (contactsRef[i].m1 == index[j])
{
result.push_back(std::make_pair(static_cast< core::objectmodel::BaseObject *>(this),mstate2Pos[contactsRef[i].m2]));
result.push_back(std::make_pair(static_cast< core::objectmodel::BaseComponent *>(this),mstate2Pos[contactsRef[i].m2]));
triangle.push_back(contactsRef[i].index2);
index_point.push_back(index[j]);
}
}
}
}
else if (static_cast< core::objectmodel::BaseObject *>(this->mstate2) == static_cast< const core::objectmodel::BaseObject *>(tool))
else if (static_cast< core::objectmodel::BaseComponent *>(this->mstate2) == static_cast< const core::objectmodel::BaseComponent *>(tool))
{
const auto& mstate1Pos = this->mstate1->read(core::vec_id::read_access::position)->getValue();
for (sofa::Index i=0; i< contactsRef.size(); i++)
Expand All @@ -371,7 +371,7 @@ void PenalityContactForceField<DataTypes>::grabPoint(
{
if (contactsRef[i].m2 == index[j])
{
result.push_back(std::make_pair(static_cast< core::objectmodel::BaseObject *>(this), mstate1Pos[contactsRef[i].m1]));
result.push_back(std::make_pair(static_cast< core::objectmodel::BaseComponent *>(this), mstate1Pos[contactsRef[i].m1]));
triangle.push_back(contactsRef[i].index1);
index_point.push_back(index[j]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ void LinearSolverConstraintCorrection<DataTypes>::init()
if (l_linearSolver.get() == nullptr)
{
msg_error() << "No LinearSolver component found at path: " << l_linearSolver.getLinkedPath() << ", nor in current context: " << context->name;
sofa::core::objectmodel::BaseObject::d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid);
this->d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid);
return;
}
else
{
if (l_linearSolver->getTemplateName() == "GraphScattered")
{
msg_error() << "Can not use the solver " << l_linearSolver->getName() << " because it is templated on GraphScatteredType";
sofa::core::objectmodel::BaseObject::d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid);
this->d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid);
return;
}
else
Expand All @@ -114,7 +114,7 @@ void LinearSolverConstraintCorrection<DataTypes>::init()
if (l_ODESolver.get() == nullptr)
{
msg_error() << "No ODESolver component found at path: " << l_ODESolver.getLinkedPath() << ", nor in current context: " << context->name;
sofa::core::objectmodel::BaseObject::d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid);
this->d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid);
return;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API ConstraintSolverImpl : pub

/// Do not use the following LCPs until the next call to this function.
/// This is used to prevent concurrent access to the LCP when using a LCPForceFeedback through an haptic thread.
virtual void lockConstraintProblem(sofa::core::objectmodel::BaseObject* from, ConstraintProblem* p1, ConstraintProblem* p2=nullptr) = 0;
virtual void lockConstraintProblem(sofa::core::objectmodel::BaseComponent* from, ConstraintProblem* p1, ConstraintProblem* p2=nullptr) = 0;

void removeConstraintCorrection(core::behavior::BaseConstraintCorrection *s) override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ void GenericConstraintSolver::clearConstraintProblemLocks()
std::fill(m_cpIsLocked.begin(), m_cpIsLocked.end(), false);
}

void GenericConstraintSolver::lockConstraintProblem(sofa::core::objectmodel::BaseObject* from, ConstraintProblem* p1, ConstraintProblem* p2)
void GenericConstraintSolver::lockConstraintProblem(sofa::core::objectmodel::BaseComponent* from, ConstraintProblem* p1, ConstraintProblem* p2)
{
if( (current_cp != p1) && (current_cp != p2) ) // The current ConstraintProblem is not locked
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API GenericConstraintSolver :
bool applyCorrection(const core::ConstraintParams * /*cParams*/, MultiVecId res1, MultiVecId res2=MultiVecId::null()) override;
void computeResidual(const core::ExecParams* /*params*/) override;
ConstraintProblem* getConstraintProblem() override;
void lockConstraintProblem(sofa::core::objectmodel::BaseObject* from, ConstraintProblem* p1, ConstraintProblem* p2 = nullptr) override;
void lockConstraintProblem(sofa::core::objectmodel::BaseComponent* from, ConstraintProblem* p1, ConstraintProblem* p2 = nullptr) override;


Data<int> d_maxIt; ///< maximal number of iterations of iterative algorithm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ ConstraintProblem* LCPConstraintSolver::getConstraintProblem()
return last_cp;
}

void LCPConstraintSolver::lockConstraintProblem(sofa::core::objectmodel::BaseObject* /*from*/, ConstraintProblem* l1, ConstraintProblem* l2)
void LCPConstraintSolver::lockConstraintProblem(sofa::core::objectmodel::BaseComponent* /*from*/, ConstraintProblem* l1, ConstraintProblem* l2)
{
if((current_cp!=l1)&&(current_cp!=l2)) // Le lcp courant n'est pas locké
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API LCPConstraintSolver : publ
DeprecatedAndRemoved d_showLevelTranslation; ///< Translation between levels

ConstraintProblem* getConstraintProblem() override;
void lockConstraintProblem(sofa::core::objectmodel::BaseObject* from, ConstraintProblem* p1, ConstraintProblem* p2=nullptr) override; ///< Do not use the following LCPs until the next call to this function. This is used to prevent concurrent access to the LCP when using a LCPForceFeedback through an haptic thread
void lockConstraintProblem(sofa::core::objectmodel::BaseComponent* from, ConstraintProblem* p1, ConstraintProblem* p2=nullptr) override; ///< Do not use the following LCPs until the next call to this function. This is used to prevent concurrent access to the LCP when using a LCPForceFeedback through an haptic thread

private:
void addRegularization(linearalgebra::BaseMatrix& W);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace sofa::component::engine::generate
class SOFA_COMPONENT_ENGINE_GENERATE_API MeshTetraStuffing : public core::DataEngine
{
public:
SOFA_CLASS(MeshTetraStuffing,core::objectmodel::BaseObject);
SOFA_CLASS(MeshTetraStuffing,core::objectmodel::BaseComponent);

typedef defaulttype::Vec3Types::Real Real;
typedef defaulttype::Vec3Types::Coord Point;
Expand Down
6 changes: 3 additions & 3 deletions Sofa/Component/Engine/Select/tests/BoxROI_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ using sofa::simulation::Simulation;
using sofa::simulation::graph::DAGSimulation;
#include <sofa/simulation/Node.h>
using sofa::simulation::Node;
using sofa::core::objectmodel::BaseObject;
using sofa::core::objectmodel::BaseComponent;
using sofa::core::objectmodel::BaseData;
using sofa::core::objectmodel::New;
using sofa::defaulttype::Vec3Types;
Expand Down Expand Up @@ -133,7 +133,7 @@ struct BoxROITest : public sofa::testing::BaseTest
EXPECT_NE(root.get(), nullptr);
root->init(sofa::core::execparams::defaultInstance());

sofa::core::objectmodel::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. "
Expand Down Expand Up @@ -202,7 +202,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());
sofa::core::objectmodel::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. ";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void SmoothMeshEngine<DataTypes>::init()
if (m_topology == nullptr)
{
msg_error() << "No topology component found at path: " << l_topology.getLinkedPath() << ", nor in current context: " << this->getContext()->name;
sofa::core::objectmodel::BaseObject::d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid);
this->d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid);
return;
}

Expand Down
Loading
Loading