Salome HOME
Issue #2324: Update all indexes on show/hide
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Selection.cpp
index 60017e8cc972e35af3e319f019f6d01744058b4b..ec6201600f530f5f3ef4a4c4071115b15af0e8cf 100644 (file)
@@ -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<ModelAPI_Result> 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)