| 145 | } |
| 146 | |
| 147 | std::vector<DocumentObject*> |
| 148 | GeoFeatureGroupExtension::addObjects(std::vector<App::DocumentObject*> objects) |
| 149 | { |
| 150 | |
| 151 | std::vector<DocumentObject*> grp = Group.getValues(); |
| 152 | std::vector<DocumentObject*> ret; |
| 153 | |
| 154 | for (auto object : objects) { |
| 155 | |
| 156 | if (!allowObject(object)) { |
| 157 | continue; |
| 158 | } |
| 159 | |
| 160 | std::vector<App::DocumentObject*> links; |
| 161 | |
| 162 | // Prevent from extracting children of nested groups fixed issue:(#26743, #28830) |
| 163 | // As groups manage their own local coordinate systems and children, |
| 164 | // so transfer this and remove from the old group. if not a group then get CSRelevantLinks |
| 165 | if (!object->hasExtension(GeoFeatureGroupExtension::getExtensionClassTypeId())) { |
| 166 | links = getCSRelevantLinks(object); |
| 167 | } |
| 168 | links.push_back(object); |
| 169 | |
| 170 | for (auto obj : links) { |
| 171 | // only one geofeaturegroup per object. |
| 172 | auto* group = App::GeoFeatureGroupExtension::getGroupOfObject(obj); |
| 173 | if (group && group != getExtendedObject()) { |
| 174 | group->getExtensionByType<App::GroupExtension>()->removeObject(obj); |
| 175 | } |
| 176 | |
| 177 | if (!hasObject(obj)) { |
| 178 | grp.push_back(obj); |
| 179 | ret.push_back(obj); |
| 180 | } |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | Group.setValues(grp); |
| 185 | return ret; |
| 186 | } |
| 187 | |
| 188 | std::vector<DocumentObject*> |
| 189 | GeoFeatureGroupExtension::removeObjects(std::vector<App::DocumentObject*> objects) |
nothing calls this directly
no test coverage detected