2 #ifndef HYDROData_Bathymetry_HeaderFile
3 #define HYDROData_Bathymetry_HeaderFile
5 #include "HYDROData_IAltitudeObject.h"
9 class Handle_HYDROData_PolylineXY;
11 DEFINE_STANDARD_HANDLE(HYDROData_Bathymetry, HYDROData_IAltitudeObject)
14 /**\class HYDROData_Bathymetry
15 * \brief Class that stores/retreives information about the Bathymetry.
17 * The Bathymetry represents measurement of the altitude of points on the terrain.
19 class HYDROData_Bathymetry : public HYDROData_IAltitudeObject
23 typedef gp_XYZ AltitudePoint;
24 typedef NCollection_Sequence<AltitudePoint> AltitudePoints;
29 * Enumeration of tags corresponding to the persistent object parameters.
33 DataTag_First = HYDROData_IAltitudeObject::DataTag_First + 100, ///< first tag, to reserve
34 DataTag_AltitudePoints, ///< altitude points, array of reals
35 DataTag_FilePath, ///< bathymetry imported file path
36 DataTag_AltitudesInverted, ///< flag to invert z values
41 DEFINE_STANDARD_RTTI(HYDROData_Bathymetry);
44 * Returns the kind of this object. Must be redefined in all objects of known type.
46 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_BATHYMETRY; }
50 * Dump Bathymetry object to Python script representation.
52 HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
55 // Public methods to work with Bathymetry altitudes.
58 * Replace current altitude points by new one.
59 * \param thePoints the altitude points list
61 HYDRODATA_EXPORT virtual void SetAltitudePoints( const AltitudePoints& thePoints );
64 * Returns altitude points list.
67 HYDRODATA_EXPORT virtual AltitudePoints GetAltitudePoints() const;
70 * Remove all altitude points.
72 HYDRODATA_EXPORT virtual void RemoveAltitudePoints();
75 * Returns altitude for given point.
76 * \param thePoint the point to examine
77 * \return altitude value
79 HYDRODATA_EXPORT virtual double GetAltitudeForPoint( const gp_XY& thePoint ) const;
82 // Public methods to work with files.
85 * Stores the bathymetry file path
86 * \param theFilePath image file path
88 HYDRODATA_EXPORT void SetFilePath( const TCollection_AsciiString& theFilePath );
91 * Returns uploaded bathymetry file path
93 HYDRODATA_EXPORT TCollection_AsciiString GetFilePath() const;
96 * Set flag indicating needs to invert altitude values
97 * \param theIsInverted new invert value
98 * \param theIsUpdate flag indicating necessity to update points
100 HYDRODATA_EXPORT void SetAltitudesInverted( const bool theIsInverted,
101 const bool theIsUpdate = true );
104 * Returns flag indicating needs to invert altitude values.
106 HYDRODATA_EXPORT bool IsAltitudesInverted() const;
109 * Imports Bathymetry data from file. The supported file types:
111 * \param theFileName the path to file
112 * \return \c true if file has been successfully read
114 HYDRODATA_EXPORT virtual bool ImportFromFile( const TCollection_AsciiString& theFileName );
116 HYDRODATA_EXPORT Handle_HYDROData_PolylineXY CreateBoundaryPolyline() const;
118 HYDRODATA_EXPORT virtual void UpdateLocalCS( double theDx, double theDy );
123 * Imports Bathymetry data from 'XYZ' file.
125 bool importFromXYZFile( QFile& theFile,
126 AltitudePoints& thePoints ) const;
130 friend class HYDROData_Iterator;
133 * Creates new object in the internal data structure. Use higher level objects
134 * to create objects with real content.
136 HYDRODATA_EXPORT HYDROData_Bathymetry();
139 * Destructs properties of the object and object itself, removes it from the document.
141 HYDRODATA_EXPORT ~HYDROData_Bathymetry();