@@ -102,8 +102,34 @@ class SOFA_COMPONENT_VISUAL_API BaseCamera : public core::objectmodel::BaseCompo
102102 void moveCamera (const type::Vec3 &p, const Quat &q);
103103
104104 void rotateCameraAroundPoint ( Quat& rotation, const type::Vec3& point);
105- virtual void rotateWorldAroundPoint (Quat& rotation, const type::Vec3& point, Quat orientationCam);
106- virtual void rotateWorldAroundPoint (Quat& rotation, const type::Vec3& point, Quat orientationCam, type::Vec3 positionCam);
105+
106+ /* *
107+ * !!! WARNING since v25.12 !!!
108+ *
109+ * The template method pattern has been applied to this part of the API.
110+ * This method calls the newly introduced method "doRotateWorldAroundPoint" internally,
111+ * which is the method to override from now on.
112+ *
113+ **/
114+ virtual void rotateWorldAroundPoint (Quat& rotation, const type::Vec3& point, Quat orientationCam) final {
115+ // TODO (SPRINT SED 2025): Component state mechanism
116+ this ->doRotateWorldAroundPoint (rotation, point, orientationCam);
117+ }
118+
119+
120+ /* *
121+ * !!! WARNING since v25.12 !!!
122+ *
123+ * The template method pattern has been applied to this part of the API.
124+ * This method calls the newly introduced method "doRotateWorldAroundPoint" internally,
125+ * which is the method to override from now on.
126+ *
127+ **/
128+ virtual void rotateWorldAroundPoint (Quat& rotation, const type::Vec3& point, Quat orientationCam, type::Vec3 positionCam) final {
129+ // TODO (SPRINT SED 2025): Component state mechanism
130+ this ->doRotateWorldAroundPoint (rotation, point, orientationCam, positionCam);
131+ }
132+
107133
108134 type::Vec3 screenToViewportPoint (const type::Vec3& p) const ;
109135 type::Vec3 screenToWorldPoint (const type::Vec3& p);
@@ -191,17 +217,64 @@ class SOFA_COMPONENT_VISUAL_API BaseCamera : public core::objectmodel::BaseCompo
191217 // be according to the gravity.
192218 void setDefaultView (const type::Vec3& gravity = type::Vec3(0 , -9.81 , 0 ));
193219
194- virtual void getModelViewMatrix (double mat[16 ]);
195- virtual void getProjectionMatrix (double mat[16 ]);
220+ /* *
221+ * !!! WARNING since v25.12 !!!
222+ *
223+ * The template method pattern has been applied to this part of the API.
224+ * This method calls the newly introduced method "doGetModelViewMatrix" internally,
225+ * which is the method to override from now on.
226+ *
227+ **/
228+ virtual void getModelViewMatrix (double mat[16 ]) final {
229+ // TODO (SPRINT SED 2025): Component state mechanism
230+ this ->doGetModelViewMatrix (mat);
231+ }
232+
233+ /* *
234+ * !!! WARNING since v25.12 !!!
235+ *
236+ * The template method pattern has been applied to this part of the API.
237+ * This method calls the newly introduced method "doGetProjectionMatrix" internally,
238+ * which is the method to override from now on.
239+ *
240+ **/
241+ virtual void getProjectionMatrix (double mat[16 ]) final {
242+ // TODO (SPRINT SED 2025): Component state mechanism
243+ this ->doGetProjectionMatrix (mat);
244+ }
245+
196246 void getOpenGLModelViewMatrix (double mat[16 ]);
197247 void getOpenGLProjectionMatrix (double mat[16 ]);
198248
199249 Quat getOrientationFromLookAt (const type::Vec3 &pos, const type::Vec3& lookat);
200250 type::Vec3 getLookAtFromOrientation (const type::Vec3 &pos, const double &distance,const Quat & orientation);
201251 type::Vec3 getPositionFromOrientation (const type::Vec3 &lookAt, const double &distance, const Quat& orientation);
202252
203- virtual void manageEvent (core::objectmodel::Event* event) = 0 ;
204- virtual void internalUpdate () {}
253+ /* *
254+ * !!! WARNING since v25.12 !!!
255+ *
256+ * The template method pattern has been applied to this part of the API.
257+ * This method calls the newly introduced method "doManageEvent" internally,
258+ * which is the method to override from now on.
259+ *
260+ **/
261+ virtual void manageEvent (core::objectmodel::Event* event) final {
262+ // TODO (SPRINT SED 2025): Component state mechanism
263+ this ->doManageEvent (event);
264+ }
265+
266+ /* *
267+ * !!! WARNING since v25.12 !!!
268+ *
269+ * The template method pattern has been applied to this part of the API.
270+ * This method calls the newly introduced method "doInternalUpdate" internally,
271+ * which is the method to override from now on.
272+ *
273+ **/
274+ virtual void internalUpdate () final {
275+ // TODO (SPRINT SED 2025): Component state mechanism
276+ this ->doInternalUpdate ();
277+ }
205278
206279 void handleEvent (sofa::core::objectmodel::Event* event) override ;
207280 void computeZ ();
@@ -254,13 +327,38 @@ class SOFA_COMPONENT_VISUAL_API BaseCamera : public core::objectmodel::BaseCompo
254327
255328 void draw (const core::visual::VisualParams*) override ;
256329 void computeClippingPlane (const core::visual::VisualParams* vp, double & zNear, double & zFar);
257- virtual void drawCamera (const core::visual::VisualParams*);
330+
331+ /* *
332+ * !!! WARNING since v25.12 !!!
333+ *
334+ * The template method pattern has been applied to this part of the API.
335+ * This method calls the newly introduced method "doDrawCamera" internally,
336+ * which is the method to override from now on.
337+ *
338+ **/
339+ virtual void drawCamera (const core::visual::VisualParams* vparams) final {
340+ // TODO (SPRINT SED 2025): Component state mechanism
341+ this ->doDrawCamera (vparams);
342+ }
343+
258344protected:
259345 void updateOutputData ();
260346
347+ virtual void doRotateWorldAroundPoint (Quat& rotation, const type::Vec3& point, Quat orientationCam);
348+ virtual void doRotateWorldAroundPoint (Quat& rotation, const type::Vec3& point, Quat orientationCam, type::Vec3 positionCam);
349+
350+ virtual void doManageEvent (core::objectmodel::Event* event) = 0;
351+
352+ virtual void doGetModelViewMatrix (double mat[16 ]);
353+ virtual void doGetProjectionMatrix (double mat[16 ]);
354+
355+ virtual void doInternalUpdate () {}
356+
357+ virtual void doDrawCamera (const core::visual::VisualParams*);
358+
261359 type::Vec3 getSceneCenter () const ;
262360 SReal getSceneRadius () const ;
263-
361+
264362 bool b_setDefaultParameters;
265363
266364 // need to keep "internal" lookAt and distance for updating Data
0 commit comments