+ if (myVariantType == VT_ResultSubShapePair)
+ myResultSubShapePair.first->data()->setName(theName);
+}
+
+void ModelHighAPI_Selection::setColor(int theRed, int theGreen, int theBlue)
+{
+ if (myVariantType != VT_ResultSubShapePair)
+ return;
+
+ AttributeIntArrayPtr aColor =
+ myResultSubShapePair.first->data()->intArray(ModelAPI_Result::COLOR_ID());
+ aColor->setSize(3);
+ aColor->setValue(0, theRed);
+ aColor->setValue(1, theGreen);
+ aColor->setValue(2, theBlue);
+}
+
+void ModelHighAPI_Selection::setDeflection(double theValue)
+{
+ if (myVariantType != VT_ResultSubShapePair)
+ return;
+
+ AttributeDoublePtr aDeflectionAttr =
+ myResultSubShapePair.first->data()->real(ModelAPI_Result::DEFLECTION_ID());
+
+ aDeflectionAttr->setValue(theValue);
+}
+
+ModelHighAPI_Selection ModelHighAPI_Selection::subResult(int theIndex)
+{
+ if (myVariantType != VT_ResultSubShapePair)
+ return ModelHighAPI_Selection();
+
+ ResultCompSolidPtr aCompSolid =
+ std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(myResultSubShapePair.first);
+ if (!aCompSolid)
+ return ModelHighAPI_Selection();
+
+ ResultBodyPtr aResult = aCompSolid->subResult(theIndex);
+ return ModelHighAPI_Selection(aResult, aResult->shape());