Salome HOME
Small correction for writing of data to file.
[modules/hydro.git] / src / HYDROData / HYDROData_Image.cxx
index a41cc26415820521fa13192f7b5471a25bdacd61..930d2a0e0733b9c04f8aa5c4ee5761e3cc7fc69a 100644 (file)
@@ -7,6 +7,7 @@
 #include <TDataStd_ReferenceList.hxx>
 #include <TDataStd_Name.hxx>
 #include <TDataStd_UAttribute.hxx>
+#include <TDataStd_AsciiString.hxx>
 #include <TDF_ListIteratorOfLabelList.hxx>
 
 static const Standard_GUID GUID_MUST_BE_UPDATED("80f2bb81-3873-4631-8ddd-940d2119f000");
@@ -58,6 +59,23 @@ QImage HYDROData_Image::Image()
   return aResult;
 }
 
+void HYDROData_Image::SetFilePath(const QString& theFilePath)
+{
+  TCollection_AsciiString anAsciiStr( theFilePath.toStdString().c_str() );
+  TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), anAsciiStr );
+}
+
+QString HYDROData_Image::GetFilePath() const
+{
+  QString aRes;
+
+  Handle(TDataStd_AsciiString) anAsciiStr;
+  if ( myLab.FindChild( DataTag_FilePath ).FindAttribute( TDataStd_AsciiString::GetID(), anAsciiStr ) )
+    aRes = QString( anAsciiStr->Get().ToCString() );
+
+  return aRes;
+}
+
 void HYDROData_Image::SetTrsf(const QTransform& theTrsf)
 {
   // locate 9 coeffs of matrix into the real array