From: mpv Date: Thu, 27 Dec 2018 05:24:24 +0000 (+0300) Subject: Fix for the issue #2820: restore the attribute list sub-shape type for weak naming... X-Git-Tag: End2018~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=75fe2bf30fb30bf750ebd4dca02f6a1827c1a0b0;p=modules%2Fshaper.git Fix for the issue #2820: restore the attribute list sub-shape type for weak naming scripts --- 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;