+ addValue(anObject, aShape, theFeature, theWorkshop, theObjectShapes);
+ }
+ }
+}
+
+void PartSet_OperationPrs::getResultShapes(const FeaturePtr& theFeature,
+ ModuleBase_IWorkshop* theWorkshop,
+ QMap<ObjectPtr, QList<GeomShapePtr> >& theObjectShapes,
+ const bool theListShouldBeCleared)
+{
+ if (theListShouldBeCleared)
+ theObjectShapes.clear();
+
+ if (!theFeature.get())
+ return;
+
+ XGUI_Displayer* aDisplayer = XGUI_Tools::workshop(theWorkshop)->displayer();
+
+ std::list<ResultPtr> aFeatureResults = theFeature->results();
+ std::list<ResultPtr>::const_iterator aRIt = aFeatureResults.begin(),
+ aRLast = aFeatureResults.end();
+ for (; aRIt != aRLast; aRIt++) {
+ ResultPtr aResult = *aRIt;
+ GeomShapePtr aGeomShape = aResult->shape();
+ appendShapeIfVisible(theWorkshop, aResult, aGeomShape, theObjectShapes);
+ }
+}
+
+void PartSet_OperationPrs::getHighlightedShapes(ModuleBase_IWorkshop* theWorkshop,
+ QMap<ObjectPtr, QList<GeomShapePtr> >& theObjectShapes)
+{
+ theObjectShapes.clear();
+
+ QList<ModuleBase_ViewerPrsPtr> aValues;
+ ModuleBase_IPropertyPanel* aPanel = theWorkshop->propertyPanel();
+ if (aPanel) {
+ ModuleBase_ModelWidget* aWidget = aPanel->activeWidget();
+ if (aWidget) {
+ aWidget->getHighlighted(aValues);
+ }
+ }
+
+ QList<GeomShapePtr> aShapes;
+ QList<ModuleBase_ViewerPrsPtr>::const_iterator anIIt = aValues.begin(),
+ aILast = aValues.end();
+ for (; anIIt != aILast; anIIt++) {
+ ModuleBase_ViewerPrsPtr aPrs = *anIIt;
+ ObjectPtr anObject = aPrs->object();
+
+ GeomShapePtr aGeomShape = aPrs->shape();
+ if (!aGeomShape.get() || aGeomShape->isNull()) {
+ ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
+ if (aResult.get()) {
+ aGeomShape = aResult->shape();
+ }