Salome HOME
Merge branch 'Dev_GroupsRevision'
[modules/shaper.git] / src / PartSet / PartSet_IconFactory.cpp
index 7234906c0952391fa746eb0bf5c999484e168eb5..42b3d4d62f6f65b516232f300dbc7f603d3ba098 100644 (file)
@@ -14,7 +14,8 @@
 // License along with this library; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
 //
 
 #include "PartSet_IconFactory.h"
@@ -28,6 +29,8 @@
 #include <Config_FeatureMessage.h>
 #include <Events_Loop.h>
 
+#include <CollectionPlugin_Group.h>
+
 QMap<QString, QString> PartSet_IconFactory::myIcons;
 
 PartSet_IconFactory::PartSet_IconFactory():ModuleBase_IconFactory()
@@ -93,6 +96,19 @@ QIcon PartSet_IconFactory::getIcon(ObjectPtr theObj)
     if(aShape.get()) {
       switch(aShape->shapeType()) {
         case GeomAPI_Shape::COMPOUND: {
+          FeaturePtr aFeature = ModelAPI_Feature::feature(theObj);
+          if (aFeature.get() && aFeature->getKind() == CollectionPlugin_Group::ID()) {
+            switch (aShape->typeOfCompoundShapes()) {
+            case GeomAPI_Shape::VERTEX:
+              return QIcon(":icons/group_vertex.png");
+            case GeomAPI_Shape::EDGE:
+              return QIcon(":icons/group_edge.png");
+            case GeomAPI_Shape::FACE:
+              return QIcon(":icons/group_face.png");
+            case GeomAPI_Shape::SOLID:
+              return QIcon(":icons/group_solid.png");
+            }
+          }
           ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(aResult);
           if (aBody.get() && aBody->isConnectedTopology())
             return QIcon(":pictures/compoundofsolids.png");