]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_ResultSketchPrs.cpp
Salome HOME
Merge branch 'BR_internationalization'
[modules/shaper.git] / src / PartSet / PartSet_ResultSketchPrs.cpp
index 154ca8d41d9bc671ac9f02525d10d4b78f336e63..d23125683ca8ae9868af9b340982a876810e5b84 100755 (executable)
@@ -18,6 +18,8 @@
 
 #include <SketchPlugin_SketchEntity.h>
 
+#include <SketcherPrs_Tools.h>
+
 #include <Config_PropManager.h>
 
 #include <BRep_Builder.hxx>
@@ -86,7 +88,7 @@ void PartSet_ResultSketchPrs::Compute(const Handle(PrsMgr_PresentationManager3d)
   setAuxiliaryPresentationStyle(false);
 
   // change deviation coefficient to provide more precise circle
-  ModuleBase_Tools::setDefaultDeviationCoefficient(Shape(), Attributes());
+  ModuleBase_Tools::setDefaultDeviationCoefficient(myResult, Attributes());
   AIS_Shape::Compute(thePresentationManager, thePresentation, theMode);
 
   if (!myAuxiliaryCompound.IsNull()) {
@@ -120,15 +122,21 @@ void debugInfo(const TopoDS_Shape& theShape, const TopAbs_ShapeEnum theType)
 #endif
 
 void PartSet_ResultSketchPrs::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
-                                            const Standard_Integer aMode)
+                                            const Standard_Integer theMode)
 {
-  if (aMode > 8)
+  int aMode = theMode;
+
+  if (aMode > 8 &&
+      aMode != SketcherPrs_Tools::Sel_Sketch_Face &&
+      aMode != SketcherPrs_Tools::Sel_Sketch_Wire)
     // In order to avoid using custom selection modes
     return;
 
   bool aShapeIsChanged = false;
-  if (aMode == AIS_Shape::SelectionMode(TopAbs_FACE) ||
-      aMode == AIS_Shape::SelectionMode(TopAbs_WIRE)) {
+  if (aMode == SketcherPrs_Tools::Sel_Sketch_Face ||
+      aMode == SketcherPrs_Tools::Sel_Sketch_Wire) {
+    aMode = (aMode == SketcherPrs_Tools::Sel_Sketch_Face) ? AIS_Shape::SelectionMode(TopAbs_FACE)
+                                                          : AIS_Shape::SelectionMode(TopAbs_WIRE);
 #ifdef DEBUG_WIRE
     const TopoDS_Shape& aShape = Shape();
     debugInfo(aShape, TopAbs_VERTEX); // 24