2 #ifndef HYDROData_Bathymetry_HeaderFile
3 #define HYDROData_Bathymetry_HeaderFile
5 #include "HYDROData_IAltitudeObject.h"
6 #include "HYDROData_QuadtreeNode.hxx"
10 class Handle_HYDROData_PolylineXY;
12 DEFINE_STANDARD_HANDLE(HYDROData_Bathymetry, HYDROData_IAltitudeObject)
15 /**\class HYDROData_Bathymetry
16 * \brief Class that stores/retreives information about the Bathymetry.
18 * The Bathymetry represents measurement of the altitude of points on the terrain.
20 class HYDROData_Bathymetry : public HYDROData_IAltitudeObject
24 typedef gp_XYZ AltitudePoint;
25 typedef NCollection_Sequence<AltitudePoint> AltitudePoints;
30 * Enumeration of tags corresponding to the persistent object parameters.
34 DataTag_First = HYDROData_IAltitudeObject::DataTag_First + 100, ///< first tag, to reserve
35 DataTag_AltitudePoints, ///< altitude points, array of reals
36 DataTag_FilePath, ///< bathymetry imported file path
37 DataTag_AltitudesInverted, ///< flag to invert z values
42 DEFINE_STANDARD_RTTI(HYDROData_Bathymetry);
45 * Returns the kind of this object. Must be redefined in all objects of known type.
47 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_BATHYMETRY; }
51 * Dump Bathymetry object to Python script representation.
53 HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
56 // Public methods to work with Bathymetry altitudes.
59 * Replace current altitude points by new one.
60 * \param thePoints the altitude points list
62 HYDRODATA_EXPORT virtual void SetAltitudePoints( const AltitudePoints& thePoints );
65 * Returns altitude points list.
68 HYDRODATA_EXPORT virtual AltitudePoints GetAltitudePoints() const;
69 HYDRODATA_EXPORT virtual HYDROData_QuadtreeNode* GetQuadtreeNodes() const;
72 * Remove all altitude points.
74 HYDRODATA_EXPORT virtual void RemoveAltitudePoints();
77 * Returns altitude for given point.
78 * \param thePoint the point to examine
79 * \return altitude value
81 HYDRODATA_EXPORT virtual double GetAltitudeForPoint( const gp_XY& thePoint ) const;
84 // Public methods to work with files.
87 * Stores the bathymetry file path
88 * \param theFilePath image file path
90 HYDRODATA_EXPORT void SetFilePath( const TCollection_AsciiString& theFilePath );
93 * Returns uploaded bathymetry file path
95 HYDRODATA_EXPORT TCollection_AsciiString GetFilePath() const;
98 * Set flag indicating needs to invert altitude values
99 * \param theIsInverted new invert value
100 * \param theIsUpdate flag indicating necessity to update points
102 HYDRODATA_EXPORT void SetAltitudesInverted( const bool theIsInverted,
103 const bool theIsUpdate = true );
106 * Returns flag indicating needs to invert altitude values.
108 HYDRODATA_EXPORT bool IsAltitudesInverted() const;
111 * Imports Bathymetry data from file. The supported file types:
113 * \param theFileName the path to file
114 * \return \c true if file has been successfully read
116 HYDRODATA_EXPORT virtual bool ImportFromFile( const TCollection_AsciiString& theFileName );
118 HYDRODATA_EXPORT Handle_HYDROData_PolylineXY CreateBoundaryPolyline() const;
120 HYDRODATA_EXPORT virtual void UpdateLocalCS( double theDx, double theDy );
125 * Imports Bathymetry data from 'XYZ' file.
127 bool importFromXYZFile( QFile& theFile,
128 AltitudePoints& thePoints ) const;
129 static std::map<int, HYDROData_QuadtreeNode*> myQuadtrees;
133 friend class HYDROData_Iterator;
136 * Creates new object in the internal data structure. Use higher level objects
137 * to create objects with real content.
139 HYDRODATA_EXPORT HYDROData_Bathymetry();
142 * Destructs properties of the object and object itself, removes it from the document.
144 HYDRODATA_EXPORT ~HYDROData_Bathymetry();