From 4504d8807980fb2a03caad131571d47725a0117a Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 23 May 2018 11:44:46 +0300 Subject: [PATCH] Issue #2484: Fix for re-creation of a sketcher --- src/PartSet/PartSet_Module.cpp | 2 ++ src/SketcherPrs/SketcherPrs_PositionMgr.cpp | 1 - src/SketcherPrs/SketcherPrs_PositionMgr.h | 9 +++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 9696ee41f..dd8931d19 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -104,6 +104,7 @@ #include #include +#include #include #include @@ -721,6 +722,7 @@ bool PartSet_Module::isSketchNeutralPointActivated() const void PartSet_Module::closeDocument() { myActivePartIndex = QModelIndex(); + SketcherPrs_PositionMgr::get()->clearAll(); } //****************************************************** diff --git a/src/SketcherPrs/SketcherPrs_PositionMgr.cpp b/src/SketcherPrs/SketcherPrs_PositionMgr.cpp index 498926419..dfa3103dd 100644 --- a/src/SketcherPrs/SketcherPrs_PositionMgr.cpp +++ b/src/SketcherPrs/SketcherPrs_PositionMgr.cpp @@ -61,7 +61,6 @@ SketcherPrs_PositionMgr::SketcherPrs_PositionMgr() { } - int SketcherPrs_PositionMgr::getPositionIndex(ObjectPtr theLine, const SketcherPrs_SymbolPrs* thePrs) { diff --git a/src/SketcherPrs/SketcherPrs_PositionMgr.h b/src/SketcherPrs/SketcherPrs_PositionMgr.h index 8695126b2..7acc36e11 100644 --- a/src/SketcherPrs/SketcherPrs_PositionMgr.h +++ b/src/SketcherPrs/SketcherPrs_PositionMgr.h @@ -21,6 +21,7 @@ #ifndef SketcherPrs_PositionMgr_H #define SketcherPrs_PositionMgr_H +#include "SketcherPrs.h" #include "SketcherPrs_SymbolPrs.h" #include @@ -36,7 +37,7 @@ * A class Position Manager which manages position of constraints symbols along a source object line. * it expects that symbol icons have size 16x16 px */ -class SketcherPrs_PositionMgr +class SKETCHERPRS_EXPORT SketcherPrs_PositionMgr { public: /// Returns current instance of position manager @@ -53,6 +54,9 @@ public: /// \param thePrs a constraint presentation void deleteConstraint(const SketcherPrs_SymbolPrs* thePrs); + /// Cleares all stored positions for all constraints + void clearAll() { myShapes.clear(); myPntShapes.clear(); } + private: /// Constructor SketcherPrs_PositionMgr(); @@ -82,9 +86,6 @@ private: typedef std::map PositionsMap; typedef std::map> FeaturesMap; - /// The map which contains position of presentation - PositionsMap myIndexes; - /// The map contains position index std::map myShapes; -- 2.39.2