X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_CustomPrs.cpp;h=e18ca5bb063b58a5716997908d3c8b078328ac4d;hb=bed0a043369bee847810ec7ed46470a59ca49174;hp=7b4ab82a290d555e4557e58159807d81eaf29a4c;hpb=c4eab94a20a0d93100549a210582d46409fec1cc;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_CustomPrs.cpp b/src/PartSet/PartSet_CustomPrs.cpp index 7b4ab82a2..e18ca5bb0 100644 --- a/src/PartSet/PartSet_CustomPrs.cpp +++ b/src/PartSet/PartSet_CustomPrs.cpp @@ -17,10 +17,11 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#include -#include +#include "PartSet_CustomPrs.h" +#include "PartSet_Module.h" #include "PartSet_OperationPrs.h" #include "PartSet_OverconstraintListener.h" +#include "PartSet_SketcherMgr.h" #include #include @@ -30,6 +31,9 @@ #include #include +#include +#include + #include #include #include @@ -41,7 +45,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)); @@ -67,12 +72,22 @@ bool PartSet_CustomPrs::activate(const FeaturePtr& theFeature, #ifdef DO_NOT_VISUALIZE_CUSTOM_PRESENTATION return false; #endif + bool isModified = false; - myIsActive[theFlag] = true; - myFeature = theFeature; + // Do not call customisation for sketcher and all its sub-objects + if (theFeature->getKind() == SketchPlugin_Sketch::ID()) + return isModified; + + FeaturePtr aParent = ModelAPI_Tools::compositeOwner(theFeature); + if (aParent.get()) { + std::string aType = aParent->getKind(); + if (aType == SketchPlugin_Sketch::ID()) + return isModified; + } - bool isModified = false; if (theFeature.get()) { + myIsActive[theFlag] = true; + myFeature = theFeature; displayPresentation(theFlag, theUpdateViewer); isModified = true; } @@ -93,6 +108,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(); @@ -136,7 +154,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; } @@ -243,7 +261,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();