]> SALOME platform Git repositories - modules/hydro.git/blob - src/HYDROData/HYDROData_Zone.h
Salome HOME
e9ad3ba9c976b0e972a97fe5f3676932cabbf3e0
[modules/hydro.git] / src / HYDROData / HYDROData_Zone.h
1
2 #ifndef HYDROData_Zone_HeaderFile
3 #define HYDROData_Zone_HeaderFile
4
5 #include <HYDROData_Object.h>
6
7 #include <QPointF>
8 #include <QPainterPath>
9 #include <QList>
10
11 class Handle(HYDROData_Bathymetry);
12 class Handle(HYDROData_Polyline);
13
14 DEFINE_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Object)
15
16
17 /**\class HYDROData_Zone
18  * \brief Class that stores/retreives information about the 2d face.
19  */
20 class HYDROData_Zone : public HYDROData_Object
21 {
22
23 protected:
24   /**
25    * Enumeration of tags corresponding to the persistent object parameters.
26    */
27   enum DataTag
28   {
29     DataTag_First = HYDROData_Object::DataTag_First + 100, ///< first tag, to reserve
30     DataTag_Bathymetry, ///< reference bathymetries
31     DataTag_Polyline,   ///< reference polyline
32     DataTag_Color       ///< color of zone
33   };
34
35 public:
36   DEFINE_STANDARD_RTTI(HYDROData_Zone);
37
38   /**
39    * Returns the kind of this object. Must be redefined in all objects of known type.
40    */
41   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_ZONE;}
42
43   /**
44    * Dump object to Python script representation.
45    */
46   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
47
48
49   /**
50    * Sets color for zone.
51    */
52   HYDRODATA_EXPORT virtual void SetColor( const QColor& theColor );
53
54   /**
55    * Returns color of zone.
56    */
57   HYDRODATA_EXPORT virtual QColor GetColor() const;
58
59
60   /**
61    * Sets reference polyline object for zone.
62    */
63   HYDRODATA_EXPORT virtual void SetPolyline( const Handle(HYDROData_Polyline)& thePolyline );
64
65   /**
66    * Returns reference polyline object of zone.
67    */
68   HYDRODATA_EXPORT virtual Handle(HYDROData_Polyline) GetPolyline() const;
69
70   /**
71    * Remove reference polyline object of zone.
72    */
73   HYDRODATA_EXPORT virtual void RemovePolyline();
74
75
76   /**
77    * Returns number of bathymetry objects for zone.
78    */
79   HYDRODATA_EXPORT virtual int NbBathymetries() const;
80
81   /**
82    * Add reference bathymetry object for zone.
83    */
84   HYDRODATA_EXPORT virtual void AddBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry );
85
86   /**
87    * Change reference bathymetry object with given index for zone.
88    */
89   HYDRODATA_EXPORT virtual void SetBathymetry( const int                           theIndex,
90                                                const Handle(HYDROData_Bathymetry)& theBathymetry );
91
92   /**
93    * Returns reference bathymetry object of zone by it index.
94    */
95   HYDRODATA_EXPORT virtual Handle(HYDROData_Bathymetry) GetBathymetry( const int theIndex ) const;
96
97   /**
98    * Returns list of all reference bathymetry objects of zone.
99    */
100   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects  GetBathymetries() const;
101
102   /**
103    * Clear list of bathymetry objects of zone.
104    */
105   HYDRODATA_EXPORT virtual void RemoveBathymetries();
106
107   /**
108    * Returns data of object wrapped to QVariant.
109    * Reimplemented to wrap and return saved 2d polyline.
110    */
111   //HYDRODATA_EXPORT virtual QVariant GetDataVariant();
112
113   /**
114    * Returns the painter path. The painter path is construct by polyline
115    */
116   HYDRODATA_EXPORT QPainterPath GetPainterPath() const;
117
118
119 protected:
120
121   friend class HYDROData_Iterator;
122
123   /**
124    * Creates new object in the internal data structure. Use higher level objects 
125    * to create objects with real content.
126    */
127   HYDROData_Zone();
128
129   /**
130    * Destructs properties of the object and object itself, removes it from the document.
131    */
132   ~HYDROData_Zone();
133 };
134
135 #endif