+// Copyright (C) 2014-2015 EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#ifndef HYDROData_Image_HeaderFile
#define HYDROData_Image_HeaderFile
#include <HYDROData_Entity.h>
+#ifdef WIN32
+ #pragma warning ( disable: 4251 )
+#endif
+
#include <QImage>
#include <QTransform>
-DEFINE_STANDARD_HANDLE(HYDROData_Image, HYDROData_Entity)
+#ifdef WIN32
+ #pragma warning ( default: 4251 )
+#endif
/**\class HYDROData_Image
* \brief Class that stores/retreives information about the image.
{
ManualGeodesic = 0,
ManualCartesian,
+ CartesianFromFile,
ReferenceImage
};
+ enum ECW_CellUnits
+ {
+ ECW_CellUnits_Meters = 1,
+ ECW_CellUnits_Deg = 2,
+ ECW_CellUnits_Feet = 3,
+ ECW_CellUnits_Unknown = -1
+ };
+
+ struct ECW_FileInfo
+ {
+ ECW_CellUnits myCellSizeUnits;
+ double myCellIncrementX;
+ double myCellIncrementY;
+ double myOriginX;
+ double myOriginY;
+ int myXSize;
+ int myYSize;
+ };
+
protected:
/**
* Enumeration of tags corresponding to the persistent object parameters.
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_Image);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Image, HYDROData_Entity);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
/**
* Dump Image object to Python script representation.
*/
- HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
+ HYDRODATA_EXPORT virtual QStringList DumpToPython( const QString& thePyScriptPath,
+ MapOfTreatedObjects& theTreatedObjects ) const;
/**
* Updates object state.
*/
HYDRODATA_EXPORT virtual void Update();
+ /**
+ * Checks that object has 2D presentation. Reimlemented to retun true.
+ */
+ HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
+
/**
* Returns data of object wrapped to QVariant.
* Reimplemented to wrap and return saved image.
*/
HYDRODATA_EXPORT bool LoadImage(const QString& theFilePath);
+ /**
+ * Load the ECW image from file
+ * \param theFilePath path to image
+ */
+ HYDRODATA_EXPORT bool LoadImageECW( const QString& theFilePath );
+
+
+ HYDRODATA_EXPORT static bool OpenECW(char* theFileName, QImage& theImage, ECW_FileInfo* theECWInfo);
+
/**
* Returns the kept image
*/
QPointF& thePointB,
QPointF& thePointC ) const;
+ /**
+ * Get transformation points from the file and stores them in global cs
+ * \param theFileName the image georeferencement file name
+ * \return true in case of success
+ */
+ HYDRODATA_EXPORT bool SetGlobalPointsFromFile( const QString& theFileName );
+
/**
* Returns true if global points has been set before
*/
/**
- * Marks the image as self-splitted.
- * \param theFlag is true for self-splitted image
+ * Marks the image as self-split.
+ * \param theFlag is true for self-plit image
*/
- HYDRODATA_EXPORT void SetIsSelfSplitted(bool theFlag);
+ HYDRODATA_EXPORT void SetIsSelfSplit(bool theFlag);
/**
- * Checks that the image is self-splitted.
- * \returns true if image is self-splitted
+ * Checks that the image is self-split.
+ * \returns true if image is self-split
*/
- HYDRODATA_EXPORT bool IsSelfSplitted() const;
+ HYDRODATA_EXPORT bool IsSelfSplit() const;
private: