@@ -48,17 +48,46 @@ class SOFA_CORE_API BehaviorModel : public virtual sofa::core::objectmodel::Base
4848 // / Destructor
4949 ~BehaviorModel () override {}
5050
51+ // / Computation of a new simulation step.
52+ virtual void doUpdatePosition (SReal /* dt*/ ) = 0;
53+
54+ virtual bool doAddBBox (SReal* /* minBBox*/ , SReal* /* maxBBox*/ )
55+ {
56+ return false ;
57+ }
58+
5159private:
5260 BehaviorModel (const BehaviorModel& n) = delete ;
5361 BehaviorModel& operator =(const BehaviorModel& n) = delete ;
5462
5563public:
56- // / Computation of a new simulation step.
57- virtual void updatePosition (SReal dt) = 0;
5864
59- virtual bool addBBox (SReal* /* minBBox*/ , SReal* /* maxBBox*/ )
65+ /* *
66+ * !!! WARNING since v25.12 !!!
67+ *
68+ * The template method pattern has been applied to this part of the API.
69+ * This method calls the newly introduced method "doUpdatePosition" internally,
70+ * which is the method to override from now on.
71+ *
72+ **/
73+ virtual void updatePosition (SReal dt) final
6074 {
61- return false ;
75+ // TODO (SPRINT SED 2025): Component state mechamism
76+ this ->doUpdatePosition (dt);
77+ }
78+
79+ /* *
80+ * !!! WARNING since v25.12 !!!
81+ *
82+ * The template method pattern has been applied to this part of the API.
83+ * This method calls the newly introduced method "doAddBBox" internally,
84+ * which is the method to override from now on.
85+ *
86+ **/
87+ virtual bool addBBox (SReal* minBBox, SReal* maxBBox) final
88+ {
89+ // TODO (SPRINT SED 2025): Component state mechamism
90+ return this ->doAddBBox (minBBox, maxBBox);
6291 }
6392
6493 bool insertInNode ( objectmodel::BaseNode* node ) override ;
0 commit comments