X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_CustomPrs.cpp;h=21465eb1cb133887e2a96caf458beb7fe9b87fd6;hb=156333d6ed445c784552815acc68e5cbd1be02c8;hp=cc52284cca9e8e51c1452c7cadf4bd56adfa6603;hpb=de93e11325cc65d1067e0c3484cbb5c836bdcde6;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_CustomPrs.cpp b/src/PartSet/PartSet_CustomPrs.cpp old mode 100755 new mode 100644 index cc52284cc..21465eb1c --- a/src/PartSet/PartSet_CustomPrs.cpp +++ b/src/PartSet/PartSet_CustomPrs.cpp @@ -1,8 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: PartSet_CustomPrs.cpp -// Created: 30 Jun 2015 -// Author: Natalia ERMOLAEVA +// Copyright (C) 2014-2019 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 #include @@ -28,7 +41,8 @@ //#define DO_NOT_VISUALIZE_CUSTOM_PRESENTATION PartSet_CustomPrs::PartSet_CustomPrs(ModuleBase_IWorkshop* theWorkshop) - : myWorkshop(theWorkshop), myFeature(FeaturePtr()), myPresentationIsEmpty(false) + : myWorkshop(theWorkshop), myFeature(FeaturePtr()), myPresentationIsEmpty(false), + myDisabledMode(-1) { Events_Loop* aLoop = Events_Loop::loop(); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_EMPTY_OPERATION_PRESENTATION)); @@ -80,6 +94,9 @@ bool PartSet_CustomPrs::displayPresentation( { bool isModified = false; + if (myDisabledMode == theFlag) + return isModified; + // update the AIS objects content AISObjectPtr aPresentation = getPresentation(theFlag, true); Handle(AIS_InteractiveObject) anAISIO = aPresentation->impl(); @@ -96,6 +113,7 @@ bool PartSet_CustomPrs::displayPresentation( break; case ModuleBase_IModule::CustomizeResults: PartSet_OperationPrs::getResultShapes(myFeature, myWorkshop, aFeatureShapes); + PartSet_OperationPrs::getPresentationShapes(myFeature, myWorkshop, aFeatureShapes, false); break; case ModuleBase_IModule::CustomizeHighlightedObjects: PartSet_OperationPrs::getHighlightedShapes(myWorkshop, aFeatureShapes); @@ -103,7 +121,7 @@ bool PartSet_CustomPrs::displayPresentation( default: return isModified; } - NCollection_DataMap& aShapeMap = + NCollection_DataMap& aShapeMap = anOperationPrs->shapesMap(); PartSet_OperationPrs::fillShapeList(aFeatureShapes, myWorkshop, aShapeMap); @@ -122,7 +140,7 @@ bool PartSet_CustomPrs::displayPresentation( PartSet_Module* aModule = dynamic_cast(myWorkshop->module()); XGUI_Workshop* aWorkshop = workshop(); aRedisplayed = aWorkshop->displayer()->displayAIS(myPresentations[theFlag], - false/*load object in selection*/, false); + false/*load object in selection*/, 0, false); aContext->SetZLayer(anOperationPrs, aModule->getVisualLayerId()); isModified = true; } @@ -229,7 +247,7 @@ void PartSet_CustomPrs::initPresentation( if (theFlag == ModuleBase_IModule::CustomizeArguments || theFlag == ModuleBase_IModule::CustomizeResults) { anOperationPrs->setPointMarker(5, 2.); - anOperationPrs->setWidth(1); + anOperationPrs->setWidth((theFlag == ModuleBase_IModule::CustomizeHighlightedObjects)? 2 : 1); } else if (theFlag == ModuleBase_IModule::CustomizeHighlightedObjects) anAISPrs->useAISWidth();