| 102 | } |
| 103 | |
| 104 | bool Group::SetFromDesc(const EntityDescription& desc) { |
| 105 | bool ret = Object::SetFromDesc(desc); |
| 106 | if (ret) { |
| 107 | for (auto new_desc : desc.children) { |
| 108 | Object* obj = CreateObjectFromDesc(new_desc); |
| 109 | if (obj) { |
| 110 | obj->SetParent(this); |
| 111 | children.resize(children.size() + 1); |
| 112 | children.back().direct_ptr = obj; |
| 113 | } else { |
| 114 | LOGE << "Failed constructing child to Group" << std::endl; |
| 115 | } |
| 116 | } |
| 117 | const EntityDescriptionField* version_edf = desc.GetField(EDF_VERSION); |
| 118 | if (!version_edf) { |
| 119 | InitShape(); |
| 120 | } |
| 121 | |
| 122 | InitRelMats(); |
| 123 | } |
| 124 | return ret; |
| 125 | } |
| 126 | |
| 127 | void Group::GetDesc(EntityDescription& desc) const { |
| 128 | Object::GetDesc(desc); |
no test coverage detected