- QList<ModuleBase_ViewerPrsPtr> aTmpList = aSelectedPrs;
- ObjectPtr aObject;
- FeaturePtr aFeature;
- foreach(ModuleBase_ViewerPrsPtr aPrs, aTmpList) {
- aObject = aPrs->object();
- if (aObject.get()) {
- aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObject);
- if (aFeature.get()) {
- const std::list<std::shared_ptr<ModelAPI_Result>> aResList = aFeature->results();
- ResultPtr aResult;
- ResultCompSolidPtr aCompSolid;
- std::list<ResultPtr>::const_iterator aIt;
- for (aIt = aResList.cbegin(); aIt != aResList.cend(); ++aIt) {
- aResult = (*aIt);
- aSelectedPrs.append(std::shared_ptr<ModuleBase_ViewerPrs>(
- new ModuleBase_ViewerPrs(aResult, GeomShapePtr(), NULL)));
- aCompSolid = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aResult);
- if (aCompSolid.get()) {
- for (int i = 0; i < aCompSolid->numberOfSubs(); i++) {
- ResultBodyPtr aResult = aCompSolid->subResult(i);
- aSelectedPrs.append(std::shared_ptr<ModuleBase_ViewerPrs>(
- new ModuleBase_ViewerPrs(aResult, aResult->shape(), NULL)));
- }
+ ObjectPtr aObject;
+ FeaturePtr aFeature;
+ // Select all results of a selected feature in viewer
+ foreach(ModuleBase_ViewerPrsPtr aPrs, aSelectedPrs) {
+ aObject = aPrs->object();
+ if (aObject.get()) {
+ aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObject);
+ if (aFeature.get()) {
+ std::list<ResultPtr> allRes;
+ ModelAPI_Tools::allResults(aFeature, allRes);
+ std::list<ResultPtr>::iterator aRes;
+ for(aRes = allRes.begin(); aRes != allRes.end(); aRes++) {
+ aSelectedPrs.append(std::shared_ptr<ModuleBase_ViewerPrs>(
+ new ModuleBase_ViewerPrs(*aRes, GeomShapePtr(), NULL)));