diff --git a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/MirrorIntersector.h b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/MirrorIntersector.h index a5e9d1500fd..ea02b053abe 100644 --- a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/MirrorIntersector.h +++ b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/MirrorIntersector.h @@ -67,13 +67,13 @@ class MirrorIntersector : public core::collision::ElementIntersector return intersector->name() + std::string(""); } - SOFA_ATTRIBUTE_DEPRECATED__CORE_INTERSECTION_AS_PARAMETER() + SOFA_ATTRIBUTE_DISABLED__CORE_INTERSECTION_AS_PARAMETER() bool canIntersect(core::CollisionElementIterator elem1, core::CollisionElementIterator elem2) override { assert(intersector != nullptr); return intersector->canIntersect(elem2, elem1); } - SOFA_ATTRIBUTE_DEPRECATED__CORE_INTERSECTION_AS_PARAMETER() + SOFA_ATTRIBUTE_DISABLED__CORE_INTERSECTION_AS_PARAMETER() int intersect(core::CollisionElementIterator elem1, core::CollisionElementIterator elem2, core::collision::DetectionOutputVector* contacts) override { assert(intersector != nullptr); diff --git a/Sofa/framework/Core/src/sofa/core/collision/Intersection.h b/Sofa/framework/Core/src/sofa/core/collision/Intersection.h index 9335a713e52..5ca8085d21b 100644 --- a/Sofa/framework/Core/src/sofa/core/collision/Intersection.h +++ b/Sofa/framework/Core/src/sofa/core/collision/Intersection.h @@ -82,9 +82,9 @@ class ElementIntersector virtual std::string name() const = 0; - SOFA_ATTRIBUTE_DEPRECATED__CORE_INTERSECTION_AS_PARAMETER() + SOFA_ATTRIBUTE_DISABLED__CORE_INTERSECTION_AS_PARAMETER() virtual bool canIntersect(core::CollisionElementIterator, core::CollisionElementIterator) { return false; }; - SOFA_ATTRIBUTE_DEPRECATED__CORE_INTERSECTION_AS_PARAMETER() + SOFA_ATTRIBUTE_DISABLED__CORE_INTERSECTION_AS_PARAMETER() virtual int intersect(core::CollisionElementIterator, core::CollisionElementIterator, DetectionOutputVector*) { return 0; }; }; diff --git a/Sofa/framework/Core/src/sofa/core/collision/Intersection.inl b/Sofa/framework/Core/src/sofa/core/collision/Intersection.inl index 2b47c30a62a..487162db1af 100644 --- a/Sofa/framework/Core/src/sofa/core/collision/Intersection.inl +++ b/Sofa/framework/Core/src/sofa/core/collision/Intersection.inl @@ -26,50 +26,6 @@ #include -// remove the conent of this anonymous namespace once the compat layer is deleted -// SOFA_ATTRIBUTE_DEPRECATED("v24.06", "v24.12") -#if (SOFA_VERSION / 100) <= 2406 -namespace -{ - // SFINAE block of code to detect at compile time if - // - Intersector implements testIntersection(ModelElement1&, ModelElement2&, Intersection*) - // - Intersector implements computeIntersection(ModelElement1&, ModelElement2&, OutputVector*, Intersection*) - - template - struct has_testIntersection_with_Intersection - : std::false_type - { }; - - template - struct has_computeIntersection_with_Intersection - : std::false_type - { }; - - // detect at compile time if Intersector implements testIntersection(ModelElement1&, ModelElement2&, Intersection*) - template - struct has_testIntersection_with_Intersection().testIntersection( - std::declval(), - std::declval(), - std::declval() - ))>> - : std::true_type - { }; - - // detect at compile time if Intersector implements computeIntersection(ModelElement1&, ModelElement2&, OutputVector*, Intersection*) - template - struct has_computeIntersection_with_Intersection().computeIntersection( - std::declval(), - std::declval(), - std::declval(), - std::declval() - ))>> - : std::true_type - { }; -} -#endif - namespace sofa::core::collision { @@ -81,7 +37,7 @@ public: typedef typename Elem2::Model Model2; MemberElementIntersector(T* ptr) : impl(ptr) {} /// Test if 2 elements can collide. Note that this can be conservative (i.e. return true even when no collision is present) - SOFA_ATTRIBUTE_DEPRECATED__CORE_INTERSECTION_AS_PARAMETER() + SOFA_ATTRIBUTE_DISABLED__CORE_INTERSECTION_AS_PARAMETER() bool canIntersect(core::CollisionElementIterator elem1, core::CollisionElementIterator elem2) override { Elem1 e1(elem1); @@ -91,16 +47,9 @@ public: bool canIntersect(core::CollisionElementIterator elem1, core::CollisionElementIterator elem2, const core::collision::Intersection* currentIntersection) override { - if constexpr (!has_testIntersection_with_Intersection::value) - { - return canIntersect(elem1, elem2); - } - else - { - Elem1 e1(elem1); - Elem2 e2(elem2); - return impl->testIntersection(e1, e2, currentIntersection); - } + Elem1 e1(elem1); + Elem2 e2(elem2); + return impl->testIntersection(e1, e2, currentIntersection); } /// Begin intersection tests between two collision models. Return the number of contacts written in the contacts vector. @@ -117,7 +66,7 @@ public: } /// Compute the intersection between 2 elements. - SOFA_ATTRIBUTE_DEPRECATED__CORE_INTERSECTION_AS_PARAMETER() + SOFA_ATTRIBUTE_DISABLED__CORE_INTERSECTION_AS_PARAMETER() int intersect(core::CollisionElementIterator elem1, core::CollisionElementIterator elem2, DetectionOutputVector* contacts) override { Elem1 e1(elem1); @@ -127,16 +76,9 @@ public: int intersect(core::CollisionElementIterator elem1, core::CollisionElementIterator elem2, DetectionOutputVector* contacts, const core::collision::Intersection* currentIntersection) override { - if constexpr (!has_computeIntersection_with_Intersection::value) - { - return intersect(elem1, elem2, contacts); - } - else - { - Elem1 e1(elem1); - Elem2 e2(elem2); - return impl->computeIntersection(e1, e2, impl->getOutputVector(e1.getCollisionModel(), e2.getCollisionModel(), contacts), currentIntersection); - } + Elem1 e1(elem1); + Elem2 e2(elem2); + return impl->computeIntersection(e1, e2, impl->getOutputVector(e1.getCollisionModel(), e2.getCollisionModel(), contacts), currentIntersection); } std::string name() const override diff --git a/Sofa/framework/Core/src/sofa/core/config.h.in b/Sofa/framework/Core/src/sofa/core/config.h.in index b7544e70b97..61f6a5ae104 100644 --- a/Sofa/framework/Core/src/sofa/core/config.h.in +++ b/Sofa/framework/Core/src/sofa/core/config.h.in @@ -62,8 +62,8 @@ #endif #ifdef SOFA_BUILD_SOFA_CORE -#define SOFA_ATTRIBUTE_DEPRECATED__CORE_INTERSECTION_AS_PARAMETER() +#define SOFA_ATTRIBUTE_DISABLED__CORE_INTERSECTION_AS_PARAMETER() #else -#define SOFA_ATTRIBUTE_DEPRECATED__CORE_INTERSECTION_AS_PARAMETER() \ +#define SOFA_ATTRIBUTE_DISABLED__CORE_INTERSECTION_AS_PARAMETER() \ SOFA_ATTRIBUTE_DEPRECATED("v24.06", "v24.12", "Intersection detection methods now needs the Intersection method as a parameter.") #endif