X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_IconFactory.cpp;h=5543d690201d7e1a49a1dc6224db81312b6ded3b;hb=75a52b87325dd36217603277b84bab5fa345b642;hp=2beae8cc10aeb6646be0bc8fb87daefded454a96;hpb=3170cb411285df0bc16a9b411ab65b89ee1878a3;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_IconFactory.cpp b/src/PartSet/PartSet_IconFactory.cpp index 2beae8cc1..5543d6902 100644 --- a/src/PartSet/PartSet_IconFactory.cpp +++ b/src/PartSet/PartSet_IconFactory.cpp @@ -1,8 +1,22 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: PartSet_IconFactory.cpp -// Created: 28 Jul 2015 -// Author: Vitaly SMETANNIKOV +// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// 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 +// #include "PartSet_IconFactory.h" #include @@ -19,7 +33,7 @@ QMap PartSet_IconFactory::myIcons; PartSet_IconFactory::PartSet_IconFactory():ModuleBase_IconFactory() { - Events_Loop::loop()->registerListener(this, + Events_Loop::loop()->registerListener(this, Events_Loop::eventByName(Config_FeatureMessage::GUI_EVENT())); } @@ -60,9 +74,9 @@ QIcon PartSet_IconFactory::getIcon(ObjectPtr theObj) anIconString); } break; - default: break; + default: break; } - } + } if (theObj->data() && theObj->data()->execState() == ModelAPI_StateMustBeUpdated) return QIcon(":pictures/constr_object_modified.png"); @@ -79,8 +93,12 @@ QIcon PartSet_IconFactory::getIcon(ObjectPtr theObj) GeomShapePtr aShape = aResult->shape(); if(aShape.get()) { switch(aShape->shapeType()) { - case GeomAPI_Shape::COMPOUND: return aShape->isConnectedTopology() ? - QIcon(":pictures/compoundofsolids.png") : QIcon(":pictures/compound.png"); + case GeomAPI_Shape::COMPOUND: { + ResultBodyPtr aBody = std::dynamic_pointer_cast(aResult); + if (aBody.get() && aBody->isConnectedTopology()) + return QIcon(":pictures/compoundofsolids.png"); + return QIcon(":pictures/compound.png"); + } case GeomAPI_Shape::COMPSOLID: return QIcon(":pictures/compsolid.png"); case GeomAPI_Shape::SOLID: return QIcon(":pictures/solid.png"); case GeomAPI_Shape::SHELL: return QIcon(":pictures/shell.png"); @@ -96,7 +114,8 @@ QIcon PartSet_IconFactory::getIcon(ObjectPtr theObj) void PartSet_IconFactory::processEvent(const std::shared_ptr& theMessage) { - if (theMessage->eventID() == Events_Loop::loop()->eventByName(Config_FeatureMessage::GUI_EVENT())) { + if (theMessage->eventID() == + Events_Loop::loop()->eventByName(Config_FeatureMessage::GUI_EVENT())) { std::shared_ptr aFeatureMsg = std::dynamic_pointer_cast(theMessage); if (!aFeatureMsg->isInternal()) {