Attach the tree of defaults recursively and with namespacing.

PiperOrigin-RevId: 650664018
Change-Id: I17751a02a406dcb2a2ca218c316b5eb0370071b8
This commit is contained in:
Alessio Quaglino
2024-07-09 09:53:05 -07:00
committed by Copybara-Service
parent d0f86bc2c5
commit 462cfa5ceb
6 changed files with 111 additions and 50 deletions
+2 -3
View File
@@ -165,6 +165,7 @@ class mjCModel : public mjCModel_, private mjSpec {
mjCModel& operator=(const mjCModel& other); // copy other into this, if they are not the same
mjCModel& operator+=(const mjCModel& other); // add other into this, even if they are the same
mjCModel& operator-=(const mjCBody& subtree); // remove subtree and all references from model
mjCModel_& operator+=(mjCDef& subtree); // add default tree to this model
mjSpec spec;
@@ -333,9 +334,7 @@ class mjCModel : public mjCModel_, private mjSpec {
// copy vector of elements to this model
template <class T> void CopyList(std::vector<T*>& dest,
const std::vector<T*>& sources,
std::map<mjCDef*, int>& def_map,
const std::vector<mjCDef*>& defaults);
const std::vector<T*>& sources);
// delete from list the elements that are compatible with other but not this model
template <class T> void RemoveFromList(std::vector<T*>& list, const mjCModel& other);