#include <gp_XYZ.hxx>
#include <TDataStd_RealArray.hxx>
+#include <TDataStd_AsciiString.hxx>
#include <QFile>
#include <QFileInfo>
return aResAltitude;
}
+void HYDROData_Bathymetry::SetFilePath(const QString& theFilePath)
+{
+ TCollection_AsciiString anAsciiStr( theFilePath.toStdString().c_str() );
+ TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), anAsciiStr );
+}
+
+QString HYDROData_Bathymetry::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;
+}
+
bool HYDROData_Bathymetry::ImportFromFile( const QString& theFileName )
{
// Try to open the file
if ( aRes )
{
- // Update altitude points of this Bathymetry
+ // Update file path and altitude points of this Bathymetry
+ SetFilePath( theFileName );
SetAltitudePoints( aPoints );
}
enum DataTag
{
DataTag_First = HYDROData_Object::DataTag_First + 100, ///< first tag, to reserve
- DataTag_AltitudePoints ///< altitude points, array of reals
+ DataTag_AltitudePoints, ///< altitude points, array of reals
+ DataTag_FilePath ///< bathymetry imported file path
};
public:
public:
// Public methods to work with files.
+ /**
+ * Stores the bathymetry file path
+ * \param theFilePath image file path
+ */
+ HYDRODATA_EXPORT void SetFilePath( const QString& theFilePath );
+
+ /**
+ * Returns uploaded bathymetry file path
+ */
+ HYDRODATA_EXPORT QString GetFilePath() const;
+
/**
* Imports Bathymetry data from file. The supported file types:
* - xyz
#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");
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
enum DataTag
{
DataTag_First = HYDROData_Object::DataTag_First + 100, ///< first tag, to reserve
- DataTag_Operator, ///< name of the operator that must be executed for image update
- DataTag_TrsfPoints ///< image transformation points (3 input + 3 output)
+ DataTag_Operator, ///< name of the operator that must be executed for image update
+ DataTag_TrsfPoints, ///< image transformation points (3 input + 3 output)
+ DataTag_FilePath ///< image imported file path
};
public:
*/
HYDRODATA_EXPORT QImage Image();
+ /**
+ * Stores the image file path
+ * \param theFilePath image file path
+ */
+ HYDRODATA_EXPORT void SetFilePath(const QString& theFilePath);
+
+ /**
+ * Returns uploaded image file path
+ */
+ HYDRODATA_EXPORT QString GetFilePath() const;
+
/**
* Stores the image transformation
* \param theTrsf new transformation