Skip to content

Commit

Permalink
Merge branch 'master' into 24_12_change_default_sofa_scene
Browse files Browse the repository at this point in the history
  • Loading branch information
bakpaul authored Jan 22, 2025
2 parents 81f1af5 + f8ed001 commit 321cc94
Show file tree
Hide file tree
Showing 402 changed files with 3,282 additions and 10,721 deletions.
229 changes: 229 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ project(Sofa
include(CMakeDependentOption)

# Manually define VERSION
set(Sofa_VERSION_MAJOR 24)
set(Sofa_VERSION_MINOR 12)
set(Sofa_VERSION_MAJOR 25)
set(Sofa_VERSION_MINOR 06)
set(Sofa_VERSION_PATCH 99)
set(Sofa_VERSION ${Sofa_VERSION_MAJOR}.${Sofa_VERSION_MINOR}.${Sofa_VERSION_PATCH})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include <sofa/simulation/CollisionAnimationLoop.h>
#include <sofa/core/MultiVecId.h>
#include <sofa/core/objectmodel/RenamedData.h>
#include <sofa/core/objectmodel/lifecycle/RenamedData.h>

namespace sofa::core::behavior
{
Expand All @@ -45,7 +45,7 @@ class SOFA_COMPONENT_ANIMATIONLOOP_API FreeMotionAnimationLoop : public sofa::si


SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_ANIMATIONLOOP()
sofa::core::objectmodel::RenamedData<bool> m_solveVelocityConstraintFirst;
sofa::core::objectmodel::lifecycle::RenamedData<bool> m_solveVelocityConstraintFirst;

Data<bool> d_solveVelocityConstraintFirst; ///< solve separately velocity constraint violations before position constraint violations
Data<bool> d_threadSafeVisitor; ///< If true, do not use realloc and free visitors in fwdInteractionForceField.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include <sofa/core/behavior/BaseAnimationLoop.h>
#include <sofa/simulation/CollisionAnimationLoop.h>
#include <sofa/core/objectmodel/RenamedData.h>
#include <sofa/core/objectmodel/lifecycle/RenamedData.h>

namespace sofa::component::animationloop
{
Expand All @@ -43,10 +43,10 @@ class SOFA_COMPONENT_ANIMATIONLOOP_API MultiStepAnimationLoop : public sofa::sim
void step (const sofa::core::ExecParams* params, SReal dt) override;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_ANIMATIONLOOP()
sofa::core::objectmodel::RenamedData<int> collisionSteps;
sofa::core::objectmodel::lifecycle::RenamedData<int> collisionSteps;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_ANIMATIONLOOP()
sofa::core::objectmodel::RenamedData<int> integrationSteps;
sofa::core::objectmodel::lifecycle::RenamedData<int> integrationSteps;

Data<int> d_collisionSteps; ///< number of collision steps between each frame rendering
Data<int> d_integrationSteps; ///< number of integration steps between each collision detection
Expand Down
7 changes: 7 additions & 0 deletions Sofa/Component/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,10 @@ sofa_create_package_with_targets(
INCLUDE_SOURCE_DIR "src"
INCLUDE_INSTALL_DIR "${PROJECT_NAME}"
)

# Tests
# If SOFA_BUILD_TESTS exists and is OFF, then these tests will be auto-disabled
cmake_dependent_option(SOFA_COMPONENT_BUILD_TESTS "Compile the automatic tests" ON "SOFA_BUILD_TESTS OR NOT DEFINED SOFA_BUILD_TESTS" OFF)
if(SOFA_COMPONENT_BUILD_TESTS)
add_subdirectory(test)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <sofa/component/collision/detection/algorithm/config.h>
#include <sofa/core/collision/BroadPhaseDetection.h>
#include <sofa/component/collision/geometry/CubeModel.h>
#include <sofa/core/objectmodel/RenamedData.h>
#include <sofa/core/objectmodel/lifecycle/RenamedData.h>

namespace sofa::component::collision::detection::algorithm
{
Expand All @@ -51,7 +51,7 @@ class SOFA_COMPONENT_COLLISION_DETECTION_ALGORITHM_API BruteForceBroadPhase : pu
private:
///< if not empty, objects that do not intersect this bounding-box will be ignored
SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_DETECTION_ALGORITHM()
sofa::core::objectmodel::RenamedData<type::fixed_array<sofa::type::Vec3, 2> > box;
sofa::core::objectmodel::lifecycle::RenamedData<type::fixed_array<sofa::type::Vec3, 2> > box;

Data<type::fixed_array<sofa::type::Vec3, 2> > d_box; ///< if not empty, objects that do not intersect this bounding-box will be ignored

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <map>
#include <deque>

#include <sofa/core/objectmodel/RenamedData.h>
#include <sofa/core/objectmodel/lifecycle/RenamedData.h>


namespace sofa::component::collision::detection::algorithm
Expand Down Expand Up @@ -215,7 +215,7 @@ class SOFA_COMPONENT_COLLISION_DETECTION_ALGORITHM_API IncrSAP :
core::objectmodel::lifecycle::DeprecatedData bDraw {this, "v24.06", "v24.12", "draw", "This Data was not used"};

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_DETECTION_ALGORITHM()
sofa::core::objectmodel::RenamedData< type::fixed_array<type::Vec3,2> > box; ///< if not empty, objects that do not intersect this bounding-box will be ignored
sofa::core::objectmodel::lifecycle::RenamedData< type::fixed_array<type::Vec3,2> > box; ///< if not empty, objects that do not intersect this bounding-box will be ignored

Data< type::fixed_array<type::Vec3,2> > d_box; ///< if not empty, objects that do not intersect this bounding-box will be ignored

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ class TestCollisionPipeline : public BaseSimulationTest {
void checkCollisionPipelineWithMissingContactManager();
int checkCollisionPipelineWithMonkeyValueForDepth(int value);

void SetUp() override
void doSetUp() override
{
sofa::simpleapi::importPlugin("Sofa.Component.StateContainer");
sofa::simpleapi::importPlugin("Sofa.Component.Collision");
sofa::simpleapi::importPlugin(Sofa.Component.StateContainer);
sofa::simpleapi::importPlugin(Sofa.Component.Collision);
}

void TearDown() override
void doTearDown() override
{
if (root)
sofa::simulation::node::unload(root);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <sofa/component/collision/detection/intersection/DiscreteIntersection.h>
#include <sofa/component/collision/geometry/CubeModel.h>

#include <sofa/core/objectmodel/RenamedData.h>
#include <sofa/core/objectmodel/lifecycle/RenamedData.h>


namespace sofa::component::collision::detection::intersection
Expand All @@ -41,10 +41,10 @@ class SOFA_COMPONENT_COLLISION_DETECTION_INTERSECTION_API BaseProximityIntersect
public:
SOFA_ABSTRACT_CLASS(BaseProximityIntersection,DiscreteIntersection);
SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_DETECTION_INTERSECTION()
sofa::core::objectmodel::RenamedData<SReal> alarmDistance;
sofa::core::objectmodel::lifecycle::RenamedData<SReal> alarmDistance;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_DETECTION_INTERSECTION()
sofa::core::objectmodel::RenamedData<SReal> contactDistance;
sofa::core::objectmodel::lifecycle::RenamedData<SReal> contactDistance;


Data<SReal> d_alarmDistance; ///< Distance above which the intersection computations ignores the proximity pair. This distance can also be used in some broad phase algorithms to reduce the search area
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <sofa/component/collision/geometry/CubeModel.h>
#include <sofa/component/collision/geometry/RayModel.h>

#include <sofa/core/objectmodel/RenamedData.h>
#include <sofa/core/objectmodel/lifecycle/RenamedData.h>

namespace sofa::component::collision::detection::intersection
{
Expand Down Expand Up @@ -64,16 +64,16 @@ class SOFA_COMPONENT_COLLISION_DETECTION_INTERSECTION_API LocalMinDistance : pub
typedef core::collision::IntersectorFactory<LocalMinDistance> IntersectorFactory;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_DETECTION_INTERSECTION()
sofa::core::objectmodel::RenamedData<bool> filterIntersection;
sofa::core::objectmodel::lifecycle::RenamedData<bool> filterIntersection;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_DETECTION_INTERSECTION()
sofa::core::objectmodel::RenamedData<double> angleCone;
sofa::core::objectmodel::lifecycle::RenamedData<double> angleCone;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_DETECTION_INTERSECTION()
sofa::core::objectmodel::RenamedData<double> coneFactor;
sofa::core::objectmodel::lifecycle::RenamedData<double> coneFactor;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_DETECTION_INTERSECTION()
sofa::core::objectmodel::RenamedData<bool> useLMDFilters;
sofa::core::objectmodel::lifecycle::RenamedData<bool> useLMDFilters;


Data<bool> d_filterIntersection; ///< Activate LMD filter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include <sofa/component/collision/detection/intersection/BaseProximityIntersection.h>

#include <sofa/core/objectmodel/RenamedData.h>
#include <sofa/core/objectmodel/lifecycle/RenamedData.h>

namespace sofa::component::collision::detection::intersection
{
Expand Down Expand Up @@ -57,19 +57,19 @@ class SOFA_COMPONENT_COLLISION_DETECTION_INTERSECTION_API MinProximityIntersecti
public:
SOFA_CLASS(MinProximityIntersection,BaseProximityIntersection);
SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_DETECTION_INTERSECTION()
sofa::core::objectmodel::RenamedData<bool> useSphereTriangle;
sofa::core::objectmodel::lifecycle::RenamedData<bool> useSphereTriangle;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_DETECTION_INTERSECTION()
sofa::core::objectmodel::RenamedData<bool> usePointPoint;
sofa::core::objectmodel::lifecycle::RenamedData<bool> usePointPoint;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_DETECTION_INTERSECTION()
sofa::core::objectmodel::RenamedData<bool> useSurfaceNormals;
sofa::core::objectmodel::lifecycle::RenamedData<bool> useSurfaceNormals;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_DETECTION_INTERSECTION()
sofa::core::objectmodel::RenamedData<bool> useLinePoint;
sofa::core::objectmodel::lifecycle::RenamedData<bool> useLinePoint;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_DETECTION_INTERSECTION()
sofa::core::objectmodel::RenamedData<bool> useLineLine;
sofa::core::objectmodel::lifecycle::RenamedData<bool> useLineLine;



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <sofa/component/collision/geometry/CubeModel.h>

#include <sofa/core/objectmodel/RenamedData.h>
#include <sofa/core/objectmodel/lifecycle/RenamedData.h>

namespace sofa::component::collision::detection::intersection
{
Expand Down Expand Up @@ -58,7 +58,7 @@ class SOFA_COMPONENT_COLLISION_DETECTION_INTERSECTION_API NewProximityIntersecti
public:
SOFA_CLASS(NewProximityIntersection,BaseProximityIntersection);
SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_DETECTION_INTERSECTION()
sofa::core::objectmodel::RenamedData<bool> useLineLine;
sofa::core::objectmodel::lifecycle::RenamedData<bool> useLineLine;

Data<bool> d_useLineLine; ///< Line-line collision detection enabled

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ namespace
{

struct TestLocalMinDistance : public BaseSimulationTest {
void SetUp() override
void doSetUp() override
{
sofa::simpleapi::importPlugin("Sofa.Component.StateContainer");
sofa::simpleapi::importPlugin("Sofa.Component.Collision.Detection.Intersection");
sofa::simpleapi::importPlugin(Sofa.Component.StateContainer);
sofa::simpleapi::importPlugin(Sofa.Component.Collision.Detection.Intersection);
}
void TearDown() override
void doTearDown() override
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <sofa/helper/system/PluginManager.h>
#include <sofa/core/ObjectFactory.h>
#include <sofa/Modules.h>

namespace sofa::component::collision::detection
{
Expand Down Expand Up @@ -54,8 +55,8 @@ const char* getModuleVersion()

void registerObjects(sofa::core::ObjectFactory* factory)
{
factory->registerObjectsFromPlugin("Sofa.Component.Collision.Detection.Algorithm");
factory->registerObjectsFromPlugin("Sofa.Component.Collision.Detection.Intersection");
factory->registerObjectsFromPlugin(Sofa.Component.Collision.Detection.Algorithm);
factory->registerObjectsFromPlugin(Sofa.Component.Collision.Detection.Intersection);
}

void init()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <sofa/core/topology/BaseMeshTopology.h>
#include <sofa/defaulttype/VecTypes.h>

#include <sofa/core/objectmodel/RenamedData.h>
#include <sofa/core/objectmodel/lifecycle/RenamedData.h>


namespace sofa::component::collision::geometry
Expand Down Expand Up @@ -145,7 +145,7 @@ public :
int getLineFlags(sofa::Index i);

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_GEOMETRY()
sofa::core::objectmodel::RenamedData<bool> bothSide;
sofa::core::objectmodel::lifecycle::RenamedData<bool> bothSide;


Data<bool> d_bothSide; ///< activate collision on both side of the line model (when surface normals are defined on these lines)
Expand All @@ -172,7 +172,7 @@ public :
void computeBBox(const core::ExecParams* params, bool onlyVisible) override;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_GEOMETRY()
sofa::core::objectmodel::RenamedData<bool> m_displayFreePosition;
sofa::core::objectmodel::lifecycle::RenamedData<bool> m_displayFreePosition;


Data<bool> d_displayFreePosition; ///< Display Collision Model Points free position(in green)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <sofa/core/topology/BaseMeshTopology.h>
#include <sofa/defaulttype/VecTypes.h>

#include <sofa/core/objectmodel/RenamedData.h>
#include <sofa/core/objectmodel/lifecycle/RenamedData.h>

namespace sofa::component::collision::geometry
{
Expand Down Expand Up @@ -104,7 +104,7 @@ class PointCollisionModel : public core::CollisionModel
const Deriv& velocity(sofa::Index index) const;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_GEOMETRY()
sofa::core::objectmodel::RenamedData<bool> bothSide;
sofa::core::objectmodel::lifecycle::RenamedData<bool> bothSide;


Data<bool> d_bothSide; ///< activate collision on both side of the point model (when surface normals are defined on these points)
Expand Down Expand Up @@ -136,10 +136,10 @@ class PointCollisionModel : public core::CollisionModel
core::behavior::MechanicalState<DataTypes>* mstate;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_GEOMETRY()
sofa::core::objectmodel::RenamedData<bool> computeNormals;
sofa::core::objectmodel::lifecycle::RenamedData<bool> computeNormals;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_GEOMETRY()
sofa::core::objectmodel::RenamedData<bool> m_displayFreePosition;
sofa::core::objectmodel::lifecycle::RenamedData<bool> m_displayFreePosition;

Data<bool> d_computeNormals; ///< activate computation of normal vectors (required for some collision detection algorithms)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <sofa/defaulttype/VecTypes.h>
#include <set>

#include <sofa/core/objectmodel/RenamedData.h>
#include <sofa/core/objectmodel/lifecycle/RenamedData.h>

namespace sofa::component::collision::response::contact
{
Expand Down Expand Up @@ -96,7 +96,7 @@ class SOFA_COMPONENT_COLLISION_GEOMETRY_API RayCollisionModel : public core::Col
sofa::type::vector<type::Vec3> direction;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_GEOMETRY()
sofa::core::objectmodel::RenamedData<SReal> defaultLength;
sofa::core::objectmodel::lifecycle::RenamedData<SReal> defaultLength;



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <sofa/core/behavior/MechanicalState.h>
#include <sofa/core/topology/BaseMeshTopology.h>

#include <sofa/core/objectmodel/RenamedData.h>
#include <sofa/core/objectmodel/lifecycle/RenamedData.h>

namespace sofa::component::collision::geometry
{
Expand Down Expand Up @@ -165,10 +165,10 @@ class SphereCollisionModel : public core::CollisionModel
}

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_GEOMETRY()
sofa::core::objectmodel::RenamedData< VecReal > radius;
sofa::core::objectmodel::lifecycle::RenamedData< VecReal > radius;

SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_GEOMETRY()
sofa::core::objectmodel::RenamedData<SReal> defaultRadius;
sofa::core::objectmodel::lifecycle::RenamedData<SReal> defaultRadius;

Data< VecReal > d_radius; ///< Radius of each sphere
Data< SReal > d_defaultRadius; ///< Default radius
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 @@ -70,16 +70,16 @@ namespace sofa {

struct TestSphere : public BaseSimulationTest
{
void SetUp() override
void doSetUp() override
{
sofa::simpleapi::importPlugin("Sofa.Component.StateContainer");
sofa::simpleapi::importPlugin("Sofa.Component.Collision.Geometry");
sofa::simpleapi::importPlugin(Sofa.Component.StateContainer);
sofa::simpleapi::importPlugin(Sofa.Component.Collision.Geometry);

m_proxIntersection = sofa::core::objectmodel::New<MinProximityIntersection>();
m_proxIntersection->setAlarmDistance(1.0);
m_proxIntersection->setContactDistance(1.0);
}
void TearDown() override
void doTearDown() override
{
}

Expand Down
4 changes: 2 additions & 2 deletions Sofa/Component/Collision/Geometry/tests/Triangle_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ namespace sofa
{
struct TestTriangle : public BaseTest
{
void SetUp() override
void doSetUp() override
{
}
void TearDown() override
void doTearDown() override
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <sofa/component/collision/response/contact/BaseUnilateralContactResponse.h>
#include <sofa/component/collision/response/contact/ContactIdentifier.h>

#include <sofa/core/objectmodel/RenamedData.h>
#include <sofa/core/objectmodel/lifecycle/RenamedData.h>

namespace sofa::component::collision::response::contact
{
Expand Down
Loading

0 comments on commit 321cc94

Please sign in to comment.