1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_ResultGroup.cpp
4 // Created: 08 Jul 2014
5 // Author: Mikhail PONIKAROV
7 #include <Model_ResultGroup.h>
8 #include <ModelAPI_AttributeSelectionList.h>
9 #include <GeomAlgoAPI_CompoundBuilder.h>
11 Model_ResultGroup::Model_ResultGroup(std::shared_ptr<ModelAPI_Data> theOwnerData)
13 setIsConcealed(false);
14 myOwnerData = theOwnerData;
17 std::shared_ptr<GeomAPI_Shape> Model_ResultGroup::shape()
19 std::shared_ptr<GeomAPI_Shape> aResult;
21 AttributeSelectionListPtr aList = myOwnerData->selectionList("group_list");
23 std::list<std::shared_ptr<GeomAPI_Shape> > aSubs;
24 for(int a = aList->size() - 1; a >= 0; a--) {
25 std::shared_ptr<GeomAPI_Shape> aSelection = aList->value(a)->value();
26 if (aSelection && !aSelection->isNull()) {
27 aSubs.push_back(aSelection);
31 aResult = GeomAlgoAPI_CompoundBuilder::compound(aSubs);