@@ -73,7 +73,11 @@ class BaseObject
7373 /* *
7474 * \brief Constructor.
7575 */
76- BaseObject (): _root(nullptr ) { init (); }
76+ BaseObject ()
77+ : _root(nullptr )
78+ {
79+ init ();
80+ }
7781
7882 /* *
7983 * \brief Constructor.
@@ -305,11 +309,12 @@ class BaseObject
305309 bool _savable{true }; // !< True if the object should be saved
306310
307311 protected:
308- unsigned long _id{0 }; // !< Internal ID of the object
309- std::string _type{" baseobject" }; // !< Internal type
310- Category _category{Category::MISC}; // !< Object category, updated by the factory
311- std::string _remoteType{" " }; // !< When the object root is a Scene, this is the type of the corresponding object in the World
312- std::string _name{" " }; // !< Object name
312+ unsigned long _id{0 }; // !< Internal ID of the object
313+ std::string _type{" baseobject" }; // !< Internal type
314+ Category _category{Category::MISC}; // !< Object category, updated by the factory
315+ std::string _remoteType{" " }; // !< When the object root is a Scene, this is the type of the corresponding object in the World
316+ std::string _name{" " }; // !< Object name
317+ std::vector<BaseObject*> _parents{}; // !< Objects parents
313318
314319 Priority _renderingPriority{Priority::NO_RENDER}; // !< Rendering priority, if negative the object won't be rendered
315320 int _priorityShift{0 }; // !< Shift applied to rendering priority
@@ -347,6 +352,18 @@ class BaseObject
347352 AttributeFunctor& addAttribute (
348353 const std::string& name, const std::function<bool (const Values&)>& set, const std::function<const Values()>& get, const std::vector<char>& types = {});
349354
355+ /* *
356+ * Inform that the given object is a parent
357+ * \param obj Parent object
358+ */
359+ void linkToParent (BaseObject* obj);
360+
361+ /* *
362+ * Remove the given object as a parent
363+ * \param obj Parent object
364+ */
365+ void unlinkFromParent (BaseObject* obj);
366+
350367 /* *
351368 * \brief Register new attributes
352369 */
0 commit comments