X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelHighAPI%2FModelHighAPI_Selection.cpp;h=ec6201600f530f5f3ef4a4c4071115b15af0e8cf;hb=4842c9279b5e413ded8e7788c6ae026bb04ddfb7;hp=60017e8cc972e35af3e319f019f6d01744058b4b;hpb=08f1aef6629e6a63cc4671d271ded4de6e826948;p=modules%2Fshaper.git diff --git a/src/ModelHighAPI/ModelHighAPI_Selection.cpp b/src/ModelHighAPI/ModelHighAPI_Selection.cpp index 60017e8cc..ec6201600 100644 --- a/src/ModelHighAPI/ModelHighAPI_Selection.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Selection.cpp @@ -131,6 +131,16 @@ void ModelHighAPI_Selection::setName(const std::string& theName) } } +std::string ModelHighAPI_Selection::name() const +{ + if (myVariantType == VT_ResultSubShapePair) { + std::shared_ptr aResult = myResultSubShapePair.first; + if (aResult.get()) + return aResult->data()->name(); + } + return std::string(); +} + void ModelHighAPI_Selection::setColor(int theRed, int theGreen, int theBlue) { if (myVariantType != VT_ResultSubShapePair || !myResultSubShapePair.first.get()) @@ -155,6 +165,17 @@ void ModelHighAPI_Selection::setDeflection(double theValue) aDeflectionAttr->setValue(theValue); } +void ModelHighAPI_Selection::setTransparency(double theValue) +{ + if (myVariantType != VT_ResultSubShapePair) + return; + + AttributeDoublePtr aTransparencyAttr = + myResultSubShapePair.first->data()->real(ModelAPI_Result::TRANSPARENCY_ID()); + + aTransparencyAttr->setValue(theValue); +} + int ModelHighAPI_Selection::numberOfSubs() const { if (myVariantType != VT_ResultSubShapePair)