]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix color management
authorvsv <vsv@opencascade.com>
Thu, 5 Dec 2019 13:59:24 +0000 (16:59 +0300)
committervsv <vsv@opencascade.com>
Thu, 5 Dec 2019 13:59:24 +0000 (16:59 +0300)
src/PartSet/PartSet_MenuMgr.cpp
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_SketcherMgr.cpp
src/PartSet/PartSet_SketcherMgr.h

index def7233c95bf2e772f96617e2e05193eec996fc3..0ea7aa78d4efeafc27614cefd638c72bb8f6cb80 100644 (file)
@@ -385,6 +385,7 @@ void PartSet_MenuMgr::setAuxiliary(const bool isChecked)
 
     anOpMgr->startOperation(anOpAction);
   }
+  static const Events_ID anVisualEvent = Events_Loop::eventByName(EVENT_VISUAL_ATTRIBUTES);
   if (anObjects.size() > 0) {
     QObjectPtrList::const_iterator anIt = anObjects.begin(), aLast = anObjects.end();
     for (; anIt != aLast; anIt++) {
@@ -400,6 +401,7 @@ void PartSet_MenuMgr::setAuxiliary(const bool isChecked)
             aSketchFeature->data()->attribute(anAttribute));
           if (anAuxiliaryAttr)
             anAuxiliaryAttr->setValue(isChecked);
+          ModelAPI_EventCreator::get()->sendUpdated(aSketchFeature, anVisualEvent);
         }
       }
     }
@@ -408,6 +410,7 @@ void PartSet_MenuMgr::setAuxiliary(const bool isChecked)
     anOpMgr->commitOperation();
 
   Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
+  Events_Loop::loop()->flush(anVisualEvent);
 }
 
 bool PartSet_MenuMgr::canSetAuxiliary(bool& theValue) const
index f3e9a285618d37d6655bfae5944201595ffc54a9..5b50689714efd32cde8bd4584cae4d8411858834 100644 (file)
@@ -1366,7 +1366,7 @@ double getResultTransparency(const ResultPtr& theResult)
 void PartSet_Module::customizePresentation(const ObjectPtr& theObject,
                                            const AISObjectPtr& thePrs) const
 {
-  if (mySketchMgr->isSketchStarted()) {
+  if (mySketchMgr->isObjectOfSketch(theObject)) {
     mySketchMgr->customizeSketchPresentation(theObject, thePrs);
   }
   else {
index bd4c35fae988df2c1cceee69b11d42889015f27b..e8257714569d0363873ca9a0db1b851984a35787 100644 (file)
@@ -172,8 +172,7 @@ PartSet_SketcherMgr::PartSet_SketcherMgr(PartSet_Module* theModule)
   : QObject(theModule), myModule(theModule), myIsEditLaunching(false), myIsDragging(false),
     myDragDone(false), myIsMouseOverWindow(false),
     myIsMouseOverViewProcessed(true), myPreviousUpdateViewerEnabled(true),
-    myIsPopupMenuActive(false), myExternalPointsMgr(0), myNoDragMoving(false),
-    myIsSketchStarted(false)
+    myIsPopupMenuActive(false), myExternalPointsMgr(0), myNoDragMoving(false)
 {
   ModuleBase_IWorkshop* anIWorkshop = myModule->workshop();
   ModuleBase_IViewer* aViewer = anIWorkshop->viewer();
@@ -1028,7 +1027,6 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation)
   if (!aFOperation)
     return;
 
-  myIsSketchStarted = true;
   SketcherPrs_Tools::setPixelRatio(ModuleBase_Tools::currentPixelRatio());
 
   myModule->onViewTransformed();
@@ -1151,8 +1149,6 @@ void PartSet_SketcherMgr::stopSketch(ModuleBase_Operation* theOperation)
   myModule->workshop()->viewer()->setFitter(0);
   delete aFitter;
 
-  myIsSketchStarted = false;
-
   myIsMouseOverWindow = false;
   myIsConstraintsShown[PartSet_Tools::Geometrical] = true;
   myIsConstraintsShown[PartSet_Tools::Dimensional] = true;
@@ -1578,17 +1574,19 @@ const QMap<PartSet_Tools::ConstraintVisibleState, bool>& PartSet_SketcherMgr::sh
 
 bool PartSet_SketcherMgr::isObjectOfSketch(const ObjectPtr& theObject) const
 {
-  bool isFoundObject = false;
-
+  if (!myCurrentSketch.get())
+    return false;
   FeaturePtr anObjectFeature = ModelAPI_Feature::feature(theObject);
   if (anObjectFeature.get()) {
     int aSize = myCurrentSketch->numberOfSubs();
-    for (int i = 0; i < aSize && !isFoundObject; i++) {
-      FeaturePtr aCurrentFeature = myCurrentSketch->subFeature(i);
-      isFoundObject = myCurrentSketch->subFeature(i) == anObjectFeature;
+    FeaturePtr aCurrentFeature;
+    for (int i = 0; i < aSize; i++) {
+      aCurrentFeature = myCurrentSketch->subFeature(i);
+      if (myCurrentSketch->subFeature(i) == anObjectFeature)
+        return true;
     }
   }
-  return isFoundObject;
+  return false;
 }
 
 void PartSet_SketcherMgr::onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>& thePlane)
index 092982f52ec35255f1525b3f35ac0384ab442df7..20ee6e6594dee9e42b0466dc1960b8c49021bc92 100644 (file)
@@ -380,8 +380,6 @@ public:
   */
   virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
 
-  bool isSketchStarted() const { return myIsSketchStarted; }
-
 
 public slots:
   /// Process sketch plane selected event
@@ -511,8 +509,6 @@ private:
   QMap<ResultPtr, Handle(AIS_Shape)> myPointsHighlight;
 
   bool myNoDragMoving;
-
-  bool myIsSketchStarted;
 };