]> SALOME platform Git repositories - modules/hydro.git/blob - src/HYDROData/HYDROData_Zone.h
Salome HOME
5b277a13095b3474265b17b2176acffb320674d8
[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_FillingColor, ///< filling color of zone
33     DataTag_BorderColor,  ///< border color of zone
34   };
35
36 public:
37   DEFINE_STANDARD_RTTI(HYDROData_Zone);
38
39   /**
40    * Returns the kind of this object. Must be redefined in all objects of known type.
41    */
42   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_ZONE;}
43
44   /**
45    * Dump object to Python script representation.
46    */
47   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
48
49
50   /**
51    * Returns default filling color for new zone.
52    */
53   HYDRODATA_EXPORT static QColor DefaultFillingColor();
54
55   /**
56    * Sets filling color for zone.
57    */
58   HYDRODATA_EXPORT virtual void SetFillingColor( const QColor& theColor );
59
60   /**
61    * Returns filling color of zone.
62    */
63   HYDRODATA_EXPORT virtual QColor GetFillingColor() const;
64
65
66   /**
67    * Returns default border color for new zone.
68    */
69   HYDRODATA_EXPORT static QColor DefaultBorderColor();
70
71   /**
72    * Sets border color for zone.
73    */
74   HYDRODATA_EXPORT virtual void SetBorderColor( const QColor& theColor );
75
76   /**
77    * Returns border color of zone.
78    */
79   HYDRODATA_EXPORT virtual QColor GetBorderColor() const;
80
81
82   /**
83    * Sets reference polyline object for zone.
84    */
85   HYDRODATA_EXPORT virtual void SetPolyline( const Handle(HYDROData_Polyline)& thePolyline );
86
87   /**
88    * Returns reference polyline object of zone.
89    */
90   HYDRODATA_EXPORT virtual Handle(HYDROData_Polyline) GetPolyline() const;
91
92   /**
93    * Remove reference polyline object of zone.
94    */
95   HYDRODATA_EXPORT virtual void RemovePolyline();
96
97
98   /**
99    * Returns number of bathymetry objects for zone.
100    */
101   HYDRODATA_EXPORT virtual int NbBathymetries() const;
102
103   /**
104    * Add reference bathymetry object for zone.
105    */
106   HYDRODATA_EXPORT virtual void AddBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry );
107
108   /**
109    * Change reference bathymetry object with given index for zone.
110    */
111   HYDRODATA_EXPORT virtual void SetBathymetry( const int                           theIndex,
112                                                const Handle(HYDROData_Bathymetry)& theBathymetry );
113
114   /**
115    * Returns reference bathymetry object of zone by it index.
116    */
117   HYDRODATA_EXPORT virtual Handle(HYDROData_Bathymetry) GetBathymetry( const int theIndex ) const;
118
119   /**
120    * Returns list of all reference bathymetry objects of zone.
121    */
122   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects  GetBathymetries() const;
123
124   /**
125    * Clear list of bathymetry objects of zone.
126    */
127   HYDRODATA_EXPORT virtual void RemoveBathymetries();
128
129   /**
130    * Returns data of object wrapped to QVariant.
131    * Reimplemented to wrap and return saved 2d polyline.
132    */
133   //HYDRODATA_EXPORT virtual QVariant GetDataVariant();
134
135   /**
136    * Returns the painter path. The painter path is construct by polyline
137    */
138   HYDRODATA_EXPORT QPainterPath GetPainterPath() const;
139
140
141 protected:
142
143   friend class HYDROData_Iterator;
144
145   /**
146    * Creates new object in the internal data structure. Use higher level objects 
147    * to create objects with real content.
148    */
149   HYDROData_Zone();
150
151   /**
152    * Destructs properties of the object and object itself, removes it from the document.
153    */
154   ~HYDROData_Zone();
155 };
156
157 #endif