Salome HOME
0f93d19ca18d28dcbb44ba4fbee9be2eef175c50
[modules/hydro.git] / src / HYDROData / HYDROData_Bathymetry.h
1
2 #ifndef HYDROData_Bathymetry_HeaderFile
3 #define HYDROData_Polyline_HeaderFile
4
5 #include <HYDROData_Object.h>
6
7 class gp_XY;
8 class gp_XYZ;
9 class QPointF;
10 class QFile;
11
12 DEFINE_STANDARD_HANDLE(HYDROData_Bathymetry, HYDROData_Object)
13
14
15 /**\class HYDROData_Bathymetry
16  * \brief Class that stores/retreives information about the Bathymetry.
17  *
18  * The Bathymetry represents measurement of the altitude of points on the terrain.
19  */
20 class HYDROData_Bathymetry : public HYDROData_Object
21 {
22 public:
23
24   typedef gp_XYZ               AltitudePoint;
25   typedef QList<AltitudePoint> AltitudePoints;
26
27 protected:
28
29   /**
30    * Enumeration of tags corresponding to the persistent object parameters.
31    */
32   enum DataTag
33   {
34     DataTag_First = HYDROData_Object::DataTag_First + 100, ///< first tag, to reserve
35     DataTag_AltitudePoints ///< altitude points, array of reals
36   };
37
38 public:
39
40   DEFINE_STANDARD_RTTI(HYDROData_Bathymetry);
41
42   /**
43    * Returns the kind of this object. Must be redefined in all objects of known type.
44    */
45   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_BATHYMETRY; }
46
47
48 public:      
49   // Public methods to work with Bathymetry altitudes.
50
51   /**
52    * Replace current altitude points by new one.
53    * \param thePoints the altitude points list
54    */
55   HYDRODATA_EXPORT virtual void             SetAltitudePoints( const AltitudePoints& thePoints );
56
57   /**
58    * Returns altitude points list.
59    * \return points list
60    */
61   HYDRODATA_EXPORT virtual AltitudePoints   GetAltitudePoints() const;
62
63   /**
64    * Remove all altitude points.
65    */
66   HYDRODATA_EXPORT virtual void             RemoveAltitudePoints();
67
68   /**
69    * Returns altitude for given point.
70    * \param thePoint the point to examine
71    * \return altitude value
72    */
73   HYDRODATA_EXPORT virtual double           GetAltitudeForPoint( const QPointF& thePoint ) const;
74
75   /**
76    * Returns altitude for given point.
77    * \param thePoint the point to examine
78    * \return altitude value
79    */
80   HYDRODATA_EXPORT virtual double           GetAltitudeForPoint( const gp_XY& thePoint ) const;
81
82
83 public:
84   // Public methods to work with files.
85
86   /**
87    * Imports Bathymetry data from file. The supported file types:
88    *  - xyz
89    * \param theFileName the path to file
90    * \return \c true if file has been successfully read
91    */
92   HYDRODATA_EXPORT virtual bool             ImportFromFile( const QString& theFileName );
93
94
95 private:
96
97   /**
98    * Imports Bathymetry data from 'XYZ' file.
99    */
100   bool                                      importFromXYZFile( QFile&          theFile,
101                                                                AltitudePoints& thePoints );
102
103 protected:
104
105   friend class HYDROData_Iterator;
106
107   /**
108    * Creates new object in the internal data structure. Use higher level objects 
109    * to create objects with real content.
110    */
111   HYDROData_Bathymetry();
112
113   /**
114    * Destructs properties of the object and object itself, removes it from the document.
115    */
116   ~HYDROData_Bathymetry();
117 };
118
119 #endif