- if (theObjectShapes.contains(theObject))
- theObjectShapes[theObject].append(theShape);
- else {
- QList<GeomShapePtr> aShapes;
- aShapes.append(theShape);
- theObjectShapes[theObject] = aShapes;
+ if (theObject.get()) {
+ GeomShapePtr aShape = theShape;
+ if (!aShape.get()) {
+ ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
+ if (aResult.get())
+ aShape = aResult->shape();
+ }
+ if (!isSubObject(theObject, theFeature)) {
+ if (theObjectShapes.contains(theObject))
+ theObjectShapes[theObject].append(aShape);
+ else {
+ QList<GeomShapePtr> aShapes;
+ aShapes.append(aShape);
+ theObjectShapes[theObject] = aShapes;
+ }
+ }