]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1964 Splitting an auxiliary line gives a non auxiliary line
authornds <nds@opencascade.com>
Fri, 20 Jan 2017 14:07:53 +0000 (17:07 +0300)
committernds <nds@opencascade.com>
Fri, 20 Jan 2017 14:07:53 +0000 (17:07 +0300)
Style of sketch constraint split preview presentation should be the same as the base sketch entity has.

src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp

index d2f64ddea650659099cfc1af34ecae8c8d9e4e29..32199abce256870049b612d95c94b8459bef9566 100755 (executable)
@@ -369,11 +369,27 @@ AISObjectPtr SketchPlugin_ConstraintSplit::getAISObject(AISObjectPtr thePrevious
       if (!anAIS)
         anAIS = AISObjectPtr(new GeomAPI_AISObject);
       anAIS->createShape(aShape);
-      anAIS->setWidth(5);
+      std::shared_ptr<ModelAPI_AttributeBoolean> anAuxiliaryAttr =
+             aBaseFeature->data()->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID());
+
+      bool isConstruction = anAuxiliaryAttr.get() != NULL && anAuxiliaryAttr->value();
+
       std::vector<int> aColor;
-      aColor = Config_PropManager::color("Visualization", "sketch_entity_color",
-                                          SKETCH_ENTITY_COLOR);
-     anAIS->setColor(aColor[0], aColor[1], aColor[2]);
+      double aWidth = SketchPlugin_SketchEntity::SKETCH_LINE_WIDTH();
+      int aLineStyle = SketchPlugin_SketchEntity::SKETCH_LINE_STYLE();
+      if (isConstruction) {
+        aColor = Config_PropManager::color("Visualization", "sketch_auxiliary_color",
+                                           SKETCH_AUXILIARY_COLOR);
+        aWidth = SketchPlugin_SketchEntity::SKETCH_LINE_WIDTH_AUXILIARY();
+        aLineStyle = SketchPlugin_SketchEntity::SKETCH_LINE_STYLE_AUXILIARY();
+      }
+      else {
+        aColor = Config_PropManager::color("Visualization", "sketch_entity_color",
+                                            SKETCH_ENTITY_COLOR);
+      }
+      anAIS->setColor(aColor[0], aColor[1], aColor[2]);
+      anAIS->setWidth(aWidth + 1);
+      anAIS->setLineStyle(aLineStyle);
     }
     return anAIS;
   }