X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FPartSet%2FPartSet_PreviewPlanes.cpp;h=961c35ccb43b7fa3b3f9a85eed5d8536178b2681;hb=384c819a1edf4b726e3a523c1ffd2b5e6b16a4c0;hp=93084a00797118bad6538a87efd0f8978a6404c2;hpb=de93e11325cc65d1067e0c3484cbb5c836bdcde6;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_PreviewPlanes.cpp b/src/PartSet/PartSet_PreviewPlanes.cpp index 93084a007..961c35ccb 100755 --- a/src/PartSet/PartSet_PreviewPlanes.cpp +++ b/src/PartSet/PartSet_PreviewPlanes.cpp @@ -1,8 +1,22 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: PartSet_PreviewPlanes.cpp -// Created: 19 Jun 2015 -// Author: Natalia ERMOLAEVA +// 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_PreviewPlanes.h" @@ -10,6 +24,7 @@ #include #include +#include #include #include @@ -35,7 +50,9 @@ bool PartSet_PreviewPlanes::hasVisualizedBodies(ModuleBase_IWorkshop* theWorksho foreach (ObjectPtr anObj, aDisplayed) { ResultPtr aResult = std::dynamic_pointer_cast(anObj); // result constructions should not be taken as a body - if (aResult.get() != NULL && aResult->groupName() == ModelAPI_ResultBody::group()) { + if (aResult.get() != NULL && + ((aResult->groupName() == ModelAPI_ResultBody::group()) || + ((aResult->groupName() == ModelAPI_ResultPart::group()))) ) { GeomShapePtr aShape = aResult->shape(); if (aShape.get()) { // vertices, edges should not be taken as a body @@ -133,12 +150,15 @@ AISObjectPtr PartSet_PreviewPlanes::createPreviewPlane(std::shared_ptr theNorm, const int theRGB[3]) { - double aSize = Config_PropManager::integer(SKETCH_TAB_NAME, "planes_size"); + double aSize = Config_PropManager::real(SKETCH_TAB_NAME, "planes_size"); + if (aSize <= Precision::Confusion()) + aSize = 200; // Set default value + std::shared_ptr aFace = GeomAlgoAPI_FaceBuilder::squareFace(theOrigin, theNorm, aSize); AISObjectPtr aAIS = AISObjectPtr(new GeomAPI_AISObject()); aAIS->createShape(aFace); - aAIS->setWidth(Config_PropManager::integer(SKETCH_TAB_NAME, "planes_thickness")); + aAIS->setWidth(Config_PropManager::real(SKETCH_TAB_NAME, "planes_thickness")); aAIS->setColor(theRGB[0], theRGB[1], theRGB[2]); return aAIS; }