1 // File: Model_ResultGroup.cpp
2 // Created: 08 Jul 2014
3 // Author: Mikhail PONIKAROV
5 #include <Model_ResultGroup.h>
6 #include <ModelAPI_AttributeSelectionList.h>
7 #include <GeomAlgoAPI_CompoundBuilder.h>
9 Model_ResultGroup::Model_ResultGroup(std::shared_ptr<ModelAPI_Data> theOwnerData)
11 setIsConcealed(false);
12 myOwnerData = theOwnerData;
15 std::shared_ptr<GeomAPI_Shape> Model_ResultGroup::shape() const
17 std::shared_ptr<GeomAPI_Shape> aResult;
19 AttributeSelectionListPtr aList = myOwnerData->selectionList("group_list");
21 std::list<std::shared_ptr<GeomAPI_Shape> > aSubs;
22 for(int a = aList->size() - 1; a >= 0; a--) {
23 std::shared_ptr<GeomAPI_Shape> aSelection = aList->value(a)->value();
24 if (aSelection && !aSelection->isNull()) {
25 aSubs.push_back(aSelection);
29 aResult = GeomAlgoAPI_CompoundBuilder::compound(aSubs);