From 21aab68742ce06e6bdbbb45e55a6366a07f8db66 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 5 Apr 2016 09:20:59 +0300 Subject: [PATCH] #1371 Using auxilliary Sketch elements in any Feature: construction default line width should be equal 2, not 3. --- src/PartSet/PartSet_OperationPrs.cpp | 4 +--- src/PartSet/PartSet_ResultSketchPrs.cpp | 2 +- src/PartSet/PartSet_Tools.cpp | 6 ++++++ src/PartSet/PartSet_Tools.h | 4 ++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/PartSet/PartSet_OperationPrs.cpp b/src/PartSet/PartSet_OperationPrs.cpp index a231a9b98..8b50a2ad5 100755 --- a/src/PartSet/PartSet_OperationPrs.cpp +++ b/src/PartSet/PartSet_OperationPrs.cpp @@ -36,8 +36,6 @@ #include -static const int AIS_DEFAULT_WIDTH = 2; - //#define DEBUG_EMPTY_SHAPE // multi-rotation/translation operation @@ -108,7 +106,7 @@ void PartSet_OperationPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t /// workaround for zero width. Else, there will be a crash if (aWidth == 0) { // width returns of TSolid shape is zero bool isDisplayed = !anIO->GetContext().IsNull(); - aWidth = AIS_DEFAULT_WIDTH;// default width value + aWidth = PartSet_Tools::getAISDefaultWidth();// default width value } setWidth(aDrawer, aWidth); } diff --git a/src/PartSet/PartSet_ResultSketchPrs.cpp b/src/PartSet/PartSet_ResultSketchPrs.cpp index 64ba7b087..ede7d144d 100755 --- a/src/PartSet/PartSet_ResultSketchPrs.cpp +++ b/src/PartSet/PartSet_ResultSketchPrs.cpp @@ -257,7 +257,7 @@ void PartSet_ResultSketchPrs::setAuxiliaryPresentationStyle(const bool isAuxilia if (!isAuxiliary) { aColor = Config_PropManager::color("Visualization", "result_construction_color", ModelAPI_ResultConstruction::DEFAULT_COLOR()); - aWidth = SketchPlugin_SketchEntity::SKETCH_LINE_WIDTH(); + aWidth = PartSet_Tools::getAISDefaultWidth();// default width value aLineStyle = SketchPlugin_SketchEntity::SKETCH_LINE_STYLE(); } else { diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index 0616192d9..2fdb1da74 100755 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -74,6 +74,12 @@ #endif const double PRECISION_TOLERANCE = 0.000001; +const int AIS_DEFAULT_WIDTH = 2; + +int PartSet_Tools::getAISDefaultWidth() +{ + return AIS_DEFAULT_WIDTH; +} gp_Pnt PartSet_Tools::convertClickToPoint(QPoint thePoint, Handle(V3d_View) theView) { diff --git a/src/PartSet/PartSet_Tools.h b/src/PartSet/PartSet_Tools.h index fe133ede0..489fa6615 100755 --- a/src/PartSet/PartSet_Tools.h +++ b/src/PartSet/PartSet_Tools.h @@ -54,6 +54,10 @@ public: }; public: + /// Returns default value of AIS presentation + /// \return integer value + static int getAISDefaultWidth(); + /// Converts the 2D screen point to the 3D point on the view according to the point of view /// \param thePoint a screen point /// \param theView a 3D view -- 2.39.2