Salome HOME
Task 3.2. To keep compounds’ sub-shapes for all operations (issue #3139)
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Double.cpp
index 33c52647d98ef1009250ab14075a844c7f387869..0f0078a3a550c49afc978457bce7eb911ff14f35 100644 (file)
@@ -21,6 +21,8 @@
 
 #include <ModelAPI_AttributeDouble.h>
 #include <GeomDataAPI_Point.h>
+
+#include <sstream>
 //--------------------------------------------------------------------------------------
 
 //--------------------------------------------------------------------------------------
@@ -52,6 +54,16 @@ double ModelHighAPI_Double::value() const
   return myDouble;
 }
 
+std::string ModelHighAPI_Double::string() const
+{
+  if (myVariantType == VT_STRING)
+    return myString;
+
+  std::ostringstream anOut;
+  anOut << myDouble;
+  return anOut.str();
+}
+
 //--------------------------------------------------------------------------------------
 void ModelHighAPI_Double::fillAttribute(
     const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute) const