2 #ifndef HYDROData_Bathymetry_HeaderFile
3 #define HYDROData_Bathymetry_HeaderFile
5 #include "HYDROData_IAltitudeObject.h"
6 #include "HYDROData_QuadtreeNode.hxx"
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;
68 HYDRODATA_EXPORT virtual HYDROData_QuadtreeNode* GetQuadtreeNodes() const;
71 * Remove all altitude points.
73 HYDRODATA_EXPORT virtual void RemoveAltitudePoints();
76 * Returns altitude for given point.
77 * \param thePoint the point to examine
78 * \return altitude value
80 HYDRODATA_EXPORT virtual double GetAltitudeForPoint( const gp_XY& thePoint ) const;
83 // Public methods to work with files.
86 * Stores the bathymetry file path
87 * \param theFilePath image file path
89 HYDRODATA_EXPORT void SetFilePath( const TCollection_AsciiString& theFilePath );
92 * Returns uploaded bathymetry file path
94 HYDRODATA_EXPORT TCollection_AsciiString GetFilePath() const;
97 * Set flag indicating needs to invert altitude values
98 * \param theIsInverted new invert value
99 * \param theIsUpdate flag indicating necessity to update points
101 HYDRODATA_EXPORT void SetAltitudesInverted( const bool theIsInverted,
102 const bool theIsUpdate = true );
105 * Returns flag indicating needs to invert altitude values.
107 HYDRODATA_EXPORT bool IsAltitudesInverted() const;
110 * Imports Bathymetry data from file. The supported file types:
112 * \param theFileName the path to file
113 * \return \c true if file has been successfully read
115 HYDRODATA_EXPORT virtual bool ImportFromFile( const TCollection_AsciiString& theFileName );
117 HYDRODATA_EXPORT bool CreateBoundaryPolyline() const;
122 * Imports Bathymetry data from 'XYZ' file.
124 bool importFromXYZFile( QFile& theFile,
125 AltitudePoints& thePoints ) const;
126 static std::map<int, HYDROData_QuadtreeNode*> myQuadtrees;
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();