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>
10 #include <GeomAlgoAPI_CompoundBuilder.h>
12 #include <Config_PropManager.h>
14 Model_ResultGroup::Model_ResultGroup(std::shared_ptr<ModelAPI_Data> theOwnerData)
16 myOwnerData = theOwnerData;
19 void Model_ResultGroup::colorConfigInfo(std::string& theSection, std::string& theName,
20 std::string& theDefault)
22 theSection = "Visualization";
23 theName = "result_group_color";
24 theDefault = DEFAULT_COLOR();
27 std::shared_ptr<GeomAPI_Shape> Model_ResultGroup::shape()
29 std::shared_ptr<GeomAPI_Shape> aResult;
31 AttributeSelectionListPtr aList = myOwnerData->selectionList("group_list");
33 std::list<std::shared_ptr<GeomAPI_Shape> > aSubs;
34 for(int a = aList->size() - 1; a >= 0; a--) {
35 std::shared_ptr<GeomAPI_Shape> aSelection = aList->value(a)->value();
36 if (aSelection && !aSelection->isNull()) {
37 aSubs.push_back(aSelection);
41 aResult = GeomAlgoAPI_CompoundBuilder::compound(aSubs);