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