X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelHighAPI%2FModelHighAPI_Selection.cpp;h=fb0697635dd2b855552aa3ebd974c3a54e6a6524;hb=2054879244f3323c305222c79c57d2db6a487538;hp=536e22710957bd1e3740e992a7434f96a7dcf0be;hpb=d34842c50d5f335cca443c78910c16c54139c7d0;p=modules%2Fshaper.git diff --git a/src/ModelHighAPI/ModelHighAPI_Selection.cpp b/src/ModelHighAPI/ModelHighAPI_Selection.cpp index 536e22710..fb0697635 100644 --- a/src/ModelHighAPI/ModelHighAPI_Selection.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Selection.cpp @@ -1,5 +1,6 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Selection.cpp -// Purpose: +// Purpose: // // History: // 06/06/16 - Sergey POKHODENKO - Creation of the file @@ -7,6 +8,7 @@ //-------------------------------------------------------------------------------------- #include "ModelHighAPI_Selection.h" +#include #include #include #include @@ -42,8 +44,12 @@ void ModelHighAPI_Selection::fillAttribute( { switch(myVariantType) { case VT_Empty: return; - case VT_ResultSubShapePair: theAttribute->setValue(myResultSubShapePair.first, myResultSubShapePair.second); return; - case VT_TypeSubShapeNamePair: theAttribute->selectSubShape(myTypeSubShapeNamePair.first, myTypeSubShapeNamePair.second); return; + case VT_ResultSubShapePair: + theAttribute->setValue(myResultSubShapePair.first, myResultSubShapePair.second); + return; + case VT_TypeSubShapeNamePair: + theAttribute->selectSubShape(myTypeSubShapeNamePair.first, myTypeSubShapeNamePair.second); + return; } } @@ -53,7 +59,9 @@ void ModelHighAPI_Selection::appendToList( { switch(myVariantType) { case VT_Empty: return; - case VT_ResultSubShapePair: theAttribute->append(myResultSubShapePair.first, myResultSubShapePair.second); return; + case VT_ResultSubShapePair: + theAttribute->append(myResultSubShapePair.first, myResultSubShapePair.second); + return; case VT_TypeSubShapeNamePair: // Note: the reverse order (first - type, second - sub-shape name) theAttribute->append(myTypeSubShapeNamePair.second, myTypeSubShapeNamePair.first); @@ -83,8 +91,8 @@ TypeSubShapeNamePair ModelHighAPI_Selection::typeSubShapeNamePair() const std::string ModelHighAPI_Selection::shapeType() const { switch(myVariantType) { - case VT_ResultSubShapePair: - return myResultSubShapePair.second.get() ? myResultSubShapePair.second->shapeTypeStr() : + case VT_ResultSubShapePair: + return myResultSubShapePair.second.get() ? myResultSubShapePair.second->shapeTypeStr() : myResultSubShapePair.first->shape()->shapeTypeStr(); case VT_TypeSubShapeNamePair: return myTypeSubShapeNamePair.first; } @@ -111,3 +119,14 @@ void ModelHighAPI_Selection::setColor(int theRed, int theGreen, int theBlue) 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); +}