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