From 75fe2bf30fb30bf750ebd4dca02f6a1827c1a0b0 Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 27 Dec 2018 08:24:24 +0300 Subject: [PATCH] Fix for the issue #2820: restore the attribute list sub-shape type for weak naming scripts --- src/ModelHighAPI/ModelHighAPI_Selection.cpp | 6 ++++++ src/ModelHighAPI/ModelHighAPI_Selection.h | 4 ++++ src/ModelHighAPI/ModelHighAPI_Tools.cpp | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/src/ModelHighAPI/ModelHighAPI_Selection.cpp b/src/ModelHighAPI/ModelHighAPI_Selection.cpp index b9a9f0be5..4e70accb6 100644 --- a/src/ModelHighAPI/ModelHighAPI_Selection.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Selection.cpp @@ -161,6 +161,12 @@ TypeInnerPointPair ModelHighAPI_Selection::typeInnerPointPair() const return myTypeInnerPointPair; } +//================================================================================================== +TypeWeakNamingPair ModelHighAPI_Selection::typeWeakNamingPair() const +{ + return myWeakNamingPair; +} + //================================================================================================== std::string ModelHighAPI_Selection::shapeType() const { diff --git a/src/ModelHighAPI/ModelHighAPI_Selection.h b/src/ModelHighAPI/ModelHighAPI_Selection.h index 209aa4d95..421ff5382 100644 --- a/src/ModelHighAPI/ModelHighAPI_Selection.h +++ b/src/ModelHighAPI/ModelHighAPI_Selection.h @@ -115,6 +115,10 @@ public: MODELHIGHAPI_EXPORT virtual TypeInnerPointPair typeInnerPointPair() const; + /// \return pair of sub-shape type and pair of context name and sub-shape index. + MODELHIGHAPI_EXPORT + virtual TypeWeakNamingPair typeWeakNamingPair() const; + /// \return shape type. MODELHIGHAPI_EXPORT virtual std::string shapeType() const; diff --git a/src/ModelHighAPI/ModelHighAPI_Tools.cpp b/src/ModelHighAPI/ModelHighAPI_Tools.cpp index d658206b4..b958917bc 100644 --- a/src/ModelHighAPI/ModelHighAPI_Tools.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Tools.cpp @@ -346,6 +346,12 @@ GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection aShapeType = shapeTypeByStr(aType); break; } + case ModelHighAPI_Selection::VT_WeakNamingPair: { + TypeWeakNamingPair aPair = theSelection.typeWeakNamingPair(); + std::string aType = aPair.first; + aShapeType = shapeTypeByStr(aType); + break; + } } return aShapeType; -- 2.39.2