| 96 | } |
| 97 | |
| 98 | bool ModelObjectList_Impl::addModelObject(const ModelObject& modelObject) { |
| 99 | |
| 100 | // DLM: should this class prevent duplicates in the list? |
| 101 | |
| 102 | auto eg = getObject<ModelObject>().pushExtensibleGroup().cast<WorkspaceExtensibleGroup>(); |
| 103 | |
| 104 | bool ok = eg.setPointer(OS_ModelObjectListExtensibleFields::ModelObject, modelObject.handle()); |
| 105 | |
| 106 | if (!ok) { |
| 107 | getObject<ModelObject>().eraseExtensibleGroup(eg.groupIndex()); |
| 108 | } |
| 109 | return ok; |
| 110 | } |
| 111 | |
| 112 | bool ModelObjectList_Impl::hasModelObject(const ModelObject& modelObject) const { |
| 113 | std::vector<IdfExtensibleGroup> groups = extensibleGroups(); |